/* ==========================================================================
   Neo, a Dip picture
   Layout: one long take. Full-bleed scenes on a dark stage, a fixed viewfinder
   HUD, content on a centred grid. Every colour comes from Dip's kitty theme
   (dotfiles/Kitty/current-theme.conf). Dark is the default ("red pill");
   light is the explicit "blue pill" choice.
   ========================================================================== */

:root {
  /* colour */
  --night: #0f0b12;          /* the stage */
  --night-2: #17111b;        /* raised surfaces */
  --night-3: #211827;
  --plum: #36283d;           /* kitty background */
  --ink: #f6eef0;            /* projector white: display type */
  --fg: #cedaeb;             /* kitty foreground: running text */
  --muted: #9d96aa;          /* captions */
  --rose: #e59db1;           /* the accent (kitty color3) */
  --on-rose: #0f0b12;
  --sky: #8bb8e9;            /* kitty color5 */
  --peri: #9ea0d3;           /* kitty color4 */
  --lilac: #e1b4ce;          /* kitty color6 */
  --mauve: #ab8cae;          /* kitty color2 */
  --crimson: #e2707f;
  --line: rgb(206 218 235 / 0.14);
  --line-strong: rgb(206 218 235 / 0.3);
  --paper: #efe9e4;          /* screenplay paper */
  --paper-ink: #241c28;
  --paper-note: #9b3a59;
  --paper-shadow: rgb(0 0 0 / 0.6);
  --frame-bg: #1b1320;       /* film frames stay dark in both themes */
  --film: #09060b;
  --glow: rgb(255 170 112 / 0.22);
  --beam: rgb(255 238 224 / 0.15);
  --vignette: rgb(4 2 6 / 0.62);
  --note-bg: #f6eef0;
  --note-fg: #1c1420;
  --note-accent: #9b3a59;
  --grain-opacity: 0.075;
  --ledge: #2b2031;
  --shelf-shade: rgb(0 0 0 / 0.22);

  /* type */
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --font-guj: "Noto Serif Gujarati", "Nirmala UI", "Shruti", "Gujarati Sangam MN", serif;
  --step--2: clamp(0.7rem, 0.68rem + 0.1vw, 0.76rem);
  --step--1: clamp(0.8rem, 0.77rem + 0.15vw, 0.9rem);
  --step-0: clamp(1.06rem, 1rem + 0.28vw, 1.22rem);
  --step-1: clamp(1.25rem, 1.12rem + 0.6vw, 1.62rem);
  --step-2: clamp(1.55rem, 1.3rem + 1.25vw, 2.4rem);
  --step-3: clamp(2rem, 1.5rem + 2.6vw, 3.9rem);
  --step-4: clamp(2.7rem, 1.6rem + 5.2vw, 6.6rem);
  --step-hero: clamp(7rem, 2rem + 22vw, 21rem);

  /* space */
  --gutter: clamp(16px, 5vw, 80px);
  --maxw: 1280px;

  /* motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 160ms;
  --dur-base: 280ms;
  --dur-slow: 600ms;

  color-scheme: dark;
}

:root[data-theme="light"] {
  --night: #e6eaf2;
  --night-2: #dbe1eb;
  --night-3: #cfd6e2;
  --ink: #1c1420;
  --fg: #2b2231;
  --muted: #575166;
  --rose: #a13d5e;
  --on-rose: #ffffff;
  --sky: #2c64a3;
  --peri: #4b4f9c;
  --lilac: #8a4f7a;
  --mauve: #6f5672;
  --crimson: #b4384c;
  --line: rgb(54 40 61 / 0.16);
  --line-strong: rgb(54 40 61 / 0.32);
  --paper: #fbf8f4;
  --paper-shadow: rgb(54 40 61 / 0.28);
  --glow: rgb(226 120 60 / 0.16);
  --beam: rgb(54 40 61 / 0.05);
  --vignette: rgb(54 40 61 / 0.12);
  --note-bg: #1c1420;
  --note-fg: #f2edf2;
  --note-accent: #e59db1;
  --grain-opacity: 0.05;
  --ledge: #bdc4d2;
  --shelf-shade: rgb(54 40 61 / 0.07);
  color-scheme: light;
}

/* ---------- base ---------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html:not(.lenis) { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--fg);
  font: 400 var(--step-0)/1.6 var(--font-serif);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html.is-intro, html.is-intro body { overflow: hidden; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; }
img, svg { max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--font-mono); font-size: 0.86em; }
kbd {
  font: 500 0.78em/1 var(--font-mono);
  display: inline-grid; place-items: center;
  min-width: 1.7em; height: 1.7em; padding: 0 0.4em;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 5px;
  color: var(--fg);
}
h1, h2, h3 { text-wrap: balance; }
p, li, dd { text-wrap: pretty; }
::selection { background: #cedaeb; color: #000; } /* kitty's own selection colours */
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 4px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 16px; top: -80px; z-index: 300;
  background: var(--ink); color: var(--night); padding: 10px 14px; border-radius: 8px;
  font: 500 var(--step--1) var(--font-mono); text-decoration: none;
}
.skip:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

.wrap { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.scene { position: relative; padding-block: clamp(110px, 16vh, 200px); }
main { position: relative; z-index: 1; }

.h2 {
  font: italic 300 var(--step-4)/0.95 var(--font-serif);
  letter-spacing: -0.02em; color: var(--ink);
}
.h3 { font: italic 400 var(--step-2)/1.1 var(--font-serif); color: var(--ink); }

.tag {
  display: inline-block;
  font: 500 var(--step--2)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--rose); border: 1px solid currentColor; border-radius: 99px;
  padding: 0.5em 0.85em 0.45em; margin-right: 0.7em; vertical-align: 0.3em;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 48px; padding: 0 1.4em;
  font: 500 var(--step--1)/1 var(--font-mono); letter-spacing: 0.02em;
  border-radius: 99px; border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-base), color var(--dur-base), border-color var(--dur-base), scale var(--dur-fast);
}
.btn:active { scale: 0.97; }
.btn--primary { background: var(--rose); color: var(--on-rose); }
.btn--primary:hover { background: var(--ink); color: var(--night); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn kbd { border-color: currentColor; color: inherit; opacity: 0.7; }
.link-btn {
  background: none; border: 0; padding: 0.4em 0; cursor: pointer;
  font: 500 var(--step--1)/1.2 var(--font-mono); color: var(--rose);
  text-decoration: underline; text-underline-offset: 0.3em; text-decoration-thickness: 1px;
}
.link-btn:hover { color: var(--ink); }

/* inline director's notes */
.annot {
  all: unset;
  cursor: help;
  color: inherit;
  text-decoration: underline dotted;
  text-decoration-color: var(--annot, var(--rose));
  text-decoration-thickness: 2px;
  text-underline-offset: 0.24em;
  border-radius: 3px;
  transition: background-color var(--dur-fast), color var(--dur-fast);
}
.annot:hover, .annot[aria-expanded="true"] { background: color-mix(in srgb, var(--annot, var(--rose)) 18%, transparent); }
.annot:focus-visible { outline: 2px solid var(--annot, var(--rose)); outline-offset: 2px; }

/* ---------- atmosphere ---------- */

#stage {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none; display: block;
}
.fx { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.fx__glow {
  position: absolute; left: 0; top: 0;
  width: 1100px; height: 1100px; margin: -550px 0 0 -550px;
  background: radial-gradient(circle, var(--glow) 0%, transparent 62%);
  transform: translate3d(78vw, 42vh, 0);
  will-change: transform, opacity;
}
.fx__beam {
  position: absolute; inset: 0;
  background: conic-gradient(from 222deg at 104% -6%, transparent 0deg, var(--beam) 10deg, color-mix(in srgb, var(--beam) 160%, transparent) 17deg, var(--beam) 24deg, transparent 34deg);
  opacity: 0; transition: opacity 1.4s var(--ease-in-out);
}
html[data-stage="1"] .fx__beam { opacity: 1; }
.fx__vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 75% at 50% 45%, transparent 50%, var(--vignette) 100%);
}
.grain {
  position: fixed; inset: -50%; z-index: 40; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: var(--grain);
  animation: grain 0.9s steps(6) infinite;
}
:root[data-theme="light"] .grain { mix-blend-mode: multiply; }
@keyframes grain {
  0% { translate: 0 0; } 17% { translate: -6% 3%; } 33% { translate: 4% -5%; }
  50% { translate: -3% 6%; } 67% { translate: 7% 1%; } 83% { translate: -5% -4%; } 100% { translate: 0 0; }
}
@keyframes flicker {
  0%, 100% { opacity: 1; } 8% { opacity: 0.86; } 12% { opacity: 1; } 47% { opacity: 0.93; } 52% { opacity: 1; } 74% { opacity: 0.88; }
}

/* ---------- film leader (intro) ---------- */

.leader { display: none; }
html.is-intro .leader {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  background: #0b080d; color: #cedaeb; font-family: var(--font-mono);
  overflow: hidden;
}
.leader::before, .leader::after {
  content: ""; position: absolute; background: rgb(206 218 235 / 0.28);
}
.leader::before { left: 0; right: 0; top: 50%; height: 1px; }
.leader::after { top: 0; bottom: 0; left: 50%; width: 1px; }
.leader__frame { position: relative; width: min(76vmin, 560px); aspect-ratio: 1; display: grid; place-items: center; }
.leader__rings { position: absolute; inset: 0; width: 100%; height: 100%; stroke: rgb(206 218 235 / 0.5); stroke-width: 1.2; }
.leader__rings path { stroke: transparent; }
.leader__sweep {
  position: absolute; inset: 12.5%; border-radius: 50%;
  background: conic-gradient(from 0deg, rgb(229 157 177 / 0.22) var(--a, 0deg), transparent 0deg);
}
.leader__num {
  position: relative; z-index: 1;
  font: italic 300 min(44vmin, 330px)/1 var(--font-serif); color: #f6eef0;
  font-variant-numeric: tabular-nums;
}
.leader__corner, .leader__log {
  position: absolute; z-index: 1;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: #9d96aa;
}
.leader__corner--tl { left: 24px; top: calc(env(safe-area-inset-top, 0px) + 22px); }
.leader__corner--tr { right: 24px; top: calc(env(safe-area-inset-top, 0px) + 22px); }
.leader__corner--br { right: 24px; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); }
.leader__log {
  left: 24px; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  list-style: none; text-transform: none; letter-spacing: 0.02em; line-height: 1.8;
}
.leader__log b { color: #ab8cae; font-weight: 500; }
.leader__wake { color: #e59db1; }

/* ---------- nav ---------- */

.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--gutter) 12px;
  transition: background-color 0.4s, border-color 0.4s, translate 0.5s var(--ease-out);
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: color-mix(in srgb, var(--night) 74%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { translate: 0 -110%; }
.nav__logo {
  display: inline-flex; align-items: flex-end; gap: 3px; min-height: 44px; align-content: center;
  font: italic 400 1.75rem/1 var(--font-serif); color: var(--ink); text-decoration: none;
  padding-top: 6px;
}
.nav__dot {
  width: 0.28em; height: 0.28em; margin-bottom: 0.32em; border-radius: 50%;
  background: #ffb37a; box-shadow: 0 0 10px 2px rgb(255 160 100 / 0.65);
  animation: flicker 3.2s infinite;
}
.nav__tools { display: flex; align-items: center; gap: 8px; }
.nav__link {
  display: none; align-items: center; min-height: 44px; padding: 0 10px;
  font: 500 var(--step--1)/1 var(--font-mono); color: var(--fg); text-decoration: none;
}
.nav__link:hover { color: var(--rose); }
.pill-btn, .icon-btn, .menu-btn {
  display: inline-grid; place-items: center; height: 44px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); border-radius: 99px;
  color: var(--ink); transition: border-color var(--dur-base), background-color var(--dur-base);
}
.pill-btn:hover, .icon-btn:hover, .menu-btn:hover { border-color: var(--ink); }
.pill-btn { width: 44px; padding: 0; }

/* The theme button is a two-tone capsule: red half for the dark theme, blue half for the light one.
   The half you have taken is lit; the other one dims. */
.capsule {
  position: relative; display: flex;
  width: 26px; height: 11px; border-radius: 99px; overflow: hidden;
  transform: rotate(-35deg);
  box-shadow: 0 3px 5px -1px rgb(0 0 0 / 0.5), inset 0 -1.5px 1.5px rgb(0 0 0 / 0.28);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.capsule::after {
  content: ""; position: absolute; left: 3px; right: 4px; top: 1.5px; height: 2.6px; border-radius: 99px;
  background: linear-gradient(90deg, rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.3) 65%, rgb(255 255 255 / 0));
  pointer-events: none;
}
.capsule__half { flex: 1; transition: filter 0.45s; }
.capsule__half--red { background: linear-gradient(180deg, #ffa3a8 0%, #ec4d60 42%, #b32539 100%); }
.capsule__half--blue {
  background: linear-gradient(180deg, #b3d1ff 0%, #4d82e6 42%, #2148a8 100%);
  box-shadow: inset 1px 0 0 rgb(20 10 30 / 0.4);
  filter: saturate(0.55) brightness(0.92);
}
:root[data-theme="light"] .capsule__half--blue { filter: none; }
:root[data-theme="light"] .capsule__half--red { filter: saturate(0.5) brightness(1.15); }
.pill-btn:hover .capsule, .pill-btn:focus-visible .capsule, .pill-btn[aria-expanded="true"] .capsule { transform: rotate(-16deg) scale(1.12); }
.icon-btn { width: 44px; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-btn { padding: 0 18px; font: 500 var(--step--1)/1 var(--font-mono); }

/* ---------- scene 1: opening ---------- */

.hero {
  min-height: 100svh;
  display: grid; align-content: end;
  padding-block: calc(env(safe-area-inset-top, 0px) + 110px) 0;
}
.hero__inner { position: relative; z-index: 1; padding-bottom: 28px; }
.hero__presents {
  font: 500 var(--step--1)/1 var(--font-mono); color: var(--muted); letter-spacing: 0.04em;
  margin-bottom: clamp(4px, 1vw, 12px);
}
.hero__title {
  font: italic 300 var(--step-hero)/0.8 var(--font-serif);
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.035em; color: var(--ink);
  margin-left: -0.05em; padding-block: 0.06em 0.12em;
}
.hero__word { display: inline-block; white-space: nowrap; }
.hero__word .ch {
  display: inline-block;
  font-weight: var(--w, 300);
  color: color-mix(in oklab, var(--ink), #ffd7b8 calc(var(--warm, 0) * 70%));
  text-shadow: 0 0 calc(var(--warm, 0) * 46px) rgb(255 168 108 / calc(var(--warm, 0) * 0.55));
}
:root[data-theme="light"] .hero__word .ch {
  color: color-mix(in oklab, var(--ink), #b4492a calc(var(--warm, 0) * 60%));
  text-shadow: none;
}
.hero__def {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.55em; row-gap: 0.2em;
  font-size: var(--step-1); line-height: 1.3; margin-top: 0.3em;
}
.hero__name { font-weight: 600; color: var(--ink); }
.annot--guj { font-family: var(--font-guj); font-size: 1.12em; color: var(--rose); line-height: 1; }
.hero__gloss { color: var(--muted); }
.hero__logline {
  max-width: 36ch; margin-top: clamp(18px, 2.4vw, 30px);
  font-size: var(--step-1); line-height: 1.38; color: var(--fg);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(22px, 3vw, 36px); }
.hero__billing {
  position: relative; z-index: 1;
  display: flex; flex-wrap: wrap; gap: 10px 32px;
  padding-block: 18px calc(env(safe-area-inset-bottom, 0px) + 24px);
  border-top: 1px solid var(--line);
  font: 500 var(--step--2)/1.2 var(--font-mono); color: var(--muted);
}
.hero__billing div { display: flex; gap: 10px; }
.hero__billing dt { text-transform: uppercase; letter-spacing: 0.12em; }
.hero__billing dd { color: var(--fg); }
.hero__billing a { color: var(--rose); text-underline-offset: 0.25em; }
.hero__fallback { display: none; }
html.no-webgl .hero__fallback {
  display: block; position: absolute; z-index: 0; right: 16%; top: 28%;
  width: 120px; height: 180px; pointer-events: none;
}
html.no-webgl .hero__fallback span {
  position: absolute; inset: 0;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: radial-gradient(ellipse 40% 34% at 50% 70%, #fff4e6 0%, #ffb37a 45%, rgb(229 157 177 / 0.6) 70%, transparent 74%);
  filter: blur(6px);
  animation: flicker 2.6s infinite;
}

/* ---------- scene 2: the room ---------- */

.script { overflow-x: clip; }
.script__wrap { display: grid; justify-items: center; gap: 26px; }
.page {
  --annot: var(--paper-note);
  position: relative;
  width: min(100%, 740px);
  background: var(--paper);
  color: var(--paper-ink);
  font: 400 clamp(12.5px, 0.42vw + 10.5px, 15.5px)/1.62 var(--font-mono);
  padding: clamp(40px, 7vw, 88px) clamp(20px, 6.5vw, 76px) clamp(44px, 7vw, 92px) clamp(46px, 11vw, 124px);
  box-shadow: 0 50px 90px -40px var(--paper-shadow), 0 1px 0 rgb(255 255 255 / 0.5) inset;
  transform: rotate(-1.1deg);
  border-radius: 2px;
}
.page::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(ellipse 70% 50% at 70% 0%, rgb(255 255 255 / 0.55), transparent 70%),
    linear-gradient(180deg, transparent 70%, rgb(120 90 80 / 0.06));
}
.page__hole {
  position: absolute; left: clamp(16px, 3.6vw, 42px);
  width: 13px; height: 13px; margin-top: -6.5px; border-radius: 50%;
  background: var(--night);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.5);
}
.page__hole--1 { top: 11%; }
.page__hole--2 { top: 50%; }
.page__hole--3 { top: 89%; }
.page__hole--1::after, .page__hole--3::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #fbe7b3 0%, #d2a453 38%, #8a6224 72%, #5d4115 100%);
  box-shadow: 0 2px 3px rgb(0 0 0 / 0.35);
}
.sp + .sp { margin-top: 1.62em; }
.sp--char + .sp--paren, .sp--char + .sp--dia, .sp--paren + .sp--dia { margin-top: 0; }
.sp--slug { position: relative; font-weight: 700; }
.sp__no { position: absolute; top: 0; font-weight: 700; }
.sp__no:first-child { right: calc(100% + 2.4ch); }
.sp__no:last-child { left: calc(100% + 1.6ch); }
.sp--char { padding-left: 37%; }
.sp--paren { padding-left: 27%; padding-right: 22%; }
.sp--dia { padding-left: 17%; padding-right: 22%; }
.sp--end { text-align: right; }
.script__hint {
  display: flex; align-items: center; gap: 10px;
  font: 500 var(--step--1)/1.4 var(--font-mono); color: var(--muted);
}
.script__hint-mark { width: 26px; height: 0; border-bottom: 2px dotted var(--rose); }
.page__caret {
  position: absolute; left: 0; top: 0; width: 0.62em; height: 1.3em; margin-top: 0.12em;
  background: var(--paper-ink); opacity: 0.85; pointer-events: none;
}
.page__caret.is-done { animation: blink 1s steps(1) infinite; }
.sp.is-typing .annot { text-decoration-color: transparent; }
.kitty__cursor { display: inline-block; width: 0.62em; height: 1.2em; vertical-align: -0.22em; background: #cedaeb; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- scene 3: system settings ---------- */

.vo__wrap {
  display: grid; gap: clamp(36px, 6vw, 72px);
  grid-template-columns: minmax(0, 1fr);
}
.cue {
  font: 700 var(--step--1)/1 var(--font-mono); letter-spacing: 0.04em; color: var(--rose);
  margin-bottom: clamp(16px, 2vw, 24px);
}
.vo__lede {
  font: italic 300 var(--step-4)/0.98 var(--font-serif);
  letter-spacing: -0.02em; color: var(--ink); max-width: 13ch;
}
.vo__body {
  margin-top: clamp(22px, 3vw, 36px); max-width: 30ch;
  font: 350 var(--step-2)/1.3 var(--font-serif); color: var(--fg);
}
.vo__lock { position: relative; min-height: clamp(220px, 40vw, 480px); }
.lock-caption {
  position: sticky; top: 46svh;
  font: 500 var(--step--1)/1 var(--font-mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
  display: flex; gap: 0.7em; align-items: center; justify-content: center;
}
.lock-caption b { font-weight: 700; color: var(--fg); min-width: 8.5ch; }
.lock-caption.is-open b { color: var(--rose); }
.word { display: inline-block; }
.vo__lede { --lyric: var(--ink); }
.vo__body { --lyric: var(--fg); }
[data-lyrics] .word { color: color-mix(in srgb, var(--rose) calc(var(--hot, 0) * 100%), var(--lyric)); }

.kitty { display: grid; gap: 14px; }
.kitty__win {
  background: #36283d; color: #cedaeb;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 40px 90px -30px rgb(0 0 0 / 0.7), 0 0 0 1px rgb(255 255 255 / 0.07);
}
.kitty__screen { padding: 8px 10px 12px; min-height: 21.5em; overflow-x: auto; }
.kitty__pre {
  font: 400 clamp(11px, 0.48vw + 8px, 13.5px)/1.5 var(--font-mono);
  white-space: pre; tab-size: 4; color: #cedaeb;
}
.t-user { color: #8bb8e9; }
.t-at { color: #cedaeb; }
.t-host { color: #e1b4ce; }
.t-path { color: #e59db1; }
.t-label { color: #e59db1; font-weight: 700; }
.t-title { color: #8bb8e9; font-weight: 700; }
.t-dim { color: #9098a4; }
.t-art1 { color: #ffb37a; }
.t-art2 { color: #e59db1; }
.t-art3 { color: #8bb8e9; }
.t-ok { color: #ab8cae; }
.t-err { color: #e59db1; }
.t-link { color: #71ade9; text-decoration: underline; text-underline-offset: 0.2em; }
.t-sw { display: inline-block; width: 2.2ch; height: 1.15em; vertical-align: -0.2em; }
.kitty__tabs {
  display: flex; height: 22px; background: #36283d;
  font: 500 11.5px/22px var(--font-mono); white-space: nowrap; overflow: hidden;
}
.ktab {
  padding: 0 18px 0 10px; margin-right: -8px;
  background: #e59db1; color: #60486d;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 100%, 0 100%);
}
.ktab--active { background: #8bb8e9; color: #36283d; position: relative; z-index: 1; }
.ktab--spacer { flex: 1; background: transparent; }
.kitty__cap {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 20px;
  font: 400 var(--step--1)/1.5 var(--font-mono); color: var(--muted);
}

/* ---------- scene 4: filmography ---------- */

.work { padding-block: 0; }
.work__pin {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center; gap: clamp(26px, 4vh, 46px);
  padding-block: clamp(100px, 14vh, 140px) clamp(40px, 7vh, 80px);
}
.work__head {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px 40px;
}
.work__lede { grid-column: 1; max-width: 46ch; color: var(--muted); }
.work__count {
  grid-column: 2; grid-row: 1 / span 2; align-self: end;
  font: 500 var(--step-1)/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums;
}
.work__count span:first-child { color: var(--ink); }

.reel {
  /* film colours are physical: the same in both themes */
  --sky: #8bb8e9; --rose: #e59db1; --lilac: #e1b4ce; --peri: #9ea0d3; --crimson: #e2707f;
  position: relative;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.reel::-webkit-scrollbar { display: none; }
html.reel-pinned .reel { overflow: hidden; scroll-snap-type: none; }
.reel__track {
  position: relative;
  display: flex; width: max-content; list-style: none; margin: 0;
  padding: 34px var(--gutter);
  background: var(--film);
}
.reel__track::before, .reel__track::after {
  content: ""; position: absolute; left: 0; right: 0; height: 14px;
  background: var(--night);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14'%3E%3Crect x='8' y='1' width='14' height='12' rx='3'/%3E%3C/svg%3E") repeat-x left center / 30px 14px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='14'%3E%3Crect x='8' y='1' width='14' height='12' rx='3'/%3E%3C/svg%3E") repeat-x left center / 30px 14px;
}
.reel__track::before { top: 10px; }
.reel__track::after { bottom: 10px; }
.frame {
  flex: 0 0 auto; width: clamp(272px, 30vw, 440px);
  padding-inline: 8px; scroll-snap-align: center;
  perspective: 900px;
}
.frame__card {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  background: var(--frame-bg); color: #cedaeb;
  border-radius: 5px; overflow: hidden;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.05);
  transition: box-shadow 0.5s var(--ease-out);
  transform-style: preserve-3d;
}
.frame__card:hover { box-shadow: 0 0 0 1px color-mix(in srgb, var(--hue) 50%, transparent), 0 30px 60px -30px color-mix(in srgb, var(--hue) 60%, transparent); }
.frame__edge {
  position: absolute; top: 10px; left: 12px; z-index: 1;
  font: 500 10px/1 var(--font-mono); letter-spacing: 0.14em; color: color-mix(in srgb, var(--hue) 70%, transparent);
}
.frame__edge span { margin-left: 6px; }
.frame__poster {
  aspect-ratio: 400 / 260; display: grid; place-items: center; overflow: hidden;
  color: var(--hue);
  background: radial-gradient(ellipse 60% 70% at 50% 45%, color-mix(in srgb, var(--hue) 16%, transparent), transparent 72%);
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}
.frame__poster svg { width: 92%; height: auto; transition: scale 0.7s var(--ease-out); }
.frame__card:hover .frame__poster svg { scale: 1.05; }
.frame__body { flex: 1; display: grid; align-content: start; gap: 8px; padding: 16px 20px 20px; }
.frame__meta {
  display: flex; justify-content: space-between; gap: 10px;
  font: 500 var(--step--2)/1.3 var(--font-mono); letter-spacing: 0.03em; color: #9d96aa;
}
.frame__title { font: italic 400 var(--step-2)/1.05 var(--font-serif); color: #f6eef0; letter-spacing: -0.01em; }
.frame__line { font-size: 1rem; line-height: 1.5; color: #cedaeb; }
.frame__line code { color: var(--hue); }
.frame__open {
  justify-self: start; margin-top: 6px; padding: 10px 0 6px; min-height: 44px;
  background: none; border: 0; cursor: pointer;
  font: 500 var(--step--1)/1 var(--font-mono); color: var(--hue);
  text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1px;
}
.frame__open:hover { color: #f6eef0; }
.frame template { display: none; }

.work__more {
  display: grid; gap: clamp(40px, 6vw, 64px);
  padding-block: clamp(40px, 7vw, 80px) clamp(110px, 16vh, 200px);
}
.shorts { list-style: none; margin-top: 18px; border-top: 1px solid var(--line); }
.shorts a {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px;
  padding: 14px 0; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--fg);
  transition: color var(--dur-base), padding var(--dur-base) var(--ease-out);
}
.shorts b { font-weight: 600; color: var(--ink); }
.shorts span { color: var(--muted); font-size: 0.95em; }
.shorts a:hover { padding-left: 10px; }
.shorts a:hover b { color: var(--rose); }
.work__all { margin-top: 28px; }

/* ---------- intermission ---------- */

.intermission {
  position: relative; z-index: 1;
  padding-block: clamp(46px, 8vw, 110px);
  border-block: 1px solid var(--line);
  overflow: clip;
}
.marquee { overflow: clip; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee__track {
  display: flex; align-items: center; gap: 0.45em; width: max-content; padding-right: 0.45em;
  font: italic 300 var(--step-4)/1.1 var(--font-serif); color: var(--ink); letter-spacing: -0.02em;
  animation: marquee 40s linear infinite;
  will-change: transform;
}
.marquee__track i { width: 0.2em; height: 0.2em; border-radius: 50%; background: var(--rose); flex: none; }
@keyframes marquee { to { translate: -50% 0; } }
.intermission__note {
  margin-top: 22px; padding-inline: var(--gutter); text-align: center;
  font: 500 var(--step--1)/1.4 var(--font-mono); color: var(--muted);
}

/* ---------- scene 5: bonus features ---------- */

.extras__head { display: grid; gap: 14px; margin-bottom: clamp(34px, 5vw, 60px); }
.extras__lede { max-width: 48ch; color: var(--muted); }
.facts {
  list-style: none; display: grid; gap: 0 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
}
.fact { padding: 18px 0 20px; border-top: 1px solid var(--line); }
.fact__title { font: italic 400 var(--step-1)/1.2 var(--font-serif); color: var(--ink); }
.fact__text { margin-top: 6px; color: var(--fg); max-width: 46ch; }
.guj { font-family: var(--font-guj); }

/* enhanced DVD menu (added by main.js) */
.dvd.is-on { display: grid; gap: clamp(24px, 4vw, 56px); grid-template-columns: minmax(0, 1fr); }
.dvd.is-on .facts { display: block; counter-reset: none; }
.dvd.is-on .fact { padding: 0; border: 0; }
.dvd.is-on .fact__text { display: none; }
.dvd__item {
  all: unset; box-sizing: border-box; cursor: pointer;
  display: grid; grid-template-columns: 1.4em minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  width: 100%; min-height: 44px; padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font: italic 400 var(--step-1)/1.2 var(--font-serif); color: var(--muted);
  transition: color var(--dur-base);
}
.dvd__item::before {
  content: ""; width: 0; height: 0; align-self: center;
  border-left: 0.42em solid var(--rose); border-block: 0.27em solid transparent;
  opacity: 0; translate: -6px 0; transition: opacity var(--dur-base), translate var(--dur-base) var(--ease-out);
}
.dvd__item .dvd__rt { font: 500 var(--step--2)/1 var(--font-mono); font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.dvd__item:hover { color: var(--fg); }
.dvd__item[aria-selected="true"] { color: var(--ink); }
.dvd__item[aria-selected="true"]::before { opacity: 1; translate: 0 0; }
.dvd__item:focus-visible { outline-offset: 2px; }
.dvd__screen {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 300px;
  display: grid; align-content: end; gap: 14px;
  padding: clamp(22px, 3.4vw, 44px);
  border-radius: 14px; border: 1px solid var(--line-strong);
  background:
    radial-gradient(ellipse 70% 60% at 80% 10%, color-mix(in srgb, var(--rose) 16%, transparent), transparent 70%),
    var(--night-2);
}
.dvd__screen::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgb(255 255 255 / 0.028) 0 1px, transparent 1px 3px);
}
.dvd__meta {
  position: absolute; top: clamp(18px, 2.6vw, 30px); left: clamp(22px, 3.4vw, 44px); right: clamp(22px, 3.4vw, 44px);
  display: flex; justify-content: space-between; gap: 12px;
  font: 500 var(--step--2)/1.2 var(--font-mono); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.dvd__title { font: italic 300 var(--step-3)/1 var(--font-serif); color: var(--ink); letter-spacing: -0.02em; }
.dvd__text { font-size: var(--step-1); line-height: 1.38; color: var(--fg); max-width: 34ch; }
.dvd__controls { display: flex; gap: 16px; align-items: center; margin-top: 6px; }
.dvd__bar { flex: 1; height: 2px; background: var(--line); overflow: hidden; border-radius: 2px; }
.dvd__bar span { display: block; height: 100%; width: 100%; background: var(--rose); transform-origin: left; transform: scaleX(0); }
.dvd__screen::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--ink); opacity: var(--flash, 0);
}

/* ---------- scene 5: the video store ---------- */

.store__head { position: relative; display: grid; gap: 22px 40px; align-items: end; }
.store__lede { max-width: 50ch; margin-top: 14px; color: var(--muted); }
.store__stats { margin-top: 12px; font: 500 var(--step--2)/1.5 var(--font-mono); letter-spacing: 0.05em; color: var(--fg); }
.store__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.sticker {
  position: absolute; top: -54px; right: 0; z-index: 2;
  display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%;
  background: #e59db1; color: #1c1420;
  font: 700 9.5px/1.2 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; text-align: center;
  transform: rotate(12deg);
  box-shadow: 0 8px 16px -8px rgb(0 0 0 / 0.55), inset 0 0 0 3px rgb(255 255 255 / 0.35);
}
.shelves { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(26px, 4vw, 40px); margin-top: clamp(36px, 6vw, 64px); }
.shelf { min-width: 0; }
.shelf__label {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 2px;
  font: 500 var(--step--2)/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
.shelf__label span { color: var(--rose); letter-spacing: 0.04em; }
.shelf__row {
  --scale: 1;
  list-style: none; display: flex; align-items: flex-end; gap: 4px;
  margin: 0; padding: 28px 8px 0;
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  border-bottom: 12px solid var(--ledge);
  background: linear-gradient(180deg, transparent 45%, var(--shelf-shade));
  box-shadow: 0 18px 22px -16px rgb(0 0 0 / 0.55);
}
.shelf__row::-webkit-scrollbar { display: none; }
.shelf__row li { flex: none; display: flex; }
.spine {
  all: unset; box-sizing: border-box; cursor: pointer; position: relative; flex: none;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 6px;
  width: var(--w, 44px); height: calc(var(--h, 262px) * var(--scale));
  padding: 13px 0 9px;
  background-color: var(--bg, #36283d); color: var(--fg, #e1b4ce);
  background-image: linear-gradient(90deg, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0.03) 20%, transparent 55%, rgb(0 0 0 / 0.3));
  border-radius: 3px 3px 1px 1px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.28), 0 1px 0 rgb(0 0 0 / 0.4);
  transition: translate 0.45s var(--ease-out), rotate 0.45s var(--ease-out), box-shadow 0.3s;
}
.spine:hover, .spine:focus-visible { translate: 0 -14px; rotate: -1.5deg; }
.spine:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.spine.is-picked {
  translate: 0 -24px;
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / 0.28), 0 0 0 2px var(--rose), 0 22px 30px -12px rgb(0 0 0 / 0.6);
}
.spine__title {
  writing-mode: vertical-rl; text-orientation: mixed;
  max-height: calc(100% - 34px); overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: italic 500 var(--fs, 14px)/1 var(--font-serif);
}
.spine.f1 .spine__title { font: 700 calc(var(--fs, 14px) * 0.82)/1 var(--font-serif); letter-spacing: 0.1em; text-transform: uppercase; }
.spine.f2 .spine__title { font: 500 calc(var(--fs, 14px) * 0.8)/1 var(--font-mono); }
.spine__year { font: 600 9px/1 var(--font-mono); letter-spacing: 0.02em; opacity: 0.85; }
.spine.v1::before, .spine.v2::before, .spine.v3::before { content: ""; position: absolute; left: 0; right: 0; pointer-events: none; }
.spine.v1::before { bottom: 25px; height: 3px; background: currentColor; opacity: 0.5; }
.spine.v2::before { top: 7px; height: 2px; background: currentColor; opacity: 0.6; box-shadow: 0 5px 0 currentColor; }
.spine.v3::before { top: 0; height: 20px; background: rgb(0 0 0 / 0.25); }

.rental { display: grid; gap: 6px; margin-top: 4px; padding-top: 14px; border-top: 1px dashed var(--line-strong); font: 500 var(--step--1)/1.4 var(--font-mono); }
.rental div { display: flex; gap: 14px; }
.rental dt { min-width: 9ch; color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.85em; }
.rental dd { color: var(--fg); }
.ticket { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--paper); color: var(--paper-ink); border-radius: 10px; overflow: hidden; }
.ticket__stub { position: relative; display: grid; align-content: start; gap: 6px; padding: 18px 20px 20px; }
.ticket__stub + .ticket__stub { border-top: 2px dashed rgb(36 28 40 / 0.3); }
.ticket__admit { font: 700 10px/1 var(--font-mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-note); }
.ticket__title { font: italic 400 var(--step-2)/1.05 var(--font-serif); }
.ticket__meta { font: 500 var(--step--2)/1.4 var(--font-mono); color: rgb(36 28 40 / 0.72); }
.ticket__theme { display: flex; gap: 12px; align-items: baseline; font: italic 400 var(--step-1)/1.35 var(--font-serif); color: var(--ink); }
.ticket__theme span { flex: none; font: 600 var(--step--2)/1 var(--font-mono); font-style: normal; letter-spacing: 0.14em; text-transform: uppercase; color: var(--rose); }
@media (min-width: 560px) {
  .ticket { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ticket__stub + .ticket__stub { border-top: 0; border-left: 2px dashed rgb(36 28 40 / 0.3); }
  .ticket__stub + .ticket__stub::before, .ticket__stub + .ticket__stub::after {
    content: ""; position: absolute; left: -10px; width: 18px; height: 18px; border-radius: 50%; background: var(--night-2);
  }
  .ticket__stub + .ticket__stub::before { top: -9px; }
  .ticket__stub + .ticket__stub::after { bottom: -9px; }
}
@media (min-width: 900px) {
  .store__head { grid-template-columns: minmax(0, 1fr) auto; }
  .sticker { top: -30px; right: -6px; width: 84px; height: 84px; font-size: 10px; }
}
@media (max-width: 640px) {
  .shelf__row { --scale: 0.8; }
}

/* ---------- scene 7: end credits ---------- */

.credits { padding-block: 0; }
.credits__viewport { position: relative; display: grid; justify-items: center; padding-block: clamp(110px, 16vh, 200px) 40px; padding-inline: var(--gutter); }
html.credits-rolling .credits__viewport { height: 100svh; overflow: hidden; align-content: start; padding-block: 0; }
.credits__roll { display: grid; justify-items: center; gap: 26px; width: min(100%, 760px); text-align: center; }
.credits__title { font: italic 300 var(--step-4)/0.9 var(--font-serif); color: var(--ink); }
.credits__sub { font: 500 var(--step--1)/1 var(--font-mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.credits__list { display: grid; gap: 16px; width: 100%; margin-block: 26px; }
.credits__list > div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: baseline; }
.credits__list dt {
  text-align: right; font: 500 var(--step--2)/1.4 var(--font-mono);
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.credits__list dd { text-align: left; font: 400 var(--step-1)/1.3 var(--font-serif); color: var(--ink); overflow-wrap: anywhere; }
.credits__note { font: italic 400 var(--step-1)/1.4 var(--font-serif); color: var(--muted); max-width: 30ch; }
.rating {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  width: min(100%, 470px); margin-top: 14px; text-align: left;
  border: 2px solid var(--ink); color: var(--ink);
}
.rating__mark {
  display: grid; place-items: center; padding: 12px 16px;
  border-right: 2px solid var(--ink);
  font: 800 clamp(1.7rem, 1.3rem + 1.5vw, 2.4rem)/1 var(--font-mono); letter-spacing: -0.04em;
}
.rating__text { padding: 10px 14px 12px; font: 500 0.8rem/1.45 var(--font-mono); }
.rating__name {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  padding-bottom: 6px; margin-bottom: 6px; border-bottom: 2px solid var(--ink);
}
.credits__end { margin-top: 30px; font: italic 300 var(--step-3)/1 var(--font-serif); color: var(--ink); }

.contact { display: grid; justify-items: start; gap: 18px; padding-block: clamp(90px, 14vh, 170px) 0; }
.contact__lede { max-width: 44ch; color: var(--fg); font-size: var(--step-1); line-height: 1.4; }
.contact__link {
  display: inline-flex; align-items: baseline; gap: 0.25em; flex-wrap: wrap;
  margin-top: 10px;
  font: italic 300 clamp(1.8rem, 0.9rem + 5vw, 5.6rem)/1.05 var(--font-serif); letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none;
  background: linear-gradient(var(--rose), var(--rose)) left 100% / 0% 2px no-repeat;
  transition: background-size 0.6s var(--ease-out), color var(--dur-base);
  padding-bottom: 6px;
}
.contact__arrow { width: 0.55em; height: 0.55em; flex: none; align-self: center; fill: none; stroke: var(--rose); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: translate 0.5s var(--ease-out); }
.contact__link:hover .contact__arrow { translate: 0.08em -0.08em; }
.contact__link:hover { background-size: 100% 2px; }

/* ---------- post-credits ---------- */

.post { position: relative; z-index: 1; padding-block: clamp(150px, 34vh, 360px) calc(env(safe-area-inset-bottom, 0px) + 70px); text-align: center; }
.post__inner { display: grid; justify-items: center; gap: 22px; }
.post__label { font: 500 var(--step--2)/1 var(--font-mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.post__line { font: italic 300 var(--step-3)/1.05 var(--font-serif); color: var(--ink); }
.post__foot { margin-top: clamp(70px, 12vh, 120px); font: 400 var(--step--2)/1.6 var(--font-mono); color: var(--muted); max-width: 60ch; }

/* ---------- HUD ---------- */

.hud {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: none; align-items: center; justify-content: space-between; gap: 20px;
  padding: 26px var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 12px);
  font: 500 var(--step--2)/1 var(--font-mono); color: var(--muted); letter-spacing: 0.06em;
  background: linear-gradient(to top, color-mix(in srgb, var(--night) 88%, transparent), transparent);
  pointer-events: none;
  transition: opacity 0.5s;
}
.hud kbd { min-width: 1.6em; height: 1.6em; font-size: 0.95em; margin-right: 0.15em; }
.hud__no { color: var(--rose); margin-right: 0.6em; }
.hud__tc { font-variant-numeric: tabular-nums; }
.hud__bar {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--rose); transform-origin: left; scale: var(--p, 0) 1;
}
html.is-intro .hud { opacity: 0; }

/* ---------- scene selection (dialog) ---------- */

.menu {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: var(--night); color: var(--fg);
  overflow: auto;
}
.menu::backdrop { background: transparent; }
.menu[open] { display: block; }
.menu__inner {
  min-height: 100%; width: 100%; max-width: var(--maxw); margin-inline: auto;
  display: grid; grid-template-rows: auto 1fr auto; gap: 24px;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 26px);
}
.menu__top { display: flex; justify-content: space-between; align-items: center; }
.menu__label { font: 500 var(--step--1)/1 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.menu__close {
  min-height: 44px; padding: 0 18px; cursor: pointer;
  background: none; border: 1px solid var(--line-strong); border-radius: 99px;
  font: 500 var(--step--1)/1 var(--font-mono); color: var(--ink);
}
.menu__list { list-style: none; align-self: center; }
.menu__list a {
  display: grid; grid-template-columns: 2.2em minmax(0, 1fr); align-items: baseline; gap: 6px 16px;
  padding: clamp(10px, 1.6vh, 18px) 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.menu__no { font: 500 var(--step-0)/1 var(--font-mono); color: var(--rose); }
.menu__t { font: italic 300 var(--step-3)/1 var(--font-serif); letter-spacing: -0.02em; transition: translate 0.5s var(--ease-out), color var(--dur-base); }
.menu__slug { display: none; font: 500 var(--step--2)/1.2 var(--font-mono); color: var(--muted); letter-spacing: 0.06em; }
.menu__list a:hover .menu__t, .menu__list a:focus-visible .menu__t { translate: 14px 0; color: var(--rose); }
.menu__list a[aria-current="true"] .menu__t { color: var(--rose); }
.menu__foot { font: 400 var(--step--1)/2 var(--font-mono); color: var(--muted); }

/* ---------- theme pills (popover) ---------- */

.pill-pop {
  position: fixed; inset: auto; margin: 0;
  top: var(--top, 72px); left: var(--left, auto); right: var(--right, 16px);
  width: min(320px, calc(100vw - 32px));
  padding: 16px; border-radius: 16px;
  background: var(--night-2); color: var(--fg);
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 60px -24px rgb(0 0 0 / 0.55);
}
.pill-pop:popover-open { display: grid; gap: 12px; }
.pill-pop__q { font: italic 400 var(--step-1)/1.2 var(--font-serif); color: var(--ink); }
.pill-pop__opts { display: grid; gap: 8px; }
.pill {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 8px 12px;
  background: none; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; text-align: left;
  transition: border-color var(--dur-base), background-color var(--dur-base);
}
.pill:hover { border-color: var(--line-strong); background: var(--night-3); }
.pill[aria-pressed="true"] { border-color: var(--rose); }
.pill b { display: block; font: 600 var(--step-0)/1.2 var(--font-serif); color: var(--ink); }
.pill small { display: block; font: 400 var(--step--1)/1.3 var(--font-mono); color: var(--muted); }
.pill__cap {
  position: relative; flex: none; overflow: hidden;
  width: 34px; height: 14px; border-radius: 99px;
  transform: rotate(-28deg);
  box-shadow: 0 4px 7px -2px rgb(0 0 0 / 0.45), inset 0 -2px 2px rgb(0 0 0 / 0.25);
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pill__cap::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: rgb(20 10 30 / 0.28);
}
.pill__cap::after {
  content: ""; position: absolute; left: 4px; right: 5px; top: 2px; height: 3px; border-radius: 99px;
  background: linear-gradient(90deg, rgb(255 255 255 / 0.9), rgb(255 255 255 / 0.3) 65%, rgb(255 255 255 / 0));
}
.pill--red .pill__cap { background: linear-gradient(180deg, #ffa3a8 0%, #ec4d60 42%, #b32539 100%); }
.pill--blue .pill__cap { background: linear-gradient(180deg, #b3d1ff 0%, #4d82e6 42%, #2148a8 100%); }
.pill:hover .pill__cap, .pill:focus-visible .pill__cap { transform: rotate(-12deg) scale(1.08); }

/* ---------- project notes (dialog) ---------- */

.notes {
  width: min(640px, calc(100vw - 32px)); max-width: none; max-height: none;
  padding: 0; border: 0; background: transparent; color: var(--fg); overflow: visible;
}
.notes::backdrop { background: rgb(8 5 10 / 0.72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.notes__card {
  position: relative;
  max-height: min(84svh, 760px); overflow: auto; overscroll-behavior: contain;
  padding: clamp(24px, 4.4vw, 44px);
  border-radius: 18px; border: 1px solid var(--line-strong);
  background: var(--night-2);
  box-shadow: 0 50px 100px -30px rgb(0 0 0 / 0.6);
}
.notes__label { font: 500 var(--step--2)/1 var(--font-mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--rose); margin-bottom: 18px; }
.notes__content { display: grid; gap: 14px; }
.notes__kicker { font: 500 var(--step--1)/1.3 var(--font-mono); color: var(--muted); }
.notes__title { font: italic 300 var(--step-3)/1 var(--font-serif); color: var(--ink); letter-spacing: -0.02em; }
.notes__content ul { display: grid; gap: 8px; padding-left: 1.1em; }
.notes__content li::marker { color: var(--rose); }
.notes__links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.notes__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 99px;
  font: 500 var(--step--1)/1 var(--font-mono); color: var(--ink); text-decoration: none;
}
.notes__links a:first-child { background: var(--rose); color: var(--on-rose); border-color: transparent; }
.notes__links a:hover { border-color: var(--ink); }
.notes__close {
  position: absolute; top: 14px; right: 14px; min-height: 40px; padding: 0 14px; cursor: pointer;
  background: none; border: 1px solid var(--line-strong); border-radius: 99px;
  font: 500 var(--step--2)/1 var(--font-mono); color: var(--ink);
}

/* ---------- terminal ---------- */

.term {
  position: fixed; z-index: 60;
  left: 8px; right: 8px; top: calc(env(safe-area-inset-top, 0px) + 8px);
  height: min(60svh, 520px);
  display: flex; flex-direction: column;
  background: #36283d; color: #cedaeb;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 40px 100px -20px rgb(0 0 0 / 0.75), 0 0 0 1px rgb(255 255 255 / 0.09);
  font: 400 13.5px/1.5 var(--font-mono);
}
.term__bar {
  flex: none; height: 36px; display: flex; align-items: center; gap: 10px;
  padding: 0 4px 0 12px; background: #2a1f30; user-select: none; touch-action: none;
}
.term__icon {
  width: 14px; height: 14px; border-radius: 3px;
  background: linear-gradient(135deg, #e59db1, #8bb8e9);
}
.term__title { flex: 1; text-align: center; font-size: 12px; color: #cedaeb; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.term__btns { display: flex; gap: 2px; }
.term__btns button {
  width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer;
  background: none; border: 0; border-radius: 50%; color: #cedaeb;
}
.term__btns button:hover { background: rgb(255 255 255 / 0.1); }
.term__btns [data-term-close]:hover { background: #e0525f; color: #fff; }
.term__btns svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.term__body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 8px 10px 10px; cursor: text; }
.term__out { white-space: pre-wrap; overflow-wrap: anywhere; }
.term__out pre { margin: 0; font: inherit; white-space: pre; overflow-x: auto; }
.term__out a { color: #71ade9; }
.term__line { display: flex; gap: 0.6ch; align-items: baseline; }
.term__prompt { flex: none; white-space: nowrap; }
.term__in {
  flex: 1; min-width: 0; padding: 0; margin: 0;
  background: none; border: 0; outline: 0; color: #cedaeb; caret-color: #cedaeb;
  font: inherit; font-size: 16px;
}
.term .kitty__tabs { flex: none; }
.term.is-max { left: 8px !important; right: 8px !important; top: calc(env(safe-area-inset-top, 0px) + 8px) !important; bottom: 8px !important; width: auto !important; height: auto !important; }
.term canvas.term__rain { position: absolute; inset: 36px 0 22px; width: 100%; height: calc(100% - 58px); pointer-events: none; }

/* ---------- note tooltip, toast, cursor ---------- */

.note {
  position: fixed; z-index: 70; left: 0; top: 0;
  width: max-content; max-width: min(320px, calc(100vw - 32px));
  padding: 12px 14px 13px; border-radius: 10px;
  background: #36283d; color: #f6eef0;
  border: 1px solid rgb(229 157 177 / 0.35);
  font: 400 0.98rem/1.45 var(--font-serif);
  box-shadow: 0 22px 48px -14px rgb(0 0 0 / 0.6);
  pointer-events: none;
}
.note::before {
  content: "Director’s note"; display: block; margin-bottom: 4px;
  font: 600 0.64rem/1 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: #e59db1;
}
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 64px); z-index: 80;
  max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 99px;
  background: var(--note-bg); color: var(--note-fg);
  font: 500 var(--step--1)/1.35 var(--font-mono); text-align: center;
  opacity: 0; translate: -50% 16px; pointer-events: none;
  transition: opacity 0.3s, translate 0.45s var(--ease-out);
  box-shadow: 0 20px 40px -16px rgb(0 0 0 / 0.5);
}
.toast.is-on { opacity: 1; translate: -50% 0; }

.cursor { display: none; }
html.has-cursor .cursor { display: block; }
html.has-cursor, html.has-cursor a, html.has-cursor button, html.has-cursor .annot, html.has-cursor [data-drag] { cursor: none; }
html.has-cursor input, html.has-cursor .term__body { cursor: text; }
.cursor__dot, .cursor__ring { position: fixed; left: 0; top: 0; z-index: 95; pointer-events: none; }
.cursor__dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink); }
.cursor__ring {
  width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--ink) 45%, transparent);
}
.cursor__ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--rose) 18%, transparent);
  scale: 0; transition: scale 0.4s var(--ease-out);
}
.cursor__label {
  position: relative; font: 600 9.5px/1 var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink); white-space: nowrap; opacity: 0; transition: opacity 0.25s;
}
.cursor.is-hover .cursor__ring { border-color: var(--rose); }
.cursor.is-hover .cursor__ring::before { scale: 1; }
.cursor.is-label .cursor__label { opacity: 1; }
.cursor.is-hidden .cursor__dot, .cursor.is-hidden .cursor__ring { opacity: 0; }
.cursor__dot, .cursor__ring { transition: opacity 0.3s; }

/* ---------- Lenis ---------- */

html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* ---------- larger screens ---------- */

@media (min-width: 560px) {
  .shorts a { grid-template-columns: minmax(0, 15ch) minmax(0, 1fr); gap: 18px; align-items: baseline; }
}
@media (min-width: 640px) {
  .nav__link { display: inline-flex; }
  .term { left: 50%; right: auto; top: 50%; bottom: auto; width: min(780px, calc(100vw - 48px)); height: min(520px, calc(100svh - 140px)); translate: -50% -50%; }
  .term.is-moved { translate: none; }
}
@media (min-width: 720px) {
  .menu__list a { grid-template-columns: 2.4em minmax(0, 1fr) auto; }
  .menu__slug { display: block; }
}
@media (min-width: 860px) {
  .work__more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 900px) and (pointer: fine) {
  .hud { display: flex; }
  .hero__billing { padding-bottom: 66px; }
}
@media (min-width: 960px) {
  .vo__wrap { grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
  .vo__text { grid-column: 1 / span 7; }
  .vo__lock { grid-column: 8 / span 5; align-self: stretch; min-height: 0; }
  .lock-caption { top: 76svh; margin-top: 64svh; }
  .kitty { grid-column: 4 / span 9; }
  .dvd.is-on { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: start; }
  .dvd__screen { position: sticky; top: 110px; width: 100%; min-width: 0; min-height: clamp(380px, 48vh, 520px); }
}
@media (max-width: 959.98px) {
  .dvd.is-on .dvd__screen { order: -1; }
  html:not([data-stage="0"]):not([data-stage="5"]) #stage { opacity: 0.5; }
  #stage { transition: opacity 0.8s; }
  .fx__glow { transform: translate3d(55vw, 24vh, 0); }
}
@media (max-width: 1100px) and (min-width: 900px) {
  .hud__keys { display: none; }
}
@media (max-width: 480px) {
  .work__count { display: none; }
  .work__head { grid-template-columns: minmax(0, 1fr); }
  .hero__billing { gap: 8px 22px; }
  .credits__list > div { gap: 14px; }
  .sp__no:last-child { display: none; }
}

/* ---------- without JavaScript, hide the controls that need it ---------- */

html:not(.js) [data-open-terminal], html:not(.js) [data-pill], html:not(.js) [data-menu],
html:not(.js) [data-rabbit], html:not(.js) .hud, html:not(.js) .store__actions, html:not(.js) .script__hint, html:not(.js) .kitty__cap .link-btn { display: none; }

/* ---------- reduced motion ---------- */

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

/* ---------- theme swap (view transition) ---------- */

::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { z-index: 2; }
