:root {
  --primary: #0C2340;
  --secondary: #4B92DB;
  --accent: #C8102E;
  --dark: #050b16;
  --ink: #e8eef7;
  --muted: #8ea2bd;
  --glass: rgba(8, 16, 30, 0.62);
  --line: rgba(255, 255, 255, 0.12);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--dark); color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, monospace; transition: background 1.2s var(--ease); }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; touch-action: none; }

.btn { font: 600 12px/1 "JetBrains Mono", monospace; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: var(--glass); border: 1px solid var(--line); border-radius: 10px;
  padding: 0 16px; min-height: 44px; cursor: pointer; backdrop-filter: blur(10px);
  transition: border-color .3s, background .3s; }
.btn:hover, .btn:focus-visible { border-color: var(--secondary); outline: none; }

/* HUD top */
.hud-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 20px;
  padding: max(16px, env(safe-area-inset-top)) 20px 16px; pointer-events: none; z-index: 5;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent); }
.hud-top > * { pointer-events: auto; }
.title-block { flex: 1; text-align: center; }
h1 { margin: 0; font: 700 clamp(26px, 4vw, 44px)/1 "Oswald", sans-serif; letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(90deg, var(--ink), var(--secondary)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.title-block p { margin: 6px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }

.era-badge { display: flex; align-items: center; gap: 12px; padding: 8px 14px 8px 8px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); min-width: 230px; }
.era-mark { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; flex: none; background: none !important; box-shadow: none !important; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--secondary) 45%, transparent));
  background: radial-gradient(circle at 30% 30%, var(--secondary), var(--primary)); box-shadow: 0 0 24px -4px var(--secondary);
  transition: background 1s, box-shadow 1s; }
.era-mark svg { width: 46px; height: 46px; }
.gate { display: flex; align-items: center; gap: 10px; }
.gate-mark svg { width: 34px; height: 34px; display: block; }
.list-era { display: flex; align-items: center; gap: 12px; }
.list-mark svg { width: 34px; height: 34px; display: block; }
.intro-mark { width: 96px; height: 96px; margin: 0 auto 18px; filter: drop-shadow(0 0 28px rgba(75,146,219,.45)); }
.intro-mark svg { width: 100%; height: 100%; }
.era-kicker { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.era-name { font: 700 15px/1.2 "Oswald", sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.era-badge.swap { animation: swap .9s var(--ease); }
@keyframes swap { 0% { transform: rotateX(0); } 50% { transform: rotateX(90deg); opacity: .2; } 100% { transform: rotateX(0); } }

/* Altimeter */
.altimeter { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 4; text-align: center; }
.alt-label { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.alt-track { position: relative; width: 6px; height: 38vh; margin: 0 auto; border-radius: 3px; background: rgba(255,255,255,.08); overflow: visible; }
.alt-fill { position: absolute; bottom: 0; left: 0; right: 0; border-radius: 3px; background: linear-gradient(to top, var(--accent), var(--secondary)); }
.alt-needle { position: absolute; left: -8px; width: 22px; height: 2px; background: var(--ink); box-shadow: 0 0 10px var(--ink); }
.alt-value { margin-top: 8px; font-weight: 800; font-size: 13px; }

/* Now card */
.now-card { position: fixed; left: 24px; bottom: 120px; max-width: min(440px, 80vw); z-index: 4; pointer-events: auto; cursor: pointer;
  padding: 16px 18px; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px);
  transition: opacity .4s, transform .4s var(--ease); }
.now-card.fade { opacity: 0; transform: translateY(8px); }
.now-card .date { font-size: 11px; color: var(--muted); letter-spacing: .1em; }
.now-card .t { font: 700 22px/1.15 "Oswald", sans-serif; margin: 6px 0; letter-spacing: .02em; }
.now-card .h { font-size: 13px; color: #c6d3e6; line-height: 1.5; }
.now-card .open { margin-top: 10px; font-size: 11px; color: var(--secondary); letter-spacing: .1em; text-transform: uppercase; }

/* Bottom scrubber */
.hud-bottom { position: fixed; left: 0; right: 0; bottom: 0; display: flex; gap: 12px; align-items: center; z-index: 5;
  padding: 16px 20px max(18px, env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(0,0,0,.6), transparent); }
.scrubber { position: relative; flex: 1; height: 44px; cursor: pointer; touch-action: none; }
.scrubber:focus-visible { outline: 1px solid var(--secondary); border-radius: 6px; }
.scrub-eras { position: absolute; left: 0; right: 0; top: 30px; height: 6px; display: flex; border-radius: 3px; overflow: hidden; }
.scrub-eras div { height: 100%; }
.scrub-ticks { position: absolute; inset: 0 0 16px 0; }
.scrub-ticks i { position: absolute; bottom: 0; width: 2px; border-radius: 1px; background: var(--muted); opacity: .7; transform: translateX(-1px); }
.scrub-ticks i.mishap { background: var(--accent); }
.scrub-ticks i.peak, .scrub-ticks i.now { background: #fff; opacity: 1; }
.scrub-head { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 14px #fff; transform: translateX(-1px); }
.nav { width: 52px; font-size: 18px; padding: 0; }

.hint { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); font-size: 11px; color: var(--muted); letter-spacing: .1em;
  text-transform: uppercase; z-index: 4; transition: opacity 1s; pointer-events: none; }
.hint.gone { opacity: 0; }

/* 3D labels */
.label { font: 600 11px/1.25 "JetBrains Mono", monospace; color: var(--ink); white-space: nowrap; pointer-events: auto; cursor: pointer;
  padding: 6px 10px; border-radius: 8px; background: rgba(5, 10, 20, .7); border: 1px solid var(--line); transform: translateY(-34px);
  transition: border-color .3s, opacity .3s; user-select: none; }
.label b { display: block; font: 700 13px "Oswald", sans-serif; letter-spacing: .04em; }
.label small { color: var(--muted); }
.label.sev-4, .label.sev-5 { border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.label.active { border-color: #fff; box-shadow: 0 0 20px -4px var(--secondary); }
.label.far { opacity: .35; }

/* Detail panel */
.panel { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  background: rgba(2, 6, 14, .82); backdrop-filter: blur(18px); animation: rise .5s var(--ease); overflow: auto; }
.panel[hidden] { display: none; }
@keyframes rise { from { opacity: 0; transform: scale(.98); } }
.panel .close { position: fixed; top: 18px; right: 18px; z-index: 2; }
.panel-media { position: relative; min-height: 100%; overflow: hidden; }
.panel-media img, .panel-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel-body { padding: clamp(28px, 6vw, 80px) clamp(22px, 5vw, 64px); max-width: 760px; }
.panel-meta { font-size: 12px; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; display: flex; gap: 12px; flex-wrap: wrap; }
.panel-meta .sev { color: var(--accent); }
.panel h2 { font: 700 clamp(30px, 4vw, 52px)/1.05 "Oswald", sans-serif; margin: 12px 0 8px; letter-spacing: .02em; }
.panel-headline { font-size: 15px; color: var(--secondary); margin: 0 0 26px; line-height: 1.5; }
.panel h3 { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 30px; }
.cols p { font-size: 14px; line-height: 1.7; margin: 0; color: #d4deec; }
.hind { border-left: 2px solid var(--accent); padding-left: 18px; }
.sources { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sources a { display: block; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 13px; }
.sources a:hover { border-color: var(--secondary); }
.sources span { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }

/* Real media */
.thumb { position: absolute; inset: 0; overflow: hidden; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.05) translate(0, 0); } to { transform: scale(1.22) translate(-5%, -4%); } }
.play, .lt .play { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.7); }
.play::after { content: ""; position: absolute; left: 8px; top: 6px; border-left: 8px solid #fff; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.label { display: flex; align-items: center; gap: 9px; }
.label .lt { position: relative; flex: none; width: 0; height: 40px; border-radius: 6px; background-size: cover; background-position: center; transition: width .35s var(--ease); animation: kenburns-bg 10s ease-in-out infinite alternate; }
.label.near .lt, .label.active .lt { width: 68px; }
.label .lt .play { right: 3px; bottom: 3px; width: 16px; height: 16px; }
.label .lt .play::after { left: 5.5px; top: 4px; border-left-width: 6px; border-top-width: 4px; border-bottom-width: 4px; }
@keyframes kenburns-bg { from { background-size: 110%; background-position: 40% 40%; } to { background-size: 135%; background-position: 60% 55%; } }
.panel-media { position: sticky; top: 0; height: 100vh; height: 100dvh; overflow: auto; padding: 70px 22px 30px; background: rgba(0,0,0,.35); }
.media-stack { display: grid; gap: 14px; }
.vid { margin: 0; }
.vid-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vid figcaption { font-size: 12px; color: var(--ink); margin-top: 8px; line-height: 1.5; }
.vid figcaption span, .vid figcaption a { color: var(--muted); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.ph { position: relative; display: block; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; background: #000; }
.ph img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.ph:hover img { transform: scale(1.04); }
.ph span { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 7px; font-size: 10px; letter-spacing: .06em; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.media-fallback { position: relative; height: 100%; min-height: 300px; border-radius: 14px; overflow: hidden; }

/* Giants vs Simmons comparison */
#panel-compare:not(:empty) { margin-bottom: 30px; }
.cmp-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: stretch; }
.cmp { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); }
.cmp.r { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.cmp-label { font: 700 16px "Oswald", sans-serif; letter-spacing: .04em; }
.cmp-for { font-size: 12px; color: var(--muted); margin: 4px 0 10px; }
.cmp ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.cmp-verdict { margin-top: 10px; font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--secondary); }
.cmp.r .cmp-verdict { color: var(--accent); }
.cmp-vs { align-self: center; font: 700 14px "Oswald", sans-serif; color: var(--muted); text-transform: uppercase; }
.cmp-note { font-size: 13px; line-height: 1.6; color: #c6d3e6; margin: 12px 0 0; }
@media (max-width: 760px) { .cmp-grid { grid-template-columns: 1fr; } .cmp-vs { justify-self: center; } }

/* Animated thumbnail art */
.art { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(120% 90% at 20% 10%, var(--a1), var(--a0) 70%); }
.art::before { content: ""; position: absolute; inset: -50%; background: repeating-linear-gradient(115deg, transparent 0 22px, rgba(255,255,255,.05) 22px 24px);
  animation: drift 14s linear infinite; }
.art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 60% at 70% 80%, var(--a2), transparent 70%); opacity: .55; animation: pulse 5s ease-in-out infinite; }
.art .glyph { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.art .glyph span { font: 700 clamp(60px, 12vw, 160px)/1 "Oswald", sans-serif; color: rgba(255,255,255,.1); letter-spacing: .04em; }
.art .q { position: absolute; left: 20px; right: 20px; bottom: 20px; z-index: 2; font-size: 12px; color: rgba(255,255,255,.7); }
.art .q a { color: var(--ink); }
@keyframes drift { to { transform: translateX(48px); } }
@keyframes pulse { 50% { opacity: .9; transform: scale(1.08); } }

/* Intro + rewind */
.intro { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(80% 70% at 50% 50%, rgba(0,0,0,.35), rgba(0,0,0,.8)); animation: rise .8s var(--ease); }
.intro[hidden] { display: none; }
.intro { backdrop-filter: blur(6px); }
body.intro-on #stage > div, body.intro-on .now-card, body.intro-on .hint { opacity: 0; transition: opacity .6s; }
#stage > div { transition: opacity .6s; }
.intro-card { max-width: 620px; text-align: center; }
.intro-date { font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.intro h2 { font: 700 clamp(40px, 7vw, 84px)/1 "Oswald", sans-serif; margin: 14px 0; letter-spacing: .02em; text-transform: uppercase; }
.intro p { font-size: 15px; line-height: 1.7; color: #c6d3e6; margin: 0 auto 28px; max-width: 520px; }
.intro-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn.primary { background: var(--accent); border-color: var(--accent); padding: 0 24px; }
.btn.primary:hover { filter: brightness(1.15); border-color: #fff; }
.rewind-fx { position: fixed; inset: 0; z-index: 6; pointer-events: none; opacity: 0; transition: opacity .5s;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 2px, transparent 2px 5px); }
.rewind-fx span { position: absolute; top: 110px; left: 50%; transform: translateX(-50%); font: 800 20px "JetBrains Mono", monospace;
  letter-spacing: .3em; color: #fff; text-shadow: 0 0 18px var(--secondary); animation: blink 1s steps(2) infinite; }
body.rewinding .rewind-fx { opacity: 1; }
body.rewinding .now-card { opacity: .5; }
@keyframes blink { 50% { opacity: .2; } }
.toast { position: fixed; top: 120px; left: 50%; transform: translateX(-50%); z-index: 7; text-align: center; padding: 18px 26px;
  border-radius: 16px; background: var(--glass); border: 1px solid var(--secondary); backdrop-filter: blur(14px); animation: rise .6s var(--ease); }
.toast[hidden] { display: none; }
.toast small { display: block; font-size: 11px; letter-spacing: .16em; color: var(--muted); text-transform: uppercase; }
.toast b { display: block; font: 700 26px "Oswald", sans-serif; margin: 6px 0; }
.toast span { font-size: 11px; color: var(--secondary); letter-spacing: .1em; text-transform: uppercase; }
.art.mini .glyph span { font-size: 26px; color: rgba(255,255,255,.22); }

/* List view */
.listview { position: fixed; inset: 0; z-index: 8; overflow: auto; background: rgba(3, 7, 15, .94); padding: 110px 20px 140px; }
.listview[hidden] { display: none; }
.list-inner { max-width: 880px; margin: 0 auto; }
.list-era { margin: 36px 0 10px; font: 700 13px "Oswald", sans-serif; letter-spacing: .18em; text-transform: uppercase; }
.list-item { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 14px 16px; border-radius: 12px; cursor: pointer; border: 1px solid transparent; }
.list-item:hover, .list-item:focus-visible { border-color: var(--line); background: rgba(255,255,255,.03); outline: none; }
.list-item .d { color: var(--muted); font-size: 12px; padding-top: 3px; }
.list-item .t { font: 700 17px "Oswald", sans-serif; letter-spacing: .02em; }
.list-item .h { font-size: 13px; color: #b8c6da; margin-top: 4px; line-height: 1.5; }

@media (max-width: 760px) {
  .era-badge { min-width: 0; }
  .era-badge > div:last-child { display: none; }
  .title-block p { display: none; }
  .altimeter { right: 10px; }
  .alt-track { height: 24vh; }
  .now-card { left: 12px; right: 12px; bottom: 96px; max-width: none; }
  .panel { display: block; }
  .panel-media { position: static; height: auto; min-height: 0; overflow: visible; padding: 64px 14px 4px; background: none; }
  .photos { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 72%; overflow-x: auto; scroll-snap-type: x mandatory; gap: 8px; padding-bottom: 4px; }
  .ph { scroll-snap-align: start; }
  .panel-body { padding: 18px 18px 60px; }
  .panel h2 { font-size: 30px; }
  .hud-top { gap: 10px; padding-left: 12px; padding-right: 12px; }
  .era-badge { padding: 5px; }
  .era-mark, .era-mark svg { width: 38px; height: 38px; }
  h1 { font-size: 21px; letter-spacing: .08em; }
  .btn { padding: 0 12px; }
  .now-card { padding: 12px 14px; }
  .now-card .t { font-size: 18px; }
  .now-card .h { display: none; }
  .label { font-size: 10px; }
  .label b { font-size: 12px; white-space: normal; max-width: 150px; }
  .label.near .lt, .label.active .lt { width: 56px; height: 34px; }
  .intro h2 { font-size: 44px; }
  .intro-mark { width: 76px; height: 76px; }
  .nav { width: 44px; }
  .cols { grid-template-columns: 1fr; }
  .hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .art::before, .art::after, .era-badge.swap { animation: none; }
}
