:root {
  color-scheme: dark;
  --paper: #eeeae1;
  --muted: #b0afa4;
  --green: #c4d1a9;
  --ink: #131411;
  --line: #404138;
  --body: Georgia, "Times New Roman", serif;
  --label: ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
}
a { color: inherit; text-underline-offset: 0.23em; }
a:hover { color: var(--green); }
a:focus-visible, video:focus-visible, iframe:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
.shell {
  width: min(100% - clamp(2rem, 8vw, 8rem), 88rem);
  margin-inline: auto;
}
.mast {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding-block: 1.4rem;
  border-bottom: 1px solid var(--line);
  font: 0.75rem/1.4 var(--label);
  color: var(--muted);
}
.mast a { color: var(--paper); }
.opening { padding-block: clamp(2rem, 5vw, 4.25rem) clamp(3rem, 7vw, 7rem); }
.index {
  margin: 0 0 1rem;
  font: 0.72rem/1.5 var(--label);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--green);
}
h1, h2 { margin: 0; font-weight: 400; }
h1 {
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
  font-size: clamp(2.35rem, 8vw, 7.4rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
}
h2 {
  font-size: clamp(1.85rem, 4vw, 3.9rem);
  line-height: 0.99;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.screen { margin: 0; min-width: 0; }
.screen video, .screen iframe {
  display: block;
  width: 100%;
  height: auto;
  background: #080907;
  border: 0;
}
.screen-wide video { max-height: 73svh; }
.screen iframe { aspect-ratio: 16 / 9; }
.screen figcaption {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.3rem 1.2rem;
  margin-top: 0.7rem;
  color: var(--muted);
  font: 0.75rem/1.5 var(--label);
}
.screen figcaption > :first-child { color: var(--paper); }
.chapter {
  display: grid;
  grid-template-columns: minmax(0, 0.83fr) minmax(0, 1.47fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: start;
  padding-block: clamp(3rem, 8vw, 7.5rem);
  border-top: 1px solid var(--line);
}
.voice {
  max-width: 34ch;
  margin: 1.25rem 0 0;
  color: var(--paper);
  font-size: clamp(1.12rem, 1.7vw, 1.48rem);
  line-height: 1.48;
}
.studies {
  display: grid;
  gap: clamp(1.6rem, 4vw, 3rem);
  min-width: 0;
}
.closing {
  padding-block: clamp(3rem, 8vw, 8rem) clamp(3rem, 7vw, 7rem);
  border-top: 1px solid var(--line);
}
.footer { border-top: 1px solid var(--line); border-bottom: 0; }
@media (max-width: 48rem) {
  .chapter { grid-template-columns: minmax(0, 1fr); }
  .screen-wide video { max-height: none; }
}

.context { padding-bottom: clamp(1.5rem, 4vw, 3rem); }
.contact-sheet {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 3rem);
  margin: clamp(1.5rem, 4vw, 3rem) 0 1.75rem;
  padding: 0;
  list-style: none;
}
.contact-sheet a { display: grid; gap: 0.5rem; }
.contact-sheet img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  background: #080907;
  border: 1px solid var(--line);
}
.contact-sheet small, .working-notes summary {
  color: var(--muted);
  font: 0.75rem/1.5 var(--label);
}
.working-notes {
  max-width: 44rem;
  padding-block: 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.working-notes summary { color: var(--paper); cursor: pointer; }
.working-notes summary:focus-visible { outline: 2px solid var(--green); outline-offset: 4px; }
.working-notes p { max-width: 56ch; line-height: 1.5; }
.working-notes .contact-sheet { margin-bottom: 0; }
@media (max-width: 39rem) {
  .contact-sheet { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 62rem) {
  .opening { padding-top: clamp(2.4rem, 4vw, 3.25rem); }
  h1 { font-size: clamp(3.5rem, 6.6vw, 6.9rem); }
  h1 br { display: none; }
  .opening video { max-height: 62svh; }
}

.essay-copy .voice { max-width: 52ch; }
.essay-copy .voice:first-child { margin-top: 0; }

.origin-photo { margin-top: clamp(1.25rem, 3vw, 2.5rem); }
.origin-photo img { display: block; width: 100%; height: auto; }

.origin {
  display: grid;
  gap: clamp(2.25rem, 6vw, 6rem);
  padding-block: clamp(3rem, 8vw, 7.5rem);
  border-top: 1px solid var(--line);
}
.origin-spread {
  display: grid;
  grid-template-columns: minmax(0, 0.83fr) minmax(0, 1.32fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: start;
}
.origin-spread--study {
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  align-items: center;
}
.early-still img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}
.early-film {
  width: min(76%, 54rem);
  margin-inline: auto;
}
.early-film video {
  aspect-ratio: 1842 / 824;
  border: 1px solid var(--line);
}
@media (max-width: 52rem) {
  .origin-spread { grid-template-columns: minmax(0, 1fr); }
  .early-film { width: 100%; }
}

/* Preserve the original prototype framing in the hosted player. */
#early-green-cloud .release-video iframe { aspect-ratio: 1842 / 824; }


/* Keep legacy fragments at the start of their figure without adding grid items. */
.screen { position: relative; }
.screen > .legacy-anchor { position: absolute; inset: 0 auto auto 0; }

/* Match the original media frame before and after an embed loads. */
.release-video { background: #080907; }
.release-video__poster span {
  color: var(--paper);
  background: var(--ink);
  font: 0.75rem/1.5 var(--label);
}
.early-film .release-video { outline: 1px solid var(--line); outline-offset: -1px; }

.screen-wide .release-video img,
.screen-wide .release-video iframe {
  max-height: 73svh;
}

.screen .release-video img { object-fit: contain; }

@media (min-width: 62rem) {
  .opening .release-video img,
  .opening .release-video iframe {
    max-height: 62svh;
  }
}

@media (max-width: 48rem) {
  .screen-wide .release-video img,
  .screen-wide .release-video iframe,
  .opening .release-video img,
  .opening .release-video iframe {
    max-height: none;
  }
}

/* Keep the fallback in the caption after activation, without a second row. */
.release-video + figcaption .release-video__watch { margin: 0 0 0 auto; }
.release-video:has(.release-video__poster) + figcaption .release-video__watch { display: none; }

/* Give the paired studies equal frames while retaining the full image. */
.studies .release-video__poster img,
.studies .release-video iframe[width][height] { aspect-ratio: 16 / 9; }

/* Words and voice chapters: compact paired spreads */
.chapter.chapter-words-spread,
.chapter.chapter-voice-pair {
  column-gap: clamp(1.5rem, 4vw, 4rem);
  row-gap: clamp(1.5rem, 3.5vw, 3rem);
  padding-block: clamp(2.5rem, 6vw, 5.5rem);
}

.chapter-words-spread > *,
.chapter-voice-pair > * {
  min-width: 0;
}

.chapter-words-spread .origin-photo {
  margin-top: 0;
}

.chapter.chapter-words-spread .essay-copy > .voice:first-child {
  margin-top: 0;
}

.chapter-voice-pair .chapter-note > .voice {
  max-width: 40ch;
}

.chapter.chapter-voice-pair .essay-copy > * + .voice {
  margin-top: clamp(1.25rem, 2.5vw, 2rem);
}

@media (min-width: 48.0625rem) {
  /* Fixed child order: lead, video, continuation, photo */
  .chapter-words-spread > :nth-child(1) { grid-area: 1 / 1; }
  .chapter-words-spread > :nth-child(2) { grid-area: 1 / 2; }
  .chapter-words-spread > :nth-child(3) { grid-area: 2 / 2; }
  .chapter-words-spread > :nth-child(4) { grid-area: 2 / 1; }

  .chapter.chapter-voice-pair {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr);
  }
}

/* Voice and closing chapters: shared two-column rhythm.
   Scoped to .voice-chapter and .share-chapter only. Base .chapter, .shell,
   .screen, copy and caption styles are left untouched. */

.voice-chapter,
.share-chapter {
  --pair-gap: clamp(2rem, 4.5vw, 4.5rem);  /* set to the base .83fr/1.47fr column gap so edges align with neighbouring chapters */
  --band-gap: clamp(3.5rem, 7vw, 6.5rem);  /* interval between bands, and from the film into the closing */
  --stack-gap: clamp(1.75rem, 5vw, 2.5rem);
}

/* Film -> closing: one interval, the same as the voice chapter's band break. */
.share-chapter {
  padding-block-start: var(--band-gap);
}

/* Single column (default): DOM order is the reading order. */
.voice-grid,
.share-grid {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

.voice-grid > *,
.share-grid > * {
  min-width: 0;
}

/* Trim only the outer margins of each token root so cell edges align;
   spacing between paragraphs inside a block stays with the base styles. */
.voice-grid > * > :first-child,
.share-grid > * > :first-child {
  margin-block-start: 0;
}

.voice-grid > * > :last-child,
.share-grid > * > :last-child {
  margin-block-end: 0;
}

.voice-media {
  display: flex;
  flex-direction: column;
  gap: var(--stack-gap);
}

.voice-media > * {
  margin-block: 0;
}

/* Portraits: natural 4:5, never cropped, never a backdrop. On one column
   they cap at a readable portrait size that still fits the viewport. */
.voice-photo .chapter-photo,
.share-photo .chapter-photo {
  margin: 0;
  width: min(100%, 34rem);
  width: min(100%, 34rem, 56svh);
  height: auto;
  aspect-ratio: auto;
}

.voice-photo .chapter-photo img,
.share-photo .chapter-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

@media (min-width: 48.0625rem) {
  .voice-grid,
  .share-grid {
    display: grid;
    grid-template-columns: minmax(0, .83fr) minmax(0, 1.47fr);
    column-gap: var(--pair-gap);
    row-gap: 0;
    align-items: start;
  }

  /* Band 1: heading + portrait | P1.  Band 2: P2 | clip + P3. */
  .voice-grid {
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
      "head   first"
      "photo  first"
      "second media";
  }

  /* Same as voice band 1: heading + portrait | prose. */
  .share-grid {
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "head  copy"
      "photo copy";
  }

  .voice-head,
  .share-head {
    grid-area: head;
  }

  .voice-first {
    grid-area: first;
  }

  .share-copy {
    grid-area: copy;
  }

  /* Portrait sits on the floor of its band, so the band closes on one line. */
  .voice-photo,
  .share-photo {
    grid-area: photo;
    align-self: end;
    padding-block-start: var(--stack-gap);
  }

  .voice-photo .chapter-photo,
  .share-photo .chapter-photo {
    width: 100%;
  }

  .voice-second {
    grid-area: second;
    margin-block-start: var(--band-gap);
  }

  .voice-media {
    grid-area: media;
    margin-block-start: var(--band-gap);
  }
}
/* The chapter shell owns the border and width; its child owns the responsive grid. */
.chapter.voice-chapter,
.chapter.share-chapter {
  display: block;
  --pair-gap: clamp(2rem, 6vw, 7rem);
}

/* Leave one clear transition from the full-width film into the closing. */
.closing[aria-labelledby="word-hole-heading"] {
  padding-block-end: clamp(1.25rem, 2.5vw, 2.5rem);
}

/* ── Layout tightening, Nov 10: one shared two-column grid, one section rhythm,
   copy filling its column so left and right edges line up across chapters. ── */
:root {
  --col-l: 0.83fr;
  --col-r: 1.47fr;
  --col-gap: clamp(2rem, 6vw, 7rem);
  --section-pad: clamp(3rem, 7vw, 6rem);
  --row-gap: clamp(2rem, 4.5vw, 4rem);
}

.chapter,
.origin,
.closing,
.chapter.chapter-words-spread,
.chapter.voice-chapter,
.chapter.share-chapter,
.share-chapter {
  padding-block: var(--section-pad);
}
.closing[aria-labelledby="word-hole-heading"] { padding-block-end: var(--section-pad); }

.chapter.chapter-words-spread {
  column-gap: var(--col-gap);
  row-gap: var(--row-gap);
}
.chapter.voice-chapter,
.chapter.share-chapter { --pair-gap: var(--col-gap); --band-gap: var(--row-gap); }

/* Copy fills its column (~70 characters on the wide side) instead of floating short of the edge. */
.voice,
.essay-copy .voice,
.chapter-voice-pair .chapter-note > .voice { max-width: none; }

.origin { row-gap: var(--row-gap); }

@media (min-width: 52.0625rem) {
  .origin {
    grid-template-columns: minmax(0, var(--col-l)) minmax(0, var(--col-r));
    column-gap: var(--col-gap);
  }
  .origin-spread,
  .origin-spread--study {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, var(--col-l)) minmax(0, var(--col-r));
    column-gap: var(--col-gap);
    align-items: start;
  }
  /* Image left, copy right — the same order as the spread above it. */
  .origin-spread--study > .early-still { grid-column: 1; grid-row: 1; }
  .origin-spread--study > .essay-copy { grid-column: 2; grid-row: 1; }
  .early-film { grid-column: 2; width: 100%; margin: 0; }
}

@media (min-width: 48.0625rem) {
  .chapter {
    grid-template-columns: minmax(0, var(--col-l)) minmax(0, var(--col-r));
    column-gap: var(--col-gap);
  }
  /* Portraits sit directly under their heading. */
  .voice-photo,
  .share-photo { align-self: start; }

  /* Word Hole: heading left, copy right, film full width below. */
  .word-hole-note {
    display: grid;
    grid-template-columns: minmax(0, var(--col-l)) minmax(0, var(--col-r));
    column-gap: var(--col-gap);
    align-items: start;
  }
  .word-hole-note > .voice { margin-top: 0; }
}
.word-hole-note { margin-bottom: var(--row-gap); }

/* Notes drawer spans the full measure so its rules match the section rules. */
.working-notes { max-width: none; }
.context { padding-bottom: 0; margin-bottom: var(--section-pad); }
.working-notes { border-bottom: 0; }
