/* STOIKOFF — one stylesheet, no framework.
   Light on black, one signal red (the recording light), one typeface.
   All colors are the tokens in :root. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
}

:root {
  --paper: #000000;      /* background */
  --ink: #ededed;        /* text (17:1 on black) */
  --graphite: #8d9096;   /* labels, secondary text (6.5:1 on black) */
  --rule: #2b2d30;       /* hairlines */
  --wash: #141516;       /* image placeholder while loading */
  --rec: #ff3b30;        /* the period, links on hover, focus (5.6:1 on black) */

  --gutter: clamp(16px, 3.2vw, 40px);
  --label: 9.5rem;       /* left column for section names */
  --gap: 2rem;
  --big: clamp(2rem, 1rem + 4vw, 4.25rem);
  --measure: 66ch;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.125rem;
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, video { display: block; max-width: 100%; height: auto; }

:focus-visible { outline: 2px solid var(--rec); outline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: var(--gutter); top: -100px; background: var(--ink); color: var(--paper); padding: .5rem .75rem; z-index: 10; }
.skip:focus { top: .5rem; }

/* ---------- header / footer ---------- */

.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: var(--gutter);
  max-width: 1320px; margin: 0 auto;
}
.wordmark {
  display: inline-flex; align-items: center; gap: .7rem;
  font-weight: 800; font-size: 1rem; letter-spacing: .08em;
  text-decoration: none;
}
.wordmark img { width: 1.75rem; height: 1.75rem; object-fit: contain; }
.tools { display: flex; align-items: center; gap: 1.5rem; }
.lang { font-size: 1rem; text-decoration: none; color: var(--graphite); }
.lang:hover { color: var(--ink); }
.close {
  font-size: 2.25rem; line-height: 1; font-weight: 300; text-decoration: none;
  width: 2.75rem; height: 2.75rem; display: grid; place-items: center; margin-right: -.6rem;
}
.close:hover { color: var(--rec); }

.main { max-width: 1320px; margin: 0 auto; padding: clamp(1rem, 4vw, 3.5rem) var(--gutter) 4rem; }

.foot {
  max-width: 1320px; margin: 0 auto; padding: 2rem var(--gutter) 2.5rem;
  color: var(--graphite); font-size: .875rem;
}
.foot p { margin: 0; }

/* ---------- the index ---------- */

.group,
.work-head,
.work-next {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  column-gap: var(--gap);
  align-items: baseline;
}
.group + .group { margin-top: clamp(1.5rem, 3vw, 2.75rem); }

.group-label {
  margin: 0; font-size: .95rem; font-weight: 400; line-height: 1.4;
  color: var(--graphite);
}

.index ul { list-style: none; margin: 0; padding: 0; }
.index a,
.work-title {
  font-size: var(--big);
  font-weight: 480;
  line-height: 1.04;
  letter-spacing: -.028em;
  text-wrap: pretty;
}
.index li + li { margin-top: .08em; }
.index a {
  display: inline-block; text-decoration: none;
  padding-left: .55em; text-indent: -.55em;   /* wrapped lines hang, so one item never reads as two */
}
.index a:hover .dot,
.index a:focus-visible .dot { color: var(--rec); }
.index a:focus-visible { outline-offset: 6px; }

.dot { transition: color .15s; }

/* ---------- a work ---------- */

.work-head { margin-bottom: clamp(2rem, 5vw, 4rem); }
.work-title { margin: 0; }
.work-title .dot { color: var(--rec); animation: rec 1.4s steps(1, end) 2; }
@keyframes rec { 50% { color: transparent; } }

.prose { margin-left: calc(var(--label) + var(--gap)); }
.prose > * { margin-top: 0; margin-bottom: 1.5rem; }
.prose > p, .prose > ul, .prose > ol, .prose > h2, .prose > h3,
.prose > .specs, .prose > .notice, .prose > .contact { max-width: var(--measure); }

.prose p { hyphens: auto; }
.prose a { text-decoration-thickness: 1px; text-underline-offset: .18em; }
.prose a:hover { color: var(--rec); }

.prose h2 { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; margin-top: 3.5rem; margin-bottom: 1rem; }
.prose h3 { font-size: 1.05rem; font-weight: 600; margin-top: 2rem; margin-bottom: .5rem; }
.prose ul { padding-left: 1.1em; }
.prose ul.plain { list-style: none; padding: 0; }
.prose .note { color: var(--graphite); font-size: .95rem; font-weight: 400; }

.epigraph {
  margin: 0 0 3rem; padding: 0; max-width: 58ch;
  font-style: italic; font-size: 1.28rem; line-height: 1.5;
}
.epigraph p { margin: 0 0 .9em; }
.epigraph footer { font-style: normal; font-size: .95rem; color: var(--graphite); }
.epigraph cite { font-style: italic; }

/* figures */
.fig { margin: 2.5rem 0; }
.fig a { display: block; cursor: zoom-in; }
.fig img { width: 100%; background: var(--wash); }
.fig video { width: 100%; background: #000; }
.fig figcaption { margin-top: .6rem; font-size: .9rem; color: var(--graphite); }
.fig--wide  { max-width: 64rem; }
.fig--text  { max-width: var(--measure); }
.fig--small { max-width: 22rem; }
.fig--cell  { margin: 0; }

.pair {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
  max-width: 64rem; margin: 2.5rem 0; align-items: start;
}
.pair--narrow { max-width: 34rem; }

.gallery {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem;
  max-width: 64rem; margin: 2.5rem 0;
}
.gallery a { display: block; cursor: zoom-in; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--wash); }
.gallery--squares { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); max-width: 48rem; }
.gallery--squares img { aspect-ratio: 1; }
.gallery a:hover img { outline: 2px solid var(--rec); outline-offset: -2px; }

/* facts and lists */
.specs { display: grid; grid-template-columns: max-content 1fr; column-gap: 0; margin-top: 2.5rem; border-top: 1px solid var(--ink); }
.specs > div { display: contents; }
.specs dt, .specs dd { margin: 0; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.specs dt { color: var(--graphite); padding-right: 2rem; }

.table-wrap { overflow-x: auto; max-width: 48rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; line-height: 1.4; }
th, td { text-align: left; vertical-align: top; padding: .5rem 1rem .5rem 0; border-bottom: 1px solid var(--rule); }
thead th { font-weight: 500; color: var(--graphite); border-bottom-color: var(--ink); }
td:first-child, th:first-child { white-space: nowrap; }

.bio, .book { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: var(--gap); align-items: start; max-width: 64rem; }
.bio .fig, .book .fig { margin: 0; }
.bio p, .book p { max-width: var(--measure); margin-top: 0; }
.name { margin-top: 0 !important; }

.poem { margin: 2rem 0; padding: 0; font-size: 1.25rem; line-height: 1.5; }
.poem p { margin: 0 0 .9em; }

.cv { list-style: none; padding: 0 !important; margin-top: 3rem !important; border-top: 1px solid var(--ink); max-width: 52rem !important; }
.cv li { display: grid; grid-template-columns: 4rem 1fr; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--rule); }
.cv .year { color: var(--graphite); font-variant-numeric: tabular-nums; }

/* next */
.work-next { margin-top: clamp(4rem, 9vw, 7rem); padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.work-next a { font-size: clamp(1.5rem, 1rem + 2vw, 2.5rem); font-weight: 480; letter-spacing: -.02em; line-height: 1.1; text-decoration: none; }
.work-next a:hover .dot, .work-next a:focus-visible .dot { color: var(--rec); }

/* ---------- contact ---------- */

.contact { display: grid; gap: 1.25rem; max-width: 34rem !important; }
.contact label { display: grid; gap: .35rem; font-size: .95rem; color: var(--graphite); }
.contact input, .contact textarea {
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--graphite); border-radius: 0; padding: .65rem .75rem; width: 100%;
}
.contact textarea { resize: vertical; min-height: 9rem; }
.contact input:focus, .contact textarea:focus { outline: 2px solid var(--rec); outline-offset: 0; border-color: var(--rec); }
.contact button {
  justify-self: start; font: inherit; font-weight: 600; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 0; padding: .75rem 1.4rem;
}
.contact button:hover { background: var(--rec); }
.contact .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: .75rem 1rem; border-left: 3px solid var(--ink); background: var(--wash); }
.notice--error { border-left-color: var(--rec); }
.notice ul { margin: 0; padding-left: 1.1em; }

/* ---------- image viewer ---------- */

.viewer {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none;
  background: rgba(0, 0, 0, .94); color: #fff;
}
.viewer::backdrop { background: rgba(0, 0, 0, .94); }
.viewer[open] { display: grid; place-items: center; }
.viewer img { max-width: calc(100vw - 7rem); max-height: calc(100vh - 6rem); width: auto; height: auto; object-fit: contain; }
.viewer button {
  position: absolute; background: none; border: 0; color: #fff; cursor: pointer;
  font: 300 2.25rem/1 "Schibsted Grotesk", system-ui, sans-serif;
  width: 3.25rem; height: 3.25rem; display: grid; place-items: center;
}
.viewer button:hover { color: var(--rec); }
.viewer button[hidden] { display: none; }
.viewer .v-close { top: .75rem; right: .75rem; }
.viewer .v-prev  { left: .5rem; top: 50%; translate: 0 -50%; }
.viewer .v-next  { right: .5rem; top: 50%; translate: 0 -50%; }
.viewer .v-count { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; font-size: .85rem; color: #b8bbbf; font-variant-numeric: tabular-nums; }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .group, .work-head, .work-next { grid-template-columns: minmax(0, 1fr); }
  .group-label:empty { display: none; }
  .group .group-label, .work-head .group-label { margin-bottom: .2rem; }
  .prose { margin-left: 0; }
  .epigraph { font-size: 1.15rem; }
  .bio, .book { grid-template-columns: minmax(0, 1fr); }
  .bio .fig, .book .fig { max-width: 15rem; }
  .pair { grid-template-columns: minmax(0, 1fr); }
  .pair--narrow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35rem; }
  .viewer img { max-width: 100vw; max-height: calc(100vh - 8rem); }
  .viewer .v-prev, .viewer .v-next { top: auto; bottom: .5rem; translate: none; }
}

@media (prefers-reduced-motion: reduce) {
  .work-title .dot { animation: none; }
  .dot { transition: none; }
}

@media print {
  body { background: #fff; color: #000; }
  .top .tools, .work-next, .foot, .viewer { display: none; }
  .prose { margin-left: 0; }
  .fig a::after { content: none; }
}
