/*=============== TOKENS ===============*/
:root {
  color-scheme: light;
  --bg: #F6F1EA;
  --bg-alt: #EFE7DC;
  --surface: #FFFDF9;
  --ink: #1B1614;
  --muted: #5E544E;
  --subtle: #8C8077;
  --line: #E2D6C8;
  --accent: #B3261E;
  --accent-hover: #941C16;
  --accent-ink: #FFFFFF;
  --accent-soft: #F6DCD6;
  --gold: #A86A12;
  --slot-a: #EADFD1;
  --slot-b: #E3D6C5;
  --shadow: 0 1px 2px rgb(27 22 20 / .05), 0 10px 28px -14px rgb(27 22 20 / .18);
  --shadow-lg: 0 2px 4px rgb(27 22 20 / .05), 0 28px 56px -24px rgb(27 22 20 / .3);
  --header-bg: rgb(246 241 234 / .82);
  --grain-opacity: .06;

  /* The reel, scene menu and end credits are always "in the dark" */
  --night: #0F0D0C;
  --night-2: #1E1A17;
  --night-line: #2F2925;
  --night-ink: #F3ECE3;
  --night-muted: #B3A79B;
  --night-accent: #FF6B5B;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'Courier Prime', 'Courier New', monospace;
  --font-hand: 'Caveat', 'Segoe Print', cursive;

  --radius-sm: .5rem;
  --radius: 1rem;
  --radius-lg: 1.5rem;
  --header-h: 4.25rem;
  --container: 72rem;
  --gutter: 1rem;
  --section-space: clamp(4.5rem, 10vw, 8rem);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0F0D0C;
    --bg-alt: #161311;
    --surface: #1E1A17;
    --ink: #F3ECE3;
    --muted: #B3A79B;
    --subtle: #85796E;
    --line: #2F2925;
    --accent: #FF6B5B;
    --accent-hover: #FF8A7D;
    --accent-ink: #140F0D;
    --accent-soft: #3A1B17;
    --gold: #E8B04B;
    --slot-a: #221D1A;
    --slot-b: #1A1614;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -14px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 28px 56px -24px rgb(0 0 0 / .7);
    --header-bg: rgb(15 13 12 / .8);
    --grain-opacity: .09;
    --night: #070605;
    --night-2: #171412;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0F0D0C;
  --bg-alt: #161311;
  --surface: #1E1A17;
  --ink: #F3ECE3;
  --muted: #B3A79B;
  --subtle: #85796E;
  --line: #2F2925;
  --accent: #FF6B5B;
  --accent-hover: #FF8A7D;
  --accent-ink: #140F0D;
  --accent-soft: #3A1B17;
  --gold: #E8B04B;
  --slot-a: #221D1A;
  --slot-b: #1A1614;
  --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -14px rgb(0 0 0 / .6);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 28px 56px -24px rgb(0 0 0 / .7);
  --header-bg: rgb(15 13 12 / .8);
  --grain-opacity: .09;
  --night: #070605;
  --night-2: #171412;
}

/*=============== BASE ===============*/
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.menu-open { overflow: hidden; }

h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 400; }
p { margin: 0 0 1rem; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
code { font-family: var(--font-mono); font-size: .9em; background: var(--accent-soft); padding: .05em .35em; border-radius: .3em; }
strong { font-weight: 600; color: var(--ink); }
button { font: inherit; color: inherit; }
em { font-style: italic; color: var(--accent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

.skip-link {
  position: fixed; top: -3rem; left: 1rem; z-index: 200;
  background: var(--accent); color: var(--accent-ink);
  padding: .5rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

/* Film grain across the whole page */
.grain {
  position: fixed; inset: -50%; z-index: 150; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -1%); }
  80% { transform: translate(3%, 3%); }
  100% { transform: translate(0, 0); }
}

/*=============== BUTTONS & SMALL PARTS ===============*/
.button {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .9rem 1.5rem;
  border: 1px solid var(--accent); border-radius: 999px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; cursor: pointer;
  transition: background .2s, transform .2s var(--ease), box-shadow .2s;
}
.button:hover { background: var(--accent-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.button i { font-size: 1.25rem; }
.button--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.button--ghost:hover { background: var(--surface); }

.icon-button {
  display: inline-grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); cursor: pointer;
  font-size: 1.2rem;
  transition: border-color .2s;
}
.icon-button:hover { border-color: var(--accent); }

.tag {
  display: inline-block;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  padding: .1rem .5rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted);
}

.rec {
  display: inline-block; width: .55rem; height: .55rem; border-radius: 50%;
  background: #E5322D; animation: blink 1.2s steps(2) infinite;
}
@keyframes blink { 50% { opacity: .15; } }

.status__dot { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: #2E9E58; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgb(46 158 88 / .5); } 70%, 100% { box-shadow: 0 0 0 .5rem rgb(46 158 88 / 0); } }

/*=============== HEADER ===============*/
.header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.header__progress {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--accent);
  transform-origin: left; transform: scaleX(var(--scroll, 0));
}
.header__inner { height: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; }

.logo { display: flex; align-items: center; gap: .65rem; justify-self: start; }
.logo__name { font-family: var(--font-display); font-size: 1.6rem; letter-spacing: .01em; }

/* Clapperboard logo: the top bar claps on hover */
.slate { position: relative; width: 2.2rem; height: 2.1rem; display: block; }
.slate__body {
  position: absolute; inset: auto 0 0 0; height: 1.55rem;
  background: var(--ink); color: var(--bg);
  border-radius: .25rem;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 1.2rem; font-style: italic;
}
.slate__top {
  position: absolute; left: 0; right: 0; top: .1rem; height: .42rem;
  border-radius: .15rem;
  background: repeating-linear-gradient(-55deg, var(--ink) 0 .32rem, var(--accent) .32rem .64rem);
  transform-origin: left bottom; transform: rotate(-16deg);
  transition: transform .18s var(--ease);
}
.logo:hover .slate__top, .slate.is-clapping .slate__top { transform: rotate(0); }

.timecode {
  display: inline-flex; align-items: center; gap: .45rem;
  font-family: var(--font-mono); font-size: .85rem; color: var(--muted);
  padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.header__actions { display: flex; align-items: center; gap: .6rem; justify-self: end; }

.scenes-button {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .55rem .6rem .55rem 1.1rem;
  border: 1px solid var(--ink); border-radius: 999px;
  background: var(--ink); color: var(--bg); cursor: pointer;
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
}
.scenes-button__icon { position: relative; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--accent); }
.scenes-button__icon span {
  position: absolute; left: .4rem; right: .4rem; height: 1.5px; background: var(--accent-ink);
  transition: transform .3s var(--ease), top .3s var(--ease);
}
.scenes-button__icon span:first-child { top: .55rem; }
.scenes-button__icon span:last-child { top: .85rem; }
.scenes-button[aria-expanded="true"] .scenes-button__icon span:first-child { top: .7rem; transform: rotate(45deg); }
.scenes-button[aria-expanded="true"] .scenes-button__icon span:last-child { top: .7rem; transform: rotate(-45deg); }

/*=============== SCENE MENU ===============*/
.scene-menu {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 90;
  background: var(--night); color: var(--night-ink);
  overflow-y: auto;
  animation: menu-in .5s var(--ease);
}
@keyframes menu-in { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.scene-menu__inner { padding-block: clamp(2rem, 6vh, 4rem); display: grid; gap: 2rem; }
.scene-menu__kicker { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .3em; text-transform: uppercase; color: var(--night-muted); margin: 0; }
.scene-menu__list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 3rem; }
.scene-menu__list a {
  display: grid; grid-template-columns: 3rem 1fr; align-items: baseline;
  padding: 1rem 0; border-bottom: 1px solid var(--night-line);
  font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 3rem); line-height: 1.1;
  transition: color .2s, padding .3s var(--ease);
}
.scene-menu__list a:hover { color: var(--night-accent); padding-left: .5rem; }
.scene-menu__list span { font-family: var(--font-mono); font-size: .85rem; color: var(--night-accent); }
.scene-menu__list small { grid-column: 2; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--night-muted); margin-top: .35rem; }
.scene-menu .button { justify-self: start; --accent: var(--night-accent); --accent-ink: var(--night); --accent-hover: #FF8A7D; }
.scene-menu__list li { animation: menu-item .6s var(--ease) both; }
.scene-menu__list li:nth-child(2) { animation-delay: .05s; }
.scene-menu__list li:nth-child(3) { animation-delay: .1s; }
.scene-menu__list li:nth-child(4) { animation-delay: .15s; }
.scene-menu__list li:nth-child(5) { animation-delay: .2s; }
.scene-menu__list li:nth-child(6) { animation-delay: .25s; }
@keyframes menu-item { from { opacity: 0; transform: translateY(1rem); } }

/*=============== SIDE TRACKER ===============*/
.tracker {
  position: fixed; right: 1.25rem; top: 50%; z-index: 80;
  transform: translateY(-50%);
  display: grid; gap: .9rem; justify-items: end;
}
.tracker a { position: relative; display: block; width: 1rem; height: 2px; background: var(--subtle); transition: width .3s var(--ease), background .3s; }
.tracker a::before {
  content: attr(data-label); position: absolute; right: calc(100% + .6rem); top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: .7rem; white-space: nowrap; color: var(--subtle);
  opacity: 0; transition: opacity .2s;
}
.tracker a.is-active { width: 2.25rem; background: var(--accent); }
.tracker a.is-active::before { opacity: 1; color: var(--accent); }
.tracker { transition: opacity .3s; }
.tracker.is-on-dark { opacity: 0; pointer-events: none; }

/*=============== COLD OPEN ===============*/
.cold-open {
  position: relative;
  min-height: calc(100svh - var(--header-h));
  display: grid; align-content: center;
  padding-block: clamp(3.5rem, 8vh, 5rem) 5rem;
  text-align: center;
  overflow: hidden;
}
.letterbox { position: absolute; left: 0; right: 0; height: clamp(1rem, 4vh, 2.25rem); background: #000; z-index: 2; }
.letterbox--top { top: 0; animation: bars-top 1.2s var(--ease) .2s both; }
.letterbox--bottom { bottom: 0; animation: bars-bottom 1.2s var(--ease) .2s both; }
@keyframes bars-top { from { transform: translateY(-100%); } }
@keyframes bars-bottom { from { transform: translateY(100%); } }

.cold-open__kicker {
  justify-self: center; max-width: 100%;
  font-family: var(--font-mono); font-size: .8rem; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.cold-open__inner { display: grid; justify-items: center; }
.cold-open__kicker .status__dot { margin-right: .5rem; vertical-align: .1em; }
.cold-open__title { display: grid; justify-items: center; margin: .5rem 0 2.5rem; }
.cold-open__name {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 17vw, 13.5rem);
  line-height: .85; letter-spacing: -.03em;
}
.cold-open__tagline { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.25rem); color: var(--muted); margin-top: .5rem; }

.cold-open__stage {
  width: 100%;
  display: grid; grid-template-columns: 1fr 17rem 1fr; align-items: center;
  gap: clamp(1.5rem, 4vw, 3.5rem);
}
.cold-open__intro { text-align: left; justify-self: end; max-width: 22rem; }
.cold-open__intro p { color: var(--muted); }
.cold-open__buttons { display: flex; flex-wrap: wrap; gap: .6rem; }
.cold-open__side { justify-self: start; display: grid; justify-items: start; gap: .75rem; }
.hint { font-family: var(--font-hand); font-size: 1.25rem; color: var(--accent); margin: 0; transform: rotate(-3deg); }

.roll-cue {
  position: absolute; left: 50%; bottom: 3.25rem; transform: translateX(-50%);
  display: grid; justify-items: center; gap: .1rem;
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .25em; text-transform: uppercase; color: var(--subtle);
}
.roll-cue i { font-size: 1.2rem; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(.35rem); } }

.socials { display: flex; gap: .4rem; }
.socials a { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; font-size: 1.3rem; color: var(--muted); border: 1px solid var(--line); border-radius: 50%; transition: color .2s, border-color .2s; }
.socials a:hover { color: var(--accent); border-color: var(--accent); }

/* Viewfinder around the portrait */
.viewfinder { position: relative; padding: .9rem; }
.viewfinder__corner { position: absolute; width: 1.5rem; height: 1.5rem; border: 2px solid var(--accent); z-index: 2; }
.viewfinder__corner--tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.viewfinder__corner--tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.viewfinder__corner--bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.viewfinder__corner--br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.viewfinder__focus {
  position: absolute; left: 48%; top: 20%; z-index: 3; width: 3.5rem; height: 3.5rem;
  transform: translate(-50%, -50%);
  border: 1.5px solid rgb(255 255 255 / .75); border-radius: .3rem;
  animation: focus 3.5s var(--ease) infinite;
}
@keyframes focus { 0%, 100% { scale: 1; opacity: .8; } 12% { scale: .82; } 20% { scale: 1.06; opacity: 1; } 28% { scale: 1; } }
.viewfinder__hud {
  position: absolute; left: 1.6rem; z-index: 3;
  display: inline-flex; align-items: center; gap: .4rem;
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em;
  color: #fff; text-shadow: 0 1px 4px rgb(0 0 0 / .6);
}
.viewfinder__hud--top { top: 1.5rem; }
.viewfinder__hud--bottom { bottom: 1.5rem; }

/* The clappable slate */
.hero-slate {
  display: block; width: 14rem; padding: 0; border: 0; background: none; cursor: pointer;
  transform: rotate(3deg); text-align: left;
  transition: transform .3s var(--ease);
}
.hero-slate:hover { transform: rotate(0); }
.hero-slate__clapper {
  display: block; height: 1.1rem; border-radius: .3rem .3rem 0 0;
  background: repeating-linear-gradient(-55deg, #111 0 .9rem, #F3ECE3 .9rem 1.8rem);
  transform-origin: left bottom; transform: rotate(-14deg);
  transition: transform .15s var(--ease);
}
.hero-slate.is-clapping .hero-slate__clapper { transform: rotate(0); }
.hero-slate__grid {
  display: grid; grid-template-columns: 1fr 1fr;
  background: #141110; color: #F3ECE3;
  border-radius: 0 0 .4rem .4rem; box-shadow: var(--shadow-lg);
  font-family: var(--font-mono); font-size: .95rem; font-weight: 700;
}
.hero-slate__grid > span { padding: .35rem .6rem; border: 1px solid rgb(255 255 255 / .18); }
.hero-slate__grid b { display: block; font-size: .6rem; font-weight: 400; text-transform: uppercase; letter-spacing: .1em; opacity: .65; }
.hero-slate__grid i { font-style: normal; }

/* Scrolling roles strip */
.marquee {
  background: var(--ink); color: var(--bg);
  overflow: hidden; white-space: nowrap;
}
.marquee__track {
  display: inline-flex; align-items: center; gap: 1.75rem;
  padding: .9rem 0;
  font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.25rem); font-style: italic;
  animation: marquee 32s linear infinite;
}
.marquee__track i { color: var(--accent); font-size: 1rem; }
@keyframes marquee { to { transform: translateX(-50%); } }

/*=============== SLOTS (image placeholders) ===============*/
.slot {
  position: relative; margin: 0; overflow: hidden;
  display: grid; place-items: center;
  background: repeating-linear-gradient(45deg, var(--slot-a) 0 12px, var(--slot-b) 12px 24px);
  color: var(--subtle);
  border-radius: var(--radius);
}
.slot > i { font-size: 2.5rem; opacity: .7; transition: transform .3s var(--ease); }
.slot::after {
  content: attr(data-label) '\A' attr(data-src);
  white-space: pre; text-align: center;
  position: absolute; left: .75rem; right: .75rem; top: calc(50% + 2rem);
  font-family: var(--font-mono); font-size: .68rem; line-height: 1.5;
  color: var(--subtle); overflow: hidden; text-overflow: ellipsis;
}
.slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.slot.has-img > i, .slot.has-img::after { display: none; }
.slot.has-img[data-lightbox] { cursor: zoom-in; }

.slot--portrait { aspect-ratio: 3 / 4; border-radius: .4rem; }
.slot--portrait img { object-position: 50% 12%; }
.slot--poster { aspect-ratio: 4 / 5; border-radius: .6rem; }
.slot[data-fit="top"] img { object-position: 50% 0; }
.slot[data-fit="contain"].has-img { background: var(--fit-bg, #000); }
.slot[data-fit="contain"] img { object-fit: contain; }
/* Wide or square posters sit whole on a blurred copy of themselves */
.slot[data-fit="blur"] img { object-fit: contain; }
.slot[data-fit="blur"].has-img::before {
  content: ''; position: absolute; inset: -2rem;
  background: var(--img) center / cover;
  filter: blur(22px) brightness(.55) saturate(1.2);
}

/*=============== SCENES (shared) ===============*/
.scene { padding-block: var(--section-space); }
.scene--alt { background: var(--bg-alt); }

.slugline {
  display: flex; align-items: center; gap: 1rem;
  font-family: var(--font-mono); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase;
}
.slugline__no { flex: none; white-space: nowrap; padding: .2rem .6rem; border: 1.5px solid var(--accent); color: var(--accent); border-radius: .3rem; font-weight: 700; }
.slugline__text { color: var(--muted); }
.slugline::after { content: ''; flex: 1; border-bottom: 1.5px dashed var(--line); }

.scene__title { font-family: var(--font-display); font-size: clamp(2.6rem, 6vw, 4.5rem); letter-spacing: -.01em; margin: 1.25rem 0 clamp(2rem, 5vw, 3rem); }
.scene__lead { color: var(--muted); max-width: 40rem; margin-top: -1.5rem; margin-bottom: 2.5rem; }

/*=============== SC. 1 — SCREENPLAY PAGE ===============*/
.script { display: grid; grid-template-columns: minmax(0, 46rem) 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.script__page {
  position: relative;
  background: var(--surface); border: 1px solid var(--line);
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 5vw, 3.5rem) clamp(2rem, 5vw, 3.5rem) clamp(2.75rem, 7vw, 5rem);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-mono); font-size: 1rem; line-height: 1.55;
  rotate: -.5deg;
}
/* Three brass brads down the left edge, like a bound script */
.script__page::before {
  content: ''; position: absolute; left: clamp(1rem, 2.5vw, 1.6rem); top: 0; bottom: 0; width: .8rem;
  background:
    radial-gradient(circle, #B98A3E 0 .3rem, transparent .32rem) 0 18% / .8rem .8rem no-repeat,
    radial-gradient(circle, #B98A3E 0 .3rem, transparent .32rem) 0 50% / .8rem .8rem no-repeat,
    radial-gradient(circle, #B98A3E 0 .3rem, transparent .32rem) 0 82% / .8rem .8rem no-repeat;
}
.script__page p { margin: 0 0 1rem; }
.script__action { color: var(--ink); }
.script__caps { font-weight: 700; }
.script__heading { font-weight: 700; text-transform: uppercase; margin-top: 1.5rem !important; }
.script__character { margin: 1.5rem 0 0 !important; padding-left: 35%; font-weight: 700; }
.script__character span { font-weight: 400; }
.script__paren { margin: 0 !important; padding-left: 28%; color: var(--muted); }
.script__dialogue { padding-left: 18%; padding-right: 12%; }
.script__transition:last-child { margin-bottom: 0 !important; }
.script__transition { text-align: right; text-transform: uppercase; color: var(--accent); margin-top: 1.5rem !important; }

.notes { display: grid; gap: 2.25rem; padding-top: 2rem; }
.note {
  font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.15; color: var(--accent);
  max-width: 14rem; margin: 0;
}
.note:nth-child(1) { rotate: -3deg; }
.note:nth-child(2) { rotate: 2deg; margin-left: 2rem; }
.note:nth-child(3) { rotate: -1.5deg; }
.note__num { display: block; font-size: 4rem; line-height: .9; font-weight: 700; }
.note--circle {
  justify-self: start; padding: 1rem 1.5rem; rotate: -4deg;
  border: 2px solid var(--accent); border-radius: 55% 45% 50% 50% / 50% 55% 45% 50%;
}
.note--circle b { font-size: 2rem; }

/*=============== SC. 2 — THE REEL ===============*/
.reel {
  --bg: var(--night); --surface: var(--night-2); --ink: var(--night-ink); --muted: var(--night-muted);
  --subtle: #85796E; --line: var(--night-line); --accent: var(--night-accent);
  --slot-a: #221D1A; --slot-b: #1A1614;
  position: relative;
  background: var(--bg); color: var(--ink);
}
.reel__sticky {
  position: relative;
  display: flex; align-items: center;
  padding-block: 4.5rem;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
}
.reel__sticky::-webkit-scrollbar { display: none; }
/* Sprocket holes along both edges */
.reel__sticky::before, .reel__sticky::after {
  content: ''; position: absolute; left: 0; right: 0; height: 12px;
  background: repeating-linear-gradient(90deg, var(--night-ink) 0 16px, transparent 16px 36px);
  opacity: .18;
}
.reel__sticky::before { top: 1.5rem; }
.reel__sticky::after { bottom: 1.5rem; }

.reel__track {
  display: flex; align-items: stretch; gap: clamp(1.25rem, 3vw, 2.25rem);
  padding-inline: max(var(--gutter), (100vw - var(--container)) / 2);
  will-change: transform;
}
.reel__track > * { flex: none; scroll-snap-align: center; }
.reel__track::after { content: ''; flex: none; width: 1px; }
.reel__intro, .reel__end { align-self: center; }

.reel__intro { width: min(24rem, 82vw); }
.reel__intro .scene__title { margin-bottom: 1rem; }
.reel__intro p { color: var(--muted); }
.reel__hint { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.reel__hint i { animation: slide 1.6s ease-in-out infinite; }
@keyframes slide { 50% { transform: translateX(.4rem); } }

.frame-card {
  --w: min(18rem, 74vw);
  position: relative; width: var(--w);
  background: var(--surface); border: 1px solid var(--line); border-radius: 1rem;
  padding: .75rem .75rem 1.25rem;
  transition: transform .4s var(--ease), border-color .3s;
}
.frame-card:hover { transform: translateY(-6px) rotate(-1deg); border-color: var(--accent); }
.frame-card:hover .slot > i { transform: scale(1.15) rotate(-6deg); }
.frame-card__no {
  position: absolute; top: 1.4rem; right: 1.4rem; z-index: 2;
  font-family: var(--font-mono); font-size: .72rem; color: var(--ink);
  background: rgb(0 0 0 / .55); padding: .1rem .45rem; border-radius: .3rem;
}
.frame-card__role { margin: 1rem .25rem .1rem; font-family: var(--font-mono); font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.frame-card__title { margin: 0 .25rem .4rem; font-family: var(--font-display); font-size: 1.75rem; }
.frame-card__meta { margin: 0 .25rem; font-size: .85rem; color: var(--muted); display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; }
.frame-card__desc { margin: .5rem .25rem 0; font-size: .9rem; color: var(--muted); }
.frame-card__link { display: inline-flex; align-items: center; gap: .3rem; margin: .6rem .25rem 0; color: var(--accent); font-weight: 600; }

/* Stand-in "poster" for unreleased work */
.classified {
  position: relative; aspect-ratio: 4 / 5; border-radius: .6rem; overflow: hidden;
  display: grid; place-items: center; align-content: center; gap: 1rem;
  background: #16120F;
}
.classified__lines {
  position: absolute; inset: 1.25rem; display: grid; align-content: start; gap: .7rem;
  background: repeating-linear-gradient(#2A2420 0 .55rem, transparent .55rem 1.3rem);
  mask: linear-gradient(90deg, #000 60%, transparent);
  opacity: .9;
}
.classified__stamp {
  position: relative; rotate: -12deg;
  padding: .35rem .9rem; border: 3px solid var(--accent); border-radius: .3rem;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.35rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); background: rgb(22 18 15 / .85);
  box-shadow: inset 0 0 0 2px rgb(22 18 15), inset 0 0 0 3px var(--accent);
}
.classified__note { position: relative; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.redacted { background: #050403; color: transparent; border-radius: .15rem; padding-inline: .15em; user-select: none; box-shadow: inset 0 0 0 1px var(--line); rotate: -1deg; display: inline-block; }
.frame-card:hover .classified__stamp { animation: stamp .35s var(--ease); }
@keyframes stamp { 40% { scale: 1.12; } }

.reel__chapter {
  align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: .6rem;
  writing-mode: vertical-rl; rotate: 180deg;
  padding-inline: .5rem; border-right: 1.5px dashed var(--line);
  font-family: var(--font-display); font-size: 2rem; font-style: italic; color: var(--ink);
}
.reel__chapter span { font-family: var(--font-mono); font-style: normal; font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }

.reel__end { width: min(18rem, 70vw); text-align: center; }
.reel__end p { font-family: var(--font-display); font-size: clamp(2.5rem, 5vw, 3.5rem); line-height: 1; }
.reel__end span { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }

/* Pinned mode (desktop): JS sets the section height and moves the track */
.reel.is-pinned .reel__sticky {
  position: sticky; top: var(--header-h);
  height: calc(100svh - var(--header-h));
  overflow: hidden; scroll-snap-type: none; padding-block: 0;
}
.reel__progress {
  position: absolute; left: 0; bottom: 0; z-index: 2; height: 3px; width: 100%;
  background: var(--accent); transform-origin: left; transform: scaleX(var(--reel-progress, 0));
}
.reel:not(.is-pinned) .reel__progress { display: none; }
.reel.is-pinned .frame-card { --w: min(18rem, calc((100svh - var(--header-h) - 16rem) * .8)); }

/*=============== SC. 3 — CONTINUITY BOARD ===============*/
#continuity { background-image: radial-gradient(var(--line) 1px, transparent 1.5px); background-size: 22px 22px; }
/* Even rows, with a centred last row */
.board {
  --cols: 4; --gap: clamp(1.25rem, 2.5vw, 2rem);
  display: flex; flex-wrap: wrap; justify-content: center; align-items: stretch;
  gap: calc(var(--gap) * 1.4) var(--gap); padding-top: 1.25rem;
}
.polaroid {
  --r: -1.5deg;
  position: relative; margin: 0;
  flex: 0 0 calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols));
  display: flex; flex-direction: column;
  background: #FBF8F3; padding: .7rem .7rem .9rem;
  box-shadow: 0 2px 4px rgb(0 0 0 / .08), 0 18px 30px -16px rgb(0 0 0 / .35);
  rotate: var(--r);
  transition: rotate .4s var(--ease), scale .4s var(--ease), box-shadow .4s;
}
/* A gentle, repeating tilt so the board feels pinned up but still lines up */
.polaroid:nth-child(4n + 2) { --r: 1deg; }
.polaroid:nth-child(4n + 3) { --r: -.5deg; }
.polaroid:nth-child(4n + 4) { --r: 1.5deg; }
.polaroid:hover { rotate: 0deg; scale: 1.05; z-index: 2; box-shadow: 0 30px 50px -20px rgb(0 0 0 / .45); }

/* Strip of tape holding each photo */
.polaroid::before {
  content: ''; position: absolute; top: -.7rem; left: 50%; z-index: 2;
  width: 4.5rem; height: 1.4rem; translate: -50% 0; rotate: -4deg;
  background: rgb(232 214 170 / .75); box-shadow: 0 1px 2px rgb(0 0 0 / .08);
}
.polaroid .slot { aspect-ratio: 1; border-radius: 0; --slot-a: #E7DED2; --slot-b: #DED3C5; color: #8C8077; }
.polaroid .slot::after { color: #8C8077; }
.polaroid .slot img { object-position: 50% 30%; }
.polaroid figcaption {
  margin-top: .6rem; text-align: center; line-height: 1.15; text-wrap: balance;
  font-family: var(--font-hand); font-size: 1.35rem; color: #2B2420;
}

/*=============== SC. 4 — THE TAKES ===============*/
.takes { display: grid; gap: 1.5rem; }
.takes__tabs { display: flex; gap: .6rem; overflow-x: auto; scrollbar-width: none; padding-bottom: .25rem; }
.takes__tabs button {
  flex: none; cursor: pointer;
  display: grid; justify-items: start; gap: .1rem;
  padding: .7rem 1.2rem; text-align: left;
  border: 1px solid var(--line); border-radius: .8rem; background: var(--surface);
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle);
  transition: background .25s, color .25s, border-color .25s;
}
.takes__tabs button span { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.takes__tabs button:hover { border-color: var(--accent); }
.takes__tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.takes__tabs button[aria-selected="true"] span { color: var(--accent-ink); }

.takes__board {
  display: grid; grid-template-columns: 17rem 1fr; gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2.75rem); box-shadow: var(--shadow);
}
.board-slate { display: block; rotate: -3deg; }
.board-slate__clapper {
  display: block; height: 1.4rem; border-radius: .35rem .35rem 0 0;
  background: repeating-linear-gradient(-55deg, #111 0 1.1rem, #F3ECE3 1.1rem 2.2rem);
  transform-origin: left bottom; transform: rotate(-12deg);
  transition: transform .15s var(--ease);
}
.board-slate.is-clapping .board-slate__clapper { transform: rotate(0); }
.board-slate__body {
  display: grid; background: #141110; color: #F3ECE3;
  border-radius: 0 0 .5rem .5rem; font-family: var(--font-mono); font-weight: 700;
  box-shadow: var(--shadow-lg);
}
.board-slate__row { padding: .6rem .9rem; border: 1px solid rgb(255 255 255 / .16); font-size: 1.1rem; }
.board-slate__row b { display: block; font-size: .62rem; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; opacity: .6; }
.board-slate__row--big i { font-style: normal; font-size: 4.5rem; line-height: 1; color: var(--night-accent); }

.takes__panel > i { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: .8rem; background: var(--accent-soft); color: var(--accent); font-size: 1.5rem; margin-bottom: 1rem; }
.takes__panel h3 { font-family: var(--font-display); font-size: clamp(2.25rem, 4.5vw, 3.25rem); margin-bottom: .75rem; }
.takes__panel p { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); max-width: 34rem; margin: 0; }
.takes__panel:not([hidden]) { animation: take-in .5s var(--ease); }
@keyframes take-in { from { opacity: 0; transform: translateY(.75rem); } }

/* Kit list on a clipboard */
.kit {
  position: relative; margin-top: clamp(3rem, 6vw, 4.5rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 2.75rem clamp(1.5rem, 4vw, 2.5rem) 2rem;
}
.kit::before {
  content: ''; position: absolute; top: -.9rem; left: 50%; translate: -50% 0;
  width: 7rem; height: 1.8rem; border-radius: .4rem .4rem .6rem .6rem;
  background: linear-gradient(#9A9089, #6E655F); box-shadow: var(--shadow);
}
.kit__title { display: flex; align-items: center; gap: .5rem; font-family: var(--font-display); font-size: 2rem; margin-bottom: 1.5rem; }
.kit__title i { color: var(--accent); font-size: 1.6rem; }
.kit__cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5rem 2rem; }
.kit li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px dashed var(--line); font-size: .95rem; }
.kit li:not(.kit__head)::before {
  content: '✓'; flex: none; display: grid; place-items: center; width: 1.1rem; height: 1.1rem;
  border: 1.5px solid var(--accent); border-radius: .2rem; color: var(--accent); font-size: .75rem; font-weight: 700;
}
.kit__learning li:not(.kit__head)::before { content: ''; border-style: dashed; border-color: var(--subtle); }
.kit__head { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--subtle); border-bottom: 1.5px solid var(--ink) !important; }

/*=============== SC. 5 — TICKET ===============*/
.ticket {
  --notch: 1.25rem;
  margin-top: 2.5rem;
  display: grid; grid-template-columns: 13rem 1fr;
  filter: drop-shadow(0 24px 30px rgb(0 0 0 / .14));
}
.ticket__stub, .ticket__main { position: relative; min-width: 0; }
.ticket__stub {
  display: grid; align-content: center; justify-items: center; gap: .75rem; text-align: center;
  padding: 2rem 1rem;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  /* Bite-shaped notches where the stub tears off */
  mask: radial-gradient(circle at 100% 0, transparent var(--notch), #000 calc(var(--notch) + .5px)) top / 100% 51% no-repeat,
        radial-gradient(circle at 100% 100%, transparent var(--notch), #000 calc(var(--notch) + .5px)) bottom / 100% 51% no-repeat;
}
.ticket__admit { font-family: var(--font-display); font-size: 2.5rem; line-height: 1; }
.ticket__show { font-family: var(--font-mono); font-size: .8rem; letter-spacing: .25em; text-transform: uppercase; }
.ticket__no { font-family: var(--font-mono); font-size: .75rem; opacity: .75; }

.ticket__main {
  padding: clamp(1.75rem, 4vw, 3rem);
  background: var(--surface);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  border-left: 2px dashed var(--line);
  mask: radial-gradient(circle at 0 0, transparent var(--notch), #000 calc(var(--notch) + .5px)) top / 100% 51% no-repeat,
        radial-gradient(circle at 0 100%, transparent var(--notch), #000 calc(var(--notch) + .5px)) bottom / 100% 51% no-repeat;
}
.ticket__main .scene__title { margin: 0 0 1rem; }
.ticket__main > p { color: var(--muted); }

.ticket__channels { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.25rem 0 2rem; }
.channel {
  display: inline-flex; align-items: center; gap: .75rem; cursor: pointer;
  padding: .75rem 1.25rem .75rem .9rem; border: 1px solid var(--line); border-radius: .9rem; background: var(--bg);
  font: inherit; color: var(--ink); text-align: left;
  transition: border-color .2s, transform .2s var(--ease);
}
.channel:hover { border-color: var(--accent); transform: translateY(-2px); }
.channel > i { font-size: 1.9rem; color: var(--accent); }
.channel { max-width: 100%; }
.channel > span { display: grid; min-width: 0; line-height: 1.25; font-size: .9rem; color: var(--muted); overflow-wrap: anywhere; }
.channel b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; color: var(--ink); }


.ticket__form { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.field { display: grid; gap: .35rem; }
.field--full { grid-column: 1 / -1; }
.field span { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.field:focus-within span { color: var(--accent); }
.field input, .field textarea {
  font: inherit; color: var(--ink);
  background: transparent; border: 0; border-bottom: 1.5px solid var(--line); border-radius: 0;
  padding: .5rem 0; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.ticket__submit { grid-column: 1 / -1; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .5rem; }
.field__note { font-size: .85rem; color: var(--subtle); margin: 0; }
.ticket__form > .field__note { grid-column: 1 / -1; }


/*=============== END CREDITS ===============*/
.footer { background: var(--night); color: var(--night-ink); padding-block: clamp(3rem, 7vw, 4.5rem) 2rem; text-align: center; }
.footer__fin { font-family: var(--font-display); font-style: italic; font-size: clamp(3.5rem, 9vw, 6rem); line-height: 1; color: var(--night-accent); margin: 0 0 1.5rem; }
.footer__copy { text-align: center; font-size: .85rem; opacity: .55; margin: 0; padding-inline: var(--gutter); }
.footer__credit { margin-top: .5rem; opacity: .8; }
.footer__credit a { color: var(--night-accent); text-decoration: underline; text-underline-offset: 3px; }

/*=============== LIGHTBOX ===============*/
.lightbox { border: 0; padding: 0; background: transparent; max-width: min(92vw, 70rem); max-height: 90vh; overflow: visible; }
.lightbox::backdrop { background: rgb(10 8 7 / .9); }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: .4rem; margin-inline: auto; }
.lightbox__caption { text-align: center; color: #F3ECE3; font-family: var(--font-mono); font-size: .8rem; margin-top: .75rem; }
.lightbox__close { position: absolute; top: -3rem; right: 0; }

/*=============== TODO HIGHLIGHT (?todo in the URL) ===============*/
.show-todo [data-todo] { outline: 2px dashed var(--gold); outline-offset: 3px; border-radius: 3px; }

/*=============== REVEAL ===============*/
.js .reveal { opacity: 0; transform: translateY(1.5rem); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/*=============== RESPONSIVE ===============*/
@media (max-width: 1100px) {
  .tracker { display: none; }
}

@media (max-width: 960px) {
  .cold-open__stage { grid-template-columns: 1fr; justify-items: center; }
  .cold-open .viewfinder { order: -1; width: min(100%, 16rem); }
  .cold-open__intro { justify-self: center; text-align: center; }
  .cold-open__buttons { justify-content: center; }
  .cold-open__side { justify-self: center; justify-items: center; }
  .cold-open__side { margin-top: 1.75rem; }
  .roll-cue { display: none; }

  .script { grid-template-columns: 1fr; }
  .notes { grid-template-columns: repeat(2, 1fr); padding-top: 0; }
  .note:nth-child(2) { margin-left: 0; }

  .kit__cols { grid-template-columns: repeat(2, 1fr); }
  .board { --cols: 3; }
  .scene-menu__list { grid-template-columns: 1fr; }
}

/* Tablets: photo beside the intro instead of one long centred column */
@media (min-width: 601px) and (max-width: 960px) {
  .cold-open__stage { grid-template-columns: minmax(14rem, 17rem) 1fr; grid-template-rows: auto auto; align-items: center; justify-items: start; column-gap: 2.5rem; row-gap: 1.25rem; }
  .cold-open .viewfinder { grid-row: 1 / span 2; width: 100%; }
  .cold-open__intro { justify-self: start; text-align: left; align-self: end; }
  .cold-open__buttons { justify-content: flex-start; }
  .cold-open__side { justify-self: start; justify-items: start; align-self: start; margin-top: 2rem; }
}

@media (min-width: 601px) {
  .takes__tabs { flex-wrap: wrap; overflow: visible; }
}

@media (max-width: 700px) {
  .timecode { display: none; }
  .header__inner { grid-template-columns: 1fr auto; }
  .scenes-button__label { display: none; }
  .scenes-button { padding: .45rem; }

  .script__character { padding-left: 22%; }
  .script__paren { padding-left: 15%; }
  .script__dialogue { padding-left: 8%; padding-right: 0; }

  .takes__board { grid-template-columns: 1fr; }
  .board { --cols: 2; }
  .board-slate { width: min(100%, 15rem); }

  .ticket { grid-template-columns: 1fr; }
  .ticket__stub {
    grid-auto-flow: column; justify-content: space-between; align-items: center; padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    mask: radial-gradient(circle at 0 100%, transparent var(--notch), #000 calc(var(--notch) + .5px)) left / 51% 100% no-repeat,
          radial-gradient(circle at 100% 100%, transparent var(--notch), #000 calc(var(--notch) + .5px)) right / 51% 100% no-repeat;
  }
  .ticket__admit { font-size: 1.6rem; }
  .ticket__main {
    border-left: 0; border-top: 2px dashed var(--line);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    mask: radial-gradient(circle at 0 0, transparent var(--notch), #000 calc(var(--notch) + .5px)) left / 51% 100% no-repeat,
          radial-gradient(circle at 100% 0, transparent var(--notch), #000 calc(var(--notch) + .5px)) right / 51% 100% no-repeat;
  }
  .ticket__form { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hide-sm { display: none; }
  .ticket__no { display: none; }
  .board { --cols: 2; --gap: 1rem; }
  .polaroid { padding: .5rem .5rem .7rem; }
  .polaroid figcaption { font-size: 1.1rem; }
  .notes { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .note { font-size: 1.25rem; }
  .note__num { font-size: 3rem; }
}

@media (max-width: 360px) {
  .kit__cols { grid-template-columns: 1fr; }
  .ticket__main { padding: 1.5rem 1.15rem; }
  .ticket__stub { padding: 1rem 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
