:root {
  --ink: #f3f0e8;
  --muted: #999ba4;
  --paper: #08090c;
  --panel: #111218;
  --line: #292b33;
  --red: #e62429;
  --red-bright: #ff3439;
  --gold: #e6b655;
  --green: #8ff0ba;
  --max: 1440px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.lenis, html.lenis body { height: auto; }
html.lenis.lenis-smooth { scroll-behavior: auto; }
html.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .055;
  z-index: 20;
  background-image: repeating-radial-gradient(circle at 17% 23%, #fff 0, #fff .45px, transparent .7px, transparent 3px);
  background-size: 7px 7px;
}
.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; }

.masthead {
  min-height: 76px;
  max-width: var(--max);
  margin: auto;
  padding: 0 clamp(20px, 4vw, 64px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; font-size: 11px; font-weight: 800; letter-spacing: .18em; }
.brand-marvel { display: inline-block; background: var(--red); color: white; padding: 7px 8px 5px; font: 900 22px/.78 Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; letter-spacing: -.035em; transform: scaleX(1.08); transform-origin: left; }
.brand-marvel.small { font-size: 17px; padding: 6px 7px 4px; }
.masthead-status { display: flex; align-items: center; gap: 10px; font: 700 10px/1 monospace; letter-spacing: .16em; color: var(--muted); }
.status-light { display: block; flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px var(--green); }

.hero {
  max-width: var(--max);
  margin: auto;
  min-height: 720px;
  padding: 100px clamp(20px, 7vw, 112px) 80px;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before { content: ""; position: absolute; width: 700px; height: 700px; right: -170px; top: 25px; border: 1px solid #24262d; border-radius: 50%; box-shadow: 0 0 0 100px rgba(255,255,255,.014), 0 0 0 260px rgba(255,255,255,.008); }
.hero::after { content: ""; position: absolute; width: 2px; height: 130%; left: 66%; top: -15%; background: linear-gradient(transparent, #393b44, transparent); transform: rotate(25deg); }
.hero-copy, .hero-console { position: relative; z-index: 1; }
.kicker { margin: 0 0 26px; color: var(--muted); font: 700 11px/1.4 monospace; letter-spacing: .19em; }
h1, h2 { margin: 0; font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; font-weight: 900; letter-spacing: -.025em; }
h1 { max-width: 790px; font-size: clamp(70px, 10vw, 148px); line-height: .9; text-shadow: 2px 2px 0 #191a20; }
.intro { max-width: 550px; margin: 38px 0 36px; color: #babac0; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.55; }
.jump-link { display: inline-flex; gap: 34px; align-items: center; padding-bottom: 9px; border-bottom: 2px solid var(--red); text-decoration: none; font: 800 11px/1 monospace; letter-spacing: .16em; }
.jump-link span { width: 20px; height: 20px; display: block; color: var(--red-bright); position: relative; transition: transform .2s; }
.jump-link span::before { content: ""; position: absolute; width: 2px; height: 13px; left: 9px; top: 2px; background: currentColor; }
.jump-link span::after { content: ""; position: absolute; width: 7px; height: 7px; left: 6px; bottom: 2px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.jump-link:hover span { transform: translateY(3px); }
.hero-console { justify-self: center; text-align: center; }
.progress-orbit { width: 236px; height: 236px; padding: 12px; border-radius: 50%; background: conic-gradient(var(--red) var(--progress), #262830 var(--progress)); position: relative; box-shadow: 0 0 60px rgba(230,36,41,.12); transition: background .5s ease; }
.progress-orbit::before { content: ""; position: absolute; inset: -20px; border: 1px solid #30313a; border-radius: 50%; border-left-color: transparent; transform: rotate(-30deg); }
.progress-core { width: 100%; height: 100%; border-radius: 50%; background: #0d0e12; display: grid; place-content: center; border: 1px solid #3a3c45; }
.progress-core strong { font: 900 54px/.9 Impact, sans-serif; }
.progress-core span { color: var(--muted); margin-top: 8px; font: 700 9px/1 monospace; letter-spacing: .2em; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 46px; background: var(--line); border: 1px solid var(--line); }
.hero-stats div { background: var(--paper); padding: 14px 8px; }
.hero-stats strong, .hero-stats span { display: block; }
.hero-stats strong { font: 800 20px/1 monospace; }
.hero-stats span { margin-top: 5px; color: var(--muted); font: 700 8px/1 monospace; letter-spacing: .12em; }
.local-note { color: #70727a; margin: 22px 0 0; font: 10px/1.4 monospace; letter-spacing: .08em; }
.local-note span { color: var(--red); margin-right: 7px; }
.hero-number { position: absolute; right: -10px; bottom: -43px; color: rgba(255,255,255,.025); font: 900 240px/.7 Impact, sans-serif; letter-spacing: -.06em; }

.archive { max-width: var(--max); margin: auto; padding: 110px clamp(20px, 4vw, 64px) 130px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin: 0 auto 62px; max-width: 1180px; }
.section-heading h2, .scope h2 { font-size: clamp(62px, 8vw, 110px); line-height: .85; }
.section-heading > p { max-width: 320px; color: var(--muted); line-height: 1.6; font-size: 14px; }
.order-bar { max-width: 1180px; min-height: 49px; margin: 0 auto 12px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.order-switch { width: 352px; flex: 0 0 352px; display: grid; grid-template-columns: 1fr 80px 124px; align-items: center; min-height: 46px; padding: 5px; border: 1px solid var(--line); background: #0e0f14; }
.order-switch > span { padding: 0 15px 0 10px; color: #686a74; font: 700 8px/1 monospace; letter-spacing: .14em; }
.order-option { min-height: 34px; padding: 0 14px; border: 0; background: transparent; color: #858791; font: 800 9px/1 monospace; letter-spacing: .08em; cursor: pointer; }
.order-option:hover { color: white; }
.order-option.active { background: var(--red); color: white; }
.chronology-note { max-width: 560px; margin: 0; color: #777983; font: 700 9px/1.5 monospace; letter-spacing: .05em; text-align: right; }
.controls { position: sticky; top: 0; z-index: 10; max-width: 1180px; margin: 0 auto; padding: 12px; display: grid; grid-template-columns: minmax(240px, 1fr) auto auto auto; gap: 10px; background: rgba(14,15,20,.94); border: 1px solid var(--line); backdrop-filter: blur(14px); }
.search-box { height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 13px; background: #08090c; border: 1px solid #30323a; }
.search-box > span { color: var(--red); font-size: 22px; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: white; font: 700 11px monospace; letter-spacing: .1em; }
.search-box input::placeholder { color: #6d6f78; }
kbd { padding: 4px 7px; border: 1px solid #363841; color: #777983; font: 10px monospace; }
.filter-row { display: flex; }
.filter { border: 0; padding: 0 13px; background: transparent; color: #7e808a; font: 700 9px monospace; letter-spacing: .08em; cursor: pointer; }
.filter:hover { color: white; }
.filter.active { background: var(--red); color: white; }
.select-wrap { position: relative; }
.select-wrap::after { content: ""; position: absolute; right: 18px; top: 18px; width: 8px; height: 8px; border: solid #a6a8b0; border-width: 0 1px 1px 0; transform: rotate(45deg); pointer-events: none; }
.select-wrap select { appearance: none; -webkit-appearance: none; height: 48px; width: 160px; padding: 0 52px 0 14px; border: 1px solid #30323a; border-radius: 0; background: #08090c; color: #b8b9bf; font: 700 9px monospace; letter-spacing: .08em; cursor: pointer; }
.result-meta { max-width: 1180px; margin: 32px auto 18px; display: flex; justify-content: space-between; color: #777983; font: 700 10px/1 monospace; letter-spacing: .14em; }
.text-button { padding: 0; border: 0; border-bottom: 1px solid #5b5d65; background: none; color: #8c8e96; font: inherit; letter-spacing: inherit; cursor: pointer; }
.text-button:hover { color: white; border-color: var(--red); }
.timeline { max-width: 1180px; margin: auto; }
.year-group { display: grid; grid-template-columns: 120px 1fr; border-top: 1px solid var(--line); }
.year-label { position: sticky; top: 86px; align-self: start; padding: 28px 0; color: #c1c2c7; font: 900 28px/1 Impact, sans-serif; letter-spacing: .03em; }
.year-label small { display: block; margin-top: 8px; color: #575963; font: 700 8px/1 monospace; letter-spacing: .18em; }
.year-list { border-left: 1px solid var(--line); }
.entry { --accent: var(--red); min-height: 112px; display: grid; grid-template-columns: minmax(220px, 1.4fr) minmax(135px, .55fr) 48px; align-items: center; gap: 20px; padding: 18px 0 18px 28px; border-bottom: 1px solid var(--line); position: relative; transition: background .25s, opacity .25s; }
.entry::before { content: ""; width: 2px; height: 0; position: absolute; left: -1px; top: 50%; background: var(--accent); transition: height .25s, top .25s; }
.entry:hover { background: #0e0f14; }
.entry:hover::before { height: 100%; top: 0; }
.entry.watched { opacity: .56; }
.entry.watched:hover { opacity: .88; }
.entry-main { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 16px; }
.format-icon { width: 48px; height: 58px; display: grid; place-items: center; border: 1px solid #33353e; color: var(--accent); background: linear-gradient(145deg, #181a21, #0b0c10); transform: skewY(-3deg); position: relative; }
.format-icon::before, .format-icon::after { content: ""; position: absolute; }
.format-icon[data-type="film"]::before { width: 24px; height: 16px; border: 2px solid currentColor; border-radius: 1px; bottom: 14px; }
.format-icon[data-type="film"]::after { width: 26px; height: 7px; top: 13px; border: solid currentColor; border-width: 2px 0; background: repeating-linear-gradient(125deg, currentColor 0 4px, transparent 4px 8px); transform: rotate(-7deg); }
.format-icon[data-type="series"]::before { width: 25px; height: 18px; border: 2px solid currentColor; border-radius: 2px; box-shadow: 5px -5px 0 -2px #111218, 5px -5px 0 0 currentColor; transform: translate(-3px, 3px); }
.format-icon[data-type="series"]::after { width: 10px; height: 2px; bottom: 13px; background: currentColor; box-shadow: 0 -4px 0 currentColor; }
.format-icon[data-type="special"]::before { content: "★"; position: static; font-size: 25px; line-height: 1; }
.entry h3 { margin: 0; font-size: clamp(16px, 1.7vw, 22px); line-height: 1.1; letter-spacing: -.01em; }
.entry.watched h3 { text-decoration: line-through; text-decoration-color: #74767f; }
.entry-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 7px 13px; color: #747680; font: 700 9px/1.2 monospace; letter-spacing: .06em; text-transform: uppercase; }
.entry-meta .universe { color: var(--accent); }
.entry-date { color: #999ba4; font: 700 10px/1.5 monospace; letter-spacing: .08em; }
.entry-date > * { display: block; }
.entry-date .story-year { color: #c7c8ce; }
.entry-date time { margin-top: 4px; color: #686a73; font-size: 8px; }
.watch-toggle { width: 42px; height: 42px; padding: 0; border: 1px solid #3b3d46; border-radius: 50%; background: transparent; color: transparent; cursor: pointer; position: relative; transition: border-color .2s, background .2s, transform .2s; }
.watch-toggle::before, .watch-toggle::after { content: ""; position: absolute; background: #71737d; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.watch-toggle::before { width: 12px; height: 2px; }
.watch-toggle::after { width: 2px; height: 12px; }
.watch-toggle:hover { border-color: var(--accent); transform: scale(1.08); }
.watched .watch-toggle { background: var(--accent); border-color: var(--accent); }
.watched .watch-toggle::before { width: 12px; height: 6px; border: solid white; border-width: 0 0 2px 2px; background: transparent; transform: translate(-50%, -65%) rotate(-45deg); }
.watched .watch-toggle::after { display: none; }
.entry.upcoming { opacity: .48; }
.entry.upcoming .watch-toggle { cursor: not-allowed; border-style: dashed; }
.entry.upcoming .watch-toggle::before { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.entry.upcoming .watch-toggle::after { display: none; }
.entry[data-universe="X-Men"] { --accent: #56b1e8; }
.entry[data-universe="Spider-Verse"] { --accent: #d06bf0; }
.entry[data-universe="Marvel TV"] { --accent: #e4a54b; }
.entry[data-universe="Legacy"] { --accent: #67c6a3; }
.empty-state { padding: 100px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty-state span { display: block; color: #24262d; font: 900 130px/.8 Impact, sans-serif; }
.empty-state h3 { margin: 5px 0 10px; font: 900 30px Impact, sans-serif; }
.empty-state p { color: var(--muted); }

.scope { max-width: var(--max); margin: auto; padding: 110px clamp(20px, 8vw, 128px); background: var(--red); position: relative; overflow: hidden; }
.scope::after { content: "M"; position: absolute; right: -20px; bottom: -150px; color: rgba(0,0,0,.12); font: 900 500px/.8 Impact, sans-serif; }
.scope .kicker { color: rgba(255,255,255,.67); }
.scope-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10vw; position: relative; z-index: 1; }
.scope-grid > div { max-width: 530px; padding-top: 10px; }
.scope-grid p { margin: 0 0 22px; font-size: 17px; line-height: 1.65; }
footer { max-width: var(--max); margin: auto; padding: 35px clamp(20px, 4vw, 64px); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 30px; border-top: 1px solid var(--line); color: #696b74; font: 700 9px/1.5 monospace; letter-spacing: .08em; }
.footer-brand { display: flex; align-items: center; gap: 12px; color: #a3a4aa; }
.footer-legal { display: grid; gap: 5px; text-align: center; }
.footer-legal p { margin: 0; }
.footer-copyright a { color: #a3a4aa; text-underline-offset: 3px; transition: color .2s; }
.footer-copyright a:hover { color: white; }
.back-to-top { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.back-to-top span { width: 13px; height: 13px; display: block; position: relative; }
.back-to-top span::before { content: ""; position: absolute; width: 1px; height: 9px; left: 6px; top: 3px; background: currentColor; }
.back-to-top span::after { content: ""; position: absolute; width: 5px; height: 5px; left: 3px; top: 2px; border: solid currentColor; border-width: 1px 1px 0 0; transform: rotate(-45deg); }
.back-to-top:hover { color: white; }
.confirm-dialog { width: min(530px, calc(100vw - 32px)); padding: 42px; border: 1px solid #4a4c55; background: #101116; color: var(--ink); box-shadow: 0 30px 100px rgba(0,0,0,.75); }
.confirm-dialog::backdrop { background: rgba(3,4,6,.8); backdrop-filter: blur(7px); }
.confirm-dialog .kicker { margin-bottom: 18px; color: var(--red-bright); }
.confirm-dialog h2 { font-size: clamp(42px, 8vw, 64px); line-height: .9; }
.confirm-dialog > p:not(.kicker) { margin: 24px 0 28px; color: #aaaab1; line-height: 1.55; }
.confirm-dialog label { display: block; margin-bottom: 9px; color: #c5c5ca; font: 700 10px/1.4 monospace; letter-spacing: .09em; text-transform: uppercase; }
.confirm-dialog label strong { color: white; }
.confirm-dialog input { width: 100%; height: 52px; padding: 0 14px; border: 1px solid #41434d; outline: none; background: #08090c; color: white; font: 700 13px monospace; letter-spacing: .14em; text-transform: uppercase; }
.confirm-dialog input:focus { border-color: var(--red); box-shadow: 0 0 0 1px var(--red); }
.dialog-close { position: absolute; top: 14px; right: 17px; padding: 4px; border: 0; background: transparent; color: #8a8c95; font-size: 26px; cursor: pointer; }
.dialog-close:hover { color: white; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 10px; margin-top: 20px; }
.dialog-actions button { min-height: 48px; border: 1px solid #41434d; color: white; font: 800 10px monospace; letter-spacing: .08em; cursor: pointer; }
.dialog-cancel { background: transparent; }
.dialog-cancel:hover { border-color: #747680; }
.dialog-confirm { background: var(--red); border-color: var(--red) !important; }
.dialog-confirm:disabled { background: #272931; border-color: #363841 !important; color: #6f717a; cursor: not-allowed; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 30; min-width: 260px; padding: 14px 18px; border-left: 3px solid var(--red); background: #f2f0e9; color: #0a0b0e; box-shadow: 0 15px 50px rgba(0,0,0,.35); font: 800 10px/1.4 monospace; letter-spacing: .08em; text-align: center; opacity: 0; visibility: hidden; pointer-events: none; transform: translate(-50%, calc(100% + 70px)); transition: transform .3s ease, opacity .2s ease, visibility 0s linear .3s; }
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .65s ease, transform .65s ease; }
.reveal.in-view { opacity: 1; transform: none; }
.year-group, .entry { will-change: transform, opacity; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 80px; padding-top: 80px; }
  .hero-console { justify-self: start; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 35px; }
  .progress-orbit { width: 180px; height: 180px; }
  .progress-core strong { font-size: 44px; }
  .hero-stats { margin: 0; min-width: 270px; }
  .local-note { grid-column: 2; margin: -55px 0 0; }
  .controls { grid-template-columns: 1fr 1fr; }
  .order-bar { align-items: flex-start; }
  .search-box { grid-column: 1 / -1; }
  .filter-row { justify-content: stretch; }
  .filter { flex: 1; padding: 0 10px; height: 48px; }
  .select-wrap select { width: 100%; }
  .scope-grid { grid-template-columns: 1fr; gap: 50px; }
  footer { grid-template-columns: 1fr; }
  .footer-legal { text-align: left; }
}

@media (max-width: 640px) {
  .masthead { min-height: 64px; }
  .brand-file, .masthead-status { display: none; }
  .hero { min-height: auto; padding-top: 70px; padding-bottom: 70px; }
  .hero::after { left: 80%; }
  h1 { font-size: clamp(64px, 20vw, 95px); line-height: .94; }
  .intro { margin-top: 30px; }
  .hero-console { justify-self: stretch; grid-template-columns: 1fr; justify-items: center; gap: 24px; }
  .progress-orbit { width: 130px; height: 130px; padding: 8px; }
  .progress-orbit::before { inset: -10px; }
  .progress-core strong { font-size: 32px; }
  .hero-stats { min-width: 0; width: 100%; grid-column: 1; }
  .hero-stats div { padding: 11px 4px; }
  .hero-stats strong { font-size: 16px; }
  .local-note { grid-column: 1; margin: 0; font-size: 8px; }
  .archive { padding-top: 80px; }
  .section-heading { display: block; margin-bottom: 45px; }
  .section-heading > p { margin-top: 24px; }
  .order-bar { display: block; }
  .order-switch { width: 100%; grid-template-columns: 1fr 80px 124px; }
  .chronology-note { max-width: none; margin-top: 10px; text-align: left; }
  .controls { position: relative; grid-template-columns: 1fr; }
  .search-box, .filter-row { grid-column: auto; }
  .result-meta { margin-top: 24px; }
  .year-group { display: block; }
  .year-label { position: relative; top: auto; padding: 24px 4px 14px; }
  .year-list { border-left: 0; }
  .entry { min-height: 112px; grid-template-columns: minmax(0, 1fr) 42px; gap: 12px; padding: 16px 4px; }
  .entry-main { grid-template-columns: 42px 1fr; gap: 12px; }
  .format-icon { width: 42px; height: 52px; }
  .entry-date { grid-column: 1; padding-left: 54px; margin-top: -16px; }
  .watch-toggle { grid-column: 2; grid-row: 1 / 3; }
  .scope { padding-top: 80px; padding-bottom: 80px; }
  .confirm-dialog { padding: 36px 24px 24px; }
  .dialog-actions { grid-template-columns: 1fr; }
}

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