/* =========================================================
   Doomsday Dossiers — styles
   Colours --accent / --accent2 are swapped per character by script.js
   ========================================================= */
:root {
  /* Avengers: Doomsday palette: Doom's green, armour steel, a little gold */
  --doom: #3ee08f;
  --doom-deep: #0e3b26;
  --steel: #9fb4c4;
  --gold: #d6b25e;
  --accent: var(--doom);
  --accent2: var(--steel);
  --bg: #050907;
  --panel: rgba(11, 17, 14, 0.76);
  --panel-solid: #0b110e;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ebf3;
  --muted: #8b91a8;
  --green: #4ade80;
  --amber: #fbbf24;
  --display: 'Rajdhani', 'Arial Narrow', sans-serif;
  --body: 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
::selection { background: color-mix(in srgb, var(--doom) 35%, transparent); }

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 650px at 85% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, color-mix(in srgb, var(--accent2) 14%, transparent), transparent 60%),
    radial-gradient(1400px 500px at 50% 120%, color-mix(in srgb, var(--doom-deep) 70%, transparent), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  overflow-x: hidden;
}

#bg {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}
.scanlines {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

/* ---------- Header ---------- */
.top {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  max-width: 1280px; margin: 0 auto;
  padding: 28px clamp(16px, 3vw, 32px) 24px;
}
.brand { display: flex; align-items: center; gap: 16px; color: inherit; text-decoration: none; }

/* Category nav */
.nav { position: relative; flex-basis: 100%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  flex: none; padding: 7px 14px; border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); text-decoration: none; border: 1px solid var(--line); background: var(--panel);
  transition: color .25s, border-color .25s, background .25s;
}
.nav a:hover { color: var(--text); border-color: var(--line-strong); }
.nav a.on { color: var(--text); border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-solid)); }

/* Breadcrumbs */
.crumbs {
  position: relative; z-index: 2; max-width: 1280px; margin: 0 auto 14px;
  padding: 0 clamp(16px, 3vw, 32px);
  font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.crumbs span { color: var(--muted); margin: 0 6px; }
.pulse {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s infinite;
  flex: none;
}
.eyebrow {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 4vw, 40px); line-height: 1;
  text-transform: uppercase; letter-spacing: 0.04em;
}
h1 em { font-style: normal; color: var(--accent); transition: color .6s; }

.countdown {
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.cd-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--muted);
}
.cd-units { display: flex; gap: 8px; }
.cd-units div {
  min-width: 58px; padding: 6px 8px; text-align: center;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--panel);
  backdrop-filter: blur(8px);
}
.cd-units b { display: block; font-family: var(--mono); font-size: 22px; font-weight: 600; line-height: 1.1; }
.cd-units i { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted); text-transform: uppercase; }
.cd-live { font-family: var(--display); font-size: 24px; color: var(--accent); text-transform: uppercase; }

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 2;
  display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px;
  max-width: 1280px; margin: 0 auto;
  padding: 0 clamp(16px, 3vw, 32px) 40px;
  align-items: start;
  --pad: clamp(20px, 3.4vw, 44px);
}

/* ---------- Roster ---------- */
.roster { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
  display: flex; justify-content: space-between;
}
.label span { color: var(--text); }
.roster-list { display: flex; flex-direction: column; gap: 10px; }

.roster-card {
  text-decoration: none;
  --a: var(--accent); --a2: var(--accent2);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  width: 100%; padding: 16px 16px 14px 18px;
  text-align: left; color: var(--text); font: inherit; cursor: pointer;
  background: var(--panel); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-left: 3px solid var(--a);
  border-radius: 14px;
  opacity: 0; transform: translateX(-16px);
  animation: slideIn .6s cubic-bezier(.2,.7,.2,1) forwards;
  transition: transform .25s, border-color .25s, box-shadow .25s, background .25s;
}
.roster-card::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, var(--a) 22%, transparent) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform .7s;
  pointer-events: none;
}
.roster-card:hover { transform: translateX(4px); border-color: color-mix(in srgb, var(--a) 50%, transparent); }
.roster-card:hover::after { transform: translateX(100%); }
.roster-card.active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--a) 18%, var(--panel-solid)), color-mix(in srgb, var(--a2) 10%, var(--panel-solid)));
  border-color: color-mix(in srgb, var(--a) 60%, transparent);
  box-shadow: 0 0 32px -8px var(--a);
}
.roster-card:focus-visible { outline: 2px solid var(--a); outline-offset: 2px; }
.rc-file { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--a); }
.rc-name { font-family: var(--display); font-size: 22px; font-weight: 700; text-transform: uppercase; line-height: 1.1; }
.rc-type { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip.confirmed { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); background: color-mix(in srgb, var(--green) 8%, transparent); }
.chip.rumored { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: color-mix(in srgb, var(--amber) 8%, transparent); }
.chip.unknown { color: var(--muted); border-color: var(--line-strong); }
.chip.neutral { color: var(--text); }
.chip.neutral::before { display: none; }

/* ---------- Dossier panel ---------- */
.dossier {
  position: relative; min-width: 0;
  --pad: clamp(20px, 3.4vw, 44px);
  padding: var(--pad);
  background: var(--panel); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 22px;
}
.dossier::before, .dossier::after {
  content: ''; position: absolute; width: 28px; height: 28px;
  border: 2px solid var(--accent); transition: border-color .6s;
}
.dossier::before { top: -1px; left: -1px; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.dossier::after { bottom: -1px; right: -1px; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.dossier.swap { animation: swap .55s cubic-bezier(.2,.7,.2,1); }

/* Hero */
.hero { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 28px; }
.emblem-wrap { position: relative; width: 150px; height: 150px; }
.emblem-wrap::before {
  content: ''; position: absolute; inset: -10px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), transparent 30%, var(--accent2) 60%, transparent 85%, var(--accent));
  filter: blur(18px); opacity: .45;
  animation: spin 8s linear infinite;
}
.emblem { position: relative; width: 100%; height: 100%; }

.glitch {
  position: relative;
  font-family: var(--display); font-weight: 700;
  font-size: clamp(40px, 7vw, 78px); line-height: .95;
  text-transform: uppercase; letter-spacing: .02em;
  margin: 6px 0 10px;
  background: linear-gradient(90deg, var(--text) 40%, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0;
  -webkit-background-clip: text; background-clip: text;
  opacity: 0;
}
.glitch::before { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; animation: glitchA 5s infinite; }
.glitch::after  { background: var(--accent2); -webkit-background-clip: text; background-clip: text; color: transparent; animation: glitchB 5s infinite; }

.tagline { font-size: clamp(15px, 1.6vw, 18px); color: #c9cde0; min-height: 1.6em; margin-bottom: 14px; }
.caret { display: inline-block; width: 9px; height: 1.05em; margin-left: 3px; vertical-align: -2px; background: var(--accent); animation: blink 1s steps(1) infinite; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin-bottom: 36px; }
.fact {
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--line);
  position: relative; overflow: hidden;
}
.fact::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--accent), var(--accent2)); }
.fact span { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fact strong { font-weight: 600; font-size: 14.5px; }

/* Blocks */
.block { margin-bottom: 40px; }
.block:last-child { margin-bottom: 0; }
.block h3 {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  font-family: var(--display); font-weight: 700; font-size: 24px;
  text-transform: uppercase; letter-spacing: .06em;
  margin-bottom: 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.block h3 i { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--accent); }
.block h3 small { font-family: var(--mono); font-size: 10.5px; font-weight: 400; letter-spacing: .12em; color: var(--muted); }
.block > p { color: #c9cde0; margin-bottom: 12px; max-width: 72ch; }

/* Power */
.power { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.radar { width: 100%; height: 330px; display: block; }
.bars { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.bar-head { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 6px; }
.bar-head b { font-family: var(--mono); color: var(--accent); }
.bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  box-shadow: 0 0 14px var(--accent);
  transition: width 1.3s cubic-bezier(.2,.7,.2,1);
}
.bars.go li:nth-child(1) i { transition-delay: .05s; }
.bars.go li:nth-child(2) i { transition-delay: .15s; }
.bars.go li:nth-child(3) i { transition-delay: .25s; }
.bars.go li:nth-child(4) i { transition-delay: .35s; }
.bars.go li:nth-child(5) i { transition-delay: .45s; }
.bars.go li:nth-child(6) i { transition-delay: .55s; }
.bars.go li:nth-child(n+7) i { transition-delay: .65s; }
.bars.go i { width: var(--v); }

/* Timeline */
.timeline { list-style: none; position: relative; padding-left: 26px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px;
  background: linear-gradient(var(--accent), var(--accent2), transparent);
}
.tl { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 10px 0 18px; }
.tl::before {
  content: ''; position: absolute; left: -25px; top: 16px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel-solid); border: 2px solid var(--accent);
}
.tl.key::before { background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 0 18px var(--accent); }
.tl-year { font-family: var(--mono); font-weight: 600; font-size: 15px; color: var(--accent); padding-top: 8px; }
.tl-body {
  padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.025); border: 1px solid var(--line);
  transition: border-color .3s, transform .3s;
}
.tl-body:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateX(4px); }
.tl.key .tl-body { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent2); filter: brightness(1.4); }
.tl-body h4 { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; margin: 2px 0 2px; }
.tl-body p { font-size: 14px; color: var(--muted); }

/* Network */
.net-wrap { border-radius: 16px; border: 1px solid var(--line); background: radial-gradient(circle at center, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%); overflow: hidden; }
.net { width: 100%; height: 380px; display: block; touch-action: manipulation; }
.net-info {
  font-family: var(--mono); font-size: 12px; color: var(--muted);
  padding: 10px 16px; border-top: 1px solid var(--line); min-height: 42px;
}
.net-info b { color: var(--text); }
.legend { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; margin-top: 12px; }
.legend li { display: flex; gap: 10px; align-items: baseline; font-size: 13.5px; color: var(--muted); }
.legend li span { width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(1px); }
.legend li strong { color: var(--text); font-weight: 600; }

/* Doomsday dots */
.dots { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.dot-card {
  position: relative; padding: 18px; border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 9%, transparent), rgba(255,255,255,0.02));
  border: 1px solid var(--line);
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.dot-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 18px 40px -20px var(--accent); }
.dot-num { font-family: var(--mono); font-size: 12px; color: var(--accent); }
.dot-card h4 { font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1.2; margin: 4px 0 6px; }
.dot-card p { font-size: 14px; color: #c3c7d9; margin-bottom: 8px; }

/* Rewatch */
.rewatch { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rewatch li {
  display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.rewatch strong { font-weight: 600; }
.rewatch p { font-size: 14px; color: var(--muted); }
.prio {
  justify-self: start; padding: 4px 10px; border-radius: 8px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line-strong);
}
.prio.essential { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.prio.recommended { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 40%, transparent); }
.prio.optional { color: var(--muted); }

/* Stills */
.stills { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.still { border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); overflow: hidden; }
.still-img { display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: var(--panel-solid); cursor: zoom-in; overflow: hidden; }
.still-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.still-img:hover img { transform: scale(1.05); }
.still figcaption { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.credit { font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--muted); }
.credit a, .clip-link { color: inherit; text-decoration: none; border-bottom: 1px dashed currentColor; }
.credit a:hover, .clip-link:hover { color: var(--accent); }
.stills-empty { padding: 18px; border-radius: 14px; border: 1px dashed var(--line-strong); }
.stills-empty p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.stills-empty code { font-family: var(--mono); font-size: 12px; color: var(--text); }

.lightbox { margin: auto; max-width: min(92vw, 1100px); padding: 0; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--panel-solid); color: var(--text); }
.lightbox::backdrop { background: rgba(3, 4, 8, 0.86); backdrop-filter: blur(4px); }
.lightbox img { display: block; max-width: 100%; max-height: 80vh; margin: 0 auto; }
.lightbox p { padding: 10px 14px; font-size: 14px; color: var(--muted); }
.lb-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(0,0,0,.6); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; }

/* Live-action clips */
.clips { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.clip { display: flex; flex-direction: column; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); overflow: hidden; transition: border-color .3s, transform .3s; }
.clip:hover { border-color: color-mix(in srgb, var(--accent) 45%, transparent); transform: translateY(-3px); }
.clip-thumb {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9;
  padding: 0; border: 0; cursor: pointer; text-decoration: none; color: var(--text); overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, var(--panel-solid)), color-mix(in srgb, var(--accent2) 18%, var(--panel-solid)));
}
.clip-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.clip-thumb iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.clip-thumb.playing { cursor: default; }
.play {
  position: relative; z-index: 1; width: 54px; height: 54px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 85%, black); box-shadow: 0 0 24px var(--accent); transition: transform .25s;
}
.play::after { content: ''; position: absolute; left: 22px; top: 17px; border-left: 16px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; }
.clip-thumb:hover .play { transform: scale(1.12); }
.clip-thumb.search { grid-template-rows: auto auto; gap: 10px; align-content: center; }
.clip-q { position: relative; z-index: 1; max-width: 85%; text-align: center; font-family: var(--mono); font-size: 11px; color: #d4d7e6; }
.clip-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.clip-body h4 { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; }
.clip-body p { font-size: 14px; color: var(--muted); }
.clip-link { align-self: flex-start; margin-top: auto; padding-top: 6px; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--accent); }

/* ---------- Landing ---------- */
.landing {
  position: relative; z-index: 2; max-width: 1280px; margin: 0 auto;
  padding: 24px clamp(16px, 3vw, 32px) 48px;
}
.intro { max-width: 760px; margin-bottom: 40px; }
.landing-title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(40px, 7vw, 84px); line-height: .95; letter-spacing: .01em; margin: 12px 0 18px;
}
.landing-title em { font-style: normal; color: var(--accent); text-shadow: 0 0 40px color-mix(in srgb, var(--accent) 50%, transparent); }
.lead { color: #c9cde0; font-size: 17px; max-width: 62ch; }
.tallies { display: flex; gap: 28px; margin-top: 24px; flex-wrap: wrap; }
.tallies div { display: flex; flex-direction: column; }
.tallies b { font-family: var(--mono); font-size: 30px; font-weight: 600; color: var(--accent); line-height: 1.1; }
.tallies span { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.cat-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px;
  padding: 26px 24px 24px; border-radius: 20px; min-height: 380px;
  color: var(--text); text-decoration: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--panel-solid)), var(--panel) 60%);
  border: 1px solid var(--line); backdrop-filter: blur(12px);
  transition: transform .35s cubic-bezier(.2,.7,.2,1), border-color .35s, box-shadow .35s;
}
.cat-card::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, color-mix(in srgb, var(--accent) 18%, transparent) 50%, transparent 70%);
  transform: translateX(-100%); transition: transform .8s;
}
.cat-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: 0 30px 60px -30px var(--accent); }
.cat-card:hover::before { transform: translateX(100%); }
.cat-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.cat-emblem { width: 88px; height: 88px; margin-bottom: 8px; }
.cat-num { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.cat-card h3 { font-family: var(--display); font-size: 32px; font-weight: 700; text-transform: uppercase; line-height: 1; }
.cat-card p { color: #c3c7d9; font-size: 14.5px; }
.cat-files { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cat-files li { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 12px; color: var(--muted); }
.cat-go { margin-top: auto; padding-top: 14px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.cat-go i { display: inline-block; font-style: normal; transition: transform .3s; }
.cat-card:hover .cat-go i { transform: translateX(6px); }

/* ---------- Story so far (arc) ---------- */
.arc { list-style: none; position: relative; display: flex; flex-direction: column; gap: 12px; }
.arc::before { content: ''; position: absolute; left: 66px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--accent2), var(--accent)); opacity: .5; }
.arc-step { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 34px; }
.arc-step::before {
  content: ''; position: absolute; left: 60px; top: 14px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--panel-solid); border: 3px solid var(--m); box-shadow: 0 0 14px var(--m);
}
.arc-year { font-family: var(--mono); font-weight: 600; font-size: 14px; color: var(--muted); padding-top: 9px; text-align: right; }
.arc-body {
  padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line);
  border-left: 3px solid var(--m); background: rgba(255,255,255,0.02);
}
.arc-mark { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--m); }
.arc-body h4 { font-family: var(--display); font-size: 19px; font-weight: 700; line-height: 1.2; margin: 2px 0 4px; }
.arc-body p { font-size: 14px; color: #c3c7d9; }
.now-what .arc-body { background: color-mix(in srgb, var(--accent) 10%, transparent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.now-what .arc-body p { color: var(--text); font-size: 15px; }
.now-what::before { animation: pulse 2s infinite; }

.more-link { display: inline-block; margin-top: 14px; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; color: var(--accent); text-decoration: none; }
.more-link:hover { text-decoration: underline; }

/* ---------- Relations ---------- */
.relations { max-width: 1280px; margin: 0 auto 40px; width: calc(100% - 2 * clamp(16px, 3vw, 32px)); z-index: 2; }
.rel-head { margin-bottom: 18px; }
.rel-head h2 { font-size: clamp(32px, 5vw, 52px); margin: 6px 0 8px; }
.rel-legend { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.rel-legend span { display: inline-flex; align-items: center; gap: 7px; }
.rel-legend i { width: 10px; height: 10px; border-radius: 50%; }
.rel-legend .ring-dot { border: 2px solid #cbd5e1; background: transparent; }
.rel-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.rel-filters button {
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: transparent; border: 1px solid var(--line-strong);
}
.rel-filters button:hover { color: var(--text); }
.rel-filters button.on { color: var(--k); border-color: var(--k); background: color-mix(in srgb, var(--k) 12%, transparent); }
.relnet { display: block; width: 100%; height: 720px; touch-action: none; }
.relations .net-wrap { margin-bottom: 36px; }
.muted { color: var(--muted); }
.threads { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.threads li {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; font-size: 14px;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,0.02);
}
.threads a { text-decoration: none; font-weight: 600; }
.threads a:hover { text-decoration: underline; }
.threads p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.kdot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 7px; }

/* ---------- The full story ---------- */
.story { max-width: 1280px; margin: 0 auto 40px; width: calc(100% - 2 * clamp(16px, 3vw, 32px)); z-index: 2; }
.story-tallies { margin: 0 0 22px; }
.story-tallies b { color: var(--s); }
.story-bar {
  position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  margin: 0 calc(-1 * var(--pad)) 10px; padding: 12px var(--pad);
  background: color-mix(in srgb, var(--panel-solid) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.story-bar .rel-filters { margin: 0; }
.phase-jump { display: flex; gap: 4px; flex-wrap: wrap; }
.phase-jump button {
  padding: 5px 10px; border-radius: 8px; cursor: pointer; border: 1px solid var(--line); background: transparent;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.phase-jump button:hover { color: var(--text); border-color: var(--accent); }
.phase { padding-top: 26px; scroll-margin-top: 70px; }
#now { scroll-margin-top: 70px; margin-top: 30px; }
.phase-head { margin-bottom: 14px; }
.phase-head h3 { font-family: var(--display); font-size: 34px; font-weight: 700; text-transform: uppercase; line-height: 1; margin: 4px 0; }
.phase-head p { color: var(--muted); font-size: 14.5px; }
.entries { list-style: none; position: relative; display: flex; flex-direction: column; gap: 12px; }
.entries::before { content: ''; position: absolute; left: 56px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--accent), var(--accent2)); opacity: .35; }
.entry { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 30px; }
.entry[hidden] { display: none; }
.entry::before {
  content: ''; position: absolute; left: 51px; top: 18px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel-solid); border: 2px solid var(--accent);
}
.entry-year { font-family: var(--mono); font-weight: 600; font-size: 13px; color: var(--muted); padding-top: 13px; text-align: right; }
.entry-card { padding: 14px 18px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.02); transition: border-color .3s; }
.entry-card:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.entry-card h4 { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; margin: 2px 0 6px; }
.entry-sum { font-size: 14.5px; color: #c9cde0; margin-bottom: 10px; }
.s-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.s-item { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--s) 6%, transparent); border-left: 2px solid var(--s); }
.s-pill { justify-self: start; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--s); padding-top: 2px; }
.s-kind { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.s-where { display: block; margin-top: 2px; font-size: 12.5px; color: var(--s); }
.s-none { font-size: 13px; color: var(--muted); font-style: italic; }
.story[data-filter="paid"] .s-item:not([data-s="paid"]),
.story[data-filter="open"] .s-item:not([data-s="open"]),
.story[data-filter="abandoned"] .s-item:not([data-s="abandoned"]),
.story:not([data-filter="all"]) .s-none { display: none; }
.standings, .caveats { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.standings li, .caveats li { position: relative; padding-left: 20px; font-size: 14.5px; color: #c9cde0; max-width: 80ch; }
.standings li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }
.caveats li::before { content: '!'; position: absolute; left: 4px; font-family: var(--mono); color: var(--amber); }
.sub { font-family: var(--display); font-size: 20px; text-transform: uppercase; margin: 6px 0 10px; }
.sub small { font-family: var(--mono); font-size: 12px; color: var(--amber); }

/* ---------- Avengers roll call ---------- */
.roll { max-width: 1280px; margin: 0 auto 40px; width: calc(100% - 2 * clamp(16px, 3vw, 32px)); z-index: 2; }
.roll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; margin-top: 18px; }
.hero-card {
  display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 14px; border-radius: 14px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--line); border-top: 3px solid var(--s);
}
.hero-card[hidden] { display: none; }
.hero-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-card h4 { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1.1; text-transform: uppercase; }
.hc-who { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.hc-status {
  flex: none; padding: 3px 9px; border-radius: 999px; font-family: var(--mono); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--s); border: 1px solid color-mix(in srgb, var(--s) 50%, transparent); background: color-mix(in srgb, var(--s) 10%, transparent);
}
.hc-films { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.hc-films li {
  padding: 3px 0; border-radius: 6px; text-align: center; font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em;
  color: color-mix(in srgb, var(--muted) 55%, transparent); border: 1px dashed var(--line);
}
.hc-films li.on { color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.hc-story { font-size: 13.5px; color: #c3c7d9; }
.hc-now { font-size: 14px; color: var(--text); padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--s) 7%, transparent); border-left: 2px solid var(--s); }
.hc-now b { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--s); margin-right: 4px; }
.hero-card footer { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.hc-last { flex-basis: 100%; }
.hc-dd { padding: 2px 8px; border-radius: 6px; font-family: var(--mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--k); border: 1px solid color-mix(in srgb, var(--k) 45%, transparent); }
.hc-file { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--accent); text-decoration: none; }
.hc-file:hover { text-decoration: underline; }
.roll-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-foot {
  position: relative; z-index: 2;
  max-width: 1280px; margin: 24px auto 0;
  padding: 28px clamp(16px, 3vw, 32px) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid color-mix(in srgb, var(--doom) 22%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--doom-deep) 35%, transparent), transparent 80%);
  font-size: 13px; color: var(--muted);
}
.site-foot::before {
  content: ''; position: absolute; left: 50%; top: -1px; width: min(420px, 60%); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--doom), transparent); box-shadow: 0 0 18px var(--doom);
}
.foot-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.foot-brand { display: flex; gap: 14px; align-items: center; }
.foot-mark { width: 40px; height: 40px; flex: none; color: var(--doom); filter: drop-shadow(0 0 10px color-mix(in srgb, var(--doom) 55%, transparent)); }
.foot-title { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: .05em; text-transform: uppercase; color: var(--text); line-height: 1; }
.foot-title em { font-style: normal; color: var(--doom); }
.foot-sub { margin-top: 4px; font-size: 13px; }
.foot-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.foot-nav span { display: contents; }
.foot-nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.foot-nav a:hover { color: var(--doom); }
.foot-made {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.foot-made a { color: var(--doom); text-decoration: none; transition: color .25s, background .25s, box-shadow .25s; }
.foot-gh {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; margin-left: 2px;
  border: 1px solid color-mix(in srgb, var(--doom) 45%, transparent);
  background: color-mix(in srgb, var(--doom) 10%, transparent);
}
.foot-gh:hover { background: color-mix(in srgb, var(--doom) 22%, transparent); box-shadow: 0 0 22px -6px var(--doom); }
.foot-made svg { width: 16px; height: 16px; }
.foot-legal { margin: 14px auto 0; max-width: 820px; text-align: center; font-size: 12px; line-height: 1.6; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1) var(--d, 0ms), transform .7s cubic-bezier(.2,.7,.2,1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- SVG emblem motion ---------- */
.spin { animation: spin 20s linear infinite; transform-box: fill-box; transform-origin: center; }
.spin-rev { animation: spin 14s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.spin-fast { animation: spin 6s linear infinite; transform-box: fill-box; transform-origin: center; }
.sweep { animation: spin 3s linear infinite; transform-box: view-box; transform-origin: 60px 60px; }
.blink { animation: blinkSoft 1.6s ease-in-out infinite; }

/* ---------- Keyframes ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent); }
  70% { box-shadow: 0 0 0 14px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes slideIn { to { opacity: 1; transform: none; } }
@keyframes swap {
  from { opacity: 0; transform: translateY(14px) scale(.985); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes blinkSoft { 50% { opacity: .35; } }
@keyframes glitchA {
  0%, 92%, 100% { opacity: 0; transform: none; }
  93% { opacity: .8; transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); }
  95% { opacity: .8; transform: translate(3px, -1px); clip-path: inset(60% 0 8% 0); }
}
@keyframes glitchB {
  0%, 93%, 100% { opacity: 0; transform: none; }
  94% { opacity: .8; transform: translate(3px, 0); clip-path: inset(40% 0 30% 0); }
  96% { opacity: .8; transform: translate(-2px, 1px); clip-path: inset(5% 0 70% 0); }
}

/* ---------- Responsive ---------- */

/* extra emblem motion */
.ring { transform-box: view-box; transform-origin: 60px 60px; animation: ripple 3s ease-out infinite; }
.r2 { animation-delay: 1s; } .r3 { animation-delay: 2s; }
.beam-bar { animation: beamPulse 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.beam-glow { animation: beamPulse 2.4s ease-in-out infinite reverse; transform-box: fill-box; transform-origin: center; }
@keyframes ripple { from { transform: scale(1); opacity: .9; } to { transform: scale(4.5); opacity: 0; } }
@keyframes beamPulse { 50% { transform: scaleX(.75); opacity: .55; } }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .roster { position: static; max-height: none; overflow: visible; padding-right: 0; }
  .roster-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .roster-card { min-width: 230px; scroll-snap-align: start; }
  .power { grid-template-columns: minmax(0, 1fr); }
  .countdown { align-items: flex-start; }
}
@media (max-width: 560px) {
  /* compact header: brand + countdown share one block, nav scrolls sideways */
  .top { gap: 12px; padding: 16px 16px 12px; }
  .brand { gap: 12px; }
  .brand .eyebrow { font-size: 9.5px; letter-spacing: .14em; }
  h1 { font-size: 26px; }
  .countdown { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; gap: 10px; }
  .cd-label { font-size: 10px; max-width: 9em; line-height: 1.3; }
  .cd-units { gap: 5px; }
  .cd-units div { min-width: 44px; padding: 4px 4px; border-radius: 8px; }
  .cd-units b { font-size: 17px; }
  .cd-units i { font-size: 9px; }
  .nav { margin: 0 -16px; padding: 0 16px; scroll-padding: 0 16px;
         -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent);
                 mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 28px), transparent); }
  .nav a { padding: 9px 13px; }
  .crumbs { margin-bottom: 10px; font-size: 10px; }

  /* panels: less padding so content gets the width */
  .dossier { --pad: 16px; border-radius: 16px; }
  .layout { padding-bottom: 24px; }
  .block { margin-bottom: 32px; }
  .block h3 { font-size: 20px; gap: 8px; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 28px; }
  .fact { padding: 10px 12px; }
  .fact strong { font-size: 13.5px; }
  /* shrink long single words (NIGHTCRAWLER) so they never break mid-word */
  .glitch { font-size: clamp(24px, min(9.5vw, calc((100vw - 150px) * 1.75 / var(--len, 8))), 42px); }

  /* landing */
  .landing { padding-top: 12px; }
  .intro { margin-bottom: 26px; }
  .lead { font-size: 15.5px; }
  .tallies { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .tallies b { font-size: 26px; }
  .tallies span { font-size: 9.5px; letter-spacing: .12em; }
  .story-tallies { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .story-tallies b { font-size: 22px; }
  .cat-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .cat-card { min-height: 0; padding: 20px 18px; border-radius: 16px; }
  .cat-card h3 { font-size: 26px; }
  .cat-emblem { width: 64px; height: 64px; }

  /* story: one-line, swipeable filter bar so the sticky bar stays short */
  .story-bar { padding-top: 8px; padding-bottom: 8px; gap: 6px; }
  .story-bar .rel-filters, .phase-jump { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  .story-bar .rel-filters::-webkit-scrollbar, .phase-jump::-webkit-scrollbar { display: none; }
  .story-bar .rel-filters button, .phase-jump button { flex: none; }
  .phase { scroll-margin-top: 96px; }
  .phase-head h3 { font-size: 28px; }
  .entry-card { padding: 12px 14px 14px; }
  .entry-card h4 { font-size: 19px; }
  .entry-sum { font-size: 14px; }
  .rel-head h2 { font-size: 30px; }
  .threads { gap: 8px; }

  .roll-grid { grid-template-columns: minmax(0, 1fr); }
  .story-tallies:has(> :nth-child(5)) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* footer */
  .foot-top { flex-direction: column; gap: 16px; }

  .hero { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 20px; }
  .emblem-wrap { width: 72px; height: 72px; }
  .radar { height: 290px; }
  .net { height: 330px; }
  .rewatch li { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tl { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .tl-year { padding-top: 0; }
  .cd-units div { min-width: 48px; }
  .relnet { height: 680px; }
  .entries::before { left: 6px; }
  .entry { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-left: 24px; }
  .entry::before { left: 1px; top: 4px; }
  .entry-year { text-align: left; padding-top: 0; }
  .s-item { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .threads { grid-template-columns: minmax(0, 1fr); }
  .arc::before { left: 8px; }
  .arc-step { grid-template-columns: minmax(0, 1fr); gap: 2px; padding-left: 28px; }
  .arc-step::before { left: 2px; top: 4px; }
  .arc-year { text-align: left; padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .roster-card { opacity: 1 !important; transform: none !important; }
}

