/* SPACEVIN — THE REEL
   A five-movement director's cut. Every slide is a different authored
   composition; the compiler decides which, this file only knows how to draw
   them. Two grounds: the first three chapters run dark, the last two run light. */

:root {
  --ink: #0a0908;
  --paper: #f2efe7;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --snap: cubic-bezier(0.76, 0, 0.24, 1);
  --whip: cubic-bezier(0.83, 0, 0.17, 1);
  --fg: #fff;
  --bg: var(--ink);
  --tint: #2a2320;
  --pad: clamp(16px, 3vw, 44px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;              /* this is a projected show, not a scroll */
  background: var(--ink);
  color: var(--fg);
  font-family: "Big Shoulders", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

@font-face {
  font-family: "Big Shoulders";
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url("fonts/big-shoulders-latin.woff2") format("woff2");
}

#stage {
  position: fixed;
  inset: 0;
  background: var(--bg);
  transition: background 700ms linear, color 700ms linear;
  overflow: hidden;
}
body[data-ground="light"] { --fg: #14110e; --bg: var(--paper); }

/* the room breathes with the frame on screen */
#throw {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(115% 85% at 50% 52%, var(--tint) 0%, transparent 68%);
  opacity: 0.55;
  transition: background 900ms linear;
}

#grain {
  position: fixed;
  inset: -50%;
  z-index: 6;
  pointer-events: none;
  opacity: 0.045;
  background-image: var(--grain);
  background-size: 200px 200px;
  animation: grain 6s steps(5) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-2%, 2%); }
  50% { transform: translate(2%, -2%); }
  75% { transform: translate(-1%, -2%); }
}

/* ─── slides ──────────────────────────────────────────────────────────────
   Two slides exist at once: the one leaving and the one arriving. The
   transition class on #stage decides how they trade places. */

.slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  will-change: transform, opacity, clip-path;
}
.slide.out { z-index: 1; }
.slide.in { z-index: 2; }

.f {                                  /* one photograph inside a composition */
  position: relative;
  display: block;
  /* the average colour stands in while the frame loads, then gets out of the
     way -- left in place it shows as bars beside any contained photograph */
  background: var(--f-avg, #16161a);
  overflow: hidden;
  border-radius: 1px;
  transition: background 400ms linear;
}
.f.loaded { background: transparent; }
.f img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;                /* never distorted; crops are opt-in */
  opacity: 0;
  transition: opacity 520ms linear;
}
.f img.on { opacity: 1; }
.f.crop img { object-fit: cover; }

/* ── FULL BLEED — the showstopper, scarce by rule ── */
.c-bleed .f { width: 100%; height: 100%; }
.c-bleed .f img { object-fit: cover;
  translate: calc(var(--px, 0) * -14px) calc(var(--py, 0) * -8px); }
.slide.in.c-bleed .f img { animation: pushin 8s linear forwards; }
/* starts pre-scaled so the parallax translate can never expose a frame edge */
@keyframes pushin { from { transform: scale(1.03); } to { transform: scale(1.09); } }

/* ── KEYLIGHT — the portrait workhorse; the visitor's hand holds the lamp ── */
.c-keylight .f {
  height: min(82vh, 56vw); width: auto;
  aspect-ratio: var(--ar);
  max-width: 88vw;
  box-shadow: 0 40px 120px rgba(0,0,0,0.55);
  translate: calc(var(--px, 0) * -10px) calc(var(--py, 0) * -6px);
}
.c-keylight::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(56% 56% at var(--mx, 50%) var(--my, 50%), var(--f-pal, #222) 0%, transparent 72%);
  opacity: 0.3;
}

/* ── BOKEH FLOAT — offset, floating on its own blurred ground ── */
.c-bokeh { place-items: center; }
.c-bokeh .f {
  height: min(74vh, 48vw); width: auto; aspect-ratio: var(--ar);
  max-width: 62vw;
  transform: translateX(var(--off, -14vw));
  box-shadow: 0 40px 140px rgba(0,0,0,0.6);
  translate: calc(var(--px, 0) * -12px) calc(var(--py, 0) * -7px);
}
.c-bokeh .bg {
  position: absolute; inset: -10%;
  z-index: -1;
  background-size: cover; background-position: center;
  background-image: var(--lqip);
  filter: saturate(1.5) blur(46px) brightness(0.7);
  opacity: 0.7;
  /* the blurred ground drifts against the sharp frame: real optical depth */
  translate: calc(var(--px, 0) * 16px) calc(var(--py, 0) * 9px);
}

/* ── QUARTER PLATE — the breathing slide: mostly bare ground ── */
.c-quarter { place-items: start end; padding: 16vh var(--pad) 0 0; }
.c-quarter .f {
  height: min(54vh, 60vw); width: auto; aspect-ratio: var(--ar);
  margin-right: 6vw;
}

/* ── SCOPE — a 2.39:1 band; an explicit horizon crop, never on faces ── */
.c-scope .f {
  width: 92vw; height: calc(92vw / 2.39);
  max-height: 74vh;
}
.c-scope .f img { object-fit: cover; }
.slide.in.c-scope .f img { animation: drift 7s linear forwards; }
@keyframes drift {
  from { transform: translateX(-3%) scale(1.06); }
  to { transform: translateX(3%) scale(1.06); }
}

/* ── TRIPTYCH — three frames of one shoot, equal height, cascading in ── */
.c-triptych {
  display: flex; gap: clamp(10px, 1.8vw, 26px);
  justify-content: center; align-items: center;
  padding: 0 var(--pad);
}
.c-triptych .f {
  height: min(62vh, 34vw); width: auto; aspect-ratio: var(--ar);
  max-width: 30vw;
}
.c-triptych .f:nth-child(1) { translate: calc(var(--px, 0) * -6px) 0; }
.c-triptych .f:nth-child(2) { transform: translateY(-3vh); translate: calc(var(--px, 0) * -11px) 0; }
.c-triptych .f:nth-child(3) { transform: translateY(2vh); translate: calc(var(--px, 0) * -16px) 0; }
.slide.in.c-triptych .f { animation: rise 620ms var(--ease) backwards; }
.slide.in.c-triptych .f:nth-child(1) { animation-delay: 0ms; }
.slide.in.c-triptych .f:nth-child(2) { animation-delay: 90ms; }
.slide.in.c-triptych .f:nth-child(3) { animation-delay: 180ms; }
@keyframes rise { from { opacity: 0; transform: translateY(6vh); } }

/* ── STAIR TRIO — ascending heights, overlapped, z toward the best frame ── */
.c-stair {
  display: flex; align-items: flex-end; justify-content: center; gap: 0;
  padding: 0 var(--pad) 9vh;
}
.c-stair .f { width: auto; aspect-ratio: var(--ar); max-width: 30vw; }
.c-stair .f:nth-child(1) { height: min(42vh, 24vw); z-index: 1; translate: calc(var(--px, 0) * -5px) 0; }
.c-stair .f:nth-child(2) { height: min(54vh, 30vw); z-index: 2; margin-left: -3.5vw;
  translate: calc(var(--px, 0) * -10px) 0; }
.c-stair .f:nth-child(3) { height: min(66vh, 36vw); z-index: 3; margin-left: -3.5vw;
  box-shadow: -30px 0 90px rgba(0,0,0,0.55); translate: calc(var(--px, 0) * -15px) 0; }

/* ── TAKES CAROUSEL — near-identical takes cycling in one slot ── */
.c-carousel .f { height: min(78vh, 52vw); width: auto; aspect-ratio: var(--ar); }
.c-carousel .f:not(.live) { display: none; }

/* ── CONTACT BURST — a sheet of six, then the best frame flips out ── */
.c-burst { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  width: min(88vw, 1200px); }
.c-burst .f { aspect-ratio: 4 / 5; width: 100%; height: auto; }
.c-burst .f img { object-fit: cover; }
.slide.in.c-burst .f { animation: rise 460ms var(--ease) backwards; }
.slide.in.c-burst .f:nth-child(1) { animation-delay: 0ms; }
.slide.in.c-burst .f:nth-child(2) { animation-delay: 50ms; }
.slide.in.c-burst .f:nth-child(3) { animation-delay: 100ms; }
.slide.in.c-burst .f:nth-child(4) { animation-delay: 150ms; }
.slide.in.c-burst .f:nth-child(5) { animation-delay: 200ms; }
.slide.in.c-burst .f:nth-child(6) { animation-delay: 250ms; }

/* ── DIPTYCH — two panes sliding in from opposite edges ── */
.c-diptych { display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  width: 100%; height: 100%; }
.c-diptych .f { width: 100%; height: 100%; }
.c-diptych .f img { object-fit: cover; }
.slide.in.c-diptych .f:nth-child(1) { animation: fromleft 560ms var(--ease) backwards; }
.slide.in.c-diptych .f:nth-child(2) { animation: fromright 560ms 60ms var(--ease) backwards; }
@keyframes fromleft { from { transform: translateX(-14%); opacity: 0; } }
@keyframes fromright { from { transform: translateX(14%); opacity: 0; } }

/* ── OFFSET OVERLAP — landscape base, portrait pinned over its corner ── */
.c-overlap { position: relative; }
.c-overlap .f:nth-child(1) {
  position: absolute; width: 62vw; height: auto; aspect-ratio: var(--ar1);
  left: var(--base-x, 4vw); top: 50%; transform: translateY(-50%);
  translate: calc(var(--px, 0) * -7px) calc(var(--py, 0) * -4px);
}
.c-overlap .f:nth-child(2) {
  position: absolute; width: 28vw; height: auto; aspect-ratio: var(--ar2);
  right: var(--over-x, 5vw); top: 56%; transform: translateY(-50%);
  z-index: 2; box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  translate: calc(var(--px, 0) * -18px) calc(var(--py, 0) * -10px);
}

/* ── DIAGONAL SPLIT — a 78° seam that wipes open along its own angle ── */
.c-diagonal { position: relative; }
.c-diagonal .f { position: absolute; inset: 0; width: 100%; height: 100%; }
.c-diagonal .f img { object-fit: cover; }
.c-diagonal .f:nth-child(2) {
  clip-path: polygon(38% 0, 100% 0, 100% 100%, 62% 100%);
  z-index: 2;
}
.slide.in.c-diagonal .f:nth-child(2) { animation: seam 620ms var(--snap) backwards; }
@keyframes seam { from { clip-path: polygon(100% 0, 100% 0, 100% 100%, 100% 100%); } }

/* ── MOTION — a film, indistinguishable in weight from a still ── */
.c-motion .f { height: min(84vh, 47vw); width: auto; aspect-ratio: var(--ar); }
.c-motion video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 420ms linear;
}
.c-motion video.on { opacity: 1; }

/* ── SWATCH — one beat of the incoming colour; punctuation, not a slide ── */
.c-swatch { background: var(--f-avg); }

/* ── CHAPTER CARD — the hero photograph lives inside the numeral's strokes ── */
.c-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.c-card .numfill {
  font-weight: 800;
  font-size: min(58vh, 44vw);
  line-height: 0.86;
  letter-spacing: 0.02em;
  background-size: cover;
  background-position: 50% 30%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px color-mix(in srgb, var(--fg) 22%, transparent);
  animation: numpan 4.6s ease-in-out both, numin 800ms var(--ease) both;
  translate: calc(var(--px, 0) * 12px) calc(var(--py, 0) * 7px);
}
@keyframes numpan { from { background-position: 50% 22%; } to { background-position: 50% 52%; } }
@keyframes numin { from { opacity: 0; filter: blur(14px); transform: scale(1.06); } }
.c-card .name {
  font-weight: 300;
  font-size: clamp(22px, 4.6vw, 62px);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  line-height: 1;
  margin-top: 0.55em;
  animation: rack 900ms 180ms var(--ease) both;
}
@keyframes rack {
  from { font-variation-settings: "wght" 200; opacity: 0; filter: blur(10px); }
  to { font-variation-settings: "wght" 400; opacity: 1; filter: blur(0); }
}

/* ── THE BREATH — nothing on this site is ever perfectly still ── */
.slide.in.c-keylight .f img,
.slide.in.c-bokeh .f img,
.slide.in.c-quarter .f img,
.slide.in.c-carousel .f img,
.slide.in.c-overlap .f img,
.slide.in.c-stair .f img,
.slide.in.c-triptych .f img,
.slide.in.c-burst .f img,
.slide.in.c-diptych .f img {
  animation: breathe 14s ease-out forwards;
}
@keyframes breathe {
  to { transform: scale(1.045) translateX(calc(var(--kb, 1) * 0.7%)); }
}

/* ─── transitions ─────────────────────────────────────────────────────────
   Each is a cut a camera professional would name. Compositor only. */

#stage[data-t="cut"] .slide.in { animation: none; }
#stage[data-t="dissolve"] .slide.in { animation: diss 620ms ease-in-out both; }
#stage[data-t="dissolve"] .slide.out { animation: dissout 620ms ease-in-out both; }
@keyframes diss { from { opacity: 0; } }
@keyframes dissout { to { opacity: 0; } }

#stage[data-t="wipe"] .slide.in { animation: wipein 520ms var(--snap) both; }
@keyframes wipein { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
#stage[data-t="wipe"].flip .slide.in { animation-name: wipeinflip; }
@keyframes wipeinflip { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }

#stage[data-t="push"] .slide.in { animation: pushin2 560ms var(--ease) both; }
#stage[data-t="push"] .slide.out { animation: pushout 560ms var(--ease) both; }
@keyframes pushin2 { from { opacity: 0; transform: scale(0.94); } }
@keyframes pushout { to { opacity: 0; transform: scale(1.06); } }

#stage[data-t="whip"] .slide.in { animation: whipin 400ms var(--whip) both; }
#stage[data-t="whip"] .slide.out { animation: whipout 400ms var(--whip) both; }
@keyframes whipin { from { transform: translateX(100%); filter: blur(14px); } }
@keyframes whipout { to { transform: translateX(-100%); filter: blur(14px); } }

#stage[data-t="smash"] .slide.in { animation: smash 480ms steps(2) both; }
@keyframes smash { 0% { opacity: 0; filter: brightness(4); } 30% { opacity: 1; filter: brightness(1.8); } 100% { filter: brightness(1); } }

#stage[data-t="dip"] .slide.in { animation: diss 420ms 300ms ease-in both; }
#stage[data-t="dip"] .slide.out { animation: dissout 300ms ease-out both; }

/* ─── film hardware: flash, cue dot, reticle ──────────────────────────── */

/* the white flash when the reel crosses between dark and paper grounds */
#fcut {
  position: fixed; inset: 0; z-index: 14;
  background: #fff; opacity: 0; pointer-events: none;
}
#fcut.go { animation: fcut 360ms steps(3, end) both; }
@keyframes fcut { 0% { opacity: 0; } 20% { opacity: 0.92; } 100% { opacity: 0; } }

/* the projectionist's changeover cue: two blinks across the chapter's last slide */
#cue {
  position: fixed; top: calc(var(--pad) + 30px); right: var(--pad); z-index: 21;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--fg); opacity: 0; pointer-events: none;
  filter: blur(0.4px);
}
#cue.go { animation: cue var(--cue-ms, 4000ms) steps(1, end) both; }
@keyframes cue {
  0%, 3% { opacity: 0.8; }
  4%, 71% { opacity: 0; }
  72%, 75% { opacity: 0.8; }
  76%, 100% { opacity: 0; }
}

/* the cursor is a focus reticle; it blends by difference so it reads on
   both grounds, opens over anything touchable, snaps shut like a shutter */
body.fine, body.fine * { cursor: none !important; }
#cursor {
  position: fixed; left: 0; top: 0; z-index: 60;
  pointer-events: none; mix-blend-mode: difference;
}
#cursor i {
  display: block; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 1.5px solid #fff; border-radius: 50%;
  transition: transform 240ms var(--ease);
}
#cursor::after {
  content: ""; position: absolute; left: -2px; top: -2px;
  width: 4px; height: 4px; border-radius: 50%; background: #fff;
}
#cursor.hot i { transform: scale(1.55); }
#cursor.snap i { transform: scale(0.55); transition-duration: 90ms; }

/* ─── chrome: three objects, nothing else ─────────────────────────────── */

#mark {
  position: fixed; top: var(--pad); left: var(--pad); z-index: 20;
  font-weight: 400; font-size: clamp(13px, 1.3vw, 17px);
  letter-spacing: 0.36em; text-indent: 0.36em;
  color: var(--fg); text-decoration: none;
  opacity: 0.82; cursor: pointer; background: none; border: 0;
  font-family: inherit;
}
#chip {
  position: fixed; top: var(--pad); right: var(--pad); z-index: 20;
  font-weight: 400; font-size: clamp(10px, 1.1vw, 13px);
  letter-spacing: 0.4em; text-indent: 0.4em;
  color: var(--fg); opacity: 0.55; cursor: pointer;
  background: none; border: 0; font-family: inherit;
}
#mark:hover, #chip:hover { opacity: 1; }

#spine {
  position: fixed; left: var(--pad); right: var(--pad); bottom: calc(var(--pad) * 0.8);
  z-index: 20; display: flex; gap: 6px; align-items: flex-end;
  height: 22px; opacity: 0; transition: opacity 420ms linear;
  cursor: pointer;
}
#spine.on { opacity: 1; }
#spine .seg { flex: var(--w, 1); display: flex; gap: 2px; align-items: flex-end; }
#spine .tick {
  flex: 1; height: 2px; background: currentColor; opacity: 0.22;
  transition: opacity 200ms linear, height 200ms var(--ease);
}
#spine .tick.done { opacity: 0.45; }
#spine .tick.now { opacity: 1; height: 8px; }

/* ─── chapter index ───────────────────────────────────────────────────── */

#index {
  position: fixed; inset: 0; z-index: 30;
  display: none; background: #050505;
}
#index.on { display: flex; }
#index.on .pane { animation: paneup 460ms var(--ease) backwards; }
#index.on .pane:nth-child(2) { animation-delay: 50ms; }
#index.on .pane:nth-child(3) { animation-delay: 100ms; }
#index.on .pane:nth-child(4) { animation-delay: 150ms; }
#index.on .pane:nth-child(5) { animation-delay: 200ms; }
#index.on .pane:nth-child(6) { animation-delay: 250ms; }
@keyframes paneup { from { opacity: 0; transform: translateY(4vh); } }
#index .pane {
  position: relative; flex: 1; overflow: hidden; cursor: pointer;
  border-right: 1px solid rgba(255,255,255,0.08);
  transition: flex-grow 380ms var(--ease);
  display: grid; place-items: center;
}
#index .pane:hover { flex-grow: 1.7; }
#index .pane .mosaic {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  opacity: 0.5;
  animation: drift2 26s linear infinite alternate;
}
@keyframes drift2 { to { transform: translateY(-8%); } }
#index .pane .mosaic i {
  display: block; aspect-ratio: 4/5;
  background-size: cover; background-position: center;
}
#index .pane .veil {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--pane-tint) 10%, transparent 90%);
}
#index .pane .label {
  position: relative; z-index: 2; text-align: center; color: #fff;
  text-shadow: 0 4px 30px rgba(0,0,0,0.8);
}
#index .pane .label b {
  display: block; font-weight: 300;
  font-size: clamp(20px, 2.6vw, 42px);
  letter-spacing: 0.22em; text-indent: 0.22em;
}
#index .pane .label span {
  display: block; font-weight: 400; opacity: 0.6;
  font-size: 11px; letter-spacing: 0.5em; text-indent: 0.5em; margin-bottom: 1.2em;
}
#index .pane.credits { flex: 0.42; }

/* ─── coverage tray ───────────────────────────────────────────────────── */

#tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 26;
  height: 26vh; display: none;
  background: linear-gradient(to top, rgba(0,0,0,0.94), rgba(0,0,0,0.62));
  padding: 2vh var(--pad);
  overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x proximity;
}
#tray.on { display: flex; gap: 12px; align-items: center; animation: trayup 380ms var(--ease); }
@keyframes trayup { from { transform: translateY(100%); } }
#tray img {
  height: 100%; width: auto; object-fit: contain;
  scroll-snap-align: center; cursor: pointer; opacity: 0.86;
  transition: opacity 200ms linear, transform 260ms var(--ease);
}
#tray img:hover { opacity: 1; transform: translateY(-4px); }

/* ─── archive wall ────────────────────────────────────────────────────── */

#wall {
  position: fixed; inset: 0; z-index: 28; display: none;
  overflow-y: auto; background: var(--bg);
  padding: calc(var(--pad) * 3) var(--pad) var(--pad);
  columns: 4; column-gap: 12px;
}
#wall.on { display: block; }
#wall img {
  width: 100%; margin-bottom: 12px; display: block; cursor: pointer;
  background: #17171a;
}

/* ─── full viewer: one frame, uncropped, the standing crop answer ─────── */

#viewer {
  position: fixed; inset: 0; z-index: 40; display: none;
  background: rgba(4,4,4,0.97); place-items: center; padding: 3vh;
}
#viewer.on { display: grid; }
#viewer.on .holder { animation: iris 460ms var(--ease); }
@keyframes iris {
  from { clip-path: circle(0% at 50% 50%); }
  to { clip-path: circle(75% at 50% 50%); }
}
#viewer img, #viewer video {
  max-width: 96vw; max-height: 94vh; width: auto; height: auto;
  object-fit: contain; display: block;
}
#viewer .bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(255,255,255,0.18);
}
#viewer .bar i { display: block; height: 100%; width: 0; background: #fff; }

/* ─── overture ────────────────────────────────────────────────────────── */

#overture {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center;
  background: var(--ink);
}
#overture.gone { display: none; }
#overture .flash {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; filter: brightness(0.42);
}
#overture .word {
  position: relative; z-index: 2;
  font-weight: 300; font-size: clamp(34px, 7.4vw, 108px);
  letter-spacing: 0.34em; text-indent: 0.34em; color: #fff;
  animation: rack 900ms var(--ease) both;
}
/* the leader sweep: a countdown arc with no number in it */
#overture .sweep {
  position: absolute; z-index: 1;
  width: 54vmin; height: 54vmin; border-radius: 50%;
  background: conic-gradient(rgba(255,255,255,0.16) 0 16deg, transparent 16deg);
  -webkit-mask: radial-gradient(closest-side, transparent 60%, #000 61%, #000 78%, transparent 79%);
  mask: radial-gradient(closest-side, transparent 60%, #000 61%, #000 78%, transparent 79%);
  animation: sweep 1.05s linear 2, sweepgone 240ms 2.1s linear forwards;
}
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes sweepgone { to { opacity: 0; } }

#overture .brackets { position: absolute; z-index: 2; inset: 30% 18%; }
#overture .brackets i {
  position: absolute; width: 34px; height: 34px;
  border: 1px solid rgba(255,255,255,0.55);
  animation: br 420ms var(--snap) 500ms both;
}
#overture .brackets i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
#overture .brackets i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
#overture .brackets i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
#overture .brackets i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }
@keyframes br { from { opacity: 0; transform: scale(1.5); } }

#overture .ribbon {
  position: absolute; z-index: 3; bottom: 16vh; left: 0; right: 0;
  display: flex; justify-content: center; gap: clamp(18px, 4vw, 64px);
  opacity: 0; transition: opacity 500ms linear;
}
#overture .ribbon.on { opacity: 1; }
#overture .ribbon button {
  background: none; border: 0; color: #fff; cursor: pointer;
  font-family: inherit; font-weight: 400; opacity: 0.62;
  font-size: clamp(11px, 1.2vw, 15px);
  letter-spacing: 0.34em; text-indent: 0.34em;
  transition: opacity 240ms linear;
}
#overture .ribbon button:hover { opacity: 1; }

/* ─── the closing sequence ────────────────────────────────────────────── */

.c-coda {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
}
.c-coda .over {
  font-weight: 400; font-size: clamp(9px, 1vw, 12px);
  letter-spacing: 0.44em; text-indent: 0.44em; opacity: 0.5; margin-bottom: 1.6em;
}
.c-coda .big {
  font-weight: 200; font-size: clamp(36px, 8vw, 96px);
  letter-spacing: 0.15em; text-indent: 0.15em; line-height: 1.02;
}
.c-coda .mid {
  font-weight: 200; font-size: clamp(22px, 4.2vw, 46px);
  letter-spacing: 0.2em; text-indent: 0.2em;
}
.c-coda .sub {
  font-weight: 400; font-size: clamp(10px, 1.15vw, 13px);
  letter-spacing: 0.34em; text-indent: 0.34em; opacity: 0.62;
}
.c-coda .num {
  font-weight: 200; font-size: clamp(28px, 6.4vw, 74px);
  letter-spacing: 0.1em; text-indent: 0.1em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.c-coda .row { display: flex; gap: 1.1em; align-items: center; justify-content: center;
  flex-wrap: wrap; margin-top: 1.4em; }
.c-coda .rule { display: block; width: 1px; height: 0.9em; background: currentColor; opacity: 0.32; }
.c-coda a { color: inherit; text-decoration: none; display: block; }
.c-coda .wa { color: #2ea86b; margin-top: 3.2em; }
.c-coda .marks { display: flex; gap: 26px; justify-content: center; margin-top: 3em; }
.c-coda .mark {
  width: 9px; height: 9px; border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 42%, transparent);
  transition: transform 260ms var(--ease), background 260ms linear;
}
.c-coda .mark:hover { transform: scale(1.6); background: var(--fg); }
.c-coda .horizon {
  display: block; width: min(46vw, 420px); height: 1px; margin: 0 auto;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.7;
}

/* ─── responsive: the grammar remaps, it does not degrade ─────────────── */

@media (max-width: 768px) {
  :root { --pad: 14px; }
  #wall { columns: 2; }

  /* portrait is this archive's native shape, so the phone gets the bleed */
  .c-bleed .f img { object-position: 50% 30%; }
  .c-keylight .f { height: 68dvh; max-width: 94vw; }
  .c-bokeh .f { height: 62dvh; max-width: 88vw; transform: none; }
  .c-quarter { place-items: center; padding: 0 var(--pad); }
  .c-quarter .f { height: 56dvh; margin: 0; }
  .c-scope .f { width: 100vw; height: calc(100vw / 2.39); }

  /* space becomes time: a triptych plays as three cuts instead of shrinking.
     !important outguns the desktop nth-child sizing, which is more specific */
  .c-triptych { display: grid; place-items: center; }
  .c-triptych .f { position: absolute; height: 66dvh !important; max-width: 94vw !important;
    transform: none !important; }
  .c-triptych .f:not(.live) { display: none; }

  .c-stair { display: grid; place-items: center; }
  .c-stair .f { position: absolute; margin: 0 !important; height: 66dvh !important;
    max-width: 94vw !important; box-shadow: none; }
  .c-stair .f:not(.live) { display: none; }

  .c-carousel .f { height: 62dvh; max-width: 94vw; }
  .c-card .numfill { font-size: min(44vh, 80vw); }

  .c-diptych { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; }
  .c-burst { grid-template-columns: repeat(2, 1fr); width: 94vw; }

  .c-overlap .f:nth-child(1) { width: 86vw; left: 2vw; }
  .c-overlap .f:nth-child(2) { width: 46vw; right: 3vw; top: 68%; }

  .c-motion .f { height: 72dvh; }
  #tray { height: 20dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; }
  #stage[data-t] .slide.in { animation: diss 200ms linear both; }
  #stage[data-t] .slide.out { animation: none; }
  #grain { display: none; }
}

/* the overture's flash montage: one hero per chapter, hard cuts on the beat */
@keyframes flash {
  0% { opacity: 0; }
  1% { opacity: 1; }
  99% { opacity: 1; }
  100% { opacity: 0; }
}
