@font-face {
  font-family: "Inter Tight";
  src: url("/fonts/inter-tight.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #fff;
  --fg: #000;
  --muted: #707070;
  --gutter: clamp(16px, 2.5vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --fg: #fff;
    --muted: #8f8f8f;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.4 "Inter Tight", "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, p, figure { margin: 0; }
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
:focus-visible { outline: 1px solid var(--fg); outline-offset: 3px; }

.page {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
  padding: var(--gutter);
}
.page > main { flex: 1; }

/* The two type sizes: this one, and the body size. */
.display {
  font-size: clamp(2rem, 10vw, 7rem);
  line-height: 1.04;
  letter-spacing: -.02em;
}
.display h1 { font: inherit; }
.display nav { display: flex; flex-direction: column; align-items: flex-start; }
.display nav a { color: var(--muted); }
.display nav a:hover { color: var(--fg); text-decoration: none; }

.site-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(48px, 9vw, 128px);
}
.site-header nav { display: flex; gap: 24px; }
.site-header nav a { color: var(--muted); }
.site-header nav a:hover, .site-header nav a[aria-current] { color: var(--fg); }

.site-footer { margin-top: clamp(64px, 9vw, 128px); color: var(--muted); }

.note { max-width: 36em; margin-top: 24px; }
.note a { text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
.muted { color: var(--muted); }

.photos {
  display: grid;
  gap: clamp(40px, 5vw, 72px) var(--gutter);
  margin-top: clamp(48px, 7vw, 96px);
}
@media (min-width: 800px) {
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.photo-open { display: block; cursor: zoom-in; }

figcaption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 8px;
}
figcaption a { flex: none; color: var(--muted); }
figcaption a:hover { color: var(--fg); }

/* Viewer */
dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--gutter);
  border: 0;
  background: var(--bg);
  color: var(--fg);
}
dialog[open] { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 12px; }
dialog > img { height: 100%; object-fit: contain; }

.viewer-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px; }
.viewer-actions { display: flex; gap: 20px; }
.viewer-actions button, .viewer-actions a {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}
.viewer-actions button:hover, .viewer-actions a:hover { color: var(--fg); text-decoration: none; }

/* Form */
#contact-form { display: grid; gap: 24px; max-width: 36em; margin-top: clamp(40px, 6vw, 72px); }
#contact-form label { display: grid; gap: 2px; color: var(--muted); }
#contact-form input, #contact-form textarea {
  width: 100%;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--muted);
  border-radius: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  resize: vertical;
}
#contact-form input:focus, #contact-form textarea:focus { border-bottom-color: var(--fg); outline: 0; }
#contact-form button {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .15em;
  text-decoration-thickness: 1px;
  cursor: pointer;
}
#contact-form button:disabled { color: var(--muted); cursor: progress; }
#form-status:empty { display: none; }

/* Resume */
.resume .display { font-size: clamp(2rem, 6vw, 5.25rem); }
.resume-headline { color: var(--muted); }
.resume-location { margin-top: 16px; }
.resume-download { margin-top: 4px; }
.resume section {
  display: grid;
  gap: 8px var(--gutter);
  margin-top: clamp(48px, 6vw, 80px);
}
@media (min-width: 800px) {
  .resume section { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); }
}
.resume h2, .resume h3 { margin: 0; font: inherit; }
.resume h2 { color: var(--muted); }
.resume h3, .resume dl.stacked dt { font-weight: 600; }
.resume section > div { max-width: 44em; }
.resume article + article { margin-top: 40px; }
.resume ul { margin: 0; padding: 0; list-style: none; }
.roles { margin-top: 12px !important; }
.roles li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; }
.points { margin-top: 12px !important; }
.points li + li { margin-top: 8px; }
.resume dl { margin: 0; }
.resume dl > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 0 16px; }
.resume dl > div + div { margin-top: 6px; }
.resume dl.stacked > div { display: block; }
.resume dl.stacked > div + div { margin-top: 16px; }
.resume dd { margin: 0; }
.resume dl:not(.stacked) dt { color: var(--muted); }
@media (max-width: 480px) {
  .resume dl > div { display: block; }
}

.site-header { flex-wrap: wrap; }

@media print {
  @page { size: A4; margin: 15mm 17mm 14mm; }
  :root { --bg: #fff; --fg: #000; --muted: #5c5c5c; --gutter: 6mm; }
  html { font-size: 9.2pt; }
  .page { display: block; min-height: 0; padding: 0; }
  .site-header, .site-footer, .resume-download { display: none; }
  .resume .display { font-size: 25pt; }
  .resume-location { margin-top: 2mm; }
  .resume section { grid-template-columns: minmax(0, 1fr) minmax(0, 4.4fr); margin-top: 5.5mm; }
  .resume section > div { max-width: none; }
  .resume article + article { margin-top: 4mm; }
  .points li + li { margin-top: 1mm; }
  .points, .roles { margin-top: 1.5mm !important; }
  .resume dl.stacked > div + div { margin-top: 1.5mm; }
  .resume dl > div + div { margin-top: .6mm; }
  .resume article, .resume dl > div, .points li { break-inside: avoid; }
}
