/* Ben Algrablee — portfolio template v1
   Black editorial canvas. Serif display for names, sans for function, mono for system labels.
   Chartreuse means one thing only: "active" (current stage, live path, focus). */
:root {
  --bg: #0a0a09; --bg-raised: #131311; --line: #2b2b27; --line-2: #3a3a34;
  --text: #f3f2ec; --muted: #a6a59d; --dim: #6c6b64; --acid: #e6ff4a;
  --display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --gutter: clamp(16px, 4vw, 56px); --max: 1440px; --header-h: 60px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  color-scheme: dark;
}

/* ---------- page-to-page: the card's media becomes the project hero ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .5s var(--ease) .15s both; }
::view-transition-group(project-media) { animation-duration: .7s; animation-timing-function: var(--ease); z-index: 10; }
::view-transition-old(project-media), ::view-transition-new(project-media) { animation-duration: .7s; height: 100%; object-fit: cover; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 var(--sans); -webkit-font-smoothing: antialiased; }
img, video, svg, picture { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-weight: 400; margin: 0; text-wrap: balance; }
p, figure, blockquote, dl, dd { margin: 0; }
ol, ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 3px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--acid); color: #000; padding: 10px 14px; text-decoration: none; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.eyebrow { font: 500 12px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow b { color: var(--acid); font-weight: 500; }
.lede { max-width: 58ch; color: var(--muted); font-size: clamp(16px, 1.3vw, 19px); }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--line-2); background: transparent; cursor: pointer; text-decoration: none; font-size: 14px; width: max-content; transition: border-color .2s; }
.btn:hover { border-color: var(--acid); }
.section { padding-block: clamp(56px, 9vw, 128px); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head h2, .index-head h2 { font-family: var(--display); font-size: clamp(44px, 6vw, 96px); line-height: .92; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.home .site-header { position: fixed; inset: 0 0 auto 0; background: linear-gradient(rgba(10,10,9,.7), transparent); backdrop-filter: none; -webkit-backdrop-filter: none; }
.home .site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.wordmark { font: 400 24px/1 var(--display); text-decoration: none; white-space: nowrap; view-transition-name: wordmark; }
.site-nav { margin-left: auto; display: flex; gap: clamp(16px, 2vw, 28px); font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 6px 0; }
.site-nav a:hover { color: var(--text); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; min-width: 0; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--text); }
.crumbs span[aria-current] { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- media frames: aspect locked, so no layout shift ---------- */
.frame { position: relative; overflow: hidden; background: var(--bg-raised); }
.frame > picture, .frame > picture img, .frame > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame > video { opacity: 0; transition: opacity .6s var(--ease); }
.frame > video.is-playing { opacity: 1; }
.play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; z-index: 2; display: inline-flex; align-items: center; gap: 12px; padding: 14px 20px 14px 16px; background: rgba(10,10,9,.55); border: 1px solid rgba(243,242,236,.35); backdrop-filter: blur(6px); cursor: pointer; font-size: 15px; transition: border-color .2s; }
.play::before { content: ""; border-left: 12px solid var(--acid); border-top: 8px solid transparent; border-bottom: 8px solid transparent; }
.play:hover { border-color: var(--acid); }
.film.is-active .play { display: none; }
.film > picture, .film > picture img, .film > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.film > video { opacity: 0; } .film > video.is-playing { opacity: 1; }

/* ================================================================ HOME */
/* opening: layered film (background · headline · isolated foreground) */
.hero { position: relative; height: 100svh; min-height: 560px; overflow: hidden; background: #000; --hp: 0; }
.hero-stage { position: absolute; left: 50%; top: 50%; aspect-ratio: 1280 / 556; width: max(100%, calc(100svh * 2.302)); transform: translate(-50%, -50%); pointer-events: none; }
.s-bg { z-index: 0; } .s-fg { z-index: 2; }
.rig { position: absolute; inset: 0; transform: scale(calc(1.03 - .05 * var(--hp))) translate3d(var(--px, 0px), var(--py, 0px), 0); will-change: transform; }
.bgwrap { position: absolute; inset: 0; overflow: hidden; opacity: calc(1 - .55 * var(--hp)); }
.bgwrap video, .bgwrap img { position: absolute; left: 0; top: 0; width: 100%; display: block; }
.bgwrap video { height: 200%; max-width: none; } /* stacked file: colour top half, matte bottom half */
.bgwrap img { height: 100%; object-fit: cover; }
.hero-title { position: absolute; z-index: 1; left: var(--gutter); top: 30svh; font-family: var(--display); font-size: min(11vw, 19svh); line-height: .86; letter-spacing: -.015em; white-space: nowrap; opacity: var(--t, 1);
  transform: translate3d(calc(var(--px, 0px) * -.6), calc(var(--py, 0px) * -.6 - 8svh * var(--hp)), 0); text-shadow: 0 2px 30px rgba(0,0,0,.25); }
.hero-title span { display: block; }
.fg, .fg-still { position: absolute; left: 0; top: 0; width: 100%; height: 100%; max-width: none; opacity: var(--f, 0); transform-origin: var(--ox, 56%) var(--oy, 22%);
  transform: translate3d(calc(var(--px, 0px) * 1.8 * var(--d, 0)), calc(var(--py, 0px) * 1.8 * var(--d, 0)), 0) scale(calc(1 + .035 * var(--d, 0)));
  filter: drop-shadow(0 1.4vw 1.8vw rgba(0,0,0,.5)); }
.fg-still { object-fit: cover; display: none; }
.hero[data-mode="still"] .fg { display: none; }
.hero[data-mode="still"] .fg-still { display: block; --f: 1; --d: 1; }
.hero[data-mode="plain"] .fg, .hero[data-mode="poster"] .fg { display: none; }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 30%; z-index: 3; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.hero-foot { position: absolute; z-index: 4; left: 0; right: 0; bottom: clamp(24px, 5svh, 48px); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px 32px; }
.hero-kicker { max-width: 38ch; color: var(--muted); font-size: 15px; }
.roles { grid-row: 2; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.roles li + li::before { content: "·"; color: var(--acid); margin-right: 18px; }
.btn--film { grid-row: 1 / span 2; grid-column: 2; background: rgba(10,10,9,.5); backdrop-filter: blur(6px); }
.btn--film::before { content: ""; border-left: 10px solid var(--acid); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }

.film-dialog { width: 100vw; height: 100svh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #000; color: var(--text); }
.film-dialog::backdrop { background: #000; }
.film-dialog[open] { display: grid; place-items: center; animation: fade-in .4s var(--ease); }
.film-dialog-frame { width: min(100vw, calc(100svh * 16 / 9)); aspect-ratio: 16 / 9; }
.film-dialog video { width: 100%; height: 100%; }
.film-close { position: absolute; top: 16px; right: 16px; z-index: 2; background: rgba(10,10,9,.6); }
@keyframes fade-in { from { opacity: 0; } }

/* index: editorial list, one shared preview */
.index { padding-block: clamp(64px, 10vw, 140px) clamp(24px, 4vw, 48px); }
.index-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(24px, 3vw, 48px); }
.index-body { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.idx-list { border-top: 1px solid var(--line); }
.idx-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) minmax(0, 13ch); grid-template-areas: "n name count" ". line count"; column-gap: 16px; padding: 22px 0 20px; border-bottom: 1px solid var(--line); text-decoration: none; position: relative; }
.idx-n { grid-area: n; font: 500 12px/1 var(--mono); color: var(--dim); padding-top: 14px; transition: color .3s; }
.idx-name { grid-area: name; font: 400 clamp(48px, 6.6vw, 104px)/.9 var(--display); letter-spacing: -.01em; color: var(--muted); transition: color .35s, transform .5s var(--ease); }
.idx-line { grid-area: line; color: var(--dim); font-size: 14px; margin-top: 8px; max-width: 46ch; transition: color .3s; }
.idx-count { grid-area: count; font: 500 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); text-align: right; padding-top: 14px; }
.idx-names { text-transform: none; letter-spacing: 0; font-family: var(--sans); font-size: 12px; }
.idx-media { display: none; }
.idx-row::before { content: ""; position: absolute; left: 0; bottom: -1px; height: 1px; width: 100%; background: var(--acid); transform: scaleX(0); transform-origin: 0 50%; transition: transform .6s var(--ease); }
.idx-row:hover::before, .idx-row:focus-visible::before, .idx-row.is-on::before { transform: scaleX(1); }
.idx-row:hover .idx-name, .idx-row:focus-visible .idx-name, .idx-row.is-on .idx-name { color: var(--text); transform: translateX(10px); }
.idx-row:hover .idx-n, .idx-row.is-on .idx-n { color: var(--acid); }
.idx-row:hover .idx-line, .idx-row.is-on .idx-line { color: var(--muted); }
.idx-preview { position: sticky; top: calc(var(--header-h) + 24px); aspect-ratio: 4 / 5; max-height: calc(100svh - var(--header-h) - 48px); justify-self: end; width: 100%; max-width: calc((100svh - var(--header-h) - 48px) * .8); overflow: hidden; background: var(--bg-raised); }
.idx-pane { position: absolute; inset: 0; opacity: 0; transform: scale(1.04); transition: opacity .5s var(--ease), transform .9s var(--ease); }
.idx-pane.is-on { opacity: 1; transform: none; }
.idx-pane picture, .idx-pane img, .idx-pane video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.idx-pane video { opacity: 0; transition: opacity .5s; } .idx-pane video.is-playing { opacity: 1; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(12px, 1.6vw, 24px); }
.card { grid-column: span 4; display: flex; flex-direction: column; gap: 14px; text-decoration: none; }
.cards--selected .card { grid-column: span 3; }
.cards--selected .card--lead { grid-column: span 6; grid-row: span 2; }
.cards--selected .card--lead .frame { aspect-ratio: 4 / 4.2 !important; }
.card .frame img { transition: scale .8s var(--ease), filter .5s; }
a.card:hover .frame img { scale: 1.035; }
.card .frame > video[data-hover] { opacity: 0; } .card .frame > video.is-playing { opacity: 1; }
.card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card h3 { font-family: var(--display); font-size: clamp(28px, 2.6vw, 40px); line-height: 1; }
.card .type { font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: right; }
.card .type b { color: var(--acid); font-weight: 500; }
.card .sub { color: var(--muted); font-size: 14px; max-width: 48ch; }
.card--draft { opacity: .5; } .card--draft .frame img { filter: grayscale(.6); }

/* ================================================================ CATEGORY */
.world-hero { position: relative; padding-block: clamp(56px, 9vw, 128px) clamp(32px, 4vw, 56px); isolation: isolate; overflow: hidden; }
.world-hero::before { content: ""; position: absolute; inset: -20% -10% 0; z-index: -1; background: var(--world-bg); filter: blur(40px); opacity: .5; animation: fade-in 1s var(--ease); }
.world-hero h1 { font-family: var(--display); font-size: clamp(80px, 14vw, 220px); line-height: .84; }
.world-hero .lede { margin-top: 20px; color: var(--text); }
.world-switch { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 32px; }
.world-switch a { display: block; text-decoration: none; padding: 9px 12px; border: 1px solid var(--line); font-size: 14px; color: var(--muted); background: rgba(10,10,9,.5); }
.world-switch a:hover { color: var(--text); border-color: var(--muted); }
.world-switch a[aria-current="page"] { color: #0a0a09; background: var(--acid); border-color: var(--acid); }
.empty { grid-column: 1 / -1; color: var(--muted); }

/* ================================================================ PROJECT */
.p-hero { padding-top: clamp(32px, 5vw, 64px); }
.p-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: end; margin-bottom: clamp(24px, 3vw, 40px); }
.p-hero h1 { font-family: var(--display); font-size: clamp(64px, 10vw, 168px); line-height: .84; letter-spacing: -.01em; }
.p-kicker { margin-top: 12px; font: 400 clamp(20px, 2vw, 28px)/1.2 var(--display); color: var(--muted); }
.p-summary { color: var(--text); max-width: 46ch; margin-bottom: 20px; }
.p-media { view-transition-name: project-media; }
/* entry choreography (index → project): media morphs via view transition; then title, then graph */
.project .p-top > * { animation: rise .8s var(--ease) both; }
.project .p-top > :nth-child(2) { animation-delay: .12s; }
.project .canvas-wrap { animation: fade-in 1.2s var(--ease) .6s both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 14px; }
.facts dt { color: var(--muted); font: 500 11px/1.9 var(--mono); letter-spacing: .06em; text-transform: uppercase; }

.stage-nav { position: sticky; top: var(--header-h); z-index: 30; margin-top: clamp(40px, 6vw, 80px); background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-block: 1px solid var(--line); }
.stage-nav ol { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.stage-nav ol::-webkit-scrollbar { display: none; }
.stage-nav a { display: flex; gap: 8px; align-items: baseline; padding: 14px 14px 14px 0; text-decoration: none; color: var(--muted); font-size: 14px; white-space: nowrap; }
.stage-nav li + li a { padding-left: 14px; }
.stage-nav a .n { font: 500 11px/1 var(--mono); }
.stage-nav a[aria-current="step"] { color: var(--text); }
.stage-nav a[aria-current="step"] .n { color: var(--acid); }
.stage-progress { height: 2px; background: transparent; margin-bottom: -1px; }
.stage-progress span { display: block; height: 100%; background: var(--acid); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); transition: transform .5s var(--ease); }

/* ---------- production canvas: sticky, behind the content ---------- */
.journey { position: relative; --canvas-top: calc(var(--header-h) + 49px); --canvas-h: calc(100svh - var(--header-h) - 49px); }
.canvas-wrap { position: sticky; top: var(--canvas-top); height: var(--canvas-h); margin-bottom: calc(-1 * var(--canvas-h)); z-index: 0; pointer-events: none; overflow: hidden; transition: opacity .5s; }
.canvas-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 0 46%, rgba(10,10,9,.85) 55%); }
.canvas-wrap[data-mode="handoff"] { opacity: .22; }
.canvas-wrap[data-mode="handoff"] .graph-key { opacity: 0; }
.swipe-hint { display: none; }
.graph-key { position: absolute; left: var(--gutter); bottom: 16px; z-index: 1; background: var(--bg); padding: 4px 6px 4px 0; transition: opacity .3s; font: 500 11px/1.3 var(--mono); letter-spacing: .04em; color: var(--dim); max-width: 40ch; }
.canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.canvas .cam { transform-origin: 0 0; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.canvas .n { opacity: .1; transition: opacity .6s; }
.canvas .n rect { fill: #121210; stroke: #34342f; stroke-width: 1; transition: stroke .4s; }
.canvas .n .lab { font: 500 13px var(--sans); fill: #8f8e86; transition: fill .4s; }
.canvas .n .sub { font: 500 9.5px var(--mono); letter-spacing: .08em; fill: #66655e; }
.canvas .n .g { fill: #8f8e86; }
.canvas .port { fill: #0a0a09; stroke: #4a4a44; stroke-width: 1; }
.canvas .status { fill: #3a3a35; }
.canvas .k-editor rect { stroke-dasharray: 4 4; }
.canvas .n.ghost rect { fill: none; stroke: #2a2a26; stroke-dasharray: 3 4; }
.canvas .n.ghost text { font: 500 11px var(--mono); fill: #55544e; }
.canvas .n.light circle { fill: #55544e; }
.canvas .n.light text { font: 400 15px var(--sans); fill: #8f8e86; }
.canvas .e { fill: none; stroke: rgba(243,242,236,.32); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: 0; transition: stroke-dashoffset 1.4s cubic-bezier(.3,.6,.2,1), opacity .6s, stroke .4s; }
.canvas .e.ghost { stroke-dasharray: .02 .02; }
.canvas .p { fill: none; stroke: var(--acid); stroke-width: 2.2; stroke-linecap: round; stroke-dasharray: .006 .16; opacity: 0; animation: pulse 3.2s linear infinite; filter: drop-shadow(0 0 3px rgba(230,255,74,.7)); transition: opacity .6s; }
@keyframes pulse { to { stroke-dashoffset: -.166; } }
.canvas-wrap[data-stage] .n .status.ok { fill: #8d8c84; }
.canvas--light .e { stroke-width: 1; }
.taps { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.taps path { fill: none; stroke: var(--acid); stroke-width: 1; opacity: 0; transition: opacity .3s; }
.taps circle { fill: var(--acid); opacity: 0; transition: opacity .3s; }
.taps.on path { opacity: .7; } .taps.on circle { opacity: 1; }

/* ---------- stages (right column on desktop) ---------- */
.stages { position: relative; z-index: 1; }
.stage { position: relative; padding: clamp(52px, 8vh, 96px) var(--gutter) clamp(52px, 8vh, 96px) calc(50% + 12px); display: grid; gap: 28px; scroll-margin-top: calc(var(--header-h) + 56px); }
.stage > * { max-width: 680px; }
.stage-head { display: grid; gap: 12px; }
.stage-head h2 { font-family: var(--display); font-size: clamp(40px, 4.6vw, 76px); line-height: .95; }
.stage-head h2 .n { font: 500 13px/1 var(--mono); color: var(--acid); vertical-align: top; margin-right: 12px; letter-spacing: .06em; }
.stage-head p { color: var(--muted); max-width: 52ch; }
.stage-visual { position: relative; }
.mod-label { margin-bottom: 12px; }
.js .stage .reveal { transition: opacity .7s var(--ease), transform .8s var(--ease); }
.js .stage:not(.is-in) .reveal { opacity: .2; transform: translateX(-14px); }
.js .stage .reveal-clip { clip-path: inset(0 0 0 0); transition: clip-path 1s var(--ease) .15s; }
.js .stage:not(.is-in) .reveal-clip { clip-path: inset(0 100% 0 0); }

/* ---------- workflow fragment: input + prompt → node → output, cropped from a larger canvas ---------- */
.frag { position: relative; border: 1px solid var(--line); background: radial-gradient(circle at 1px 1px, #24241f 1px, transparent 1.2px) 0 0 / 18px 18px, #0f0f0d; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.frag::before, .frag::after { content: ""; position: absolute; top: 40px; bottom: 0; width: 28px; z-index: 2; pointer-events: none; }
.frag::before { left: 0; background: linear-gradient(90deg, #0f0f0d, transparent); }
.frag::after { right: 0; background: linear-gradient(270deg, #0f0f0d, transparent); }
.frag-cap { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.frag-cap b { color: var(--acid); font-weight: 500; }
.frag-flow { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .85fr) minmax(0, 1fr); grid-auto-flow: column; grid-template-rows: repeat(var(--rows), auto); gap: 18px 44px; padding: 28px 36px; align-items: center; }
.fn { position: relative; background: #161613; border: 1px solid var(--line-2); padding: 10px; display: grid; gap: 6px; align-content: start; transition: border-color .5s, opacity .6s; }
.fn--in, .fn--prompt { grid-column: 1; }
.fn--node { grid-column: 2; grid-row: 1 / -1; align-self: center; }
.fn--out { grid-column: 3; grid-row: 1 / -1; align-self: center; }
.fn-k { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.fn-l { font: 500 13px/1.25 var(--sans); }
.fn-sub { font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.fn-sub .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--dim); }
.fn-text { font: 400 12px/1.4 var(--mono); color: var(--muted); }
.fn .frame { max-height: 220px; aspect-ratio: auto; }
.fn .frame[style*="9 / 16"] { width: min(100%, 124px); }
.fn--prompt blockquote { font: 400 12.5px/1.5 var(--mono); color: var(--text); }
.fn--prompt blockquote::before { content: "\201C"; color: var(--dim); } .fn--prompt blockquote::after { content: "\2026\201D"; color: var(--dim); }
.mini-sheet { display: flex; gap: 2px; align-items: end; } .mini-sheet svg { width: 33%; height: auto; }
.frag-wires { position: absolute; inset: 41px 0 0 0; width: 100%; height: calc(100% - 41px); overflow: visible; pointer-events: none; z-index: 1; }
.frag-wires path { fill: none; stroke: var(--line-2); stroke-width: 1.2; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease), stroke .5s; }
.frag-wires circle { fill: var(--line-2); transition: fill .5s; }
.js .stage.is-in .frag-wires path { stroke-dashoffset: 0; }
.js .stage.is-active .frag-wires path { stroke: var(--acid); }
.js .stage.is-active .frag-wires circle { fill: var(--acid); }
.js .stage.is-active .fn--node { border-color: var(--acid); }
.js .stage.is-active .fn--node .dot { background: var(--acid); box-shadow: 0 0 8px var(--acid); }
.js .stage:not(.is-in) .fn--out { opacity: .25; }
.js .stage.is-past .frag { opacity: .55; transition: opacity .6s; }

/* ---------- modules ---------- */
.script-page { background: #efeee6; color: #1b1b18; padding: clamp(20px, 3vw, 40px); font: 400 14px/1.7 var(--mono); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.script-page .sc { font-weight: 700; letter-spacing: .04em; margin-top: 14px; } .script-page .sc:first-child { margin-top: 0; }
.script-page .t { float: right; color: #6f6e66; font-weight: 400; }
.sheet { background: #11110f; border: 1px solid var(--line); padding: clamp(16px, 2vw, 28px); display: grid; gap: 18px; }
.sheet-top { display: flex; justify-content: space-between; gap: 12px; }
.turnaround { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: end; }
.turnaround figure, .expr figure { display: grid; gap: 8px; justify-items: center; }
.turnaround svg { width: 100%; height: auto; }
.turnaround figcaption, .expr figcaption, .frames figcaption, .out-grid figcaption { font: 500 10.5px/1 var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.expr { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.expr svg { width: 56px; height: 56px; }
.swatches { display: flex; gap: 6px; } .swatches i { width: 18px; height: 18px; display: block; }
.swatches--lg i { width: 48px; height: 48px; }
.frames { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 10px; }
.frames figure, .out-grid figure { display: grid; gap: 8px; }
.frames .is-approved .frame { outline: 1px solid var(--acid); outline-offset: 3px; }
.frames .is-approved figcaption { color: var(--acid); }
.js .stage .frames figure:nth-child(2) .reveal-clip { transition-delay: .25s; }
.js .stage .frames figure:nth-child(3) .reveal-clip { transition-delay: .35s; }
.js .stage .frames figure:nth-child(4) .reveal-clip { transition-delay: .45s; }
.compare { position: relative; aspect-ratio: 9 / 16; max-width: 300px; overflow: hidden; background: var(--bg-raised); user-select: none; touch-action: pan-y; }
.compare picture, .compare img, .compare .after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .divider { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 1px; background: var(--acid); }
.compare input[type=range] { position: absolute; left: 6%; bottom: 14px; width: 88%; accent-color: var(--acid); }
.compare .cmp-l, .compare .cmp-r { position: absolute; top: 10px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(10,10,9,.7); padding: 6px 8px; }
.compare .cmp-l { left: 10px; } .compare .cmp-r { right: 10px; }
.concept-card { border: 1px solid var(--line); padding: clamp(20px, 3vw, 36px); display: grid; gap: 10px; background: #11110f; }
.concept-card .sc { font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.concept-card .line { font: 400 clamp(28px, 3vw, 40px)/1.1 var(--display); }
.master { max-width: 380px; } .badge { position: absolute; left: 10px; top: 10px; font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: var(--acid); color: #0a0a09; padding: 6px 8px; }
.out-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* ---------- handoffs: one stage's output becomes the next stage's input (scroll-pinned) ---------- */
.handoff { position: relative; z-index: 2; height: 165vh; --p: 1; --a: 1; --b: 1; --c: 1; }
.ho-pin { position: sticky; top: var(--canvas-top, 110px); height: var(--canvas-h, 80vh); overflow: hidden; display: grid; align-content: center; justify-items: center; gap: clamp(20px, 4vh, 40px); padding: 24px var(--gutter); }
.ho-caps { position: absolute; right: var(--gutter); bottom: 24px; display: flex; gap: 24px; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.ho-caps li { transition: color .4s; } .ho-caps li::before { content: "0" counter(list-item) "  "; }
.ho-caps li.is-on { color: var(--acid); }
.ho-tag { position: absolute; left: 8px; top: 8px; z-index: 2; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(10,10,9,.75); padding: 6px 8px; }
.ho-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ho-wires path { fill: none; stroke: var(--acid); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--b)); filter: drop-shadow(0 0 3px rgba(230,255,74,.5)); }

/* isolate: a sheet view (or a master) is singled out, wired, and a frame appears */
.ho-strip { display: grid; grid-template-columns: repeat(5, 72px); gap: 18px; align-items: end; }
.ho-strip figure { display: grid; gap: 6px; justify-items: center; opacity: calc(1 - .8 * var(--a)); transition: opacity .2s; }
.ho-strip figure.is-pick { opacity: 1; }
.ho-strip figure.is-pick figcaption { color: var(--acid); }
.ho-strip figcaption { font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ho-row { display: flex; align-items: center; justify-content: center; gap: clamp(60px, 12vw, 200px); width: 100%; }
.ho-focus { position: relative; width: clamp(140px, 16vw, 220px); opacity: var(--a); transform: translateY(calc(-30px * (1 - var(--a)))) scale(calc(.7 + .3 * var(--a))); outline: 1px solid var(--acid); outline-offset: 6px; }
.ho-focus--figure { padding: 20px 26px 12px; background: #11110f; }
.ho-focus--figure svg { width: 100%; }
.ho-outs { display: grid; grid-template-columns: repeat(min(var(--n), 2), clamp(130px, 14vw, 210px)); gap: 16px; }
.ho-isolate:not(.ho-isolate--many) .ho-outs { grid-template-columns: clamp(170px, 19vw, 260px); }
.ho-out { display: grid; gap: 6px; opacity: var(--c); clip-path: inset(0 calc(100% * (1 - var(--c))) 0 0); }
.ho-out figcaption { font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ho-isolate--many .ho-focus { opacity: 1; transform: none; outline-color: color-mix(in srgb, var(--acid) calc(100% * var(--a)), transparent); }
.ho-isolate--many .ho-outs { grid-template-columns: clamp(84px, 8vw, 116px); gap: 10px; }
.ho-isolate--many .ho-out { grid-template-columns: auto 1fr; align-items: center; gap: 12px; width: 260px; }
.ho-isolate--many .ho-out .frame { aspect-ratio: 1 / 1 !important; width: clamp(84px, 8vw, 116px); }

/* expand: the approved frame grows into a shot, a motion prompt is applied, the shot moves */
.ho-expand .ho-row { gap: clamp(48px, 8vw, 140px); }
.ho-shot { width: clamp(200px, 22vw, 320px); transform: scale(calc(.62 + .38 * var(--a))); transform-origin: 50% 50%; outline: 1px solid color-mix(in srgb, var(--acid) calc(100% * var(--c)), var(--line-2)); outline-offset: 4px; }
.ho-shot .moving { display: none; color: var(--acid); }
.ho-shot.has-motion .moving { display: inline; } .ho-shot.has-motion .still { display: none; }
.ho-side { display: grid; gap: 28px; width: min(380px, 34vw); }
.ho-prompt { border-left: 2px solid var(--acid); padding: 4px 0 4px 16px; clip-path: inset(0 calc(100% * (1 - var(--b))) 0 0); }
.ho-prompt figcaption { font: 500 11px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.ho-prompt figcaption b { color: var(--acid); font-weight: 500; }
.ho-prompt blockquote { font: 400 15px/1.6 var(--mono); }
.ho-prompt blockquote::before { content: "\201C"; color: var(--dim); } .ho-prompt blockquote::after { content: "\2026\201D"; color: var(--dim); }
.ho-node { justify-self: start; border: 1px solid color-mix(in srgb, var(--acid) calc(100% * var(--b)), var(--line-2)); background: #161613; padding: 10px 12px; display: grid; gap: 6px; opacity: calc(.3 + .7 * var(--b)); }
.ho-node .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 8px var(--acid); }

/* converge: shots land on one timeline; the timeline steps aside; the final film fills the screen */
.ho-converge { height: 200vh; }
.ho-converge .ho-pin { align-content: center; }
.ho-head { position: absolute; left: var(--gutter); top: clamp(16px, 4vh, 40px); opacity: calc(1 - var(--c)); max-width: 560px; }
.ho-edit { width: min(920px, 100%); opacity: calc(1 - var(--c)); transform: scale(calc(1 - .08 * var(--c))); }
.timeline { border: 1px solid var(--line); background: #0f0f0d; padding: 14px; display: grid; gap: 8px; font: 500 11px/1 var(--mono); color: var(--muted); position: relative; }
.ruler { display: flex; justify-content: space-between; padding-left: 40px; }
.track { display: grid; grid-template-columns: 32px 1fr; gap: 8px; align-items: center; }
.lane { position: relative; height: 34px; background: #161614; }
.lane--v { height: 64px; }
.ho-clip { position: absolute; top: 4px; bottom: 4px; left: var(--x); width: 22%; overflow: hidden; border: 1px solid rgba(255,255,255,.12);
  transform: translate(calc((var(--i) - 1.5) * 6vw * (1 - var(--a))), calc(-18vh * (1 - var(--a)))) scale(calc(1 + .5 * (1 - var(--a)))); transform-origin: 50% 100%; opacity: calc(.25 + .75 * var(--a)); }
.ho-clip img, .ho-clip picture { width: 100%; height: 100%; object-fit: cover; }
.wave { position: absolute; top: 4px; bottom: 4px; left: 0; width: calc(var(--w) * var(--b)); background: repeating-linear-gradient(90deg, #4b4b43 0 2px, transparent 2px 5px); }
.playhead { position: absolute; top: 28px; bottom: 10px; left: calc(54px + (100% - 68px) * var(--b)); width: 2px; background: var(--acid); }
.ho-final { position: absolute; inset: 0; z-index: 3; clip-path: inset(calc(42% * (1 - var(--c))) calc(30% * (1 - var(--c)))); opacity: min(1, calc(var(--c) * 3)); pointer-events: none; }
.ho-final picture, .ho-final img { width: 100%; height: 100%; object-fit: cover; }
.ho-converge .ho-caps { z-index: 4; }

/* ---------- final film + next project ---------- */
.final { position: relative; z-index: 2; background: var(--bg); scroll-margin-top: var(--header-h); }
.film--bleed { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100svh - var(--header-h)); background: #000; overflow: hidden; }
.final-meta { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; padding-block: 32px 24px; align-items: start; }
.final-meta .stage-head h2 { font-size: clamp(36px, 4vw, 60px); }
.next-project { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; padding-block: clamp(48px, 8vw, 112px); border-top: 1px solid var(--line); margin-top: clamp(24px, 4vw, 48px); }
.next-link { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 44%); grid-template-areas: "eb media" "title media" "sub media"; column-gap: clamp(24px, 4vw, 56px); row-gap: 12px; align-content: end; text-decoration: none; }
.next-link .eyebrow { grid-area: eb; align-self: end; }
.next-title { grid-area: title; font: 400 clamp(56px, 9vw, 150px)/.86 var(--display); transition: color .3s; }
.next-sub { grid-area: sub; color: var(--muted); max-width: 44ch; }
.next-media { grid-area: media; }
.next-link:hover .next-title { color: var(--acid); }
.next-project > .btn { align-self: end; }

/* ---------- standalone film: the film dominates ---------- */
.film-stage { background: #000; }
.film-stage .film { width: min(100%, calc((100svh - var(--header-h)) * 16 / 9)); margin-inline: auto; max-height: calc(100svh - var(--header-h)); animation: letterbox 1.2s var(--ease) .1s both; }
@keyframes letterbox { from { clip-path: inset(38% 0 38% 0); } to { clip-path: inset(0 0 0 0); } }
.film-info { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; padding-block: 32px 24px; align-items: start; }
.film-info h1 { font-family: var(--display); font-size: clamp(48px, 6.5vw, 104px); line-height: .9; animation: rise .8s var(--ease) .5s both; }
.film-info .lede { margin-top: 14px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding-block: clamp(56px, 8vw, 104px) 32px; }
.site-footer h2 { font-family: var(--display); font-size: clamp(48px, 7vw, 112px); line-height: .9; }
.contact { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px 40px; font-size: 17px; }
.contact a { text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; } .contact a:hover { border-color: var(--acid); }
.colophon { margin-top: 64px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }

/* ================================================================ RESPONSIVE */
@media (max-width: 1100px) {
  .crumbs a, .crumbs span[aria-hidden] { display: none; }
  .frag-flow { gap: 14px 28px; padding: 24px 24px; }
  .frames { grid-template-columns: repeat(2, minmax(0, 150px)); }
}
/* phones: a designed layout, not a scaled desktop */
@media (max-width: 899px) {
  :root { --header-h: 54px; }
  .wordmark { font-size: 21px; }
  .site-nav { gap: 16px; font-size: 13px; }
  .crumbs { display: none; }
  .section-head h2, .index-head h2 { font-size: clamp(44px, 13vw, 64px); }

  .hero { height: 88svh; min-height: 520px; }
  .hero-title { top: auto; bottom: calc(150px + 4svh); font-size: 17vw; }
  .hero-foot { grid-template-columns: 1fr; }
  .btn--film { grid-row: auto; grid-column: auto; }
  .roles { display: none; }

  /* index → swipe rail of world panels */
  .index-body { display: block; }
  .idx-preview { display: none; }
  .idx-list { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; border: 0; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .idx-list::-webkit-scrollbar { display: none; }
  .idx-list li { flex: 0 0 76%; scroll-snap-align: start; }
  .idx-row { display: grid; grid-template-areas: "media" "n" "name" "line"; grid-template-columns: 1fr; border: 0; padding: 0; gap: 8px; }
  .idx-row::before { display: none; }
  .idx-media { grid-area: media; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--bg-raised); }
  .idx-media img, .idx-media picture { width: 100%; height: 100%; object-fit: cover; }
  .idx-n { padding: 4px 0 0; color: var(--acid); }
  .idx-name { font-size: 44px; color: var(--text); }
  .idx-line { margin: 0; color: var(--muted); }
  .idx-count { display: none; }

  .cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .cards::-webkit-scrollbar { display: none; }
  .card, .cards--selected .card, .cards--selected .card--lead { flex: 0 0 80%; scroll-snap-align: start; }
  .cards--selected .card--lead .frame { aspect-ratio: 4 / 5 !important; }
  .cards--grid { display: grid; grid-template-columns: 1fr; overflow: visible; margin-inline: 0; padding-inline: 0; }

  .p-top, .final-meta, .film-info { grid-template-columns: 1fr; }
  .p-hero h1 { font-size: 18vw; }

  /* canvas: a short strip with the local branch only */
  .journey { --canvas-top: calc(var(--header-h) + 47px); --canvas-h: 26svh; }
  .canvas-wrap { margin-bottom: 0; z-index: 3; background: var(--bg); border-bottom: 1px solid var(--line); }
  .canvas-wrap::after, .graph-key { display: none; }
  .canvas .n .sub, .canvas .port, .canvas .n.ghost { display: none; }
  .canvas .p { animation-duration: 5s; }
  .canvas-wrap[data-mode="handoff"] { opacity: .5; }
  .stage { padding: 48px var(--gutter); gap: 22px; }
  .stage > * { max-width: none; }

  /* rails: swipe instead of stacking */
  .rail { display: flex !important; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: none; }
  .rail::-webkit-scrollbar { display: none; }
  .rail > figure { flex: 0 0 46%; scroll-snap-align: start; }
  .turnaround.rail > figure { flex-basis: 28%; }
  .out-grid.rail > figure { flex-basis: 60%; }

  /* fragment → swipe through input, prompt, node, output */
  .frag::before, .frag::after { display: none; }
  .frag-flow { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 22px; padding: 20px var(--gutter); scrollbar-width: none; align-items: stretch; }
  .frag-flow::-webkit-scrollbar { display: none; }
  .fn { flex: 0 0 64%; scroll-snap-align: center; }
  .fn + .fn::before { content: ""; position: absolute; left: -22px; top: 50%; width: 22px; height: 1px; background: var(--line-2); }
  .js .stage.is-active .fn + .fn::before { background: var(--acid); }
  .frag-wires { display: none; }
  .frag-cap span:last-child::after { content: " · swipe →"; }

  /* handoffs: shorter, stacked vertically */
  .handoff { height: 140vh; }
  .ho-pin { top: calc(var(--header-h) + 47px + 26svh); height: calc(100svh - var(--header-h) - 47px - 26svh); gap: 16px; padding-block: 16px 44px; }
  .ho-strip { grid-template-columns: repeat(5, 44px); gap: 10px; }
  .ho-row { flex-direction: column; gap: 28px; }
  .ho-isolate .ho-row { flex-direction: row; gap: 48px; }
  .ho-outs, .ho-focus { flex: none; }
  .ho-focus { width: 96px; } .ho-focus--figure { padding: 10px 14px 6px; }
  .ho-isolate .ho-focus:not(.ho-focus--figure) { width: 120px; }
  .ho-outs, .ho-isolate:not(.ho-isolate--many) .ho-outs { grid-template-columns: repeat(min(var(--n), 4), minmax(0, 110px)); }
  .ho-isolate:not(.ho-isolate--many) .ho-outs { grid-template-columns: 160px; }
  .ho-expand .ho-row { gap: 20px; }
  .ho-shot { width: 150px; }
  .ho-side { width: 100%; gap: 12px; }
  .ho-node { display: none; }
  .ho-caps { gap: 12px; bottom: 14px; }
  .ho-converge { height: 170vh; }
  .ho-converge .ho-pin { align-content: end; padding-bottom: 56px; }
  .ho-head { position: static; } .ho-head h2 { font-size: 36px; } .ho-head p { display: none; }
  .ho-isolate--many .ho-row { gap: 40px; }
  .ho-isolate--many .ho-focus { width: 96px !important; }
  .ho-isolate--many .ho-outs { grid-template-columns: 52px; gap: 6px; }
  .ho-isolate--many .ho-out { width: 140px; gap: 8px; }
  .ho-isolate--many .ho-out .frame { width: 52px; }
  .swipe-hint { display: block; }
  .ho-clip { transform: translate(0, calc(-18vh * (1 - var(--a)))) scale(calc(1 + .6 * (1 - var(--a)))); }
  .ruler { padding-left: 32px; }

  .next-project { grid-template-columns: 1fr; }
  .next-link { grid-template-columns: 1fr; grid-template-areas: "media" "eb" "title" "sub"; }
  .next-title { font-size: 16vw; }
}
@media (max-width: 899px) and (orientation: portrait) {
  .film-stage .film { width: 100%; }
}

/* ---------- reduced motion: final states, no movement ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .canvas .p { display: none; }
  .handoff { height: auto; --p: 1 !important; --a: 1 !important; --b: 1 !important; --c: 1 !important; }
  .ho-pin { position: relative; top: 0; height: auto; min-height: 70vh; }
  .ho-converge .ho-final { display: none; }
  .ho-converge .ho-edit, .ho-converge .ho-head { opacity: 1; transform: none; }
}

/* ---------- editorial graph (any documented process; no software implied) ---------- */
.canvas--editorial .n.light text { font: 400 14px var(--sans); }
.canvas--editorial .n.light.major text { font: 400 19px var(--display); letter-spacing: .01em; }
.canvas--editorial .n.light.major circle { fill: #77766e; }
.canvas--editorial .n.light.ok circle { stroke: #8d8c84; stroke-width: 1; fill: transparent; }
.canvas--editorial .e { stroke-width: 1; }
/* the output travelling along the connector to become the next stage's input */
.ho-token { position: absolute; left: 0; top: 0; z-index: 3; width: 44px; offset-rotate: 0deg; offset-distance: calc(var(--b) * 100%); offset-anchor: 50% 50%;
  opacity: min(1, calc(var(--b) * 8), calc((1 - var(--b)) * 8)); background: #11110f; outline: 1px solid var(--acid); padding: 4px; pointer-events: none; }
.ho-token svg, .ho-token img, .ho-token picture { width: 100%; height: auto; }
.ho-after { position: absolute; inset: 0; z-index: 1; opacity: var(--c); }
.ho-after picture, .ho-after img { width: 100%; height: 100%; object-fit: cover; }
/* Weavy projects only: the graph briefly hands over to a real fragment */
.canvas-wrap .graph-key .in-tool { display: none; color: var(--acid); }
.canvas-wrap.is-zoom .graph-key .in-tool { display: inline; }
.canvas-wrap.is-zoom .graph-key .base { display: none; }
@media (max-width: 899px) { .ho-token { width: 30px; } }

/* ================================================================ PHASE 3 — real material */
/* opening: the film sits in a frame; at the accent only Beno is allowed past its top edge */
.hero { --inset-x: clamp(16px, 6vw, 96px); --inset-top: calc(var(--header-h) + 3svh); --inset-bottom: 22svh; }
.hero-layer { position: absolute; inset: 0; pointer-events: none; }
.l-bg { z-index: 0; clip-path: inset(var(--inset-top) var(--inset-x) var(--inset-bottom) var(--inset-x)); }
.l-fg { z-index: 2; }
.hero::before { content: ""; position: absolute; z-index: 0; left: var(--inset-x); right: var(--inset-x); top: var(--inset-top); bottom: var(--inset-bottom); border: 1px solid rgba(243,242,236,.14); pointer-events: none; }
/* foreground: clipped at the frame's sides and bottom, open at the top -> the head breaks the frame */
.l-fg { clip-path: inset(0 max(0px, calc(var(--inset-x) - 2vw)) var(--inset-bottom) max(0px, calc(var(--inset-x) - 2vw))); }
.fg, .fg-still { transform: translate3d(calc(var(--px, 0px) * .7 * var(--d, 0)), calc(var(--py, 0px) * .7 * var(--d, 0)), 0) scale(calc(1 + .012 * var(--d, 0)));
  filter: drop-shadow(0 1.6vw 2.2vw rgba(0,0,0,.55)) drop-shadow(0 0 1px rgba(0,0,0,.6)); }
.hero-title { top: auto; bottom: calc(var(--inset-bottom) + 4svh); font-size: min(10.5vw, 17svh); left: calc(var(--inset-x) + 2vw); }
.hero::after { height: 24%; }
.hero-foot { bottom: clamp(20px, 4svh, 40px); }
.hero-kicker { color: var(--text); font-size: clamp(14px, 1.2vw, 17px); letter-spacing: .01em; }
@media (max-width: 899px) {
  .hero { --inset-x: 0px; --inset-top: var(--header-h); --inset-bottom: 34svh; }
  .hero::before { display: none; }
  .hero-title { bottom: calc(var(--inset-bottom) + 2svh); font-size: 16vw; }
}

/* the node thread: Beno -> worlds -> projects */
.index { position: relative; }
.thread { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 0; }
.thread path { fill: none; stroke-width: 1.2; }
.thread-base { stroke: rgba(243,242,236,.12); }
.thread-live { stroke: var(--acid); stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--tp, 0)); filter: drop-shadow(0 0 3px rgba(230,255,74,.5)); }
.thread-origin { fill: var(--acid); }
.index-head, .index-body { position: relative; z-index: 1; }
@media (max-width: 899px) { .thread { display: none; } }

/* draft cards: real media, not dimmed; quiet label */
.card--draft { opacity: 1; cursor: default; }
.card--draft .frame img { filter: none; }
.card--draft .type { color: var(--muted); }

/* research and beats */
.insights { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.insights li { background: var(--bg); padding: 16px 18px; display: grid; grid-template-columns: 110px 1fr; gap: 16px; }
.insights .sc { font: 500 11px/1.5 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acid); }
.beats { border-top: 1px solid var(--line); font-size: 14px; }
.beats li { display: grid; grid-template-columns: 56px 74px 1fr 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.beats .beats-head { font: 500 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.b-sc, .b-t { font: 500 11px/1.4 var(--mono); color: var(--muted); }
.b-sc { color: var(--text); }
.b-game { color: var(--muted); display: flex; gap: 8px; align-items: baseline; }
.b-game i { width: 8px; height: 8px; flex: none; background: var(--acid); transform: translateY(1px); }
.beats li:nth-child(5) .b-story { color: var(--acid); }

/* sheets rail, boards */
.sheet-rail { display: grid; grid-auto-flow: column; grid-auto-columns: min(92%, 640px); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: 8px; }
.sheet-rail figure { scroll-snap-align: start; display: grid; gap: 8px; }
.sheet-rail figcaption, .boards figcaption, .pairs figcaption, .frames figcaption { font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.rail-hint { margin-top: 8px; font: 500 11px/1 var(--mono); color: var(--dim); }
.boards { display: grid; gap: 18px; }
.boards figure { display: grid; gap: 8px; }
.fn-crop { margin-top: 6px; border: 1px solid var(--line-2); }
.fn--node .fn-crop img { object-position: 50% 0; }
.stage .frames { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); }

/* hooks: one frame, two synced openings */
.hooks { display: grid; gap: 14px; justify-items: start; }
.hooks-tabs { display: inline-flex; border: 1px solid var(--line-2); }
.hooks-tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-size: 14px; color: var(--muted); }
.hooks-tabs button[aria-pressed="true"] { background: var(--acid); color: #0a0a09; }
.hooks-frame { width: min(300px, 70vw); }
.hooks-frame video { opacity: 0; transition: opacity .35s var(--ease); }
.hooks-frame video.is-on { opacity: 1; }
.hooks-note { color: var(--muted); font-size: 14px; max-width: 46ch; }

/* reskin pairs: video wipe */
.pairs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pair { display: grid; gap: 8px; }
.compare--video { max-width: none; width: 100%; }
.compare--video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.compare--video video.is-playing { opacity: 1; }
.compare .after video { position: absolute; inset: 0; }

/* vertical final film + variants */
.final--vertical .final-stage { background: #000; display: grid; place-items: center; padding-block: 24px; }
.film--vertical { position: relative; height: min(calc(100svh - var(--header-h) - 48px), 900px); aspect-ratio: 9 / 16; overflow: hidden; background: #000; }
.variants { padding-block: 8px 24px; display: grid; gap: 14px; }
.variants-row { display: grid; grid-template-columns: repeat(3, minmax(0, 200px)); gap: 12px; }
.film--variant { position: relative; aspect-ratio: 9 / 16; overflow: hidden; background: #000; }
.film--variant .play { font-size: 13px; padding: 10px 12px; white-space: nowrap; }
.p-media--strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; view-transition-name: project-media; }
.p-media--strip .frame { height: 100%; }
.p-media--strip .frame:nth-child(even) { transform: translateY(4%); }
.ho-strip-img { width: min(640px, 92vw); opacity: calc(1 - .55 * var(--a)); }
.ho-strip-img img { width: 100%; height: auto; }
@media (max-width: 899px) {
  .beats li { grid-template-columns: 48px 1fr; } .beats .b-t, .beats .beats-head { display: none; }
  .beats .b-game { grid-column: 2; }
  .insights li { grid-template-columns: 1fr; gap: 6px; }
  .pairs { display: flex !important; } .pairs > figure { flex: 0 0 64%; }
  .p-media--strip { grid-template-columns: repeat(3, 1fr); } .p-media--strip .frame:nth-child(n+4) { display: none; }
  .variants-row { grid-template-columns: repeat(3, 1fr); }
  .ho-strip-img { width: 100%; }
}

/* ---------- Phase 3b: carousel navigation, location, takes, edit assembly ---------- */
.carousel { position: relative; }
.carousel .sheet-rail { grid-auto-columns: 100%; scrollbar-width: none; scroll-behavior: smooth; }
.carousel .sheet-rail::-webkit-scrollbar { display: none; }
.carousel .sheet-rail figcaption { display: none; }
.car-btn { position: absolute; top: calc(50% - 30px); width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(12, 12, 10, .78); backdrop-filter: blur(8px);
  color: var(--fg); display: grid; place-items: center; cursor: pointer; transition: background .2s, color .2s, transform .2s, opacity .2s; z-index: 2; }
.car-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; }
.car-prev { left: 10px; } .car-next { right: 10px; }
.car-btn:hover, .car-btn:focus-visible { background: var(--acid); color: #0b0b0a; transform: scale(1.06); }
.car-btn[disabled] { opacity: .25; pointer-events: none; }
.car-next:not([disabled]) { animation: car-nudge 2.4s ease-in-out 1.2s 3; }
@keyframes car-nudge { 0%, 100% { transform: none; } 50% { transform: translateX(5px); } }
.car-bar { display: flex; align-items: center; gap: 16px; margin-top: 12px; font: 500 11px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.car-count b { color: var(--acid); font-weight: 500; }
.car-name { flex: 1; color: var(--fg); }
.car-dots { display: flex; gap: 6px; }
.car-dot { width: 8px; height: 8px; border-radius: 50%; border: 0; padding: 0; background: var(--line-2); cursor: pointer; }
.car-dot[aria-current="true"] { background: var(--acid); }

.location { display: grid; gap: 14px; }
.location figcaption { margin-top: 8px; font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.loc-notes { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0; margin: 0; }
.loc-notes li { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.loc-notes b { font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg); }
.ho-strip-img--sheet { width: min(560px, 44vw); }
.ho-focus--wide { width: clamp(240px, 30vw, 420px) !important; }

.takes figcaption b { display: block; color: var(--acid); font-weight: 500; margin-bottom: 3px; }
.stage-visual .takes { --cols: 4; }

/* edit assembly: tracks build, the playhead runs, the tracks collapse into one cut, one frame becomes the film */
.ho-assemble { height: 235vh; }
.ho-assemble .ho-pin { align-content: center; justify-items: center; }
.ho-assemble .ho-head { opacity: calc(1 - var(--c) * 1.6); }
.asm { --m: min(1, max(0, calc((var(--b) - .55) * 2.4))); position: relative; width: min(1040px, calc(100% - 2 * var(--gutter))); margin-top: 120px; display: grid; gap: 8px;
  padding: 16px; border: 1px solid color-mix(in srgb, var(--line) calc(100% * (1 - var(--m))), transparent); background: rgba(14, 14, 12, calc(.92 * (1 - var(--m))));
  opacity: calc(1 - var(--c) * 1.4); transform: scale(calc(1 - .06 * var(--c))); }
.asm-ruler, .asm-track { display: grid; grid-template-columns: 116px 1fr; gap: 12px; align-items: center; }
.asm-l { font: 500 10.5px/1.2 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); opacity: calc(1 - var(--m)); }
.asm-ticks { position: relative; height: 14px; opacity: calc(1 - var(--m)); }
.asm-ticks span { position: absolute; top: 0; transform: translateX(-50%); font: 500 10px/1 var(--mono); color: var(--dim); }
.asm-ticks span:first-child { transform: none; } .asm-ticks span:last-child { transform: translateX(-100%); }
.asm-lane { position: relative; height: 40px; background: #171714; }
.asm-track--v1 .asm-lane { height: 92px; }
.asm-track--gp .asm-lane { height: 64px; }
.clip { position: absolute; top: 3px; bottom: 3px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); background: #222;
  opacity: min(1, max(0, calc(var(--a) * 1.6 - var(--i) * .06))); transform: translateX(calc(40px * (1 - var(--a)))); }
.clip picture, .clip img { width: 100%; height: 100%; object-fit: cover; }
.clip em { display: block; padding: 0 6px; font: 500 10px/34px var(--mono); font-style: normal; white-space: nowrap; color: #0b0b0a; }
.asm-track--gfx .clip { background: var(--acid); border-color: transparent; }
.asm-track--gp .clip { border-color: color-mix(in srgb, var(--acid) 50%, transparent); }
/* collapse: graphics and gameplay drop into the picture lane; music fades under it */
.asm-track--gfx { transform: translateY(calc(var(--m) * 180px)); opacity: calc(1 - var(--m) * .9); }
.asm-track--gp { transform: translateY(calc(var(--m) * 112px)); }
.asm-track--gp .asm-lane, .asm-track--gfx .asm-lane { background: rgba(23, 23, 20, calc(1 - var(--m))); }
.asm-track--a1 { opacity: calc(1 - var(--m)); }
.asm-track--v1 .asm-lane { box-shadow: 0 0 0 1px color-mix(in srgb, var(--acid) calc(100% * var(--m)), transparent); }
.wave { position: absolute; inset: 5px auto 5px 0; width: calc(100% * var(--a)); background: repeating-linear-gradient(90deg, #55554b 0 2px, transparent 2px 5px);
  -webkit-mask: linear-gradient(transparent, #000 30%, #000 70%, transparent); }
.asm-play { position: absolute; top: 36px; bottom: 12px; left: calc(144px + (100% - 160px) * min(1, var(--b) * 1.25)); width: 2px; background: var(--acid); box-shadow: 0 0 10px var(--acid); opacity: calc(var(--a) * (1 - var(--m))); }
.asm-track--v1 .clip.is-sel { z-index: 2; outline: 2px solid color-mix(in srgb, var(--acid) calc(100% * var(--m)), transparent); outline-offset: 1px; }
.asm-final { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none;
  background: rgba(0, 0, 0, min(1, calc(var(--c) * 1.5))); }
.asm-final-frame { height: min(calc(100svh - var(--header-h) - 48px), 900px); aspect-ratio: 9 / 16; overflow: hidden; background: #000;
  opacity: min(1, calc(var(--c) * 4)); transform: translate(calc(min(36vw, 390px) * (1 - var(--c))), calc(6vh * (1 - var(--c)))) scale(calc(.1 + .9 * var(--c)));
  box-shadow: 0 0 0 1px rgba(255,255,255,calc(.2 * (1 - var(--c)))); }
.asm-final-frame picture, .asm-final-frame img { width: 100%; height: 100%; object-fit: cover; }
.ho-assemble .ho-caps { z-index: 4; }
@media (max-width: 899px) {
  .loc-notes { grid-template-columns: 1fr; }
  .ho-strip-img--sheet { width: 100%; }
  .ho-focus--wide { width: 70vw !important; }
  .ho-assemble { height: 210vh; }
  .ho-assemble .ho-pin { align-content: center; }
  .ho-assemble .ho-head { position: relative; left: auto; top: auto; padding-inline: var(--gutter); }
  .asm { margin-top: 20px; padding: 10px; }
  .asm-ruler, .asm-track { grid-template-columns: 1fr; gap: 4px; }
  .asm-ruler .asm-l { display: none; }
  .asm-track--v1 .asm-lane { height: 64px; } .asm-track--gp .asm-lane { height: 44px; }
  .asm-play { left: calc(10px + (100% - 20px) * min(1, var(--b) * 1.25)); }
  .asm-track--gfx { transform: translateY(calc(var(--m) * 160px)); } .asm-track--gp { transform: translateY(calc(var(--m) * 92px)); }
  .car-btn { width: 40px; height: 40px; top: calc(50% - 26px); }
  .car-btn svg { width: 18px; height: 18px; }
  .car-bar { flex-wrap: wrap; gap: 8px 12px; }
  .car-name { flex-basis: 100%; order: 3; }
  .stage-visual .takes > figure { flex-basis: 46%; }
}
.ho-strip-img { position: relative; }
.ho-mark { position: absolute; outline: 2px solid var(--acid); outline-offset: 2px; opacity: var(--a); box-shadow: 0 0 0 9999px rgba(0,0,0,calc(.45 * var(--a))); }
.ho-isolate--wide .ho-strip-img--sheet { width: min(480px, 36vw); overflow: hidden; }
.ho-isolate--wide .ho-row { gap: clamp(48px, 9vw, 150px); }
.ho-isolate--wide .ho-focus--wide { width: clamp(220px, 22vw, 320px) !important; }
.ho-isolate--wide .ho-outs { grid-template-columns: clamp(120px, 11vw, 160px) !important; }
@media (max-width: 899px) {
  .ho-isolate--wide .ho-strip-img--sheet { width: 100%; }
  .ho-isolate--wide .ho-row { gap: 24px; }
  .ho-isolate--wide .ho-focus--wide { width: 50vw !important; }
  .ho-isolate--wide .ho-outs { grid-template-columns: 116px !important; }
}

/* opening film: a primary piece of content with a clear invitation to play */
.hero-hit { position: absolute; z-index: 3; left: var(--inset-x); right: var(--inset-x); top: var(--inset-top); bottom: var(--inset-bottom); background: none; border: 0; padding: 0; cursor: pointer; }
.hero-play { position: absolute; z-index: 5; left: calc(var(--inset-x) + clamp(20px, 5vw, 80px)); top: calc(var(--inset-top) + clamp(20px, 6svh, 64px));
  display: flex; align-items: center; gap: 18px; padding: 0; background: none; border: 0; color: var(--fg); cursor: pointer; text-align: left; }
.hp-disc { position: relative; width: clamp(76px, 8vw, 112px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background: rgba(10, 10, 9, .42); backdrop-filter: blur(10px); border: 1px solid rgba(243, 242, 236, .55); transition: background .25s, border-color .25s, transform .35s cubic-bezier(.2,.8,.2,1); }
.hp-disc svg { width: 38%; fill: var(--fg); transform: translateX(6%); transition: fill .25s; }
.hp-ring { position: absolute; inset: -1px; border-radius: 50%; border: 1px solid var(--acid); animation: hp-pulse 2.6s cubic-bezier(.2,.6,.3,1) infinite; pointer-events: none; }
@keyframes hp-pulse { 0% { transform: scale(1); opacity: .9; } 80%, 100% { transform: scale(1.55); opacity: 0; } }
.hp-label { display: grid; gap: 6px; font: 400 clamp(26px, 2.6vw, 40px)/1 var(--display); text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.hp-label small { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: rgba(243, 242, 236, .8); }
.hero-play:hover .hp-disc, .hero-play:focus-visible .hp-disc, .hero:has(.hero-hit:hover) .hp-disc { background: var(--acid); border-color: var(--acid); transform: scale(1.08); }
.hero-play:hover .hp-disc svg, .hero-play:focus-visible .hp-disc svg, .hero:has(.hero-hit:hover) .hp-disc svg { fill: #0b0b0a; }
.hero:has(.hero-hit:hover)::before, .hero:has(.hero-play:hover)::before { border-color: var(--acid); }
.hero::before { transition: border-color .3s; }
.hero-play:focus-visible { outline: none; } .hero-play:focus-visible .hp-disc { outline: 2px solid var(--acid); outline-offset: 6px; }
@media (prefers-reduced-motion: reduce) { .hp-ring { animation: none; opacity: 0; } }
@media (max-width: 899px) {
  .hero-play { left: var(--gutter); top: calc(var(--inset-top) + 18px); gap: 12px; }
  .hp-disc { width: 64px; }
  .hp-label { font-size: 22px; }
}

/* pending asset: an honest placeholder inside the real layout */
.ph { position: absolute; inset: 0; display: grid; align-content: end; gap: 6px; padding: 14px; text-align: left;
  background: repeating-linear-gradient(135deg, #141412 0 10px, #11110f 10px 20px); border: 1px dashed #34342e; color: var(--muted); }
.ph-k { font: 500 9.5px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acid); opacity: .8; }
.ph-l { font-size: 12.5px; line-height: 1.35; max-width: 30ch; }
picture + .ph, .frame > .ph { position: absolute; }

/* selected work: one row, one card footprint, a horizontal carousel with arrows */
.carousel--cards { position: relative; }
.carousel--cards .cards { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--cg)) / 4); grid-template-columns: none; --cg: clamp(12px, 1.6vw, 24px); gap: var(--cg);
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; overscroll-behavior-x: contain; }
.carousel--cards .cards::-webkit-scrollbar { display: none; }
.carousel--cards .card { grid-column: auto; scroll-snap-align: start; min-width: 0; }
.carousel--cards .car-btn { top: calc((100vw - 2 * var(--gutter)) / 4 * 1.25 / 2 - 26px); }
.carousel--cards .car-prev { left: -14px; } .carousel--cards .car-next { right: -14px; }
/* true-ratio previews inside one footprint: the video is contained over a blurred copy of its poster */
.card .frame > video[data-hover] { object-fit: contain; background: transparent; }
.card .frame:has(> video.is-playing) > picture img { filter: blur(22px) brightness(.45) saturate(1.2); scale: 1.15; transition: filter .4s, scale .4s; }
@media (max-width: 899px) {
  .carousel--cards .cards { display: flex; grid-auto-flow: unset; }
  .carousel--cards .card { flex: 0 0 78%; }
  .carousel--cards .car-btn { display: none; }
}
.idx-pane video { object-fit: contain; }
.idx-pane:has(> video.is-playing) img { filter: blur(22px) brightness(.45); scale: 1.15; transition: filter .4s, scale .4s; }
.hooks--side { display: grid; grid-template-columns: repeat(2, minmax(0, 260px)); gap: 18px 20px; align-items: start; justify-content: start; }
.hook { display: grid; gap: 10px; margin: 0; }
.hook figcaption { display: grid; gap: 4px; min-height: 64px; }
.hook figcaption b { font: 500 11px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--acid); }
.hook figcaption span { font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.hook .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.hook .frame video.is-playing { opacity: 1; }
.hooks--side .hooks-replay, .hooks--side .hooks-note { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 899px) { .hooks--side { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } .hook figcaption { min-height: 84px; } }

/* the graph pulls toward the next stage: its first edges start drawing before you arrive */
.canvas .e.is-next { opacity: .5; stroke-dashoffset: .55; stroke: color-mix(in srgb, var(--acid) 55%, rgba(243,242,236,.32)); }
.p-media--vertical { background: #000; display: grid; place-items: center; }
.pv-bg { position: absolute; inset: 0; }
.pv-bg picture, .pv-bg img { width: 100%; height: 100%; object-fit: cover; filter: blur(30px) brightness(.4) saturate(1.1); scale: 1.12; }
.pv-fg { position: relative; height: 100%; aspect-ratio: 9 / 16; box-shadow: 0 30px 80px rgba(0,0,0,.5); }
.pv-fg picture, .pv-fg img { width: 100%; height: 100%; object-fit: cover; }
/* LAVI worlds: base → world, what changes vs what stays locked */
.carousel--worlds .sheet-rail { grid-auto-columns: 100%; }
.world { margin: 0; display: grid; gap: 14px; }
.world-pair { display: grid; grid-template-columns: minmax(0, .9fr) auto minmax(0, 2.2fr); align-items: center; gap: 12px; }
.world-base, .world-var { position: relative; }
.world-base { opacity: .8; }
.world-arrow { font: 400 22px/1 var(--mono); color: var(--acid); }
.world-tag { position: absolute; left: 8px; top: 8px; font: 500 9.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; background: rgba(0,0,0,.6); padding: 5px 7px; }
.world-tag--on { color: #0b0b0a; background: var(--acid); }
.world-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 13.5px; color: var(--muted); }
.world-notes b { display: block; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg); margin-bottom: 8px; }
.world-notes ul { margin: 0; padding-left: 16px; display: grid; gap: 4px; }
.carousel--worlds .car-btn { top: 28%; }
.takes--wide { --cols: 2 !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
@media (max-width: 899px) { .world-pair { grid-template-columns: 1fr; } .world-arrow, .world-base { display: none; } .takes--wide > figure { flex-basis: 80% !important; } }
.frames--wide { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.ho-shot--wide { width: clamp(320px, 36vw, 600px) !important; height: auto !important; }
@media (max-width: 899px) { .frames--wide > figure { flex-basis: 80% !important; } .ho-shot--wide { width: 88vw !important; } }
@media (max-width: 899px) { .carousel .sheet-rail > figure { flex: 0 0 100% !important; } .carousel--worlds .car-btn { top: 22%; } }
/* closing statement */
.site-footer { padding-block: clamp(96px, 16vw, 220px) 32px; }
.site-footer .closing { font-size: clamp(54px, 9.5vw, 168px); line-height: .92; letter-spacing: -.02em; max-width: 12ch; margin-top: 18px; }
.foot-node { display: block; width: clamp(80px, 14vw, 220px); height: 1px; background: linear-gradient(90deg, transparent, var(--acid)); position: relative; }
.foot-node::after { content: ""; position: absolute; right: -4px; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--acid); box-shadow: 0 0 10px var(--acid); }
.site-footer .contact { margin-top: clamp(28px, 4vw, 48px); }
.compare[style*="16 / 9"] { max-width: min(720px, 100%); }

/* index: the preview always follows the dominant row and steps aside when the list ends */
.idx-preview { transition: opacity .35s var(--ease); }
.idx-preview.is-done { opacity: 0; }
.idx-pane { transition: opacity .25s var(--ease), transform .5s var(--ease); }
/* closing navigation: back to the index only */
.back-index { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-block: clamp(40px, 6vw, 80px); border-top: 1px solid var(--line); margin-top: clamp(24px, 4vw, 48px); }
.back-index .eyebrow { margin: 0; }
/* final outputs gallery */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(240px, 44vw), 1fr)); gap: 14px; }
.gallery figure { margin: 0; display: grid; gap: 8px; }
.gallery figcaption { font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.gallery figcaption b { color: var(--acid); font-weight: 500; display: block; margin-bottom: 2px; }
.gallery .film { position: relative; overflow: hidden; background: #000; }
.gallery .film img, .gallery .film picture, .gallery .film video { width: 100%; height: 100%; object-fit: contain; }
.gallery .frame img { object-fit: contain; background: #0e0e0c; }
/* category groups */
.groups { display: grid; gap: 26px; }
.group-h { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 10px; }
.group-h b { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--acid); }
.group-h span { color: var(--muted); font-size: 13.5px; text-align: end; }
.group-row { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; }
.group-row .frame img { object-fit: cover; }
.group-row .frame.contain img { object-fit: contain; background: #f1ece4; }
/* voice */
.voice { display: grid; gap: 12px; }
.voice li { list-style: none; display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; }
.voice b { font: 500 10.5px/1.2 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg); }
.voice p { margin: 0; color: var(--muted); font-size: 14px; }
.voice audio { width: 100%; height: 34px; }
@media (max-width: 899px) { .group-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .voice li { grid-template-columns: 1fr; } }
/* 4:5 hero sources keep their frame */
.pv-fg--45 { aspect-ratio: 4 / 5; }
/* grids and galleries never leave an orphan: column count follows item count */
@media (min-width: 901px) {
  .out-grid:has(> figure:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .out-grid:has(> figure:nth-child(5):last-child) { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .gallery:has(> figure:nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 980px; }
  .gallery:has(> figure:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gallery:has(> figure:nth-child(1):last-child) { grid-template-columns: minmax(0, 300px); }
}
.gallery + .gallery { margin-top: 28px; }
.gallery { align-items: end; }
@media (min-width: 901px) {
  .gallery:has(> figure:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 760px; }
  .gallery:has(> figure:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery:has(> figure:nth-child(7):last-child), .gallery:has(> figure:nth-child(8):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .frames--wide:has(> figure:nth-child(2):last-child), .frames--wide:has(> figure:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .frames--wide:has(> figure:only-child) { grid-template-columns: minmax(0, 760px) !important; }
  .frames:not(.frames--wide):has(> figure:only-child) { grid-template-columns: minmax(0, 340px); }
}
/* final-output rows: every item in a row shares one height, widths follow the true ratio */
@media (min-width: 901px) {
  .gallery.gallery--row { display: flex; gap: 14px; align-items: flex-start; max-width: none; }
  .gallery--row > figure { flex: var(--g, 1) 1 0; min-width: 0; }
  .gallery--row:has(> figure:only-child) > figure { flex: 0 0 auto; width: min(340px, calc(var(--g) * 520px)); }
}
.variants { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 900px) { .gallery.gallery--row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- hero-media system: one container rule for every project hero and final film ---------- */
:root { --media-max-h: min(74vh, 760px); }
.p-hero { overflow: clip; padding-bottom: clamp(24px, 4vh, 48px); }
.p-media, .p-media--strip, .p-media--vertical {
  width: min(100%, calc(var(--media-max-h) * 16 / 9)) !important;
  max-height: var(--media-max-h); margin-inline: auto; position: relative; overflow: hidden; contain: paint;
}
.p-media--strip .frame:nth-child(even) { transform: none; }
.p-media img, .p-media picture { width: 100%; height: 100%; object-fit: cover; }
.final-stage { padding-inline: var(--gutter); padding-block: 0; overflow: clip; }
.film--bleed { width: min(100%, calc(var(--media-max-h) * 16 / 9), 1360px); max-height: var(--media-max-h); margin-inline: auto; }
.film--vertical { height: min(var(--media-max-h), 720px); }
.final--vertical .final-stage { background: transparent; }
section { overflow-x: clip; }
@media (max-width: 900px) {
  :root { --media-max-h: 62svh; }
  .final-stage { padding-inline: var(--gutter); }
  .film--vertical { height: auto; width: min(100%, calc(62svh * 9 / 16)); margin-inline: auto; }
}

/* contained carousel (character sheets): the whole sheet always fits */
.carousel--contain .sheet-rail .frame { background: #0e0e0c; max-height: var(--media-max-h); }
.frame--contain img, .frame--contain picture { object-fit: contain !important; }
.frame--contain { background: #0e0e0c; }

/* gameplay → film dunk */
.dunk-stage { position: relative; overflow: hidden; background: #000; width: min(100%, calc(var(--media-max-h) * 16 / 9)); margin-inline: auto; }
.dunk-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dunk-b { clip-path: inset(0 0 0 100%); transition: clip-path .7s var(--ease); }
.dunk.is-b .dunk-b { clip-path: inset(0 0 0 0); }
.dunk-tag { position: absolute; left: 14px; top: 14px; z-index: 2; font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; padding: 7px 9px; background: rgba(0,0,0,.6); color: #fff; transition: opacity .4s; }
.dunk-tag--b { color: var(--acid); opacity: 0; }
.dunk.is-b .dunk-tag--a { opacity: 0; } .dunk.is-b .dunk-tag--b { opacity: 1; }
.dunk-bar { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; width: min(100%, calc(var(--media-max-h) * 16 / 9)); margin-inline: auto; }
.dunk-bar i { flex: 0 0 40px; height: 1px; background: var(--line, #333); }
.dunk-step, .dunk-replay { font: 500 11px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: none; border: 1px solid transparent; padding: 8px 10px; cursor: pointer; }
.dunk-step .n { color: var(--muted); margin-right: 8px; }
.dunk-step.is-on { color: var(--fg, #fff); border-color: var(--acid); } .dunk-step.is-on .n { color: var(--acid); }
.dunk-replay { margin-left: auto; border-color: #333; }

/* packshot slots: one card size, intentional crops */
.slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.slots figure { display: grid; gap: 8px; margin: 0; }
.slots figcaption { font: 500 10.5px/1.35 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.slots figcaption b { display: block; color: var(--acid); font-weight: 500; }
@media (max-width: 900px) { .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* lifestyle strip: five frames, the active one grows slightly */
.strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: center; }
.strip figure { margin: 0; display: grid; gap: 8px; transition: transform .45s var(--ease), opacity .45s; transform-origin: center; }
.strip:has(figure.is-on) figure:not(.is-on) { opacity: .62; }
.strip figure.is-on { transform: scale(1.06); z-index: 1; }
.strip figcaption { font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.strip figcaption .n { color: var(--acid); margin-right: 6px; }
@media (max-width: 900px) { .strip { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-block: 12px; } .strip figure { flex: 0 0 46%; scroll-snap-align: center; } }

/* plan: whole drawing, opens full size */
.plan { margin: 0; display: grid; gap: 8px; }
.plan-link { position: relative; display: block; }
.plan-zoom { position: absolute; right: 10px; bottom: 10px; font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(0,0,0,.7); color: #fff; padding: 7px 9px; }
.plan figcaption { font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.plan .frame { background: #fff; }

/* packaging: clean source crops shown at native size, never upscaled */
.packaging { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.packaging figure { margin: 0; display: grid; gap: 8px; flex: 0 1 var(--w); min-width: 0; }
.packaging figcaption { font: 500 10.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.final--library .final-meta { padding-top: clamp(48px, 8vh, 96px); }
.takes--wide:has(> figure:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.dunk-stage video { opacity: 1 !important; visibility: visible !important; }
.packaging { flex-wrap: nowrap; align-items: flex-start; }
.packaging figure { flex: var(--g) 1 0; max-width: var(--w); }
@media (max-width: 900px) { .packaging { flex-wrap: wrap; } .packaging figure { flex: 1 1 100%; } .packaging figure:first-child { flex-basis: 40%; } }
.takes--wide:has(> figure:nth-child(5):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
@media (min-width: 901px) { .slots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 620px; } }

/* ---------- final: closing text beside the film ---------- */
.final-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: clamp(24px, 4vw, 64px); align-items: center; padding-block: clamp(56px, 9vh, 112px) clamp(24px, 4vh, 48px); }
.final-split--text { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
.final-split--text .final-text { display: contents; }
.final-split--text .stage-head { grid-column: 1; } .final-split--text .final-sum { grid-column: 1; }
.final-split--text .facts, .final-split--text .final-note { grid-column: 2; }
.final-split--text .facts { grid-row: 1 / span 2; }
.final-text { display: grid; gap: 18px; align-content: center; }
.final-sum { color: var(--muted); max-width: 44ch; font-size: 15px; line-height: 1.55; margin: 0; }
.final-note { margin: 0; font: 500 10.5px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--acid); }
.final-media { min-width: 0; }
.final-media .film--bleed { width: 100% !important; max-height: var(--media-max-h); margin: 0; }
.final-media .film--vertical { height: min(var(--media-max-h), 720px) !important; width: auto !important; aspect-ratio: 9 / 16; margin-inline: auto; }
.final--vertical .final-split { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.final-meta { display: none; }
@media (max-width: 900px) {
  .final-split, .final-split--text, .final--vertical .final-split { grid-template-columns: 1fr; }
  .final-split--text .final-text { display: grid; }
  .final-split--text .facts, .final-split--text .stage-head, .final-split--text .final-sum, .final-split--text .final-note { grid-column: 1; grid-row: auto; }
  .final-media .film--vertical { height: auto !important; width: min(100%, calc(66svh * 9 / 16)) !important; }
}
/* edit payoff: the last frame of the timeline is the player */
.asm-final .play { opacity: 0; transition: opacity .35s; }
.ho-assemble.is-arrived .asm-final-frame { pointer-events: auto; }
.ho-assemble.is-arrived .asm-final .play { opacity: 1; }
.asm-final-frame.film { position: relative; }
.asm-final-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* location marker shows only once its image is on screen */
.ho-src:not(.is-loaded) .ho-mark { opacity: 0 !important; box-shadow: none; }

/* ---------- compact process media: every visual fits beside or under its text ---------- */
:root { --proc-h: min(60vh, 640px); }
.stage-visual .frame, .stage-visual .compare { max-width: calc(var(--proc-h) * var(--ar, 1)); }
.stage-visual .compare { margin-inline: auto; width: 100%; }
.stage-visual > .frame, .stage-visual .boards .frame, .stage-visual .plan .frame { margin-inline: auto; }
.stage-visual .compare[style*="16 / 9"] { max-width: min(720px, calc(var(--proc-h) * 16 / 9)); }
.sheet-rail .frame { max-width: none; }
.carousel--contain .sheet-rail .frame { max-height: var(--proc-h); }
.dunk-stage { width: min(100%, calc(var(--proc-h) * 16 / 9)); }
.dunk-bar { width: min(100%, calc(var(--proc-h) * 16 / 9)); }
@media (max-width: 900px) { :root { --proc-h: 58svh; } }
.group-row .frame { position: relative; }
.group-row .frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame .expand { position: absolute; right: 8px; bottom: 8px; z-index: 2; font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(0,0,0,.65); color: #fff; padding: 6px 8px; text-decoration: none; }

/* vertical heroes: no box, no blurred copy; the image sits on the page background */
.p-media.p-media--vert { display: flex; justify-content: center; align-items: flex-end; gap: clamp(10px, 1.4vw, 18px); background: none; width: 100% !important; max-height: none; overflow: visible; contain: none; }
.p-media--vert .pv-main { height: min(var(--media-max-h), 720px); width: auto; flex: 0 0 auto; background: none; }
.p-media--vert .pv-main img { width: 100%; height: 100%; object-fit: cover; }
.pv-series { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; align-self: flex-end; width: min(40%, 520px); }
.pv-series figure { margin: 0; display: grid; gap: 6px; }
.pv-series figcaption { font: 500 10px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (max-width: 900px) {
  .p-media.p-media--vert { flex-direction: column; align-items: center; }
  .p-media--vert .pv-main { height: auto; width: min(100%, calc(58svh * 4 / 5)); }
  .pv-series { width: 100%; }
}
.group-row.group-row--mosaic { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, .87fr); gap: 8px; }
.group-row--mosaic > .frame:first-child { grid-row: span 2; }
.group-row .frame.contain { background: none !important; padding: 0 !important; }
.stage-visual .compare { max-width: calc(min(48vh, 520px) * var(--ar, 1)); }
.stage-visual .compare[style*="16 / 9"] { max-width: min(720px, calc(min(48vh, 520px) * 16 / 9)); }

/* ---------- mobile fixes (review 10 Nov) ---------- */
.stage > * { min-width: 0; }
.frag { max-width: 100%; }
@media (max-width: 899px) {
  .canvas-wrap[data-mode="handoff"] { opacity: 1; }
  .canvas-wrap[data-mode="handoff"] .canvas { opacity: .5; }
  .ho-outs figcaption, .ho-out figcaption { display: none; }
  .ho-caps { gap: 10px; }
}
/* mobile hero: the film fills the screen; the kicker sits just under it */
@media (max-width: 899px) {
  .hero { --inset-bottom: 15svh; }
  .hero-foot { bottom: clamp(16px, 3svh, 28px); }
}
/* mobile hero: less zoom, framed on Beno's face rather than the frame centre */
@media (max-width: 899px) and (orientation: portrait) {
  .hero-stage { width: max(100%, calc(76svh * 2.302)); transform: translate(-63%, -50%); }
}
.sheet-single { margin: 0; display: grid; gap: 10px; }
.sheet-single figcaption { font: 500 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.contact a { display: inline-grid; gap: 6px; color: var(--text); transition: border-color .2s, color .2s; }
.contact a .k { font: 500 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact a:hover, .contact a:focus-visible { color: var(--acid); border-color: var(--acid); }
