/* MCU Timeline — design tokens and shared components.
 * Base system follows balajib2.in (true neutrals, Geist, one accent, the
 * (.16, 1, .3, 1) ease), turned cinematic: crimson accent, OKLCH phase palette. */

@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/geist.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url("fonts/geist-mono.woff2") format("woff2");
}

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;

  --bg:        #0C0C0D;
  --bg-deep:   #080809;
  --surface:   #131314;
  --surface-2: #1A1A1C;
  --surface-3: #232325;
  --line:      #262628;
  --line-2:    #333336;
  --fg:        #EDEDEE;
  --fg-2:      #A0A0A6;
  --fg-3:      #8A8A92;

  --accent:      oklch(64% 0.21 25);   /* crimson */
  --accent-hi:   oklch(72% 0.19 28);
  --gold:        oklch(86% 0.14 88);

  /* Phases share one lightness/chroma so they read as a family. */
  --phase-0: oklch(62% 0.02 280);
  --phase-1: oklch(68% 0.18 25);
  --phase-2: oklch(74% 0.15 58);
  --phase-3: oklch(82% 0.14 92);
  --phase-4: oklch(74% 0.13 165);
  --phase-5: oklch(70% 0.14 245);
  --phase-6: oklch(68% 0.16 300);

  --cat-core:  var(--accent);
  --cat-other: oklch(78% 0.14 75);
  --cat-tv:    oklch(70% 0.15 295);
  --cat-sony:  oklch(70% 0.14 245);

  --f-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r: 8px;
  --r-lg: 12px;
  --r-xl: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1240px;
  --header-h: 60px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --shadow: 0 12px 28px -18px rgba(0, 0, 0, .9);
  --shadow-lg: 0 40px 80px -40px rgba(0, 0, 0, .95);
}

/* ── Base ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--fg);
  font: 400 15px/1.55 var(--f-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
::selection { background: color-mix(in oklch, var(--accent) 45%, transparent); }
:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.mono { font-family: var(--f-mono); }

/* Film grain + ambient era glow, shared by every page. */
@media (pointer: coarse) { .grain { display: none; } }
.grain {
  position: fixed; inset: 0; z-index: 100; pointer-events: none; opacity: .045;
  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");
}
@property --era { syntax: "<color>"; inherits: true; initial-value: oklch(64% 0.21 25); }
.ambient {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(70% 55% at 50% -10%, color-mix(in oklch, var(--era) 22%, transparent), transparent 70%),
    radial-gradient(40% 40% at 100% 100%, color-mix(in oklch, var(--era) 8%, transparent), transparent 70%);
  transition: --era 1.2s var(--ease);
}

/* Scroll progress hairline */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none;
  background: linear-gradient(90deg, var(--phase-1), var(--phase-3), var(--phase-4), var(--phase-5), var(--phase-6));
  transform-origin: 0 50%; transform: scaleX(0); will-change: transform;
}

/* Cross-document page transitions (progressive enhancement). */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: 260ms var(--ease-in-out) both vt-out; }
::view-transition-new(root) { animation: 520ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); filter: blur(4px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }

/* ── Header ────────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  view-transition-name: header;
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 100%; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; font-weight: 600; letter-spacing: -.02em; }
.brand-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  background: var(--surface-3); border: 1px solid var(--line-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
  color: var(--fg); font: 600 11px/1 var(--f-mono); letter-spacing: -.04em;
}
.brand-text small { margin-left: 6px; padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line-2); font: 500 10px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); vertical-align: 2px; }
.nav { display: flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.nav a {
  padding: 6px 14px; border-radius: 999px; text-decoration: none; white-space: nowrap;
  font-size: 13.5px; font-weight: 500; color: var(--fg-2); transition: color .2s, background-color .2s;
}
.nav a:hover { color: var(--fg); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--surface-3); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); }
@media (max-width: 760px) { .brand-text small { display: none; } }
@media (max-width: 560px) { .brand-text { display: none; } .site-header .wrap { gap: 10px; } .nav a { padding: 6px 9px; font-size: 13px; } }

/* ── Type ──────────────────────────────────────────────────────────────── */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-2);
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--accent); }
.display {
  margin: 0; font-weight: 600; letter-spacing: -.055em; line-height: .94;
  font-size: clamp(48px, 9.5vw, 132px); text-wrap: balance;
}
.accent-text {
  background: linear-gradient(100deg, var(--accent-hi) 10%, var(--gold) 50%, var(--accent) 90%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s var(--ease-in-out) infinite alternate;
}
@keyframes shimmer { from { background-position: 0 0; } to { background-position: 100% 0; } }
.lede { margin: 0; max-width: 60ch; color: var(--fg-2); font-size: clamp(16px, 1.6vw, 18px); line-height: 1.6; text-wrap: pretty; }
.h2 { margin: 0; font-weight: 600; letter-spacing: -.045em; line-height: 1; font-size: clamp(32px, 4.6vw, 56px); text-wrap: balance; }

.page-head { padding-top: clamp(48px, 9vw, 112px); padding-bottom: 36px; }
.page-head .display { margin: 18px 0 20px; font-size: clamp(44px, 8vw, 104px); }

/* Split-word headline reveal (motion.js wraps words). */
.split .w { display: inline-block; overflow: clip; overflow-clip-margin: .25em; vertical-align: top; }
.split .w > span { display: inline-block; }

/* ── Controls ──────────────────────────────────────────────────────────── */
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 34px;
  padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--surface) 70%, transparent); cursor: pointer;
  font-size: 13px; font-weight: 500; color: var(--fg-2);
  transition: color .2s, background-color .2s, border-color .2s, transform .15s var(--ease), box-shadow .3s;
}
.chip:hover { color: var(--fg); border-color: var(--fg-3); }
.chip:active { transform: scale(.96); }
.chip[aria-pressed="true"] {
  color: var(--fg); background: var(--surface-3);
  border-color: color-mix(in oklch, var(--chip-color, var(--fg)) 70%, transparent);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--chip-color, var(--fg)) 14%, transparent), inset 0 1px 0 rgba(255,255,255,.06);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--chip-color, var(--fg-3)); box-shadow: 0 0 10px var(--chip-color, transparent); }
.field {
  height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2);
  transition: border-color .2s, box-shadow .2s;
}
.field:hover { border-color: var(--fg-3); }
.field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in oklch, var(--accent) 20%, transparent); }
select.field {
  padding-right: 34px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%);
  background-position: calc(100% - 19px) 17px, calc(100% - 14px) 17px; background-size: 5px 5px; background-repeat: no-repeat;
}
.btn {
  display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .3s, background-color .2s, border-color .2s;
}
.btn-primary { background: var(--fg); color: var(--bg); box-shadow: 0 10px 30px -12px rgba(255,255,255,.3); }
.btn-primary:hover { box-shadow: 0 14px 44px -10px rgba(255,255,255,.4); }
.btn-ghost { border: 1px solid var(--line-2); color: var(--fg); background: color-mix(in srgb, var(--surface) 60%, transparent); backdrop-filter: blur(8px); }
.btn-ghost:hover { border-color: var(--fg-3); }
.btn:active { transform: scale(.97); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ── Badges ────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 7px; border-radius: 5px;
  font: 500 10.5px/1 var(--f-mono); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
  background: color-mix(in oklch, var(--badge-color, var(--fg-3)) 14%, transparent);
  color: color-mix(in oklch, var(--badge-color, var(--fg-3)) 80%, white);
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--badge-color, var(--fg-3)) 24%, transparent);
}
.badge.upcoming { --badge-color: var(--gold); }
.badge.upcoming::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 1.8s var(--ease-in-out) infinite; }
@keyframes pulse { 50% { opacity: .3; transform: scale(.7); } }

/* ── Generative poster (no studio artwork) ─────────────────────────────── */
.poster {
  --h: 25; --h2: 60; --a: 135deg;
  position: relative; overflow: hidden; aspect-ratio: 2 / 3; border-radius: var(--r);
  container-type: inline-size; isolation: isolate;
  background:
    radial-gradient(90% 60% at var(--px, 30%) var(--py, 25%), oklch(72% 0.17 var(--h) / .9), transparent 62%),
    radial-gradient(80% 70% at 90% 100%, oklch(45% 0.15 var(--h2) / .9), transparent 70%),
    linear-gradient(var(--a), oklch(32% 0.1 var(--h)), oklch(14% 0.04 var(--h2)));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), inset 0 1px 0 rgba(255,255,255,.14);
}
.poster::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .45; background: var(--pattern); mix-blend-mode: overlay; }
.poster::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background:
    linear-gradient(115deg, transparent 40%, rgba(255,255,255,.22) 50%, transparent 60%) var(--sheen, 130%) 0 / 300% 100% no-repeat,
    linear-gradient(to top, rgba(0,0,0,.7), transparent 55%);
  transition: background-position 1s var(--ease);
}
.poster-mono {
  position: absolute; left: 9%; top: 7%; right: 9%; z-index: 1;
  font: 600 clamp(20px, 30cqi, 72px)/.86 var(--f-sans); letter-spacing: -.06em; color: rgba(255,255,255,.95);
  text-shadow: 0 2px 24px oklch(30% 0.12 var(--h) / .8);
}
.poster-year { position: absolute; left: 9%; bottom: 8%; z-index: 3; font: 500 clamp(8px, 7cqi, 12px)/1 var(--f-mono); letter-spacing: .14em; color: rgba(255,255,255,.78); }
.poster > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; animation: img-in .8s var(--ease) both; }
@keyframes img-in { from { opacity: 0; filter: blur(8px); transform: scale(1.04); } }
.poster:has(> img) .poster-mono, .poster:has(> img) .poster-year, .poster:has(> img) .poster-ring { display: none; }
.poster:has(> img)::after { background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.22) 50%, transparent 60%) var(--sheen, 130%) 0 / 300% 100% no-repeat; }
.credit { color: var(--fg-2); text-decoration: none; border-bottom: 1px solid var(--line-2); transition: color .2s, border-color .2s; }
.credit:hover { color: var(--fg); border-color: var(--fg-3); }
.tmdb-link { font: 400 11px/1 var(--f-mono); color: var(--fg-3); text-decoration: none; }
.tmdb-link:hover { color: var(--fg); }
.poster-ring { position: absolute; right: -20%; bottom: 16%; width: 72%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(255,255,255,.16); box-shadow: 0 0 0 9cqi rgba(255,255,255,.025); }

/* Tilt wrapper (motion.js drives --rx/--ry while hovered). */
.tilt { perspective: 700px; }
.tilt > .poster { transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.tilt.is-tilting > .poster { transition-duration: .1s, .6s; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14), 0 22px 44px -18px oklch(45% 0.16 var(--h) / .95); }
.tilt.is-tilting > .poster::after { --sheen: -30%; }

/* ── Cards with cursor spotlight ───────────────────────────────────────── */
.card {
  position: relative; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px;
  padding: 16px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 85%, transparent), color-mix(in srgb, var(--surface) 85%, transparent));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), var(--shadow);
  transition: border-color .3s, opacity .4s var(--ease), background-color .3s;
}
.spot { --mx: 50%; --my: 50%; }
.spot::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), color-mix(in oklch, var(--c, var(--accent)) 13%, transparent), transparent 45%);
  transition: opacity .4s;
}
.spot::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; opacity: 0; padding: 1px;
  background: radial-gradient(240px circle at var(--mx) var(--my), color-mix(in oklch, var(--c, var(--accent)) 85%, white), transparent 60%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  transition: opacity .4s;
}
@media (hover: hover) { .spot:hover::before, .spot:hover::after { opacity: 1; } }
.card > div, .item > div, .entry > div { min-width: 0; }
.card h3 { margin: 4px 0 6px; font-size: 17px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; color: var(--fg-3); font: 400 12px/1.4 var(--f-mono); }
.desc { margin: 8px 0 0; color: var(--fg-2); font-size: 14px; text-wrap: pretty; }
.links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.links-label { width: 100%; font: 500 10.5px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--fg-3); }
.link-chip {
  position: relative; z-index: 1; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2);
  font-size: 12px; text-decoration: none; color: var(--fg-2); background: color-mix(in srgb, var(--bg) 40%, transparent);
  transition: color .2s, border-color .2s, background-color .2s, transform .2s var(--ease);
}
.link-chip:hover { color: var(--fg); border-color: var(--fg-3); background: var(--surface-3); transform: translateY(-1px); }

.is-target { animation: target-flash 1.8s var(--ease); }
@keyframes target-flash {
  0%, 35% { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in oklch, var(--gold) 25%, transparent), 0 0 60px -10px var(--gold); }
}
.empty { padding: 56px 0; text-align: center; color: var(--fg-3); }

/* ── Scroll reveal (motion.js adds .motion to <html> and .in to elements) ─ */
@media (prefers-reduced-motion: no-preference) {
  .motion [data-reveal] {
    opacity: 0; transform: translateY(28px) scale(.985); filter: blur(10px);
    transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease);
    transition-delay: calc(var(--i, 0) * 70ms);
  }
  .motion [data-reveal].in { opacity: 1; transform: none; filter: none; }
  /* Phones: animating blur on many elements is costly on mobile GPUs. */
  @media (max-width: 760px), (pointer: coarse) {
    .motion [data-reveal] { filter: none; transition: opacity .7s var(--ease), transform .8s var(--ease); }
  }
  .motion [data-reveal="fade"] { transform: none; }
  .motion .split .w > span { transform: translateY(110%) rotate(5deg); transform-origin: 0 100%; transition: transform 1.2s var(--ease); transition-delay: calc(var(--wi, 0) * 60ms + 60ms); }
  .motion .split.in .w > span { transform: none; }
}

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-footer { margin-top: 120px; padding: 32px 0 44px; border-top: 1px solid var(--line); color: var(--fg-3); font-size: 13px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: end; }
.foot-main { display: grid; gap: 6px; max-width: 72ch; }
.foot-main b { color: var(--fg-2); font-weight: 500; }
.tmdb-attrib { display: grid; gap: 8px; justify-items: start; max-width: 240px; text-decoration: none; font-size: 11px; line-height: 1.4; color: var(--fg-3); }
.tmdb-attrib img { height: 12px; width: auto; opacity: .85; transition: opacity .2s; }
.tmdb-attrib:hover img { opacity: 1; }
.watched-badge { --badge-color: var(--phase-4); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
