/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: #0b0b0c;
  color: #141414;
  font-family: 'Inter Tight', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
a { color: inherit; }
.mono, .label, .gk, .sc { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }

/* ---------- Track ---------- */
.track {
  display: flex;
  height: 100vh; height: 100dvh;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  outline: none;
}
.track::-webkit-scrollbar { display: none; }

.panel {
  flex: 0 0 auto;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(16px, 3vh, 32px);
  padding: clamp(72px, 11vh, 112px) clamp(32px, 5vw, 88px) clamp(88px, 13vh, 132px);
}
.w60  { width: max(60vw, 620px); }
.w80  { width: max(80vw, 820px); }
.w100 { width: 100vw; }
.w140 { width: max(140vw, 1400px); }

/* ---------- Reveal ---------- */
.js .r { opacity: 0; transform: translateX(48px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 90ms); }
.js .in .r { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .r { transform: none; transition: opacity .3s; } }
/* Text follows the scroll instead: --t (set in main.js) fades each line up as it nears mid-screen */
.js .in .r.txt { opacity: var(--t, 1); transform: translateX(calc((1 - var(--t, 1)) * 40px)); transition: opacity .25s linear, transform .25s linear; }
@media (prefers-reduced-motion: reduce) { .js .in .r.txt { opacity: 1; transform: none; } }

/* ---------- HUD ---------- */
.hud, .chapters, .hint, .progress { position: fixed; z-index: 10; color: #fff; mix-blend-mode: difference; }
.hud { top: 0; left: 0; right: 0; display: flex; justify-content: space-between; padding: 24px clamp(32px, 5vw, 88px); font-weight: 600; pointer-events: none; }
.hud a { pointer-events: auto; text-decoration: none; letter-spacing: -.01em; }
.hud-chapter { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 400; }
.hud-chapter #hudNum { opacity: .55; margin-right: 8px; }
.chapters { bottom: 26px; left: clamp(32px, 5vw, 88px); display: flex; gap: 20px; }
.chapters button { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .45; transition: opacity .2s; padding: 4px 0; }
.chapters button:hover, .chapters button[aria-current="true"] { opacity: 1; }
.hint { bottom: 26px; right: clamp(32px, 5vw, 88px); font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 0; transition: opacity .4s; }
.hint span { display: inline-block; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(6px); } }
.hint.gone { opacity: 0; }
.progress { left: 0; right: 0; bottom: 0; height: 3px; }
.progress i { display: block; height: 100%; background: #fff; transform-origin: left; transform: scaleX(0); }

/* ---------- Shared bits ---------- */
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(32px, 5vw, 96px); align-items: center; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 3vw, 56px); align-items: center; }
.frame { position: relative; }
.frame img, .frame video { display: block; width: 100%; max-height: 62vh; object-fit: cover; }
.specs-title .frame video { aspect-ratio: 16 / 9; }
.frame.wide { align-self: flex-start; }
.frame.wide img { width: auto; max-height: 46vh; object-fit: contain; }
figcaption { margin-top: 12px; opacity: .7; text-transform: none; letter-spacing: 0; font-size: 12px; }
.body { font-size: clamp(16px, 1.25vw, 20px); max-width: 38em; }
.dim { opacity: .6; }
.big { font-size: min(5.6vw, 9vh); line-height: .98; letter-spacing: -.03em; font-weight: 600; }
.mid { font-size: min(3.4vw, 6vh); line-height: 1.05; letter-spacing: -.025em; font-weight: 600; max-width: 22em; }
.quote { font-size: min(2.8vw, 5vh); line-height: 1.15; letter-spacing: -.02em; max-width: 20em; }
.meta-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; }
.meta-list dt { opacity: .55; }
.strip { display: flex; gap: 20px; align-items: center; height: 56vh; }
.strip img { height: 100%; width: auto; max-width: none; object-fit: cover; }
.strip img.tall { height: 72%; }

/* ---------- Paper (cover / close) ---------- */
.t-paper { background: #f2efe8; color: #141414; }
.kicker { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.cover h2 { font-size: min(8vw, 14vh); line-height: .92; letter-spacing: -.045em; font-weight: 600; }
.about h1 em, .cover h2 em, .close h2 em { font-family: 'Instrument Serif', serif; font-weight: 400; font-style: italic; letter-spacing: -.02em; }
/* Reel */
.t-reel { background: #0b0b0c; color: #ececec; }
/* Full-bleed film panels: reel, SPECS slide overview, Meta sizzle */
.film-panel { padding: 0; background: #000; }
.film-panel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.film-panel.fit-contain video { object-fit: contain; }
.film-label { position: absolute; left: clamp(32px, 5vw, 88px); bottom: clamp(88px, 13vh, 132px); z-index: 1; color: #fff; opacity: .8; text-shadow: 0 1px 12px #0008; pointer-events: none; }
/* About */
.about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 5vw; align-items: center; position: relative; z-index: 1; }
.about-copy { display: flex; flex-direction: column; gap: 3vh; }
.about h1 { font-size: min(7.6vw, 13vh); line-height: .92; letter-spacing: -.045em; font-weight: 600; }
.about-media { position: relative; height: 68vh; }
.portrait { position: absolute; inset: 0 6% 0 14%; }
.portrait img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.badge { position: absolute; left: 0; bottom: 9%; z-index: 2; }
.badge > div { background: #141414; color: #f2efe8; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; max-width: 290px; box-shadow: 0 24px 60px #14141433; }
.badge b { font-size: 18px; line-height: 1.2; letter-spacing: -.01em; font-weight: 500; }
.badge .mono { opacity: .7; }
.chip { position: absolute; right: 0; top: 7%; z-index: 2; }
.chip span { display: block; background: #f2efe8; border: 1px solid #141414; border-radius: 999px; padding: 8px 14px; }
/* Path */
.journey { display: grid; grid-template-columns: 1fr 1.15fr; gap: 5vw; align-items: center; }
.journey .kicker { margin-bottom: 3vh; }
.path-line { list-style: none; display: flex; flex-direction: column; position: relative; padding-left: 34px; }
.path-line::before { content: ''; position: absolute; left: 6px; top: 1.2vh; bottom: 1.2vh; width: 1.5px; background: #141414; transform-origin: top; transform: scaleY(0); transition: transform 1.4s cubic-bezier(.4,0,.2,1) .2s; }
.in .path-line::before, html:not(.js) .path-line::before { transform: none; }
.path-line li { position: relative; display: flex; align-items: baseline; gap: 1.6vw; padding: 1.3vh 0; cursor: default; outline: none; }
.path-line li::before { content: ''; position: absolute; left: -34px; top: calc(1.3vh + .45em); width: 13px; height: 13px; border-radius: 50%; background: #f2efe8; border: 1.5px solid #141414; transition: background .2s; }
.path-line li:last-child::before, .path-line li.on::before { background: #141414; }
.path-line .mono { opacity: .6; flex: 0 0 15em; white-space: nowrap; }
.path-line b { font-size: min(3.2vw, 5.6vh); line-height: 1.02; letter-spacing: -.03em; font-weight: 600; transition: opacity .2s; }
.path-line:has(li.on) li:not(.on) b { opacity: .35; }
/* Photo stack: fanned and overlapping, each card drifts with the scroll by its own amount */
.j-stack { position: relative; height: 68vh; }
.j-stack figure { position: absolute; width: 44%; aspect-ratio: 4 / 5; margin: 0; overflow: hidden; box-shadow: 0 24px 60px #14141433; transition: z-index 0s, box-shadow .3s; }
.j-stack img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.j-stack figure:nth-child(1) { left: 0;   top: 4%;  --rot: -5deg; --s: .6; z-index: 1; }
.j-stack figure:nth-child(2) { left: 16%; top: 22%; --rot: 3deg;  --s: 1.4; z-index: 2; }
.j-stack figure:nth-child(3) { left: 32%; top: 0;   --rot: -2deg; --s: .9; z-index: 3; }
.j-stack figure:nth-child(4) { left: 46%; top: 26%; --rot: 4deg;  --s: 1.7; z-index: 4; width: 52%; aspect-ratio: 16 / 10; }
.j-stack figure:nth-child(5) { left: 56%; top: 2%;  --rot: -3deg; --s: 1.1; z-index: 5; width: 44%; aspect-ratio: 16 / 11; }
.js .in .j-stack figure.r { transform: translate3d(calc(var(--p, 0) * var(--s) * -6vw), 0, 0) rotate(var(--rot)); }
.j-stack figure.logo-card { background: #dd5e4d; display: grid; place-items: center; }
.j-stack figure.logo-card img { width: 46%; height: auto; object-fit: contain; }
.j-stack figure.on { z-index: 10; box-shadow: 0 32px 80px #14141455; }
.j-stack figure.on img { transform: scale(1.04); }
.path-line i { font-style: normal; font-family: 'Instrument Serif', serif; font-weight: 400; }
.background { justify-content: flex-end; }
.bg-cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 3vw; position: relative; z-index: 1; }
.ph { aspect-ratio: 4 / 3; max-height: 38vh; width: 100%; margin-bottom: 2.4vh; display: flex; align-items: flex-end; padding: 12px; border: 1.5px dashed #14141455; background: repeating-linear-gradient(135deg, #e6e1d6 0 12px, #ece8df 12px 24px); }
.ph:has(img) { padding: 0; border: 0; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.logos { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 0; padding: 0; border: 0; background: none; align-items: stretch; }
.logos li { display: flex; align-items: center; justify-content: center; padding: 9% 22%; min-height: 0; }
.background .ph { max-height: 56vh; }
/* Teaching: YouTube channel first, the Domestika course overlapping it; both sized to their own shape, never cropped */
.ph.duo { display: grid; position: relative; aspect-ratio: auto; max-height: none; height: auto; background: none; padding: 0; border: 0; }
.ph.duo a { grid-area: 1 / 1; display: block; transition: transform .3s; }
.ph.duo a:hover { transform: translateY(-4px); }
.ph.duo img { width: 100%; height: auto; display: block; object-fit: contain; box-shadow: 0 18px 50px #14141433; }
.duo-yt { width: 46%; justify-self: start; align-self: start; z-index: 2; }
.duo-dom { width: 70%; justify-self: end; align-self: start; margin-top: 16%; z-index: 1; }
.duo-yt:hover, .duo-dom:hover { z-index: 3; }
.logos li.wide { grid-column: span 2; padding: 0 10%; }
/* The wordmark is very wide and thin (306×44): size it by width so it doesn't collapse */
.logos li.wide img { width: 100%; height: auto; max-height: none; }
.logos img { width: 100%; height: 100%; object-fit: contain; filter: grayscale(1) contrast(1.15); opacity: .8; transition: filter .3s, opacity .3s; }
.logos li:hover img { filter: none; opacity: 1; }
.ph span { font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.bg-cols > div { padding-top: 0; }
.bg-cols h4 { border-top: 1px solid #14141433; padding-top: 14px; }
.bg-cols h4 { font-size: clamp(18px, 1.5vw, 24px); letter-spacing: -.015em; line-height: 1.15; margin-bottom: 10px; }
.bg-cols p { font-size: 15px; opacity: .8; }

/* Parallax + overlapping floats */
[data-speed] { transform: translate3d(var(--px, 0px), 0, 0); will-change: transform; }
.float { position: absolute; z-index: 3; pointer-events: none; }
.float img { width: 100%; box-shadow: 0 30px 80px #0008; }
.specs-title .over { position: relative; z-index: 2; }
.specs-title .frame { z-index: 1; }
.f-meta { left: 31vw; top: 60vh; width: 15vw; }
.f-meta img { outline: 1px solid var(--line); outline-offset: 8px; }

.cover-foot { display: grid; grid-template-columns: 1.2fr 1fr; gap: 5vw; align-items: end; margin-top: 2vh; }
.lede { font-size: clamp(17px, 1.4vw, 22px); max-width: 30em; }
.toc { list-style: none; border-top: 1px solid #1414142a; }
.toc li { border-bottom: 1px solid #1414142a; }
.toc button { width: 100%; padding: 12px 0; font-size: clamp(15px, 1.15vw, 18px); transition: padding .25s; }
.toc button:hover { padding-left: 10px; }
.toc b { font-family: 'JetBrains Mono', monospace; font-weight: 400; font-size: 12px; opacity: .5; margin-right: 14px; }
.cols3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(24px, 4vw, 72px); }
.cols3 .num { font-family: 'Instrument Serif', serif; font-size: min(8vw, 13vh); line-height: 1; display: block; margin-bottom: 2vh; color: #b8b2a5; }
.cols3 h3 { font-size: clamp(22px, 2vw, 32px); letter-spacing: -.02em; margin-bottom: 10px; }
.cols3 p { font-size: clamp(15px, 1.15vw, 18px); opacity: .8; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr auto; gap: 5vw; align-items: center; }
.contact-copy { display: flex; flex-direction: column; min-width: 0; }
.contact-photo { margin: 0; height: 76vh; aspect-ratio: 1365 / 2048; overflow: hidden; border-radius: 4px; }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; }
.contact-mail { font-size: min(6vw, 11vh); line-height: 1; letter-spacing: -.045em; font-weight: 600; color: inherit; text-decoration: none; align-self: flex-start; border-bottom: 2px solid currentColor; padding-bottom: .06em; margin: 1vh 0 4vh; }
.contact-list { list-style: none; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 3vw; max-width: 1400px; }
.contact-list li { display: grid; grid-template-columns: 11em 1fr; gap: 1.5vw; align-items: baseline; padding: 1.6vh 0; border-top: 1px solid #14141433; }
.contact-list .mono { opacity: .55; }
.contact-list a { color: inherit; text-decoration: none; font-size: clamp(17px, 1.4vw, 24px); letter-spacing: -.01em; }
.contact-list a i { font-style: normal; opacity: .4; transition: opacity .2s, transform .2s; display: inline-block; }
.contact-list a:hover i { opacity: 1; transform: translate(2px, -2px); }
.contact-mail:hover, .contact-list a:hover { opacity: .7; }

/* ---------- 01 SPECS: LED black + acid ---------- */
.t-specs { --accent: #ffffff; background: #050505; color: #ececec; }
.t-specs .accent { color: var(--accent); }
.t-specs .mono { font-size: 12px; }
.led { position: absolute; inset: 0; background-image: radial-gradient(circle, #ffffff14 1px, transparent 1.4px); background-size: 9px 9px; mask-image: linear-gradient(90deg, #000 0%, transparent 70%); pointer-events: none; }
.specs-word { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: min(15vw, 26vh); line-height: .8; letter-spacing: -.06em; color: var(--accent); }
.specs-sub { font-size: min(3vw, 5vh); letter-spacing: -.02em; margin: 1vh 0 4vh; }
.specs-title .frame { outline: 1px solid #ffffff22; outline-offset: 10px; }
.t-specs .big, .t-specs .mid { font-family: 'Space Grotesk', sans-serif; letter-spacing: -.04em; }
/* ---------- Generative ---------- */
.t-gen { background: #0d0b14; color: #f1eefb; }
.t-gen .mono { opacity: .7; }
.gen-title { justify-content: flex-end; }
.gen-film { position: absolute; inset: 0; }
.gen-film video { width: 100%; height: 100%; object-fit: cover; }
.gen-film::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, #0d0b14e6 0%, #0d0b1466 45%, transparent 75%); }
.gen-copy { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2.4vh; }
.gen-copy h2 { font-size: min(8vw, 14vh); line-height: .92; letter-spacing: -.045em; font-weight: 600; }
.gen-copy h2 em { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -.02em; }
/* ---------- Rebuilt boards: images cropped from the originals, text set here ---------- */
.board-title { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2vh; }
.set-board { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3vh 1.4vw; }
.set-board li:nth-child(3n + 2) { transform: translateY(4vh); }
.js .in .set-board li.r:nth-child(3n + 2) { transform: translateY(4vh); }
.set-board img { width: 100%; height: auto; aspect-ratio: 1310 / 719; object-fit: cover; border-radius: 6px; }
.set-board b { display: block; margin-top: 1.2vh; font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 400; opacity: .45; }
.set-board span { display: block; font-size: clamp(14px, 1.1vw, 19px); letter-spacing: -.01em; font-weight: 500; }
.set-board em { display: block; font-style: normal; font-size: .82em; font-weight: 400; opacity: .55; }
.av-flow { background: #0a0b3a; color: #fff; padding: 3.4vh 2vw; }
.av-flow .board-title { opacity: .7; }
.av-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto 1fr 1.15fr auto 1.9fr; grid-template-areas: "a1 a2 a3 c1 a4 a5 x1 f" "b1 b2 . c2 . g x2 f"; gap: 3vh 1vw; align-items: start; }
.av-step img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
/* Upres and GFX tiles aren't square: keep their own shape */
.av-step[style="grid-area:a5"] img, .av-step[style="grid-area:g"] img { aspect-ratio: auto; }
.av-step b { display: block; margin-top: 1vh; font-size: clamp(12px, .95vw, 16px); font-weight: 500; line-height: 1.2; }
.av-step.final img { aspect-ratio: 943 / 1004; }
.av-step.final b { font-size: clamp(15px, 1.3vw, 22px); }
.av-chip, .av-arrow { align-self: center; justify-self: center; font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: .06em; opacity: .75; white-space: nowrap; }
.av-chip { border: 1px solid #ffffff55; border-radius: 999px; padding: 5px 10px; }
.av-chip i, .av-arrow { font-style: normal; font-size: 18px; }
.av-chip.up, .av-arrow.up { align-self: start; margin-top: -2vh; }

/* ---------- Collages (Futurhealth process, IPG avatars): white, so the boards' white margins vanish ---------- */
.t-gen.light { background: #fff; color: #111; }
.t-gen.light .mono { opacity: .55; }
.collage-panel { justify-content: flex-start; padding-top: clamp(72px, 11vh, 112px); }
.collage { position: relative; height: 74vh; margin-top: 3vh; }
.collage figure { position: absolute; margin: 0; transform: translate3d(var(--px, 0px), 0, 0) rotate(var(--rot, 0deg)); }
.collage > figure > img, .collage video { display: block; height: 100%; width: auto; }
.collage figcaption { margin-top: 1.2vh; opacity: .55; }
.collage .card { box-shadow: 0 30px 80px #0003, 0 4px 14px #0002; border-radius: 10px; overflow: hidden; }
.collage .card figcaption { position: absolute; left: 12px; bottom: 10px; margin: 0; color: #fff; opacity: .85; text-shadow: 0 1px 8px #000a; }
/* Process: board, tilted ComfyUI card over its corner, character sheet floating free */
.gen-process { width: max(100vw, calc(262vh + 10vw)); }
.c-set { left: 0; top: 0; width: 120vh; }
.c-comfy { left: 114vh; top: 48vh; height: 30vh; --rot: -3deg; z-index: 3; }
.c-sheet { left: 152vh; top: 2vh; height: 60vh; }
/* ComfyUI logo bubble on the card's top-right corner; the card lets it overflow */
.collage .c-comfy { overflow: visible; }
.c-comfy img:not(.tool-bubble img) { border-radius: 10px; }
.tool-bubble { position: absolute; top: -3.4vh; right: -3.4vh; z-index: 4; width: clamp(56px, 7.4vh, 96px); aspect-ratio: 1; border-radius: 50%; background: #fff; overflow: hidden; box-shadow: 0 14px 40px #0004; }
/* The logo is a full-bleed square tile; the circle crops it */
.tool-bubble img { display: block; width: 100%; height: 100% !important; object-fit: cover; }
.c-sheet img, .c-comfy img { height: 100%; }
.c-sheet img { height: calc(100% - 4vh); }
/* Avatars: the pair large, phone-shaped clips tilted over them, the process diagram as a card */
.gen-avatars { width: max(100vw, calc(322vh + 10vw)); }
.c-cover { left: 0; top: 0; height: 64vh; }
.c-ethan { left: 104vh; top: 10vh; height: 58vh; --rot: 4deg; z-index: 3; }
.c-max { left: 134vh; top: 0; height: 50vh; --rot: -3deg; z-index: 2; }
.phone { aspect-ratio: 9 / 16; border-radius: 22px; }
.phone video { width: 100%; height: 100%; object-fit: cover; }
.c-proc { left: 168vh; top: 6vh; width: min(148vh, 92vw); --rot: 1.5deg; }
.c-head { position: absolute; left: 0; bottom: 0; margin: 0; z-index: 4; color: #111; max-width: none; white-space: nowrap; }

/* ---------- Scroll scrub: --p runs 1 → 0 → -1 as a panel crosses the viewport (set in main.js) ---------- */
.scrub { transform: translate3d(calc(var(--p, 0) * -4vw), 0, 0) scale(calc(1 + var(--a, 0) * .14)); transform-origin: center; will-change: transform; }
.gen-film.scrub { transform: translate3d(calc(var(--p, 0) * 12vw), 0, 0) scale(calc(1.06 + var(--a, 0) * .1)); }
@media (prefers-reduced-motion: reduce) { .scrub, .gen-film.scrub { transform: none; } .js .in .j-stack figure.r { transform: rotate(var(--rot)); } }

/* Pipeline diagrams: drawn on the Figma frame's own coordinates */
.pipeline { align-items: center; }
.dg-tabs { display: flex; gap: 8px; align-self: flex-start; }
.dg-tabs button { padding: 8px 14px; border: 1px solid #ffffff33; border-radius: 999px; opacity: .55; transition: opacity .2s, border-color .2s; }
.dg-tabs button[aria-selected="true"] { opacity: 1; border-color: #fff; }
/* Hackerman: rises out of the bottom edge as the panel scrolls in (--p 1 → 0), only on tab A */
.hackerman { position: absolute; left: clamp(32px, 5vw, 88px); bottom: 0; z-index: 3; width: clamp(120px, 11vw, 210px); margin: 0; pointer-events: none;
  transform: translateY(calc(max(var(--p, 0), 0) * 115%)); transition: opacity .4s; }
.hackerman img { display: block; width: 100%; border-radius: 6px 6px 0 0; box-shadow: 0 -10px 40px #0009; }
.pipeline:not([data-on="0"]) .hackerman { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .hackerman { transform: none; } }
@media (max-width: 760px) { .hackerman { display: none; } }
/* Both diagrams share one cell; only the active one shows */
.diagrams { display: grid; place-items: center; }
.dg { grid-area: 1 / 1; margin: 0; opacity: 0; visibility: hidden; transition: opacity .5s, visibility 0s .5s; }
.dg.on { opacity: 1; visibility: visible; transition: opacity .5s; }
.dg svg { display: block; height: 66vh; max-width: 88vw; width: auto; aspect-ratio: var(--ar); overflow: visible; }
/* Sound toggle (added by main.js to films with audio) */
.repo-main { position: relative; }
.snd { position: absolute; right: 12px; bottom: 12px; z-index: 4; padding: 6px 11px; border-radius: 999px; background: #000a; color: #fff; border: 1px solid #ffffff40; font-size: 11px; backdrop-filter: blur(6px); }
.snd[aria-pressed="true"] { background: #fff; color: #000; }
.film-panel .snd { right: clamp(32px, 5vw, 88px); bottom: clamp(88px, 13vh, 132px); }
/* Click to play (tab C) */
.click-play { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: #0004; transition: opacity .25s; }
.click-play span { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; font-size: 20px; padding-left: 4px; box-shadow: 0 10px 40px #0008; }
.playing > .click-play { opacity: 0; pointer-events: none; }
.repo video { cursor: pointer; }

/* C: the toolkit, its repo walkthrough beside Render Array and Time Array */
.dg-repo { display: flex; flex-direction: column; align-items: center; gap: 2.4vh; }
.repo { display: flex; gap: 1.6vw; height: 62vh; }
.repo video { display: block; width: 100%; height: 100%; object-fit: cover; background: #111; }
.repo-main { height: 100%; aspect-ratio: 16 / 9; max-width: 64vw; border-radius: 8px; overflow: hidden; }
/* Two 4:5 clips stacked to the main video's height: each is (62vh - gap) / 2 tall */
.repo-side { display: flex; flex-direction: column; gap: 1.6vh; height: 100%; width: calc((62vh - 1.6vh) / 2 * 4 / 5); flex: 0 0 auto; }
.repo-side > div { position: relative; flex: 1; border-radius: 8px; overflow: hidden; }
.repo-side span { position: absolute; left: 10px; bottom: 8px; color: #fff; opacity: .85; text-shadow: 0 1px 8px #000a; }
.repo-link { color: #fff; opacity: .7; text-decoration: none; border-bottom: 1px solid #ffffff55; text-transform: none; letter-spacing: 0; }
.repo-link:hover { opacity: 1; }
.dg text { font-family: 'Space Grotesk', sans-serif; fill: #fff; text-anchor: middle; }
.dg .h { font-size: 40px; font-weight: 700; letter-spacing: -.88px; }
.dg .t { font-size: 22px; letter-spacing: .22px; }
.dg .t.b { font-weight: 700; fill: #d9d9d9; }
.dg .t.l { font-size: 30px; text-anchor: start; }
.dg .t.s { font-size: 17px; }
.dg .t.st { text-anchor: start; }
.dg .t.sm { font-size: 18px; letter-spacing: 0; }
.dg .rule { fill: none; stroke: #ffffff40; stroke-width: 2; }
.dg .c { fill: none; stroke: #fff; stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.dg .c.g { stroke: #8d8d93; }
.dg .c.d { stroke-dasharray: 10 10; stroke-dashoffset: 0; }
.dg .c.done { marker-end: url(#ah); }
.dg .c.g.done { marker-end: url(#ahg); }
.dg .c.m0.done { marker-end: none; }
.dg .p { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-dasharray: .015 .985; stroke-dashoffset: 1; opacity: 0; pointer-events: none; }
.dg .n { opacity: 0; transform: translateY(18px); transform-box: fill-box; }
.js .dg.play .c { stroke-dashoffset: 0; transition: stroke-dashoffset .7s cubic-bezier(.4,0,.2,1) calc(var(--i) * 160ms + 200ms); }
.js .dg.play .c.d { transition: none; }
.js .dg.play .n { opacity: 1; transform: none; transition: opacity .5s calc(var(--i) * 160ms + 200ms), transform .5s cubic-bezier(.2,.7,.2,1) calc(var(--i) * 160ms + 200ms); }
.js .dg.play .p { animation: dg-pulse 3.2s linear calc(var(--i) * 160ms + 1.4s) infinite; }
@keyframes dg-pulse { 0% { stroke-dashoffset: 1; opacity: .9; } 100% { stroke-dashoffset: 0; opacity: .9; } }
html:not(.js) .dg .c, html:not(.js) .dg .n { opacity: 1; transform: none; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .dg .c { stroke-dashoffset: 0; marker-end: url(#ah); } .dg .c.g { marker-end: url(#ahg); } .dg .c.m0 { marker-end: none; }
  .dg .n { opacity: 1; transform: none; } .dg .p { display: none; }
}
.specs-title .stat-grid { position: relative; z-index: 2; margin-top: 5vh; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.specs-title .stat-grid b { font-size: min(3vw, 5.4vh); }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2vw; }
.stat-grid div { border-left: 1px solid #ffffff2a; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.stat-grid b { font-family: 'Space Grotesk', sans-serif; font-size: min(4.4vw, 8vh); letter-spacing: -.04em; line-height: 1; color: var(--accent); font-weight: 500; white-space: nowrap; }
.stat-grid span { text-transform: none; letter-spacing: 0; opacity: .7; }
.tools figcaption { color: #ececec; }
.takeaway .quote { font-family: 'Space Grotesk', sans-serif; }

/* ---------- 02 META: slate, framed type, connecting lines ---------- */
.t-meta { --line: #e6ebf13d; background: #1a1f26; color: #e6ebf1; }
.t-meta .label { opacity: .6; }
.tick { position: absolute; width: 14px; height: 14px; border: 0 solid #e6ebf1; }
.tick.tl { top: -1px; left: -1px; border-top-width: 1.5px; border-left-width: 1.5px; }
.tick.tr { top: -1px; right: -1px; border-top-width: 1.5px; border-right-width: 1.5px; }
.tick.bl { bottom: -1px; left: -1px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.tick.br { bottom: -1px; right: -1px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.meta-title { flex-direction: row; align-items: center; gap: 5vw; }
.framed { position: relative; border: 1px solid var(--line); padding: 4vh 3vw; z-index: 1; background: #1a1f26; flex: 0 0 auto; }
.framed h2 { font-size: min(5.4vw, 10vh); line-height: .95; letter-spacing: -.035em; font-weight: 500; margin-top: 2vh; }
.framed h2 span { display: block; font-size: .42em; letter-spacing: -.015em; opacity: .7; margin-top: 2vh; font-weight: 400; }
.lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lines path { fill: none; stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 2400; stroke-dashoffset: 2400; transition: stroke-dashoffset 2.4s ease .3s; }
.in .lines path { stroke-dashoffset: 0; }
.meta-side { flex: 1; display: flex; flex-direction: column; gap: 3vh; z-index: 1; }
.meta-side .frame img { max-height: 52vh; }
.t-meta .big { font-weight: 500; }
/* Two systems stacked: a label, then three of that section's renders */
.sys { display: flex; flex-direction: column; gap: 3vh; }
.sys article { position: relative; padding: 2.6vh 2vw; display: grid; grid-template-columns: 13vw 1fr; gap: 2vw; align-items: center; }
.sys h4 { font-size: clamp(22px, 2vw, 34px); letter-spacing: -.02em; font-weight: 500; line-height: 1.05; }
.sys-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1vw; }
.sys-row video { display: block; width: 100%; aspect-ratio: 1600 / 714; object-fit: cover; background: #000; }
.sys-a { border: 1px solid var(--line); }
.sys-b { background: linear-gradient(135deg, #ffd2b0 0%, #ff9fa6 45%, #b9a3ff 100%); color: #24151f; border-radius: 22px; }
.sys-b video { border-radius: 10px; }
.bts .pair { grid-template-columns: 1fr; }
.bts .frame img { max-height: 70vh; }

/* ---------- 03 GOOGLE PLAY GAMES: bright, geometric ---------- */

/* ---------- 04 DISNEY+: deep blue, cinematic ---------- */
.t-disney { background: radial-gradient(120% 90% at 80% 110%, #1d4fd1 0%, #0b1f6b 38%, #040a2a 75%); color: #f1f4ff; }
.t-disney .sc { color: #9fb8ff; }
.stars { position: absolute; inset: 0; background-image: radial-gradient(1px 1px at 12% 18%, #fff9, transparent), radial-gradient(1px 1px at 72% 12%, #fff8, transparent), radial-gradient(1.5px 1.5px at 38% 64%, #fff6, transparent), radial-gradient(1px 1px at 88% 44%, #fffa, transparent), radial-gradient(1px 1px at 22% 82%, #fff7, transparent), radial-gradient(1.5px 1.5px at 56% 30%, #fff8, transparent); pointer-events: none; }
.t-disney h2, .t-disney .big, .t-disney .huge { font-family: 'Instrument Serif', serif; font-weight: 400; letter-spacing: -.02em; }
.t-disney h2 em, .t-disney .quote { font-family: 'Instrument Serif', serif; font-style: italic; }
/* Film panel carries the title; the copy sits bottom-left over a fade */
.dis-film::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, #040a2acc 0%, transparent 45%); pointer-events: none; }
.dis-copy { position: absolute; left: clamp(32px, 5vw, 88px); bottom: clamp(88px, 13vh, 132px); z-index: 2; display: flex; flex-direction: column; gap: 2vh; }
.dis-copy h2 { font-size: min(4.6vw, 8.6vh); line-height: 1; }
/* Work panel: outcome + system steps beside placements (top row) and system sheets (bottom row) */
.dis-cols { position: relative; z-index: 1; display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: center; }
.dis-side { display: flex; flex-direction: column; gap: 1.6vh; }
.dis-side .huge { font-size: min(10vw, 18vh); line-height: .9; }
.dis-side .huge i { font-style: normal; color: #9fb8ff; }
.dis-steps-v { list-style: none; margin-top: 4vh; display: flex; flex-direction: column; }
.dis-steps-v li { font-family: 'Instrument Serif', serif; font-size: clamp(22px, 2vw, 34px); padding: 1.2vh 0; border-top: 1px solid #9fb8ff55; }
.dis-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; gap: 1.2vh; height: 70vh; }
.dis-grid img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.dis-grid img.sys { object-fit: contain; background: #f1f4ff; }
.friction { list-style: none; display: flex; flex-direction: column; }
.friction li { font-family: 'Instrument Serif', serif; font-size: min(3.4vw, 6vh); line-height: 1.15; padding: 1.4vh 0; border-bottom: 1px solid #ffffff22; }
.friction li:first-child { border-top: 1px solid #ffffff22; }

/* ---------- 05 DENTSU: the films' cool grey, so they sit seamlessly on the page ---------- */
.t-dentsu { background: #b5bac1; color: #111; }
.t-dentsu .mono { opacity: .7; }
.dentsu-title h2 { font-size: min(5.6vw, 10vh); line-height: .96; letter-spacing: -.04em; font-weight: 500; margin: 2.4vh 0 4vh; }
.dentsu-hero { margin: 0; justify-self: end; position: relative; height: 72vh; aspect-ratio: 1; }
.dentsu-hero video { width: 100%; height: 100%; object-fit: cover; display: block; }
.dentsu-cols { display: grid; grid-template-columns: auto 1fr; gap: 4vw; align-items: center; }
.trend-grid { display: grid; grid-template-columns: repeat(3, 23vh); gap: 1vh; }
.trend-grid figure { position: relative; margin: 0; aspect-ratio: 1; }
.trend-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.trend-grid span { position: absolute; left: 8px; top: 6px; font-size: 11px; }
.dentsu-side { display: flex; flex-direction: column; gap: 5vh; }
.dentsu-side figure { margin: 0; }
.dentsu-side img, .dentsu-side video { display: block; width: 100%; height: auto; }
.dentsu-side figcaption { margin-top: 1.2vh; opacity: .7; }
.agency-grid { display: grid; grid-template-columns: repeat(2, min(calc(34vh * 16 / 9), 43vw)); gap: 1.6vh; justify-content: start; }
.agency-grid figure { position: relative; margin: 0; aspect-ratio: 16 / 9; }
.agency-grid video { width: 100%; height: 100%; object-fit: cover; display: block; }
.agency-grid span { position: absolute; left: 10px; top: 8px; color: #fff; text-shadow: 0 1px 8px #0008; }

/* ---------- Narrow screens: fall back to vertical stacking ---------- */
@media (max-width: 760px) {
  body { overflow: auto; }
  .track { flex-direction: column; height: auto; overflow: visible; }
  .panel { width: 100% !important; height: auto; min-height: 100vh; padding: 88px 16px 64px; }
  .float { display: none; }
  .about-media { height: 60vh; }
  .about-grid, .bg-cols, .split, .pair, .cols3, .cover-foot, .sys, .sys article, .stat-grid, .dentsu-cols { grid-template-columns: 1fr; }
  .dentsu-hero { height: auto; width: 100%; justify-self: stretch; } .trend-grid { grid-template-columns: repeat(3, 1fr); } .agency-grid { grid-template-columns: 1fr; }
  .diagrams { flex-direction: column; gap: 48px; }
  .journey { grid-template-columns: 1fr; }
  .path-line li { flex-direction: column; gap: 4px; } .path-line .mono { flex: none; }
  .path-line b { font-size: 30px; }
  .j-stack { height: 70vw; }
  .collage-panel { width: 100% !important; } .collage { height: auto; display: flex; flex-direction: column; gap: 24px; }
  .collage figure, .c-head { position: relative; left: auto; top: auto; bottom: auto; height: auto !important; transform: none; white-space: normal; }
  .collage img, .collage video { width: 100%; height: auto !important; } .phone { width: 60%; }
  .gen-film { position: relative; inset: auto; height: 56vh; margin: -88px -16px 24px; }
  .dg svg { width: 100%; height: auto; }
  .repo { flex-direction: column; height: auto; } .repo-main { max-width: none; width: 100%; height: auto; } .repo-side { flex-direction: row; height: auto; }
  .dg-tabs { flex-wrap: wrap; }
  .sys-row { grid-template-columns: 1fr; }
  .meta-title { flex-direction: column; align-items: stretch; }
  .dis-cols { grid-template-columns: 1fr; } .dis-grid { height: auto; grid-template-columns: 1fr 1fr; } .dis-copy { position: relative; left: auto; bottom: auto; padding: 0 16px 24px; }
  .strip { height: auto; flex-direction: column; }
  .strip img, .strip img.tall { width: 100%; height: auto; }
  .contact-list { grid-template-columns: 1fr; } .contact-list li { grid-template-columns: 1fr; gap: 4px; }
  .contact-mail { font-size: 30px; }
  .contact-grid { grid-template-columns: 1fr; } .contact-photo { height: auto; width: 100%; }
  .stack li { margin-left: 0 !important; }
  .chapters, .hint { display: none; }
  .big { font-size: 44px; } .mid { font-size: 30px; } .quote { font-size: 24px; }
  .cover h1 { font-size: 52px; } .specs-word { font-size: 96px; }

}

/* ---------- Brand bubbles: a client mark straddling the seam into its chapter ---------- */
.has-bubble { overflow: visible; }
.brand-bubble { position: absolute; left: 0; top: 50%; z-index: 6; width: clamp(96px, 9vw, 168px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 24px 60px #0007; transform: translate(-50%, -50%) rotate(calc(var(--p, 0) * -30deg)); pointer-events: none; }
.brand-bubble img { width: 66%; height: auto; }
.bubble-snap { background: #fffc00; }
.bubble-meta { background: #fff; }
.bubble-meta img { width: 54%; }
@media (prefers-reduced-motion: reduce) { .brand-bubble { transform: translate(-50%, -50%); } }
@media (max-width: 760px) { .brand-bubble { top: 0; left: 50%; width: 88px; } }

/* ---------- Bonus: leathercraft, hidden until the bubble opens it ---------- */
.bonus-panel { display: none; background: #efe6d8; color: #2a1416; justify-content: flex-start; padding-top: clamp(72px, 11vh, 112px); width: max(100vw, calc(230vh + 10vw)); }
.bonus-open .bonus-panel { display: flex; }
.bonus-panel .mono { opacity: .6; }
.bonus-collage { height: 76vh; }
.b-title { position: absolute; left: 0; top: 0; margin: 0; z-index: 4; font-size: min(5vw, 9vh); line-height: .95; letter-spacing: -.04em; font-weight: 600; }
.b-title em { font-family: 'Instrument Serif', serif; font-weight: 400; color: #6e1f24; }
.bonus-collage .card { background: #fff; }
.bonus-collage .card figcaption { left: 10px; bottom: 8px; }
/* Order of making: planner loops, then the build photos, the finished film last */
.b-loop { left: 2vh; top: 22vh; height: 52vh; --rot: -2deg; z-index: 2; }
.b-loop video { width: auto; }
.b-set { left: 52vh; top: 2vh; height: 30vh; --rot: 1.5deg; z-index: 3; }
.b-printed { left: 56vh; top: 38vh; height: 36vh; --rot: -3deg; z-index: 2; }
.b-clamp { left: 92vh; top: 6vh; height: 38vh; --rot: 2deg; }
.b-press { left: 100vh; top: 44vh; height: 30vh; --rot: -2deg; z-index: 2; }
.b-moulded { left: 138vh; top: 0; height: 36vh; --rot: 1.5deg; }
.b-stitch { left: 142vh; top: 38vh; height: 36vh; --rot: -2.5deg; z-index: 2; }
.b-hero { left: 184vh; top: 0; height: 74vh; z-index: 3; }
/* The bubble is a real button here */
.bubble-bonus { pointer-events: auto; cursor: pointer; background: #6e1f24; color: #f6e9d2; font-family: 'Instrument Serif', serif; font-size: clamp(22px, 2vw, 34px); letter-spacing: -.01em; border: 0; transition: background .2s, transform .3s; }
.bubble-bonus:hover { background: #8a2a30; }
.bubble-bonus[aria-expanded="true"] { background: #2a1416; font-family: 'JetBrains Mono', monospace; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 760px) { .bonus-panel { width: 100% !important; } .bonus-panel .b-title { position: relative; } }
