/* ============================================================
   DANGRIN — dangrin.com
   Design system: the printed Photo Book, opened in a browser.
   Two moods, one token set:
     [data-theme="ink"] — black grunge chapters, framed prints
     [data-theme="air"] — white airy chapters, editorial calm
   Type: Jost (display caps) · Mulish (text) · Alexross (scribbles)
   ============================================================ */

/* ---------- fonts ---------- */
@font-face { font-family: 'Jost'; src: url('../assets/fonts/jost-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../assets/fonts/jost-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../assets/fonts/jost-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Jost'; src: url('../assets/fonts/jost-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('../assets/fonts/mulish-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('../assets/fonts/mulish-400i.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('../assets/fonts/mulish-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Mulish'; src: url('../assets/fonts/mulish-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Alexross'; src: url('../assets/fonts/Alexross-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  --black: #0b0a09;
  --panel-ink: #151312;
  --white: #f7f5f1;
  --paper: #fdfdfc;
  --gray-1: #e8e5df;
  --gray-2: #b9b5ad;
  --gray-3: #6f6c66;
  --red: #e0301d;

  --font-display: 'Jost', 'Futura', sans-serif;
  --font-text: 'Mulish', 'Avenir Next', sans-serif;
  --font-scribble: 'Alexross', cursive;

  --track: 0.22em;
  --pad: clamp(20px, 4vw, 56px);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-inout: cubic-bezier(0.83, 0, 0.17, 1);
}
[data-theme="ink"] {
  --bg: var(--black);
  --panel: var(--panel-ink);
  --fg: var(--white);
  --muted: var(--gray-2);
  --faint: #8f8c85; /* ≥4.5:1 on --black */
  --frame: var(--white);
  --scribble: var(--white);
}
[data-theme="air"] {
  --bg: var(--paper);
  --panel: #f2f0ec;
  --fg: #141311;
  --muted: #5d5a55; /* ≥6:1 on --paper */
  --faint: #757169; /* ≥4.5:1 on --paper */
  --frame: #141311;
  --scribble: #141311;
}

/* ---------- base ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* scrollbar-gutter: pages with and without scroll keep the same width —
   otherwise the layout shifts sideways on every route change.
   NO overflow-x on html: root-level clip/hidden breaks touch scrolling in
   iOS Safari — horizontal bleed is clipped at its source instead (.grain
   containers), see .ch-feed/.contact-left */
html { height: 100%; scrollbar-gutter: stable; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--fg);
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s ease, color 0.6s ease;
  overflow-x: hidden;
}
body.locked { overflow: hidden; height: 100%; }
/* while the curtain covers the screen, theme/menu changes snap instead of
   animating — their tail ends used to bleed past the reveal as a flash */
body.theme-snap,
body.menu-instant .site-head nav,
body.menu-instant .site-head nav a,
body.menu-instant .nav-base,
body.menu-instant .burger .b-box i { transition: none !important; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
/* touch: no gray tap flash, no double-tap zoom delay on controls */
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { background: var(--red); color: var(--white); }

/* ---------- type utilities ---------- */
.caps {
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--track);
  font-size: 11px;
}
.scribble { font-family: var(--font-scribble); font-weight: 400; line-height: 0.9; }
.red { color: var(--red); }
.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;
}
#view:focus { outline: none; }
.tile:focus-visible, .strip-item:focus-visible, .chapter-next:focus-visible {
  outline: 2px solid var(--red); outline-offset: 4px;
}

/* ============================================================
   PRELOADER
   ============================================================ */
#preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--black); color: var(--white);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px;
  transition: clip-path 0.9s var(--ease-inout);
  clip-path: inset(0 0 0 0);
}
#preloader.done { clip-path: inset(0 0 100% 0); pointer-events: none; }
#preloader .load-col { display: flex; flex-direction: column; gap: 18px; width: fit-content; }
/* the hero print IS the progress: a dim ghost underneath, the real
   photo fills it bottom-up as assets arrive */
#preloader .load-ph {
  position: relative; height: min(62vh, 640px); aspect-ratio: 987 / 1800;
  border: 6px solid var(--white); background: #151312; overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
#preloader .load-ph img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
#preloader .load-ph img:first-child { opacity: 0.18; filter: grayscale(1) brightness(0.85); }
#preloader .ph-fill { clip-path: inset(100% 0 0 0); }
#preloader .bar { width: 100%; height: 2px; background: #2c2a27; position: relative; overflow: hidden; }
#preloader .bar i { position: absolute; inset: 0; background: var(--red); transform: scaleX(0); transform-origin: left; }
#preloader .load-name {
  font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: 0.3em; text-indent: 0.3em; text-transform: uppercase;
  color: var(--gray-2); text-align: center;
}

/* ============================================================
   HEADER  (mix-blend so it reads on both moods)
   ============================================================ */
.site-head {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: flex-end;
  gap: 30px;
  padding: 22px var(--pad);
  color: #fff;
  pointer-events: none;
}
/* burger + menu footer line exist for the mobile overlay only */
.burger, .nav-base { display: none; }
/* ∞ mark top-left on every page — the way back home. White logo file:
   inverted on paper themes, hidden while the fan's Close pill owns that
   corner, forced white over the ink menu overlay */
.brand-mark {
  position: absolute; left: var(--pad); top: 10px; z-index: 2;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.brand-mark img {
  width: clamp(56px, 4.6vw, 68px); height: auto; display: block;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.5));
}
.brand-mark:hover { transform: scale(1.05); }
body[data-theme="air"] .brand-mark img { filter: invert(1); }
body.in-fan .brand-mark { opacity: 0; pointer-events: none; }
body.menu-open .brand-mark img { filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.5)); }
/* desktop home: the big ∞ already lives in the wheel pocket */
@media (min-width: 881px) {
  body[data-route="home"] .brand-mark { display: none; }
}
body[data-theme="air"] .site-head { color: #141311; }
.site-head > * { pointer-events: auto; }
/* fixed scrim under the menu on every page — photos scrolling beneath
   the header can no longer swallow it (theme-matched, fades to nothing) */
body::after {
  content: ''; position: fixed; top: 0; left: 0; right: 0; height: 130px;
  z-index: 99; pointer-events: none;
  background: linear-gradient(to bottom, rgba(11,10,9,0.65), rgba(11,10,9,0.25) 55%, transparent);
}
body[data-theme="air"]::after,
body.in-fan::after { /* the fan lays paper over the ink stage */
  background: linear-gradient(to bottom, rgba(247,245,241,0.8), rgba(247,245,241,0.3) 55%, transparent);
}
body.in-fan .site-head { color: #141311; }
.site-head .brand {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  letter-spacing: 0.5em; text-indent: 0.5em;
}
.site-head nav { display: flex; gap: 30px; align-items: center; }
.site-head nav a, .site-head .snd {
  font-family: var(--font-display); font-weight: 500; font-size: 11px;
  letter-spacing: var(--track); text-transform: uppercase;
  position: relative; padding: 4px 0;
}
.site-head nav a::after {
  content: ''; position: absolute; left: 0; bottom: 0; height: 1px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.site-head nav a:hover::after, .site-head nav a.active::after { transform: scaleX(1); transform-origin: left; }
.site-head .snd { display: inline-flex; align-items: center; gap: 8px; }
.site-head .snd .eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 10px; }
.site-head .snd .eq i { width: 2px; background: currentColor; height: 3px; }
.site-head .snd[aria-pressed="true"] .eq i { animation: eq 0.9s ease-in-out infinite alternate; }
.site-head .snd .eq i:nth-child(2) { animation-delay: 0.2s; height: 8px; }
.site-head .snd .eq i:nth-child(3) { animation-delay: 0.4s; height: 5px; }
@keyframes eq { from { transform: scaleY(0.3); } to { transform: scaleY(1); } }

/* ============================================================
   GRAIN + GRUNGE atmosphere
   ============================================================ */
.grain::after {
  content: ''; position: absolute; inset: -100px; z-index: 3; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg width='300' height='300' viewBox='0 0 300 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 300px 300px;
  opacity: 0.05;
  animation: grain 0.9s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 25% { transform: translate(-40px, 30px); }
  50% { transform: translate(30px, -50px); } 75% { transform: translate(-20px, -30px); }
  100% { transform: translate(0, 0); }
}
/* grain sections that scroll WITH the page must clip their own bleed
   (.grain::after pokes ±100px out) — otherwise the mobile layout viewport
   widens and the fixed header slides half off-screen */
.ch-feed, .contact-left { overflow: hidden; overflow: clip; }
.grunge-bg { position: relative; }
.grunge-bg::before {
  content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: url('../assets/img/grunge.jpg') center / cover;
  opacity: 0.5; mix-blend-mode: screen; filter: brightness(0.34) contrast(1.15);
}
[data-theme="air"] .grunge-bg::before { display: none; }

/* ash — faint flakes drifting through the dark sections (canvas, engine.js) */
.ash-canvas { pointer-events: none; }
.ash-fixed { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; }
/* on the stage the ash floats in front of the dim backdrop, behind the wheel */
.stage .ash-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }

/* framed print, like the white borders in the book */
.frame { border: 5px solid var(--frame); box-shadow: 0 18px 60px rgba(0,0,0,0.45); background: var(--panel); }
[data-theme="air"] .frame { box-shadow: 0 14px 44px rgba(0,0,0,0.16); }

/* ============================================================
   HOME
   ============================================================ */
.home { position: relative; }

/* compact masthead above the mobile strip */
.masthead { padding: 13vh var(--pad) 2vh; }
.masthead .kicker {
  color: var(--red); font-family: var(--font-display); font-weight: 600;
  font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase;
}
.masthead .m-title {
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(44px, 13vw, 90px); line-height: 0.9; margin-top: 10px;
}

/* ============================================================
   HOME — STAGE (wheel scene)
   ============================================================ */
.stage {
  position: fixed; inset: 0; z-index: 10;
  background: var(--black); color: var(--white);
  opacity: 0; visibility: hidden; overflow: hidden;
  touch-action: none;
  transition: opacity 0.7s ease, visibility 0s linear 0.7s;
}
.stage.on { opacity: 1; visibility: visible; transition: opacity 0.7s ease; }

/* selection backdrop: the focal frame's project bleeds in from the right,
   fading out to the left; two layers crossfade on rotation */
.peek {
  position: absolute; top: 0; right: 0; bottom: 0; width: 62vw; z-index: 1;
  overflow: hidden;
  pointer-events: none; transition: opacity 0.5s ease;
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 45%, transparent 100%);
  mask-image: linear-gradient(to left, rgba(0,0,0,1) 45%, transparent 100%);
}
/* size/position set by JS (placePeek): eyes land on the upper-third line */
.peek img {
  position: absolute; top: 0; left: 0;
  max-width: none; max-height: none;
  opacity: 0; transform: scale(1.06);
  transition: opacity 0.9s ease, transform 6s var(--ease-out);
}
.peek img.show { opacity: 1; transform: scale(1); }
.stage.fan-mode .peek { opacity: 0; }
/* phones only: the backdrop runs full-bleed there, so the column the
   frames ride in is darkened — the photo itself stays undimmed where
   the subject is (upper right) */
.stage-veil { display: none; }

/* ticks ring — the lens-barrel etching behind the wheel */
.wheel-ticks {
  position: absolute; top: 50%; border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.14);
  pointer-events: none; z-index: 1;
}

.wheel { position: absolute; inset: 0; z-index: 2; }
.wheel-hub { position: absolute; top: 50%; left: 0; width: 0; height: 0; }
.wheel-item {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0; /* pivot on the ray anchor so every frame's centre sits exactly on the circle */
  cursor: pointer; will-change: transform;
}
.wheel-item .ph {
  transform: translate(-50%, -50%); /* centered on the ray — portraits align to the landscapes' centre, not their left edge */
  height: var(--item-h, 27vh); width: auto; max-width: none; display: block;
  filter: brightness(0.55) saturate(0.92);
  transition: filter 0.45s ease, transform 0.5s var(--ease-out), box-shadow 0.5s ease;
  border: 2px solid transparent;
  box-shadow: 0 10px 34px rgba(0,0,0,0.5);
  user-select: none; -webkit-user-drag: none;
}
.wheel-item:hover .ph { filter: brightness(0.85) saturate(1); }
.wheel-item.focal .ph {
  filter: brightness(1.08) saturate(1);
  border-color: var(--white);
  transform: translate(-50%, -50%) scale(1.22);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), 0 0 60px rgba(247, 245, 241, 0.28);
}

/* caption block — book caption, lower third so it never covers the face */
.stage-caption {
  position: absolute; z-index: 4; left: 50%; bottom: 5vh;
  transform: translate(-8%, 0);
  max-width: 34vw; pointer-events: none;
  transition: opacity 0.45s ease;
}
.stage.fan-mode .stage-caption { opacity: 0; }
.stage-caption .word {
  font-family: var(--font-scribble); color: var(--red);
  font-size: clamp(52px, 7.4vw, 118px); line-height: 0.9;
  margin-bottom: -0.2em; min-height: 1em; /* pull the name up under the word */
  transform: rotate(-2deg);
}
.stage-caption .word .r { color: var(--red); }
/* wordLong projects: same scribble, caps for even letter height, one line */
.stage-caption .word.long {
  font-size: clamp(32px, 4.4vw, 70px); white-space: nowrap;
  margin-bottom: 0.12em;
}
.chapter-hero .h-word.long { font-size: clamp(36px, 5.2vw, 88px); white-space: nowrap; }
/* Alexross's own '&' is heavy — a script ampersand blends with the handwriting */
.word .amp, .h-word .amp {
  font-family: 'Snell Roundhand', 'Savoye LET', Georgia, cursive;
  font-weight: 400; font-size: 0.95em; vertical-align: 0;
}
/* the ∞ mark in the visual centre of the wheel, left pocket of the stage */
.wheel-logo {
  position: absolute; z-index: 1; left: 9vw; top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(64px, 7.2vw, 120px); height: auto;
  opacity: 0.9; pointer-events: none;
}
/* soft dark pool behind the caption so it reads over any photo */
.stage-caption::before {
  content: ''; position: absolute; z-index: -1;
  inset: -10vh -16vw -6vh -14vw; pointer-events: none;
  background: radial-gradient(closest-side, rgba(11,10,9,0.8), rgba(11,10,9,0));
}
.stage-caption .mname { font-style: italic; color: var(--gray-2); font-size: 15px; min-height: 1.2em; }
.stage-caption .mrole { color: var(--gray-2); font-size: 13px; margin-top: 2px; }
.stage-caption .mrole:empty { display: none; }
.stage-caption .msocial { margin-top: 8px; }
.stage-caption .msocial:empty { display: none; }
.stage-caption a.social { pointer-events: auto; }

/* person's social badge (Instagram / TikTok) */
a.social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border: 1px solid currentColor; border-radius: 999px;
  font-family: var(--font-display); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-decoration: none; color: inherit;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
a.social svg { width: 15px; height: 15px; display: block; flex: none; }
a.social:hover { background: var(--red); border-color: var(--red); color: var(--white); }
.stage-caption .meta { display: flex; align-items: center; gap: 16px; margin-top: 0.9vh; }
.stage-caption .idx { font-family: var(--font-display); font-weight: 500; font-size: 12px; letter-spacing: var(--track); color: var(--gray-2); }
.stage-caption .hint { margin-top: 1.4vh; font-family: var(--font-display); font-size: 10px; letter-spacing: var(--track); text-transform: uppercase; color: #8f8c85; }
.stage-caption .cap { transition: opacity 0.28s ease, transform 0.28s ease; }
.stage-caption .cap.swap { opacity: 0; transform: translateY(10px); }

/* ============================================================
   FAN — the semicircle project preview, right side.
   Opens over a translucent white veil: this IS the project page,
   glimpsed before falling into it.
   ============================================================ */
.fan {
  position: absolute; inset: 0; z-index: 6;
  visibility: hidden; opacity: 0; color: #141311;
  /* prints carry inline visibility:visible from renderFan, so the closed fan
     is transparent yet still hit-testable — pointer-events is what actually
     lets taps through to the wheel (stale "Open project" bug) */
  pointer-events: none;
  transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}
.fan.on { visibility: visible; opacity: 1; pointer-events: auto; transition: opacity 0.6s ease; }
.fan-veil {
  position: absolute; inset: 0;
  background: rgba(247, 245, 241, 0.45);
  -webkit-backdrop-filter: blur(10px) saturate(0.9);
  backdrop-filter: blur(10px) saturate(0.9);
}
.fan-hub { position: absolute; top: 50%; left: 0; width: 0; height: 0; transition: opacity 0.35s ease; }
.fan-item { position: absolute; top: 0; left: 0; will-change: transform; cursor: pointer; }
.fan-item .ph {
  transform: translate(-50%, -50%);
  height: min(66vh, 42vw); width: auto; max-width: none; display: block;
  border: 6px solid #fff;
  box-shadow: 0 26px 80px rgba(20, 19, 17, 0.3);
  filter: brightness(0.97); opacity: 0.55;
  transition: filter 0.4s ease, opacity 0.4s ease;
  user-select: none; -webkit-user-drag: none;
}
.fan-item.focal .ph { filter: brightness(1); opacity: 1; }
.fan-item:not(.focal):hover .ph { opacity: 0.8; }
/* not yet loaded — stay invisible, fade in via the existing opacity transition */
.fan-item:not(.ld) .ph { opacity: 0; }

.fan-ui {
  position: absolute; z-index: 120; left: var(--pad); bottom: 6vh;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(420px, 34vw);
  background: var(--paper); border: 1px solid var(--gray-1);
  padding: 22px 26px;
  box-shadow: 0 18px 60px rgba(20, 19, 17, 0.22);
}
.fan-ui .person { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 20px; }
.fan-ui .role, .fan-ui .ptitle { color: #5d5a55; font-size: 14px; }
.fan-ui .psocial { color: #5d5a55; margin-top: 8px; }
.fan-ui .psocial:empty { display: none; }
.fan-ui .ptitle { font-style: italic; }
.fan-ui .idx { font-family: var(--font-display); font-size: 12px; letter-spacing: var(--track); color: #757169; margin-top: 8px; }
.fan-ui .cap { transition: opacity 0.28s ease, transform 0.28s ease; }
.fan-ui .cap.swap { opacity: 0; transform: translateY(8px); }
.fan-open {
  display: inline-block; margin-top: 16px; align-self: flex-start;
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: var(--track); text-transform: uppercase;
  color: var(--paper); background: #141311; border: 1px solid #141311;
  padding: 12px 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.fan-open:hover { background: var(--red); border-color: var(--red); }
.fan-close {
  position: absolute; z-index: 130; top: calc(var(--pad) * 0.8); left: var(--pad);
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: var(--track); text-transform: uppercase; color: #141311;
  background: var(--paper); border: 1px solid #b9b5ad; border-radius: 999px;
  padding: 12px 22px 12px 24px;
  box-shadow: 0 12px 36px rgba(20, 19, 17, 0.22);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.fan-close:hover { border-color: var(--red); color: var(--red); transform: scale(1.04); }
.fan-arrows { position: absolute; z-index: 120; right: var(--pad); bottom: 6vh; display: flex; gap: 18px; }
.fan-arrows button {
  width: 52px; height: 52px; border: 1px solid #b9b5ad; border-radius: 50%;
  color: #141311; font-size: 18px; display: grid; place-items: center;
  transition: border-color 0.3s ease, transform 0.2s ease, color .3s ease;
}
.fan-arrows button:hover { border-color: var(--red); color: var(--red); transform: scale(1.06); }

/* flip ghost — the photo travelling from wheel to fan */
.flip-ghost {
  position: fixed; z-index: 150; pointer-events: none;
  border: 2px solid var(--white); object-fit: cover;
  box-shadow: 0 30px 100px rgba(0,0,0,0.65);
}

/* ============================================================
   CURTAIN — page-turn transition
   ============================================================ */
#curtain {
  position: fixed; inset: 0; z-index: 160; pointer-events: none;
  background: var(--black);
  clip-path: inset(100% 0 0 0);
  display: grid; place-items: center;
  will-change: clip-path;
}
#curtain.air { background: var(--paper); }
#curtain.in { transition: clip-path 0.55s var(--ease-inout); clip-path: inset(0 0 0 0); pointer-events: all; }
#curtain.out { transition: clip-path 0.55s var(--ease-inout); clip-path: inset(0 0 100% 0); }
#curtain .curtain-word {
  font-family: var(--font-scribble); font-size: clamp(56px, 9vw, 140px);
  white-space: nowrap;
  color: var(--red); transform: rotate(-3deg); opacity: 0;
  transition: opacity 0.25s ease;
}
#curtain.air .curtain-word { color: var(--red); }
#curtain.in .curtain-word { opacity: 1; }

/* ============================================================
   CURSOR LABEL
   ============================================================ */
#cursor-label {
  position: fixed; z-index: 140; top: 0; left: 0; pointer-events: none;
  font-family: var(--font-display); font-weight: 600; font-size: 10px;
  letter-spacing: var(--track); text-transform: uppercase;
  color: #fff; mix-blend-mode: difference;
  padding: 6px 2px; opacity: 0; transition: opacity 0.25s ease;
  white-space: nowrap;
}
#cursor-label.on { opacity: 1; }

/* ============================================================
   CHAPTERS INDEX  (GW dimmed tiles)
   ============================================================ */
.page { min-height: 100vh; padding: 16vh var(--pad) 10vh; position: relative; }
.page-head { margin-bottom: 7vh; position: relative; z-index: 1; }
.page-head .over { color: var(--red); font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; }
.page-head h1 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; font-size: clamp(44px, 8vw, 120px); line-height: 0.88; margin-top: 12px; }
.page-head .scribble-note { font-family: var(--font-scribble); color: var(--red); font-size: clamp(20px, 2.4vw, 34px); transform: rotate(-3deg); display: inline-block; margin-top: 18px; }

/* chapters — the curated index on a horizontal shelf: two rows at the
   bento scale, wheel scroll slides them sideways */
.chapters-shelf { height: 100vh; overflow: hidden; padding: 0; display: flex; }
.chs-wrap {
  flex: 1; min-height: 0; position: relative; z-index: 1;
  display: flex; align-items: center; overflow: hidden;
  touch-action: none; cursor: grab;
  padding: 70px 0 16px;
}
.chs-wrap:active { cursor: grabbing; }
.chs-strip { display: flex; flex-direction: column; gap: 20px; padding: 0 var(--pad); will-change: transform; }
.chs-row { display: flex; align-items: flex-start; gap: 20px; height: calc(50vh - 84px); min-height: 220px; }
.chs-row .tile { height: 100%; flex: none; }

.tile { position: relative; overflow: hidden; cursor: pointer; background: var(--panel); }
.tile img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  filter: brightness(0.92); transform: scale(1.01);
  opacity: 0; /* fades in on load — a hard pop reads as a flash */
  transition: filter 0.5s ease, transform 1.1s var(--ease-out), opacity 0.25s ease;
}
.tile img.ld { opacity: 1; }
.tile:hover img { filter: brightness(1); transform: scale(1.045); }
.tile .t-name {
  position: absolute; left: clamp(16px, 2vw, 30px); bottom: clamp(10px, 1.5vw, 20px); z-index: 2;
  font-family: var(--font-display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(19px, 1.9vw, 32px); line-height: 1.05; letter-spacing: 0.02em;
  color: #fff; text-shadow: 0 2px 22px rgba(0, 0, 0, 0.5);
  max-width: 72%;
  transition: color 0.25s ease;
}
.tile:hover .t-name, .tile:focus-visible .t-name { color: var(--red); }

/* ============================================================
   CHAPTER (project) PAGE
   ============================================================ */
.chapter-hero {
  min-height: 100vh; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 14vh var(--pad) 10vh;
}
.chapter-hero .hero-ph { position: relative; z-index: 1; max-width: min(56vw, 760px); }
.chapter-hero .hero-ph img { max-height: 70vh; width: auto; max-width: 100%; }
.chapter-hero .h-word {
  position: absolute; z-index: 2; right: 6vw; bottom: 8vh;
  font-family: var(--font-scribble); color: var(--red);
  font-size: clamp(56px, 9vw, 150px); line-height: 0.9; transform: rotate(-3deg);
  pointer-events: none;
}
.chapter-hero .h-meta { position: absolute; z-index: 2; left: var(--pad); bottom: 8vh; max-width: 300px; }
.chapter-hero .h-num { font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: var(--track); color: var(--red); }
.chapter-hero .h-person { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 22px; margin-top: 10px; }
.chapter-hero .h-role { color: var(--muted); font-size: 14px; }
.chapter-hero .h-social { color: var(--muted); margin-top: 12px; }
.chapter-hero .h-title { font-style: italic; color: var(--muted); font-size: 15px; }
.chapter-manifesto {
  padding: 12vh var(--pad); text-align: center; position: relative;
}
.chapter-manifesto .m {
  font-family: var(--font-scribble); font-size: clamp(30px, 4.4vw, 64px);
  color: var(--scribble); transform: rotate(-2deg); display: inline-block; line-height: 1.05;
  max-width: 900px;
}
.chapter-feed { display: flex; flex-direction: column; gap: clamp(30px, 7vh, 90px); padding: 4vh 0 14vh; position: relative; z-index: 1; }
.chapter-feed figure { margin: 0 auto; width: 100%; display: flex; justify-content: center; }
.chapter-feed figure.land img { width: min(92vw, 1500px); height: auto; }
.chapter-feed figure.port img { height: min(92vh, 1000px); max-width: 90vw; width: auto; object-fit: contain; }
[data-ptheme="ink"] .chapter-feed figure img { border: 5px solid var(--frame); box-shadow: 0 18px 60px rgba(0,0,0,0.45); }

.chapter-next {
  position: relative; min-height: 72vh; overflow: hidden; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(28px, 6vw, 100px); padding: 12vh var(--pad);
  background: var(--panel);
}
.chapter-next .n-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; max-width: 40vw; }
.chapter-next .n-label { font-family: var(--font-display); font-weight: 600; font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--red); }
.chapter-next .n-word { font-family: var(--font-scribble); font-size: clamp(54px, 8vw, 140px); line-height: 1; color: var(--scribble); transform: rotate(-3deg); transition: color 0.4s ease; }
.chapter-next:hover .n-word { color: var(--red); }
.chapter-next .n-person { color: var(--muted); font-size: 14px; font-style: italic; }
.chapter-next .n-hint {
  margin-top: 14px; font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: var(--track); text-transform: uppercase;
  border-bottom: 1px solid var(--gray-2); padding-bottom: 6px;
  transition: transform 0.4s var(--ease-out), border-color 0.3s ease;
}
.chapter-next:hover .n-hint { transform: translateX(8px); border-color: var(--red); }
/* the next chapter's cover as a loose print: whole photo, no crop */
.chapter-next .n-print { transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.chapter-next:hover .n-print { transform: scale(1.04); }
.chapter-next .n-print img {
  height: min(52vh, 480px); width: auto; max-width: min(44vw, 680px); object-fit: contain;
  border: 8px solid #fff; box-shadow: 0 26px 80px rgba(20, 19, 17, 0.3);
  animation: n-drift 7s ease-in-out infinite alternate;
}
@keyframes n-drift {
  from { transform: rotate(1.2deg) translateY(-6px); }
  to   { transform: rotate(3deg) translateY(8px); }
}

/* reveal on scroll */
/* ============================================================
   PORTFOLIO BOOK — PDF viewer + download
   ============================================================ */
/* no page title — the book IS the page: one locked screen, no scroll */
.book-page {
  height: 100vh; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 7vh var(--pad) 2vh;
}
.book-page .book-bar {
  position: fixed; right: var(--pad); bottom: 4.5vh; z-index: 90;
  display: flex; flex-direction: column; align-items: flex-end; gap: 10px;
}
.book-dl {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 12px;
  letter-spacing: var(--track); text-transform: uppercase; color: #141311;
  background: var(--paper); border: 1px solid #b9b5ad; border-radius: 999px;
  padding: 12px 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.book-dl:hover { border-color: var(--red); color: var(--red); transform: scale(1.04); }
.book-note { font-family: var(--font-display); font-size: 11px; letter-spacing: var(--track); text-transform: uppercase; color: var(--faint); }
/* flipbook: 3D sheets turning around the spine */
.fb-stage { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 44px); margin-top: 2vh; }
.flipbook {
  /* two A-format pages, as large as the screen allows */
  width: min(92vw, 118vh); aspect-ratio: 1.4142;
  perspective: 2600px; position: relative;
  transition: transform 1.1s var(--ease-inout);
}
/* closed book: the lone cover (right half of the spread) slides left
   towards the centre; last page mirrors it */
.flipbook.at-start { transform: translateX(-24%); }
.flipbook.at-end { transform: translateX(24%); }
.fb-book { position: absolute; inset: 0; transform-style: preserve-3d; cursor: pointer; }
.fb-sheet {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 50%;
  transform-origin: left center; transform-style: preserve-3d;
  transition: transform 1.1s var(--ease-inout);
}
.fb-sheet.flipped { transform: rotateY(-180deg); }
/* one static ground shadow under the whole book — shadows on the
   rotating sheets themselves flicker while the GPU re-rasterises them */
.flipbook::before {
  content: ''; position: absolute; left: 4%; right: 4%; bottom: -4%;
  height: 12%; border-radius: 50%;
  background: rgba(0, 0, 0, 0.55); filter: blur(28px);
}
.fb-face {
  position: absolute; inset: 0; overflow: hidden; background: #171514;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.fb-face img { width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
.fb-back { transform: rotateY(180deg); }
/* soft shadow falling into the spine, like a real open book */
.fb-face::after { content: ''; position: absolute; inset: 0; pointer-events: none; }
.fb-front::after { background: linear-gradient(to right, rgba(0, 0, 0, 0.3), transparent 12%); }
.fb-back::after { background: linear-gradient(to left, rgba(0, 0, 0, 0.3), transparent 12%); }
.fb-arrow {
  width: 52px; height: 52px; border: 1px solid #4a4742; border-radius: 50%;
  color: var(--white); font-size: 18px; display: grid; place-items: center; flex: 0 0 auto;
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
}
.fb-arrow:hover { border-color: var(--red); color: var(--red); transform: scale(1.06); }
/* closed book: the forward arrow blinks — that's the way in */
.flipbook.at-start ~ .fb-arrow.next { animation: fb-arrow-pulse 1.6s ease-in-out infinite; }
@keyframes fb-arrow-pulse {
  0%, 100% { border-color: #4a4742; color: var(--white); }
  50% { border-color: var(--red); color: var(--red); }
}
.fb-idx { margin-top: 2vh; text-align: center; font-family: var(--font-display); font-size: 11px; letter-spacing: var(--track); text-transform: uppercase; color: var(--faint); }

.rv { opacity: 0; transform: translateY(46px); transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out); }
.rv.in { opacity: 1; transform: none; }
.rv-clip { clip-path: inset(12% 4% 12% 4%); transition: clip-path 1.1s var(--ease-inout), opacity 0.9s ease, transform 1.1s var(--ease-inout); opacity: 0; transform: scale(1.04); }
.rv-clip.in { clip-path: inset(0 0 0 0); opacity: 1; transform: none; }

/* ============================================================
   ABOUT
   ============================================================ */
.about-hero { display: grid; grid-template-columns: minmax(280px, 460px) 1fr; gap: clamp(30px, 6vw, 90px); align-items: start; position: relative; z-index: 1; }
/* right column capped at the text width, so the signature's right edge
   lines up with the text, not with the wide grid track */
.about-hero > div:last-child { max-width: 880px; }
.about-hero .arch { transform: rotate(-1.5deg); margin-top: 5vh; }
.about-hero .arch img { width: 100%; aspect-ratio: 1205 / 640; object-fit: cover; }
.about-word { font-family: var(--font-scribble); font-size: clamp(48px, 7vw, 110px); line-height: 0.92; transform: rotate(-2deg); margin-bottom: 5vh; color: var(--red); }
.about-word .r { color: var(--red); }
.about-text { columns: 2; column-gap: 40px; max-width: 880px; color: var(--fg); }
.about-text p { margin-bottom: 1.2em; break-inside: avoid; }
.about-text p:first-child::first-letter { initial-letter: 2; -webkit-initial-letter: 2; color: var(--red); font-family: var(--font-display); font-weight: 700; padding-right: 10px; }
.about-sig { display: block; margin: 8px 0 0 auto; width: 130px; aspect-ratio: 458 / 183; }
[data-theme="air"] .about-sig { filter: invert(1); }
.about-dogma { margin: 12vh auto 0; text-align: center; }
.about-dogma .m { font-family: var(--font-scribble); font-size: clamp(30px, 4vw, 58px); color: var(--red); transform: rotate(-2deg); display: inline-block; }
.about-clients { margin-top: 10vh; border-top: 1px solid var(--faint); padding-top: 5vh; }
.about-clients .caps { color: var(--faint); }
.about-clients ul { list-style: none; display: flex; flex-wrap: wrap; gap: 14px 40px; margin-top: 24px; }
.about-clients li { font-family: var(--font-display); font-weight: 500; text-transform: uppercase; letter-spacing: 0.18em; font-size: clamp(15px, 1.6vw, 22px); color: var(--muted); }

/* ============================================================
   CONTACT
   ============================================================ */
.contact-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; min-height: 100vh; }
.contact-left { padding: 20vh var(--pad) 10vh; position: relative; z-index: 1; }
.contact-left .c-word {
  font-family: var(--font-scribble); font-size: clamp(54px, 7vw, 110px);
  transform: rotate(-2deg); line-height: 0.9; margin-bottom: 8vh; color: var(--red);
}
.contact-block { margin-bottom: 7vh; max-width: 420px; }
.contact-block h3 { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: clamp(20px, 2.2vw, 30px); margin-bottom: 18px; }
.contact-block .row { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 12px 0; border-bottom: 1px solid rgba(128,128,128,0.25); }
.contact-block .row .l { font-family: var(--font-display); font-size: 10px; font-weight: 600; letter-spacing: var(--track); text-transform: uppercase; color: var(--faint); }
.contact-block .row a { font-size: 16px; position: relative; }
.contact-block .row a::after { content: ''; position: absolute; left: 0; bottom: -2px; width: 100%; height: 1px; background: var(--red); transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease-out); }
.contact-block .row a:hover::after { transform: scaleX(1); transform-origin: left; }
.contact-base { color: var(--muted); font-size: 14px; margin-top: 2vh; }
.contact-right { position: relative; overflow: hidden; min-height: 60vh; }
.contact-right img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 22%; }
.contact-right .v-word {
  position: absolute; z-index: 2; top: 50%; left: 34px; transform: translateY(-50%) rotate(90deg); transform-origin: left center;
  font-family: var(--font-scribble); font-size: clamp(40px, 5vw, 72px); color: var(--red); white-space: nowrap;
  text-shadow: 0 4px 30px rgba(0,0,0,0.6);
}
.site-foot { padding: 6vh var(--pad); display: flex; justify-content: space-between; gap: 20px; color: var(--faint); font-family: var(--font-display); font-size: 10px; letter-spacing: var(--track); text-transform: uppercase; position: relative; z-index: 1; }

/* ============================================================
   MOBILE STRIP (touch / small screens / reduced motion)
   ============================================================ */
.strip { padding: 14vh 0 10vh; }
.strip-item { padding: 0 var(--pad); margin-bottom: 9vh; }
.strip-item img { width: 100%; height: auto; }
.strip-item .s-cap { margin-top: 14px; }
.strip-item .s-person { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 16px; }
.strip-item .s-meta { color: var(--muted); font-size: 13px; font-style: italic; }
.strip-item .s-social { color: var(--muted); margin-top: 8px; }
.strip-item .s-idx { font-family: var(--font-display); font-size: 10px; letter-spacing: var(--track); color: var(--faint); margin-top: 4px; }

/* ============================================================
   MOBILE  (≤880px — phones and portrait tablets)
   The same book, held in one hand: the wheel stays the landing,
   the fan becomes a centered filmstrip, the menu becomes a page.
   ============================================================ */
@media (max-width: 880px) {

  /* ---------- header: sound + burger; nav = fullscreen ink page ---------- */
  .site-head {
    padding: calc(10px + env(safe-area-inset-top, 0px)) 4vw 10px;
    gap: 2px;
  }
  .site-head .snd { width: 44px; height: 44px; justify-content: center; }
  .site-head .snd .snd-txt { display: none; }
  .burger {
    display: grid; place-items: center;
    width: 44px; height: 44px; margin-right: -8px;
    position: relative; z-index: 2;
  }
  .burger .b-box { position: relative; width: 22px; height: 12px; display: block; }
  .burger .b-box i {
    position: absolute; left: 0; right: 0; height: 2px; background: currentColor;
    transition: transform 0.45s var(--ease-out);
  }
  .burger .b-box i:first-child { top: 0; }
  .burger .b-box i:last-child { bottom: 0; }
  body.menu-open .burger .b-box i:first-child { transform: translateY(5px) rotate(45deg); }
  body.menu-open .burger .b-box i:last-child { transform: translateY(-5px) rotate(-45deg); }

  .site-head nav {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; align-items: flex-start; justify-content: center;
    gap: clamp(16px, 3vh, 28px);
    padding: 0 9vw calc(env(safe-area-inset-bottom, 0px));
    background: var(--black); color: var(--white);
    clip-path: inset(0 0 100% 0);
    visibility: hidden;
    transition: clip-path 0.55s var(--ease-inout), visibility 0s linear 0.55s;
  }
  .site-head nav::before {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: url('../assets/img/grunge.jpg') center / cover;
    opacity: 0.5; mix-blend-mode: screen; filter: brightness(0.34) contrast(1.15);
  }
  body.menu-open .site-head nav {
    clip-path: inset(0 0 0 0); visibility: visible;
    transition: clip-path 0.55s var(--ease-inout);
  }
  .site-head nav a {
    font-size: clamp(26px, 7.2vw, 40px); font-weight: 600;
    letter-spacing: 0.12em; padding: 2px 0;
    opacity: 0; transform: translateY(26px);
    transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
  }
  .site-head nav a::after { display: none; }
  .site-head nav a.active { color: var(--red); }
  body.menu-open .site-head nav a { opacity: 1; transform: none; }
  body.menu-open .site-head nav a:nth-child(1) { transition-delay: 0.16s; }
  body.menu-open .site-head nav a:nth-child(2) { transition-delay: 0.22s; }
  body.menu-open .site-head nav a:nth-child(3) { transition-delay: 0.28s; }
  body.menu-open .site-head nav a:nth-child(4) { transition-delay: 0.34s; }
  body.menu-open .site-head nav a:nth-child(5) { transition-delay: 0.40s; }
  .nav-base {
    display: block; position: absolute; left: 9vw;
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    font-family: var(--font-display); font-weight: 500; font-size: 10px;
    letter-spacing: var(--track); text-transform: uppercase; color: var(--faint);
    opacity: 0; transition: opacity 0.5s ease;
  }
  body.menu-open .nav-base { opacity: 1; transition-delay: 0.45s; }
  body.menu-open { overflow: hidden; }
  body.menu-open .site-head { color: #fff; } /* over the ink overlay even on air pages */

  /* ---------- preloader / curtain / scrim ---------- */
  #preloader .load-ph { height: min(56svh, 560px); border-width: 5px; }
  #preloader .load-name { font-size: 9px; letter-spacing: 0.24em; }
  #curtain .curtain-word {
    font-size: clamp(34px, 11vw, 68px); white-space: normal;
    text-align: center; padding: 0 7vw; line-height: 0.95;
  }
  body::after { height: 96px; }

  /* ---------- home: the wheel, one-hand size ----------
     --item-h / --fan-* are written by layout() in app.js; the values here
     are only the pre-script fallback */
  .stage { --item-h: min(24vh, 44vw); }
  .brand-mark { top: calc(10px + env(safe-area-inset-top, 0px)); }
  .brand-mark img { width: clamp(64px, 19vw, 84px); }
  .wheel-logo { display: none; }
  .peek {
    width: 100vw;
    -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, transparent 96%);
    mask-image: linear-gradient(to left, rgba(0,0,0,1) 30%, transparent 96%);
  }
  .stage-veil {
    display: block; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(to right,
      rgba(11,10,9,0.90) 0%, rgba(11,10,9,0.62) 30%, rgba(11,10,9,0.18) 52%, rgba(11,10,9,0) 68%);
    transition: opacity 0.5s ease;
  }
  .stage.fan-mode .stage-veil { opacity: 0; }
  /* the ticks ring is so much wider than a phone that only its right edge
     shows — a stray dashed line, not a lens barrel */
  .wheel-ticks { display: none; }
  /* per Dan: the word and the whole caption sit in the BOTTOM-RIGHT corner */
  .stage-caption {
    left: var(--pad); right: var(--pad);
    bottom: calc(3.2vh + env(safe-area-inset-bottom, 0px));
    transform: none; max-width: none;
    text-align: right;
  }
  .stage-caption .meta { justify-content: flex-end; }
  .stage-caption .word { font-size: clamp(46px, 14vw, 76px); }
  .stage-caption .word.long { font-size: clamp(22px, 7.4vw, 42px); }
  /* the pool becomes a full-width band — and it sits ABOVE the wheel, so
     frames swinging past the bottom sink into the dark instead of
     colliding with the type */
  .stage-caption::before {
    inset: -32vh -14vw -10vh -14vw;
    background: linear-gradient(to top,
      rgba(11,10,9,0.95) 24%, rgba(11,10,9,0.72) 48%, rgba(11,10,9,0) 100%);
  }
  .stage-caption .hint { font-size: 9px; margin-top: 1vh; }

  /* ---------- fan → centered filmstrip ---------- */
  .fan-hub { top: var(--fan-cy, 44vh); } /* prints ride higher: the caption card owns the bottom */
  .fan-item .ph {
    height: auto; width: auto;
    max-width: var(--fan-w, 86vw); max-height: var(--fan-h, 52vh);
    border-width: 5px;
  }
  .fan-ui {
    left: 3.5vw; right: 3.5vw;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-width: none; padding: 14px 16px 16px; gap: 3px;
  }
  .fan-ui .person { font-size: 15px; }
  .fan-ui .role, .fan-ui .ptitle { font-size: 13px; }
  .fan-ui .psocial { margin-top: 6px; }
  .fan-ui .idx { margin-top: 4px; font-size: 11px; }
  .fan-open { margin-top: 10px; align-self: stretch; text-align: center; padding: 13px 18px; }
  .fan-close {
    top: calc(9px + env(safe-area-inset-top, 0px)); left: 4vw;
    padding: 11px 18px;
  }
  .fan-arrows { display: none; } /* swipe is the navigation */

  /* ---------- chapters: vertical feed of the same tiles ---------- */
  .page.ch-feed {
    min-height: 100svh;
    padding: calc(78px + env(safe-area-inset-top, 0px)) var(--pad) 0;
  }
  .ch-feed .tile { margin-bottom: 16px; }
  .tile .t-name { font-size: clamp(19px, 5.6vw, 28px); left: 14px; bottom: 10px; }

  /* ---------- chapter page ---------- */
  .chapter-hero {
    flex-direction: column; justify-content: flex-start; min-height: 100svh;
    padding: calc(70px + env(safe-area-inset-top, 0px)) var(--pad) 5vh;
  }
  .chapter-hero .hero-ph { max-width: 88vw; margin-top: 1vh; }
  .chapter-hero .hero-ph img { max-height: 58vh; }
  /* per Dan: under the photo ONE shared row — the "Chapter NN" block left,
     the word right, tops on the same level (no stacked dead space);
     only the home stage caption stays fully right-aligned */
  .chapter-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    column-gap: 4vw; align-items: start;
  }
  .chapter-hero .hero-ph { grid-column: 1 / -1; grid-row: 1; align-self: center; justify-self: center; }
  .chapter-hero .h-word {
    position: relative; right: auto; bottom: auto;
    grid-column: 2; grid-row: 2;
    margin: 3.5vh 2vw 0 0; text-align: right;
    font-size: clamp(48px, 13vw, 88px);
  }
  .chapter-hero .h-word.long { font-size: clamp(18px, 5.6vw, 40px); }
  .chapter-hero .h-meta {
    position: relative; left: 0; bottom: 0;
    grid-column: 1; grid-row: 2;
    margin-top: 4vh; /* the rotated word leans up — keep the tops optically level */
    text-align: left; max-width: none;
  }
  .chapter-manifesto { padding: 9vh var(--pad); }
  .chapter-manifesto .m { font-size: clamp(26px, 7.6vw, 42px); }
  .chapter-feed { gap: clamp(20px, 4.5vh, 44px); padding-bottom: 10vh; }
  .chapter-feed figure.port img { height: auto; width: min(88vw, 560px); max-width: none; }
  .chapter-feed figure.land img { width: 92vw; }
  [data-ptheme="ink"] .chapter-feed figure img { border-width: 4px; }
  .chapter-next {
    flex-direction: column-reverse; text-align: left;
    min-height: 0; gap: 30px;
    padding: 9vh var(--pad) calc(9vh + env(safe-area-inset-bottom, 0px));
  }
  .chapter-next .n-meta { max-width: none; align-items: flex-start; }
  .chapter-next .n-word { font-size: clamp(34px, 9.6vw, 64px); line-height: 1.06; }
  .chapter-next .n-print img { max-width: 84vw; height: auto; max-height: 42vh; border-width: 6px; }

  /* ---------- portfolio book: one page, swiped like a phone gallery ---------- */
  .book-page { height: 100svh; padding: calc(56px + env(safe-area-inset-top, 0px)) 0 2vh; }
  .mbook {
    display: flex; align-items: center;
    overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 12px; padding: 12px 7vw; width: 100%;
    scrollbar-width: none;
  }
  .mbook::-webkit-scrollbar { display: none; }
  /* width capped by height too (√2 pages), so a whole page fits any phone */
  .mb-page { flex: none; width: min(86vw, 46svh, 520px); scroll-snap-align: center; }
  .mb-page img {
    width: 100%; aspect-ratio: 1241 / 1754; object-fit: contain; /* a book page is never cropped */
    border: 4px solid #fff; background: #171514;
    box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
    user-select: none; -webkit-user-drag: none;
  }
  .book-page .book-bar {
    position: static; transform: none;
    flex-direction: column; align-items: center; gap: 8px;
    margin-top: 20px;
  }
  .book-page .fb-idx { margin-top: 14px; }
  .fb-stage { gap: 10px; }
  .flipbook { width: min(88vw, 980px); }
  .fb-arrow { width: 40px; height: 40px; font-size: 15px; }
  .book-dl { padding: 14px 24px; font-size: 12px; }

  /* ---------- about / contact / footer ---------- */
  .page { padding: 14vh var(--pad) 9vh; }
  .page-head { margin-bottom: 5vh; }
  .page-head h1 { font-size: clamp(36px, 10.4vw, 72px); }
  .page-head .over { letter-spacing: 0.22em; line-height: 1.7; }
  .about-hero { grid-template-columns: 1fr; }
  .about-hero .arch { margin-top: 1vh; }
  .about-word { font-size: clamp(40px, 12vw, 68px); margin-bottom: 3.5vh; }
  .about-text { columns: 1; }
  .about-dogma { margin-top: 9vh; }
  .contact-wrap { grid-template-columns: 1fr; }
  .contact-left { padding: calc(92px + env(safe-area-inset-top, 0px)) var(--pad) 7vh; }
  .contact-left .c-word { font-size: clamp(48px, 14vw, 88px); margin-bottom: 5vh; }
  .contact-block { margin-bottom: 5vh; max-width: none; }
  .contact-right { min-height: 52vh; }
  /* the rotated word overflows its line box to the LEFT — keep it clear of
     the container edge or the glyphs get clipped */
  .contact-right .v-word { font-size: clamp(32px, 9vw, 52px); left: 40px; }
  .site-foot {
    flex-wrap: wrap; row-gap: 6px;
    padding-bottom: calc(4vh + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- phone held sideways: a 390px-tall screen ----------
   the stacked phone layout would put the caption card on top of the
   print, so the two columns come back (frames left, words right) */
@media (max-width: 880px) and (orientation: landscape) {
  .brand-mark img { width: clamp(52px, 8.6vw, 72px); }
  .stage-veil {
    background: linear-gradient(to right,
      rgba(11,10,9,0.88) 0%, rgba(11,10,9,0.5) 26%, rgba(11,10,9,0) 50%);
  }
  .stage-caption { left: 44vw; right: var(--pad); bottom: 3.5vh; }
  .stage-caption .word { font-size: clamp(34px, 7.4vw, 60px); }
  .stage-caption .word.long { font-size: clamp(20px, 4vw, 34px); }
  .stage-caption::before {
    inset: -26vh -12vw -10vh -12vw;
    background: radial-gradient(closest-side, rgba(11,10,9,0.86), rgba(11,10,9,0));
  }
  .stage-caption .mname { font-size: 14px; }
  .stage-caption .mrole { font-size: 12px; }

  .fan-ui {
    left: var(--pad); right: auto; max-width: 36vw;
    bottom: calc(3vh + env(safe-area-inset-bottom, 0px));
    padding: 12px 14px;
  }
  .fan-open { align-self: flex-start; margin-top: 8px; padding: 10px 16px; }
  .fan-close { top: calc(8px + env(safe-area-inset-top, 0px)); }

  .mb-page { width: min(52vw, 44svh, 430px); }
  .book-page { padding-top: calc(46px + env(safe-area-inset-top, 0px)); }
  .book-page .book-bar { margin-top: 12px; }
  .chapter-hero .hero-ph img { max-height: 66vh; }
  .contact-right { min-height: 78vh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.15s !important; }
  .grain::after { animation: none; }
}
