@font-face {
  font-family: "Geist";
  src: url("./assets/geist.woff2") format("woff2-variations"), url("./assets/geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0d0c10;
  --ink-2: #16151a;
  --paper: #f5f5f3;
  --paper-2: #cfd0d2;
  --mute: #a6a7ab;          /* 7.6:1 on --ink */
  --line: rgba(245, 245, 243, 0.22);
  --line-strong: rgba(245, 245, 243, 0.55);
  --dark-text: #121216;
  --band: clamp(120px, 18svh, 190px);
  --pad: clamp(20px, 3.2vw, 48px);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  --hp: 0;                  /* hero scroll progress 0..1, set by main.js */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }
html, body { overflow-x: clip; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
p { margin: 0; }
h1, h2 { margin: 0; font-weight: inherit; }

:focus-visible { outline: 2px solid var(--paper); outline-offset: 3px; box-shadow: 0 0 0 7px var(--ink); border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip-link {
  position: fixed; left: 12px; top: 12px; z-index: 100; padding: 10px 14px;
  background: var(--paper); color: var(--ink); border-radius: 999px; font-size: 14px;
  transform: translateY(-160%); transition: transform 0.2s;
}
.skip-link:focus { transform: none; }

/* ---------- buttons ---------- */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; font-size: 14px; letter-spacing: 0.01em; font-weight: 450;
  border-radius: 2px; transition: color 0.45s var(--ease-out), border-color 0.45s var(--ease-out), background-color 0.25s;
}
/* hover = a fill that wipes in from the left and leaves to the right; each variant names its wipe colours */
.btn::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; background: var(--wipe-bg, var(--paper));
  transform: scaleX(0); transform-origin: 100% 50%; transition: transform 0.6s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: scaleX(1); transform-origin: 0 50%; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 14px; }
.btn-solid { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); --wipe-bg: var(--paper); --wipe-fg: var(--ink); }
.btn-line { border: 1px solid currentColor; --wipe-bg: var(--dark-text); --wipe-fg: var(--paper); }
.btn-light { background: var(--paper); color: var(--ink); border: 1px solid var(--paper); --wipe-bg: var(--ink); --wipe-fg: var(--paper); --wipe-bd: var(--paper); }

/* ---------- top bar ---------- */
.topbar {
  position: absolute; inset: 0 0 auto; z-index: 20;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: clamp(14px, 2.2vw, 28px) var(--pad);
  color: var(--paper);
}
.menu { justify-self: start; position: relative; }
.menu-toggle { width: 48px; height: 48px; display: grid; place-items: center; margin-left: -12px; border-radius: 4px; }
.menu-lines, .menu-lines::before { display: block; width: 26px; height: 1.5px; background: currentColor; transition: transform 0.35s var(--ease-out); }
.menu-lines { position: relative; transform: translateY(-3.5px); }
.menu-lines::before { content: ""; position: absolute; left: 0; top: 7px; }
.menu-toggle[aria-expanded="true"] .menu-lines { transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-lines::before { transform: translateY(-7px) rotate(-90deg); }
.menu-panel {
  position: absolute; left: -12px; top: 56px; min-width: 240px; padding: 8px;
  background: rgba(13, 12, 16, 0.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 6px;
  display: grid; gap: 2px;
}
.menu-panel[hidden] { display: none; }
.menu-panel:not([hidden]) { animation: menu-in 0.35s var(--ease-out) both; transform-origin: 0 0; }
.menu-panel:not([hidden]) a { animation: menu-item-in 0.5s var(--ease-out) both; }
.menu-panel a:nth-child(2) { animation-delay: 0.05s; }
.menu-panel a:nth-child(3) { animation-delay: 0.1s; }
@keyframes menu-in { from { opacity: 0; translate: 0 -6px; scale: 0.98; } }
@keyframes menu-item-in { from { opacity: 0; translate: -10px 0; } }
.menu-panel a { display: flex; gap: 14px; align-items: baseline; padding: 12px 14px; font-size: 16px; border-radius: 4px; }
.menu-panel a span { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.menu-panel a { transition: background-color 0.25s; }
.menu-panel a:hover { background: rgba(245, 245, 243, 0.08); }
.menu-panel a span { transition: color 0.25s; }
.menu-panel a:hover span { color: var(--paper); }

/* links: an underline that draws in from the left */
.u, .layer-name {
  background: linear-gradient(currentColor, currentColor) no-repeat 100% 100% / 0 1px;
  padding-bottom: 2px; transition: background-size 0.45s var(--ease-out);
}
a:hover .u, a:focus-visible .u { background-size: 100% 1px; background-position: 0 100%; }
.mark { justify-self: center; display: grid; place-items: center; width: 48px; height: 48px; }
.mark svg { width: 34px; height: 28px; fill: currentColor; overflow: visible; }
.mark-l, .mark-r { transition: transform 1.1s var(--ease-out); }
.topbar-cta { justify-self: end; color: var(--dark-text); background: rgba(245, 245, 243, 0.6); backdrop-filter: blur(10px); --wipe-bg: var(--ink); --wipe-fg: var(--paper); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: 100svh; min-height: 640px; max-height: 1180px;
  background: var(--ink);
  isolation: isolate;
}
.hero-photo {
  position: absolute; inset: 0 0 var(--band) 0; overflow: hidden; z-index: -1;
  background: #8d8e92;
}
.hero-photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  transform: translate3d(0, calc(var(--hp) * 6%), 0) scale(calc(1.04 + var(--hp) * 0.04));
  transform-origin: 50% 40%;
}
/* photographic grade on the dark left edge so peripheral copy reads; not a box */
.hero-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(0deg, rgba(13, 12, 16, 0.6) 0%, rgba(13, 12, 16, 0.42) 28%, rgba(13, 12, 16, 0) 52%),
    linear-gradient(90deg, rgba(13, 12, 16, 0.72) 0%, rgba(13, 12, 16, 0.48) 15%, rgba(13, 12, 16, 0) 34%);
}

.hero-note {
  position: absolute; left: var(--pad); top: clamp(120px, 21svh, 200px);
  width: min(210px, 18vw); display: grid; gap: 18px; justify-items: start;
}
.hero-note p { font-size: 14px; line-height: 1.45; color: #f2f2f0; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 14px 0 6px;
  font-size: 12px; letter-spacing: 0.02em; color: var(--paper);
  border: 1px solid rgba(245, 245, 243, 0.4); border-radius: 999px;
  background: rgba(13, 12, 16, 0.18);
}
.chip-dot { width: 20px; height: 20px; border-radius: 50%; border: 1px solid currentColor; display: grid; place-items: center; }
.chip-dot::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.hero-card {
  position: absolute; left: var(--pad); top: calc(clamp(120px, 21svh, 200px) + 150px);
  width: clamp(132px, 12vw, 172px); display: grid; gap: 12px; color: var(--paper);
}
.hero-card-media { display: block; aspect-ratio: 1.12; overflow: hidden; border-radius: 4px; background: #e9e9eb; }
.hero-card-media img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.18); transition: transform 0.9s var(--ease-out); }
.hero-card:hover .hero-card-media img { transform: scale(1.28); }
.hero-card-row { display: flex; align-items: center; gap: 10px; font-size: 12px; font-variant-numeric: tabular-nums; }
.hero-card-track { position: relative; flex: 1; height: 1px; background: rgba(245, 245, 243, 0.35); overflow: hidden; }
.hero-card-fill { position: absolute; inset: 0; background: var(--paper); transform-origin: 0 50%; transform: scaleX(calc(0.18 + var(--hp) * 0.82)); }

.hero-aside {
  position: absolute; right: var(--pad); top: 41%; translate: 0 -40%;
  width: min(200px, 16vw); font-size: 14px; line-height: 1.45; color: var(--dark-text); text-align: right;
}

.hero-actions {
  position: absolute; right: var(--pad); bottom: calc(var(--band) + clamp(24px, 4svh, 44px));
  display: grid; gap: 10px; width: clamp(180px, 15vw, 214px);
}
/* the photo changes under the buttons at every width: light solid + frosted dark outline */
.hero-actions .btn-solid {
  background: var(--paper); color: var(--ink); border-color: var(--paper);
  --wipe-bg: var(--ink); --wipe-fg: var(--paper); --wipe-bd: var(--paper);
  /* magnetic pull, set by main.js on desktop mouse only */
  transform: translate3d(var(--mx, 0px), var(--my, 0px), 0);
  transition: color 0.45s var(--ease-out), border-color 0.45s var(--ease-out), transform 0.5s var(--ease-out);
}
.hero-actions .btn-line { color: var(--paper); border-color: rgba(245, 245, 243, 0.7); background: rgba(13, 12, 16, 0.55); backdrop-filter: blur(10px); --wipe-bg: var(--paper); --wipe-fg: var(--ink); }
/* hover text colour comes after every button variant (same specificity, so order decides) */
.btn:hover, .btn:focus-visible, .hero-actions .btn:hover, .hero-actions .btn:focus-visible {
  color: var(--wipe-fg, var(--ink)); border-color: var(--wipe-bd, var(--wipe-bg, var(--paper)));
}

.hero-title {
  position: absolute; left: 50%; bottom: calc(var(--band) - 0.6em);
  translate: -50% 0; width: max-content; max-width: calc(100vw - 2 * var(--pad));
  font-size: clamp(3.6rem, 10.2vw, 9.6rem); line-height: 0.9; letter-spacing: -0.055em; font-weight: 340;
  text-align: center; color: var(--paper); z-index: 2;
}
.hero-title .line { display: block; overflow: hidden; padding: 0.02em 0.06em 0.1em; margin-bottom: -0.1em; }
.hero-title .line-inner { display: block; }
.hero-title .w { display: inline-block; }
.hero-title .line-2 { color: var(--paper-2); translate: calc(var(--hp) * 4%) 0; }
.hero-title .line:first-child { translate: calc(var(--hp) * -4%) 0; }

.hero-strip {
  position: absolute; left: var(--pad); right: var(--pad); bottom: clamp(20px, 3.4svh, 34px);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 12px; letter-spacing: 0.03em; color: var(--mute);
}
.scroll-cue { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--paper); }
.cue-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: cue 2.2s var(--ease-io) infinite; }
@keyframes cue { 0%, 100% { transform: translateY(-3px); opacity: 1; } 50% { transform: translateY(4px); opacity: 0.35; } }

/* ---------- hero entrance (time based; starts when .is-ready lands on <html>) ---------- */
.js .hero-photo { clip-path: inset(7% 7% 7% 7% round 6px); }
.js .hero-photo img { filter: brightness(0.55); scale: 1.12; }
.js .hero-title .w { transform: translateY(108%); filter: blur(14px); }
.js [data-reveal] { opacity: 0; translate: 0 14px; }
.js .topbar[data-reveal] { translate: 0 -28px; }
.js .mark-l { transform: translateX(-9px); }
.js .mark-r { transform: translateX(9px); }

.is-ready .hero-photo { clip-path: inset(0 0 0 0 round 0); transition: clip-path 1.5s var(--ease-out); }
.is-ready .hero-photo img { filter: none; scale: 1; transition: filter 1.4s var(--ease-out), scale 1.9s var(--ease-out); }
/* per-word mask rise, blur to sharp, staggered across both lines */
.is-ready .hero-title .w {
  transform: none; filter: none;
  transition: transform 1.25s var(--ease-out) calc(0.35s + var(--w) * 90ms), filter 1.1s var(--ease-out) calc(0.4s + var(--w) * 90ms);
}
.is-ready [data-reveal] { opacity: 1; translate: 0 0; transition: opacity 0.9s var(--ease-out) calc(0.55s + var(--i, 0) * 60ms), translate 0.9s var(--ease-out) calc(0.55s + var(--i, 0) * 60ms); }
.is-ready .mark-l, .is-ready .mark-r { transform: none; transition-delay: 0.7s; }

/* ---------- anatomy (section 2) ---------- */
.anatomy { position: relative; background: var(--ink); }
.anatomy-track { position: relative; }
.stage {
  position: relative; min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: clamp(56px, 9svh, 96px) var(--pad) clamp(24px, 4svh, 40px);
  overflow: hidden;
}
/* pinned story: track is tall, stage sticks */
.is-story .anatomy-track { height: calc(100svh + 420svh); }
.is-story .stage { position: sticky; top: 0; height: 100svh; min-height: 0; }

.stage-head { display: grid; justify-items: center; gap: 18px; text-align: center; position: relative; z-index: 3; }
.pill {
  display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 16px 0 14px;
  background: var(--paper); color: var(--ink); border-radius: 999px; font-size: 14px; font-weight: 450;
}
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink); }
.stage-head h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 380; text-wrap: balance; }
.stage-head p { font-size: 15px; line-height: 1.55; color: var(--mute); max-width: 36ch; }

.js .stage-head > * { opacity: 0; translate: 0 18px; }
.stage-head.is-in > * { opacity: 1; translate: 0 0; transition: opacity 0.9s var(--ease-out), translate 1s var(--ease-out); }
.stage-head.is-in > :nth-child(2) { transition-delay: 0.08s; }
.stage-head.is-in > :nth-child(3) { transition-delay: 0.16s; }

.viewport { position: relative; min-height: 0; z-index: 1; }
/* the WebGL canvas spans the whole stage (behind the head, rail and views); #viewport stays the framing box */
.stage-canvas {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; display: block;
  touch-action: pan-y; cursor: grab; outline: none;
}
.stage-canvas:active { cursor: grabbing; }
.stage-canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--line-strong); }
.viewport-fallback { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: min(78%, 720px); height: auto; mix-blend-mode: normal; }
.has-gl .viewport-fallback { display: none; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 2; }

/* pins ride on the parts; they carry a number, never text */
.pins { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.pin {
  position: absolute; left: 0; top: 0; width: 32px; height: 32px; margin: -16px 0 0 -16px;
  display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity 0.35s var(--ease-out);
}
.pin-num {
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums;
  color: var(--paper); background: rgba(13, 12, 16, 0.62); border: 1px solid rgba(245, 245, 243, 0.75);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: background-color 0.3s, color 0.3s, border-color 0.3s, opacity 0.3s, scale 0.4s var(--ease-out);
}
.pin::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px solid var(--paper); opacity: 0; pointer-events: none; }
.pin.is-active .pin-num, .pin:hover .pin-num { background: var(--paper); color: var(--ink); border-color: var(--paper); scale: 1.12; }
.pin.is-active::after { animation: pin-pulse 2.4s var(--ease-out) infinite; }
.pin.is-dim .pin-num { opacity: 0.55; }
@keyframes pin-pulse { 0% { opacity: 0.7; scale: 1; } 70%, 100% { opacity: 0; scale: 1.9; } }

/* the one callout: a short leader that draws in only while the model is still */
.callout-line {
  fill: none; stroke: rgba(245, 245, 243, 0.85); stroke-width: 1; vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--len, 100); stroke-dashoffset: var(--len, 100); opacity: 0;
  transition: stroke-dashoffset 0.15s linear, opacity 0.15s;
}
.callout-on .callout-line { stroke-dashoffset: 0; opacity: 1; transition: stroke-dashoffset 0.42s var(--ease-out), opacity 0.1s; }
.callout-tag {
  position: absolute; left: 0; top: 0; z-index: 3; display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 10px; white-space: nowrap; font-size: 14px; line-height: 1.2; color: var(--paper);
  background: rgba(13, 12, 16, 0.72); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  pointer-events: none; opacity: 0; translate: 0 4px; transition: opacity 0.15s, translate 0.15s;
}
.callout-num { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.callout-on .callout-tag { opacity: 1; translate: 0 0; transition: opacity 0.3s var(--ease-out) 0.28s, translate 0.4s var(--ease-out) 0.28s; }

/* drag cursor over the canvas (fine pointers only; added by stage.js) */
.drag-cursor {
  position: absolute; left: 0; top: 0; z-index: 3; width: 68px; height: 68px; margin: -34px 0 0 -34px;
  display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 50%;
  font-size: 12px; letter-spacing: 0.04em; color: var(--paper);
  background: rgba(13, 12, 16, 0.4); border: 1px solid rgba(245, 245, 243, 0.6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none; opacity: 0; scale: 0.5; transition: opacity 0.25s, scale 0.4s var(--ease-out);
}
.drag-cursor span { color: var(--mute); }
.drag-cursor.is-on { opacity: 1; scale: 1; }
.drag-cursor.is-down { scale: 0.82; }
.stage-canvas.has-drag-cursor { cursor: none; }

/* layer list: a static grid without WebGL; with WebGL a fixed index rail at the left of the viewport */
.layers { list-style: none; margin: 0; padding: 0; position: relative; z-index: 4; }
.layer-label {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 4px;
  font-size: 15px; color: var(--paper); white-space: nowrap; transition: color 0.3s, opacity 0.4s, translate 0.4s var(--ease-out);
}
.layer-num { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; transition: color 0.3s; }
.layer-dot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--paper); transition: background-color 0.3s, transform 0.3s; }
.layer-label:hover .layer-dot, .layer.is-active .layer-dot { background: var(--paper); transform: scale(1.25); }
.layer-label:hover .layer-name, .layer-label:focus-visible .layer-name, .layer.is-hover .layer-name { background-size: 100% 1px; background-position: 0 100%; }
.layer-bar { display: none; }
.layer-desc { font-size: 14px; line-height: 1.5; color: var(--mute); max-width: 34ch; }

/* static (no WebGL / no JS) layout: grid of 4 */
.stage[data-mode="static"] .viewport { min-height: min(62vw, 520px); }
.stage[data-mode="static"] .layers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px 32px; margin: 24px 0; }
.stage[data-mode="static"] .views, .stage[data-mode="static"] .stage-hint, .stage[data-mode="static"] .focus-panel { display: none; }

.stage[data-mode="gl"] .layer-desc, .stage[data-mode="gl"] .layer-dot { display: none; }
/* parts can pass behind the text now: a soft ink halo keeps it legible and is invisible on the plain page */
.stage[data-mode="gl"] .stage-head h2,
.stage[data-mode="gl"] .stage-head p,
.stage[data-mode="gl"] .layer-label,
.stage[data-mode="gl"] .focus-panel,
.stage[data-mode="gl"] .stage-hint { text-shadow: 0 0 2px var(--ink), 0 0 14px var(--ink), 0 0 28px var(--ink); }
/* the canvas sits under everything: let drags through the empty parts of the boxes stacked on it */
.stage[data-mode="gl"] .viewport,
.stage[data-mode="gl"] .stage-head,
.stage[data-mode="gl"] .views { pointer-events: none; }
.stage[data-mode="gl"] .stage-head > *,
.stage[data-mode="gl"] .views > * { pointer-events: auto; }
.stage[data-mode="gl"] .layers { position: absolute; z-index: 4; left: var(--pad); top: var(--layers-top, 30%); display: grid; }
@media (min-width: 761px) {
  .stage[data-mode="gl"] .layers { width: max-content; }
  .stage[data-mode="gl"] .layer-label { position: relative; padding: 0 14px 0 20px; color: var(--mute); }
  .stage[data-mode="gl"] .layer-bar { display: block; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: var(--line); overflow: hidden; }
  .stage[data-mode="gl"] .layer-bar > span { position: absolute; inset: 0; background: var(--paper); transform-origin: 50% 0; transform: scaleY(var(--lp, 0)); }
  .stage[data-mode="gl"] .layer.is-active .layer-label,
  .stage[data-mode="gl"] .layer.is-hover .layer-label,
  .stage[data-mode="gl"] .layer-label:hover { color: var(--paper); }
  .stage[data-mode="gl"] .layer.is-active .layer-num,
  .stage[data-mode="gl"] .layer.is-hover .layer-num,
  .stage[data-mode="gl"] .layer-label:hover .layer-num { color: var(--paper); }
  .stage[data-mode="gl"] .layer-label:hover { translate: 4px 0; }
}

.js .stage[data-mode="gl"] .layer-label { opacity: 0; translate: -14px 0; }
.stage[data-mode="gl"].is-in .layer-label { opacity: 1; translate: 0 0; transition: opacity 0.8s var(--ease-out) calc(0.9s + var(--n) * 90ms), translate 0.8s var(--ease-out) calc(0.9s + var(--n) * 90ms), color 0.3s; }
@media (min-width: 761px) {
  .stage[data-mode="gl"].is-in .layer-label:hover { translate: 4px 0; transition: translate 0.4s var(--ease-out), color 0.3s; }
}

.focus-panel {
  position: absolute; z-index: 4; left: var(--pad); top: var(--panel-top, 50%);
  width: min(280px, 24vw); pointer-events: none;
}
/* on wider screens the rail already names the layer */
@media (min-width: 761px) { .focus-panel .fp-title-layer { display: none; } }
/* portrait tablets: the model fills the width, so the description sits under it, above the views */
@media (min-width: 761px) and (max-width: 1099px) and (orientation: portrait) {
  .focus-panel { top: auto; bottom: var(--fp-bottom, 150px); width: min(460px, calc(100% - 2 * var(--pad))); }
}
.focus-panel .fp { display: grid; gap: 10px; animation: fp-in 0.7s var(--ease-out) both; }
.focus-panel .fp-count { font-size: 12px; letter-spacing: 0.06em; color: var(--mute); font-variant-numeric: tabular-nums; }
.focus-panel .fp-title { font-size: clamp(1.4rem, 2vw, 1.9rem); line-height: 1.1; letter-spacing: -0.02em; font-weight: 400; }
.focus-panel .fp-body { font-size: 15px; line-height: 1.55; color: var(--mute); }
@keyframes fp-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }

.views { position: relative; z-index: 4; display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 1.4vw, 18px); }
.view { display: grid; gap: 8px; justify-items: center; font-size: 12px; color: var(--mute); transition: color 0.3s; }
.view-img {
  display: block; width: clamp(46px, 4.2vw, 60px); aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  background: #f4f4f2; transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out), box-shadow 0.4s;
}
.view-img img { width: 100%; height: 100%; object-fit: contain; }
.view[aria-pressed="true"] { color: var(--paper); }
.view[aria-pressed="true"] .view-img { width: clamp(58px, 5.4vw, 78px); box-shadow: 0 0 0 1px var(--paper), 0 10px 30px rgba(0, 0, 0, 0.45); }
.view:hover { color: var(--paper); }
.view:hover .view-img { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(245, 245, 243, 0.5), 0 14px 30px rgba(0, 0, 0, 0.5); }
.view[aria-pressed="true"]:hover .view-img { box-shadow: 0 0 0 1px var(--paper), 0 14px 34px rgba(0, 0, 0, 0.5); }
.view-name { min-height: 18px; }
/* wide screens: the views stand in a vertical column on the right, level with the index rail on the left */
@media (min-width: 1100px), (min-width: 761px) and (orientation: landscape) {
  .stage[data-mode="gl"] .views {
    position: absolute; right: var(--pad); top: var(--layers-top, 30%);
    flex-direction: column; align-items: center; gap: clamp(14px, 2.2svh, 22px);
  }
  .stage[data-mode="gl"] .view-name { min-height: 0; }
  .view:hover .view-img { transform: translateX(-4px); }
  /* keep the framing box clear of the column (both sides, so the model stays centred under the title)
     and keep the height the row used to take, so every shot keeps its size */
  .stage[data-mode="gl"] .viewport { margin-inline: clamp(84px, 7.6vw, 112px); margin-bottom: clamp(64px, 11svh, 104px); }
}

.stage-hint { position: absolute; right: var(--pad); bottom: clamp(24px, 4svh, 40px); font-size: 12px; color: var(--mute); z-index: 4; }
.story-progress { position: absolute; left: var(--pad); bottom: clamp(24px, 4svh, 40px); z-index: 4; display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
.story-progress .sp-track { width: 96px; height: 1px; background: var(--line); position: relative; overflow: hidden; }
.story-progress .sp-fill { position: absolute; inset: 0; background: var(--paper); transform-origin: 0 50%; transform: scaleX(var(--sp, 0)); }

/* ---------- closing + footer ---------- */
.closing {
  padding: clamp(96px, 16svh, 180px) var(--pad) clamp(72px, 12svh, 140px);
  display: grid; justify-items: center; text-align: center; gap: 24px;
  border-top: 1px solid rgba(245, 245, 243, 0.08);
}
.closing h2 { font-size: clamp(2.6rem, 7vw, 6.4rem); line-height: 0.95; letter-spacing: -0.05em; font-weight: 330; }
.closing .line { display: block; overflow: hidden; padding: 0 0.04em 0.1em; margin-bottom: -0.1em; }
.closing .line-inner { display: block; }
.js .closing .line-inner { translate: 0 110%; }
.js .closing > p, .js .closing > .btn { opacity: 0; translate: 0 16px; }
.closing.is-in .line-inner { translate: 0 0; transition: translate 1.2s var(--ease-out); }
.closing.is-in .line + .line .line-inner { transition-delay: 0.12s; }
.closing.is-in > p { opacity: 1; translate: 0 0; transition: opacity 0.9s var(--ease-out) 0.35s, translate 0.9s var(--ease-out) 0.35s; }
.closing.is-in > .btn { opacity: 1; translate: 0 0; transition: opacity 0.9s var(--ease-out) 0.45s, translate 0.9s var(--ease-out) 0.45s, color 0.45s var(--ease-out), border-color 0.45s var(--ease-out); }
.closing p { max-width: 44ch; color: var(--mute); font-size: 16px; }
.footer {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px var(--pad) 28px; font-size: 14px; color: var(--mute); border-top: 1px solid rgba(245, 245, 243, 0.08);
}
.footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--paper); }

/* ---------- tablet ---------- */
@media (max-width: 1100px) {
  .hero-aside { display: none; }
  .focus-panel { width: min(260px, 30vw); }
  /* the wall behind the left copy is lighter at these widths */
  .hero-photo::after {
    background:
      linear-gradient(0deg, rgba(13, 12, 16, 0.6) 0%, rgba(13, 12, 16, 0.42) 28%, rgba(13, 12, 16, 0) 52%),
      linear-gradient(90deg, rgba(13, 12, 16, 0.8) 0%, rgba(13, 12, 16, 0.62) 20%, rgba(13, 12, 16, 0) 44%);
  }
}
/* tablet: the centred model leaves no room for the side panel outside the layer steps */
@media (min-width: 761px) and (max-width: 1100px) {
  .focus-panel[data-kind="phase"] { visibility: hidden; }
}

/* ---------- mobile + narrow tablet: flow layout ---------- */
@media (max-width: 760px) {
  :root { --pad: 20px; }
  .topbar-cta { display: none; }
  .topbar { grid-template-columns: 1fr auto 1fr; }
  .hero { height: auto; min-height: 0; max-height: none; display: grid; padding-bottom: 8px; }
  .hero-photo { position: relative; inset: auto; height: 74svh; min-height: 460px; z-index: 0; }
  .hero-photo img { object-position: 38% 30%; }
  .hero-photo::after { background: linear-gradient(180deg, rgba(13, 12, 16, 0.5) 0%, rgba(13, 12, 16, 0) 22%); }
  .hero-note, .hero-card, .hero-aside { display: none; }
  /* flow order: photo, headline bridging its edge, actions, strip */
  .hero-title { order: 1; }
  .hero-actions { order: 2; }
  .hero-strip { order: 3; }
  .hero-title {
    position: relative; left: auto; bottom: auto; translate: none; width: auto; max-width: none;
    margin: calc(-0.98em) var(--pad) 0; font-size: clamp(3.1rem, 15.5vw, 5.6rem); text-align: left;
  }
  .hero-actions { position: relative; right: auto; bottom: auto; width: auto; margin: 28px var(--pad) 0; grid-template-columns: 1fr 1fr; }
  .hero-strip { position: relative; left: auto; right: auto; bottom: auto; margin: 22px var(--pad) 0; }

  .stage { padding-top: 64px; }
  .stage-head h2 { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .stage-head p { font-size: 14px; }
  .br-wide { display: none; }

  /* phones: the rail collapses to the active layer's name on the top edge; the pins still number the parts */
  .stage[data-mode="gl"] .layers { right: var(--pad); }
  .stage[data-mode="gl"] .layer { grid-area: 1 / 1; }
  .stage[data-mode="gl"] .layer .layer-label,
  .stage[data-mode="gl"].is-in .layer .layer-label { opacity: 0; pointer-events: none; }
  .stage[data-mode="gl"].is-in .layer.is-active .layer-label { opacity: 1; pointer-events: auto; }
  .focus-panel { left: var(--pad); right: var(--pad); top: auto; bottom: var(--fp-bottom, 150px); translate: none; width: auto; }
  .focus-panel .fp-title { font-size: 1.35rem; }
  .focus-panel .fp-body { font-size: 14px; }
  .stage-hint { display: none; }
  .story-progress { display: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .hero-photo img { transform: none !important; }
  .hero-title .line, .hero-title .line-2 { translate: none !important; }
  .js .hero-title .w { filter: none; transform: none; }
  .hero-actions .btn-solid { transform: none; }
  .pin.is-active::after { animation: none; }
  .drag-cursor { display: none; }
}
