/* ============================================
   MULTIVERSE COLLAPSE — Design System
   Direction: Immersive Cinematic / Dark Maximalist
   Fonts: Syne (display), Chakra Petch (body), Share Tech Mono (data)
   ============================================ */

:root {
  /* Void spectrum */
  --void: #030308;
  --abyss: #08080f;
  --deep: #0e0e1a;
  --surface: #141422;
  --raised: #1c1c30;
  --glass: rgba(14, 14, 26, 0.7);

  /* Borders */
  --border: rgba(255, 255, 255, 0.05);
  --border-lit: rgba(255, 255, 255, 0.1);

  /* Text */
  --text: #eae8f4;
  --text-2: #9d99b2;
  --text-3: #5e5978;

  /* Energy palette */
  --red: #ff2d2d;
  --red-g: rgba(255, 45, 45, 0.35);
  --gold: #ffb800;
  --gold-g: rgba(255, 184, 0, 0.3);
  --purple: #9945ff;
  --purple-g: rgba(153, 69, 255, 0.3);
  --blue: #00b4ff;
  --blue-g: rgba(0, 180, 255, 0.25);
  --cyan: #00ffc8;
  --cyan-g: rgba(0, 255, 200, 0.2);
  --amber: #ff8a00;
  --crimson: #dc2626;
  --emerald: #10b981;

  /* Type */
  --f-display: 'Syne', sans-serif;
  --f-body: 'Chakra Petch', sans-serif;
  --f-mono: 'Share Tech Mono', monospace;

  /* Motion */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-dramatic: cubic-bezier(0.7, 0, 0.3, 1);

  /* Radii */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;
}

/* ─── Reset ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--f-body);
  background: var(--void);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  cursor: auto;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: none; cursor: pointer; background: none; color: inherit; }
input { font-family: inherit; border: none; outline: none; background: none; color: inherit; }

::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--raised); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }

/* ============================================
   ATMOSPHERE (fixed background layers)
   ============================================ */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.atmosphere__grain {
  position: absolute;
  inset: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 256px;
  mix-blend-mode: overlay;
}

/* Animated multiverse cracks */
.atmosphere__cracks {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(127deg, transparent 40%, var(--purple-g) 40.2%, transparent 40.4%),
    linear-gradient(237deg, transparent 55%, var(--red-g) 55.15%, transparent 55.3%),
    linear-gradient(17deg,  transparent 70%, var(--blue-g) 70.1%, transparent 70.2%),
    linear-gradient(310deg, transparent 25%, var(--gold-g) 25.1%, transparent 25.2%);
  opacity: 0;
  animation: cracksReveal 4s 1s ease-out forwards;
}

@keyframes cracksReveal {
  to { opacity: 0.6; }
}

#void-canvas {
  position: absolute;
  inset: 0;
}

/* ============================================
   HERO — THE PORTAL
   ============================================ */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 50% 45% at 50% 50%, rgba(153, 69, 255, 0.07) 0%, transparent 100%),
    var(--void);
}

/* ─── Portal rings ─── */
.portal {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal__ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid transparent;
}

.portal__ring--1 {
  width: min(85vw, 700px);
  height: min(85vw, 700px);
  border-image: conic-gradient(from 0deg, var(--red), var(--gold), var(--purple), var(--blue), var(--red)) 1;
  border-width: 1.5px;
  opacity: 0.25;
  animation: portalSpin 25s linear infinite;
}

.portal__ring--2 {
  width: min(65vw, 520px);
  height: min(65vw, 520px);
  border-image: conic-gradient(from 90deg, var(--purple), var(--cyan), var(--gold), var(--red), var(--purple)) 1;
  border-width: 1px;
  opacity: 0.2;
  animation: portalSpin 18s linear infinite reverse;
}

.portal__ring--3 {
  width: min(45vw, 360px);
  height: min(45vw, 360px);
  border-image: conic-gradient(from 180deg, var(--gold), var(--red), var(--blue), var(--purple), var(--gold)) 1;
  border-width: 1px;
  opacity: 0.3;
  animation: portalSpin 12s linear infinite;
}

.portal__ring--4 {
  width: min(22vw, 180px);
  height: min(22vw, 180px);
  background: radial-gradient(circle, rgba(153, 69, 255, 0.08) 0%, transparent 70%);
  border-image: conic-gradient(from 270deg, var(--red), var(--purple), var(--gold), var(--red)) 1;
  border-width: 2px;
  opacity: 0.4;
  animation: portalSpin 8s linear infinite reverse;
}

@keyframes portalSpin {
  to { transform: rotate(360deg); }
}

/* ─── Hero content ─── */
.hero__content {
  position: relative;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem;
}

.hero__badge {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.45em;
  color: var(--text-3);
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  opacity: 0;
  animation: fadeSlideUp 0.8s 0.4s var(--ease-expo) forwards;
}

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 0.85;
}

.hero__title-top {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(1rem, 3vw, 1.8rem);
  letter-spacing: 0.35em;
  color: var(--text-2);
  opacity: 0;
  animation: fadeSlideUp 0.8s 0.6s var(--ease-expo) forwards;
}

.hero__title-main {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(3.5rem, 10vw, 9rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
  animation:
    fadeSlideUp 1s 0.8s var(--ease-expo) forwards,
    gradientShift 8s ease-in-out infinite;
  opacity: 0;
  filter: drop-shadow(0 0 60px var(--red-g)) drop-shadow(0 0 120px var(--purple-g));
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.hero__tagline {
  font-family: var(--f-body);
  font-weight: 300;
  font-size: clamp(0.85rem, 1.8vw, 1.15rem);
  color: var(--text-3);
  line-height: 1.7;
  max-width: 32ch;
  opacity: 0;
  animation: fadeSlideUp 0.8s 1s var(--ease-expo) forwards;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── Doom Clock ─── */
.doom-clock {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.6rem;
  opacity: 0;
  animation: fadeSlideUp 0.8s 1.2s var(--ease-expo) forwards;
}

.doom-clock__svg {
  width: clamp(180px, 28vw, 240px);
  height: clamp(180px, 28vw, 240px);
  transform: rotate(-90deg); /* start arcs from 12 o'clock */
}

/* Track rings (background) */
.clock-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.05);
  stroke-width: 3;
}

/* Progress arcs */
.clock-arc {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s var(--ease-expo);
}

.arc-days  {
  stroke: var(--red);
  filter: drop-shadow(0 0 4px var(--red)) drop-shadow(0 0 10px rgba(255,45,45,0.3));
  animation: ringRotateCW 120s linear infinite;
}
.arc-hours {
  stroke: var(--gold);
  filter: drop-shadow(0 0 4px var(--gold)) drop-shadow(0 0 10px rgba(255,184,0,0.3));
  animation: ringRotateCCW 30s linear infinite;
}
.arc-mins {
  stroke: var(--purple);
  filter: drop-shadow(0 0 4px var(--purple)) drop-shadow(0 0 10px rgba(168,85,247,0.3));
  animation: ringRotateCW 8s linear infinite;
}
.arc-secs {
  stroke: var(--cyan);
  filter: drop-shadow(0 0 4px var(--cyan)) drop-shadow(0 0 10px rgba(0,180,255,0.3));
  animation: ringRotateCCW 2s linear infinite;
}

/* Ring rotation without disturbing the arc fill (origin: SVG center 100 100) */
@keyframes ringRotateCW  { from { transform-origin: 100px 100px; transform: rotate(0deg);    } to { transform-origin: 100px 100px; transform: rotate(360deg);  } }
@keyframes ringRotateCCW { from { transform-origin: 100px 100px; transform: rotate(0deg);    } to { transform-origin: 100px 100px; transform: rotate(-360deg); } }

/* Center overlay (absolute over SVG) */
.doom-clock__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  pointer-events: none;
}

.doom-clock__primary {
  font-family: var(--f-mono);
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold-g), 0 0 40px rgba(255,184,0,0.2);
  line-height: 1;
  transition: transform 0.25s var(--ease-spring);
}

.doom-clock__primary.tick { transform: scale(1.15); }

.doom-clock__unit-label {
  font-family: var(--f-mono);
  font-size: 0.38rem;
  letter-spacing: 0.35em;
  color: var(--text-3);
  text-transform: uppercase;
}

.doom-clock__secondary {
  font-family: var(--f-mono);
  font-size: clamp(0.55rem, 1.5vw, 0.75rem);
  color: var(--text-2);
  letter-spacing: 0.12em;
  margin-top: 0.15rem;
}

/* ─── Enter CTA ─── */
.hero__enter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 0.75rem 2rem;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.25em;
  color: var(--void);
  background: var(--gold);
  border-radius: var(--r-sm);
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeSlideUp 0.8s 1.4s var(--ease-expo) forwards;
  transition: all 0.4s var(--ease-expo);
}

.hero__enter::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--red), var(--purple));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.hero__enter:hover {
  color: #fff;
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px var(--gold-g), 0 0 80px var(--gold-g);
}

.hero__enter:hover::after { opacity: 1; }

.hero__enter svg,
.hero__enter-arrow {
  position: relative;
  z-index: 1;
}

/* the text needs z-index too */
.hero__enter {
  isolation: isolate;
}

/* ============================================
   TRACKER (sticky progress)
   ============================================ */
.tracker {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(3, 3, 8, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.tracker__bar {
  height: 2px;
  background: var(--deep);
  border-radius: 2px;
  overflow: hidden;
}

.tracker__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--gold), var(--purple));
  border-radius: 2px;
  transition: width 0.6s var(--ease-expo);
  box-shadow: 0 0 10px var(--red-g);
}

.tracker__info {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
}

/* ============================================
   CONTROLS (search + filter pills)
   ============================================ */
.controls {
  position: sticky;
  top: 36px;
  z-index: 199;
  background: rgba(3, 3, 8, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.controls__search-box {
  position: relative;
  flex: 0 1 280px;
}

.controls__search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
}

.controls__search {
  width: 100%;
  padding: 0.45rem 0.7rem 0.45rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.8rem;
  font-family: var(--f-body);
  color: var(--text);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.controls__search:focus {
  border-color: var(--purple);
  box-shadow: 0 0 0 3px var(--purple-g);
}

.controls__search::placeholder { color: var(--text-3); }

.controls__filters {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  flex: 1;
}

.pill {
  padding: 0.3rem 0.7rem;
  font-family: var(--f-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  border-radius: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  white-space: nowrap;
  transition: all 0.3s ease;
}

.pill:hover {
  border-color: var(--border-lit);
  color: var(--text);
  background: var(--raised);
}

.pill.active {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
  box-shadow: 0 0 14px var(--purple-g);
}

.controls__actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-left: auto;
}

.ctrl-btn {
  padding: 0.3rem 0.85rem;
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  border-radius: 100px;
  border: 1px solid;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 700;
}

.ctrl-btn--all {
  background: rgba(16,185,129,0.1);
  border-color: rgba(16,185,129,0.4);
  color: var(--emerald);
}
.ctrl-btn--all:hover {
  background: var(--emerald);
  border-color: var(--emerald);
  color: var(--void);
  box-shadow: 0 0 16px rgba(16,185,129,0.4);
}

.ctrl-btn--reset {
  background: rgba(255,45,45,0.08);
  border-color: rgba(255,45,45,0.3);
  color: rgba(255,100,100,0.7);
}
.ctrl-btn--reset:hover {
  background: rgba(255,45,45,0.18);
  border-color: rgba(255,45,45,0.6);
  color: var(--red);
}


/* ============================================
   TIMELINE — Vertical spine layout
   ============================================ */
.tl {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.tl__spine {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(
    to bottom,
    transparent 0%,
    var(--purple) 10%,
    var(--red) 50%,
    var(--gold) 80%,
    transparent 100%
  );
  opacity: 0.15;
  transform: translateX(-50%);
}

/* ─── Phase block ─── */
.phase-block {
  margin-bottom: 5rem;
  position: relative;
}

.phase-block__header {
  text-align: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.phase-block__icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 0.4rem;
}

.phase-block__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.phase-block__sub {
  font-family: var(--f-body);
  font-size: 0.75rem;
  color: var(--text-3);
  margin-top: 0.3rem;
}

.phase-block__counter {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  border: 1px solid var(--border);
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  margin-top: 0.5rem;
}

/* Diagonal energy line under header */
.phase-block__header::after {
  content: '';
  display: block;
  width: 120px;
  height: 2px;
  margin: 1rem auto 0;
  border-radius: 2px;
  transform: skewX(-20deg);
}

/* Per-phase accent colors on the diagonal */
[data-phase="fox"] .phase-block__header::after { background: var(--amber); box-shadow: 0 0 12px rgba(255,138,0,0.4); }
[data-phase="sony-legacy"] .phase-block__header::after { background: var(--cyan); box-shadow: 0 0 12px var(--cyan-g); }
[data-phase="infinity"] .phase-block__header::after { background: var(--red); box-shadow: 0 0 12px var(--red-g); }
[data-phase="defenders"] .phase-block__header::after { background: var(--crimson); box-shadow: 0 0 12px rgba(220,38,38,0.4); }
[data-phase="multiverse"] .phase-block__header::after { background: var(--purple); box-shadow: 0 0 12px var(--purple-g); }
[data-phase="sony-verse"] .phase-block__header::after { background: var(--cyan); box-shadow: 0 0 12px var(--cyan-g); }
[data-phase="phase56"] .phase-block__header::after { background: var(--emerald); box-shadow: 0 0 12px rgba(16,185,129,0.4); }
[data-phase="2026"] .phase-block__header::after { background: var(--gold); box-shadow: 0 0 12px var(--gold-g); }

/* ─── Cards container ─── */
.phase-block__items {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============================================
   CARD — Alternating left/right
   ============================================ */
.card {
  position: relative;
  width: 46%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 1.1rem 1.3rem;
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  cursor: pointer;
  transition: all 0.4s var(--ease-expo);

  /* Start hidden for reveal */
  opacity: 0;
  transform: translateX(-30px) translateY(10px);
}

/* Alternating sides */
.card:nth-child(odd) {
  align-self: flex-start;
  margin-left: 2%;
  transform: translateX(-30px) translateY(10px);
}

.card:nth-child(even) {
  align-self: flex-end;
  margin-right: 2%;
  transform: translateX(30px) translateY(10px);
}

/* Timeline connector dot */
.card::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple);
  box-shadow: 0 0 8px var(--purple-g);
  transition: transform 0.3s var(--ease-spring), background 0.3s;
}

.card:nth-child(odd)::before {
  right: -5.5%;
  transform: translateY(-50%);
}

.card:nth-child(even)::before {
  left: -5.5%;
  transform: translateY(-50%);
}

/* Connector line from dot to spine */
.card::after {
  content: '';
  position: absolute;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, var(--purple-g), transparent);
  opacity: 0.3;
}

.card:nth-child(odd)::after {
  right: -5%;
  width: 5%;
}

.card:nth-child(even)::after {
  left: -5%;
  width: 5%;
  background: linear-gradient(270deg, var(--purple-g), transparent);
}

/* Revealed state */
.card.revealed {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

/* Hover */
.card:hover {
  background: var(--raised);
  border-color: var(--border-lit);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.card:nth-child(odd):hover { transform: translateX(4px) translateY(-3px); }
.card:nth-child(even):hover { transform: translateX(-4px) translateY(-3px); }

.card:hover::before {
  transform: translateY(-50%) scale(1.6);
  background: var(--gold);
  box-shadow: 0 0 14px var(--gold-g);
}

/* Watched state */
.card.watched { opacity: 0.4; }
.card.watched .card__title { text-decoration: line-through; text-decoration-color: var(--text-3); }
.card.watched::before { background: var(--emerald); box-shadow: 0 0 8px rgba(16,185,129,0.4); }

/* Per-phase left accent */
.card { border-left: 3px solid var(--border); }
[data-phase="fox"] .card            { border-left-color: var(--amber); }
[data-phase="sony-legacy"] .card    { border-left-color: var(--cyan); }
[data-phase="infinity"] .card       { border-left-color: var(--red); }
[data-phase="defenders"] .card      { border-left-color: var(--crimson); }
[data-phase="multiverse"] .card     { border-left-color: var(--purple); }
[data-phase="sony-verse"] .card     { border-left-color: var(--cyan); }
[data-phase="phase56"] .card        { border-left-color: var(--emerald); }
[data-phase="2026"] .card           { border-left-color: var(--gold); }

/* Card internals */
.card__check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-3);
  display: grid;
  place-items: center;
  margin-top: 1px;
  transition: all 0.3s var(--ease-spring);
  font-size: 0.65rem;
}

.card.watched .card__check {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #fff;
}

.card__check-icon { display: none; }
.card.watched .card__check-icon { display: block; }

.card__body { flex: 1; min-width: 0; }

.card__num {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.25em;
  color: var(--text-3);
  margin-bottom: 3px;
}

.card__name {
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin-bottom: 5px;
  transition: color 0.3s;
}

.card:hover .card__name { color: var(--gold); }

.card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.card__tag {
  font-family: var(--f-body);
  font-size: 0.65rem;
  padding: 1px 7px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 3px;
  color: var(--text-2);
}

.card.hidden { display: none; }

/* ============================================
   NANOTECH BORDER CRAWL (card hover)
   ============================================ */
@property --nano-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

.card__nano {
  position: absolute;
  inset: -1px;
  border-radius: var(--r-md);
  padding: 2px;
  background: conic-gradient(
    from var(--nano-angle),
    transparent 0%,
    transparent 55%,
    var(--gold) 70%,
    #fff 78%,
    var(--purple) 85%,
    transparent 100%
  );
  /* Mask trick: show only the border ring, not the fill */
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.4s ease;
}

.card:hover .card__nano {
  opacity: 1;
  animation: nanoSpin 1.8s linear infinite;
}

@keyframes nanoSpin {
  to { --nano-angle: 360deg; }
}

/* ============================================
   ENERGY CURSOR TRAIL
   ============================================ */
.cursor-dot {
  position: fixed;
  pointer-events: none;
  z-index: 9998;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
}


/* ============================================
   TERMINUS — DOOMSDAY FINALE
   ============================================ */
.terminus {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto 4rem;
  padding: 5rem 2rem;
  text-align: center;
  overflow: hidden;
  border-radius: var(--r-lg);
  background:
    radial-gradient(ellipse 70% 50% at 50% 40%, rgba(255, 45, 45, 0.08) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 70%, rgba(153, 69, 255, 0.06) 0%, transparent 60%),
    var(--surface);
  border: 1px solid var(--border);
}

/* Rotating fracture glow */
.terminus__fracture {
  position: absolute;
  inset: -3px;
  border-radius: var(--r-lg);
  background: conic-gradient(
    from 0deg,
    var(--red), transparent,
    var(--gold), transparent,
    var(--purple), transparent,
    var(--blue), transparent,
    var(--red)
  );
  opacity: 0.25;
  z-index: -1;
  animation: fractureSpin 8s linear infinite;
  filter: blur(6px);
}

@keyframes fractureSpin { to { transform: rotate(360deg); } }

.terminus__inner { position: relative; z-index: 1; }

.terminus__num {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--gold);
  margin-bottom: 1rem;
}

/* ─── Glitch text ─── */
.glitch {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2.2rem, 7vw, 4.5rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  display: inline-block;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.glitch::before {
  color: var(--red);
  z-index: -1;
  animation: glitchTop 3s ease-in-out infinite alternate;
}

.glitch::after {
  color: var(--blue);
  z-index: -2;
  animation: glitchBottom 2.5s ease-in-out infinite alternate-reverse;
}

@keyframes glitchTop {
  0%   { clip-path: inset(0 0 85% 0); transform: translate(-2px, -1px); }
  20%  { clip-path: inset(30% 0 50% 0); transform: translate(2px, 1px); }
  40%  { clip-path: inset(60% 0 10% 0); transform: translate(-1px, 2px); }
  60%  { clip-path: inset(10% 0 70% 0); transform: translate(1px, -1px); }
  80%  { clip-path: inset(80% 0 0 0); transform: translate(-2px, 0); }
  100% { clip-path: inset(0 0 90% 0); transform: translate(2px, 1px); }
}

@keyframes glitchBottom {
  0%   { clip-path: inset(85% 0 0 0); transform: translate(2px, 1px); }
  25%  { clip-path: inset(50% 0 20% 0); transform: translate(-2px, -1px); }
  50%  { clip-path: inset(10% 0 60% 0); transform: translate(1px, 2px); }
  75%  { clip-path: inset(70% 0 5% 0); transform: translate(-1px, -2px); }
  100% { clip-path: inset(0 0 80% 0); transform: translate(2px, -1px); }
}

/* Hover intensifies glitch */
.terminus:hover .glitch::before {
  animation-duration: 0.4s;
}

.terminus:hover .glitch::after {
  animation-duration: 0.3s;
}

.terminus__date {
  font-family: var(--f-mono);
  font-size: clamp(0.6rem, 1.4vw, 0.85rem);
  letter-spacing: 0.3em;
  color: var(--text-2);
  margin-top: 1.2rem;
}

.terminus__quote {
  font-family: var(--f-body);
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  color: var(--text-3);
  font-style: italic;
  margin-top: 1rem;
  opacity: 0.6;
}

/* ============================================
   FOOTER
   ============================================ */
.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4rem 1.5rem 3rem;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--text-3);
}

.foot__copy {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  margin-top: 0.5rem;
  opacity: 0.4;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .tl__spine { left: 20px; }

  .card {
    width: calc(100% - 50px);
    margin-left: 50px !important;
    margin-right: 0 !important;
    align-self: flex-start !important;
  }

  .card:nth-child(odd),
  .card:nth-child(even) {
    transform: translateX(20px) translateY(10px);
  }

  .card.revealed {
    transform: translateX(0) translateY(0);
  }

  .card:nth-child(odd):hover,
  .card:nth-child(even):hover {
    transform: translateX(4px) translateY(-2px);
  }

  .card::before {
    left: -22px !important;
    right: auto !important;
  }

  .card::after {
    left: -18px !important;
    right: auto !important;
    width: 18px !important;
    background: linear-gradient(90deg, var(--purple-g), transparent) !important;
  }
}

@media (max-width: 640px) {
  .hero__title-main {
    font-size: clamp(3.5rem, 20vw, 6rem);
  }

  .portal__ring--1 { width: 90vw; height: 90vw; }
  .portal__ring--2 { width: 70vw; height: 70vw; }
  .portal__ring--3 { width: 50vw; height: 50vw; }
  .portal__ring--4 { width: 28vw; height: 28vw; }

  .countdown { gap: 0.3rem; }
  .countdown__unit { min-width: 42px; }
  .countdown__value { font-size: 1.4rem; }

  .controls {
    top: 30px;
    padding: 0.5rem 1rem;
  }

  .controls__search-box { flex: 1 1 100%; }

  .controls__filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .controls__filters::-webkit-scrollbar { display: none; }

  .tl { padding: 2.5rem 0.8rem 4rem; }
  .tl__spine { left: 12px; }

  .card {
    width: calc(100% - 32px);
    margin-left: 32px !important;
    padding: 0.8rem 1rem;
  }

  .card::before { left: -14px !important; width: 6px; height: 6px; }
  .card::after { left: -10px !important; width: 10px !important; }

  .terminus { padding: 3rem 1rem; margin: 0 0.8rem 3rem; }

  .phase-block__title { font-size: 1.2rem; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================
   THOR LIGHTNING STRIKE
   ============================================ */
#lightning-canvas {
  position: fixed;
  inset: 0;
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
}

#lightning-canvas.strike {
  opacity: 1;
}

.lightning-flash {
  position: fixed;
  inset: 0;
  z-index: 9989;
  background: #fff;
  pointer-events: none;
  opacity: 0;
}

.lightning-flash.flashing {
  animation: flashOut 0.6s ease-out forwards;
}

@keyframes flashOut {
  0%   { opacity: 0.7; }
  15%  { opacity: 0; }
  30%  { opacity: 0.4; }
  100% { opacity: 0; }
}

/* Phase-block electrified header (after lightning) */
.phase-block[data-phase="2026"] .phase-block__title {
  transition: text-shadow 0.3s ease;
}
.phase-block[data-phase="2026"].electrified .phase-block__title {
  text-shadow:
    0 0 10px #fff,
    0 0 30px var(--gold),
    0 0 60px var(--blue),
    0 0 100px var(--purple);
  animation: electricHum 0.08s linear infinite;
}
@keyframes electricHum {
  0%, 100% { transform: translateX(0); }
  25%       { transform: translateX(-1px); }
  75%       { transform: translateX(1px); }
}

/* ============================================
   THANOS SNAP — DISINTEGRATION
   ============================================ */
.snap-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  border-radius: var(--r-md);
  opacity: 0;
}

.card.snapping .snap-canvas {
  opacity: 1;
}

/* Card content collapses as particles fly */
.card.snapping .card__body,
.card.snapping .card__check {
  animation: snapFade 0.8s ease-out forwards;
}

@keyframes snapFade {
  0%   { opacity: 1; transform: scale(1); }
  40%  { opacity: 0.6; transform: scale(0.97); }
  100% { opacity: 0; transform: scale(0.93); }
}

/* Reassemble animation (un-watch) */
.card.assembling .card__body,
.card.assembling .card__check {
  animation: assemble 0.6s var(--ease-spring) forwards;
}

@keyframes assemble {
  0%   { opacity: 0; transform: scale(0.9) translateY(4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Snap icon flash on the check circle */
.card.snapping .card__check {
  animation: snapFade 0.8s ease-out forwards,
             snapGlow 0.3s ease-out;
}

@keyframes snapGlow {
  0%   { box-shadow: 0 0 0 0 var(--purple-g); }
  50%  { box-shadow: 0 0 20px 8px var(--purple-g); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ============================================
   DOCTOR STRANGE PORTAL OVERLAY
   ============================================ */
#portal-canvas {
  position: fixed;
  inset: 0;
  z-index: 9985;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#portal-canvas.active { opacity: 1; pointer-events: all; }

/* ============================================
   INFINITY GAUNTLET TRACKER
   ============================================ */
/* Hide the old tracker bar fill (we keep the bar as fallback) */
.tracker { display: none; }

.gauntlet-tracker {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(3, 3, 8, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gauntlet-tracker__label {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
  white-space: nowrap;
}

.gauntlet-tracker__stat {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: var(--text-2);
  margin-left: auto;
  white-space: nowrap;
}

/* The gauntlet hand shape */
.gauntlet {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.stone {
  flex: 1;
  height: 10px;
  border-radius: 5px;
  background: var(--deep);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  transition: border-color 0.4s ease;
}

.stone__fill {
  position: absolute;
  inset: 0;
  border-radius: 5px;
  width: 0%;
  transition: width 0.8s var(--ease-expo);
}

/* Stone colours */
.stone--power   { --sc: #9945ff; --sg: rgba(153,69,255,0.5); }
.stone--space   { --sc: #00b4ff; --sg: rgba(0,180,255,0.5); }
.stone--reality { --sc: #ff2d2d; --sg: rgba(255,45,45,0.5); }
.stone--soul    { --sc: #ff8a00; --sg: rgba(255,138,0,0.5); }
.stone--time    { --sc: #10b981; --sg: rgba(16,185,129,0.5); }
.stone--mind    { --sc: #ffb800; --sg: rgba(255,184,0,0.5); }

.stone__fill { background: var(--sc); }

.stone.lit {
  border-color: var(--sc);
  box-shadow: 0 0 8px var(--sg), inset 0 0 6px rgba(255,255,255,0.1);
  animation: stonePulse 2s ease-in-out infinite;
}

@keyframes stonePulse {
  0%, 100% { box-shadow: 0 0 6px var(--sg); }
  50%       { box-shadow: 0 0 18px var(--sg), 0 0 40px var(--sg); }
}

/* Stone tooltip */
.stone::after {
  content: attr(data-name);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--raised);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: var(--f-mono);
  font-size: 0.5rem;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.stone:hover::after { opacity: 1; }

/* ── Snap celebration overlay ── */
#snap-celebration {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.92);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  text-align: center;
  padding: 2rem;
}
#snap-celebration.visible {
  opacity: 1;
  pointer-events: all;
}
.snap-celebration__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 6vw, 4rem);
  background: linear-gradient(135deg, var(--gold), #fff, var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}
.snap-celebration__sub {
  font-family: var(--f-mono);
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--text-2);
  margin-bottom: 2rem;
}
.snap-celebration__close {
  padding: 0.6rem 1.8rem;
  border: 1px solid var(--gold);
  border-radius: 100px;
  font-family: var(--f-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--gold);
  cursor: pointer;
  background: none;
  transition: all 0.3s ease;
}
.snap-celebration__close:hover {
  background: var(--gold);
  color: var(--void);
}

/* ============================================
   DOOMSDAY LETTER SCATTER (scroll parallax)
   ============================================ */
.doom-letter {
  display: inline-block;
  will-change: transform, opacity, filter;
  transition: none;
  cursor: default;
  /* Each letter inherits gradient from parent via background-clip */
  background: linear-gradient(
    160deg,
    var(--red) 0%,
    #ff6b35 20%,
    var(--gold) 42%,
    #fff 52%,
    var(--purple) 68%,
    var(--blue) 100%
  );
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 8s ease-in-out infinite;
}

/* Letter hover: flash gold */
.doom-letter:hover {
  background: none !important;
  -webkit-text-fill-color: var(--gold) !important;
  filter: drop-shadow(0 0 20px var(--gold-g)) drop-shadow(0 0 40px var(--red-g)) !important;
  transform: translateY(-10px) scale(1.12) !important;
  transition: transform 0.25s var(--ease-spring), filter 0.2s !important;
}




/* ============================================
   REALITY TEAR — Phase Dividers
   ============================================ */
.phase-tear {
  position: relative;
  width: 100%;
  height: 60px;
  margin: -2rem 0 2rem;
  overflow: visible;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.phase-tear.visible { opacity: 1; }

.phase-tear svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.tear-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  filter: drop-shadow(0 0 6px currentColor);
  transition: stroke-dashoffset 1.2s var(--ease-expo);
}

.phase-tear.visible .tear-line { stroke-dashoffset: 0; }

.tear-glow {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  opacity: 0.1;
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  transition: stroke-dashoffset 1.4s 0.2s var(--ease-expo);
}

.phase-tear.visible .tear-glow { stroke-dashoffset: 0; }

[data-tear="fox"]         .tear-line,
[data-tear="fox"]         .tear-glow  { stroke: var(--amber); }
[data-tear="sony-legacy"] .tear-line,
[data-tear="sony-legacy"] .tear-glow  { stroke: var(--cyan); }
[data-tear="infinity"]    .tear-line,
[data-tear="infinity"]    .tear-glow  { stroke: var(--red); }
[data-tear="defenders"]   .tear-line,
[data-tear="defenders"]   .tear-glow  { stroke: var(--crimson); }
[data-tear="multiverse"]  .tear-line,
[data-tear="multiverse"]  .tear-glow  { stroke: var(--purple); }
[data-tear="sony-verse"]  .tear-line,
[data-tear="sony-verse"]  .tear-glow  { stroke: var(--cyan); }
[data-tear="phase56"]     .tear-line,
[data-tear="phase56"]     .tear-glow  { stroke: var(--emerald); }
[data-tear="2026"]        .tear-line,
[data-tear="2026"]        .tear-glow  { stroke: var(--gold); }

@keyframes tearSpark {
  0%   { opacity: 0.2; }
  100% { opacity: 1;   }
}

.tear-spark { animation: tearSpark 1.8s ease-in-out infinite alternate; }




/* ============================================
   PHASE PARALLAX DEPTH BACKGROUNDS
   ============================================ */
.phase-block { position: relative; overflow: visible; }

.phase-bg {
  position: absolute;
  inset: -80px -40px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.055;
  border-radius: 50%;
  will-change: transform;
  filter: blur(90px);
}

.phase-block[data-phase="fox"]         .phase-bg { background: radial-gradient(ellipse, var(--amber) 0%, transparent 70%); }
.phase-block[data-phase="sony-legacy"] .phase-bg { background: radial-gradient(ellipse, var(--cyan) 0%, transparent 70%); }
.phase-block[data-phase="infinity"]    .phase-bg { background: radial-gradient(ellipse, var(--red) 0%, transparent 70%); }
.phase-block[data-phase="defenders"]   .phase-bg { background: radial-gradient(ellipse, var(--crimson) 0%, transparent 70%); }
.phase-block[data-phase="multiverse"]  .phase-bg { background: radial-gradient(ellipse, var(--purple) 0%, transparent 70%); }
.phase-block[data-phase="sony-verse"]  .phase-bg { background: radial-gradient(ellipse, #00e5ff 0%, transparent 70%); }
.phase-block[data-phase="phase56"]     .phase-bg { background: radial-gradient(ellipse, var(--emerald) 0%, transparent 70%); }
.phase-block[data-phase="2026"]        .phase-bg { background: radial-gradient(ellipse, var(--gold) 0%, transparent 70%); }

/* ============================================
   INFINITY TRIAL MINIGAME
   ============================================ */
.minigame { padding: 4rem 1.5rem 2rem; max-width: 900px; margin: 0 auto; }
.minigame__header { text-align: center; margin-bottom: 1.5rem; }

.minigame__badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.3em;
  color: var(--purple);
  border: 1px solid rgba(168,85,247,0.4);
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 0.6rem;
}

.minigame__title {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 3rem);
  background: linear-gradient(135deg, var(--purple), var(--cyan), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.1em;
}

.minigame__sub {
  font-family: var(--f-mono);
  font-size: 0.65rem;
  color: var(--text-3);
  letter-spacing: 0.1em;
  margin-top: 0.4rem;
}

.minigame__arena {
  position: relative;
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: 0 0 40px rgba(168,85,247,0.08), inset 0 0 60px rgba(0,0,0,0.4);
  cursor: none;
}

#game-canvas { display: block; width: 100%; background: transparent; }

.minigame__scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.minigame__score-label {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.2em;
  color: var(--text-3);
}

.minigame__score-val {
  font-family: var(--f-mono);
  font-size: 0.75rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}

/* ============================================
   JARVIS SPLASH SCREEN
   ============================================ */
#jarvis-splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  overflow: hidden;
  transition: transform 0.85s cubic-bezier(0.76, 0, 0.24, 1);
  cursor: pointer;
}

#jarvis-splash.dismiss { transform: translateY(-100vh); }

#jv-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* ── Corners ── */
.jv-corner {
  position: absolute;
  width: 55px;
  height: 55px;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.5s var(--ease-expo);
}
.jv-tl { top: 22px; left: 22px;  border-top: 1.5px solid #00cfff; border-left: 1.5px solid #00cfff;  transform: translate(-20px,-20px); }
.jv-tr { top: 22px; right: 22px; border-top: 1.5px solid #00cfff; border-right: 1.5px solid #00cfff; transform: translate(20px,-20px); }
.jv-bl { bottom: 22px; left: 22px;  border-bottom: 1.5px solid #00cfff; border-left: 1.5px solid #00cfff;  transform: translate(-20px,20px); }
.jv-br { bottom: 22px; right: 22px; border-bottom: 1.5px solid #00cfff; border-right: 1.5px solid #00cfff; transform: translate(20px,20px); }

#jarvis-splash.active .jv-corner {
  opacity: 1;
  transform: translate(0,0);
}

/* ── Side panels ── */
.jv-panel {
  position: absolute;
  top: 80px;
  bottom: 80px;
  width: 120px;
  font-family: var(--f-mono);
  font-size: 0.42rem;
  line-height: 1.7;
  color: rgba(0,180,255,0.35);
  letter-spacing: 0.08em;
  overflow: hidden;
  white-space: pre;
  opacity: 0;
  transition: opacity 0.6s 0.4s ease;
}
.jv-panel--l { left: 18px; }
.jv-panel--r { right: 18px; text-align: right; }
#jarvis-splash.active .jv-panel { opacity: 1; }

/* ── Scan line ── */
.jv-scan {
  position: absolute;
  left: 0; right: 0;
  height: 1px;
  background: rgba(0,200,255,0.18);
  animation: jvScan 3.5s linear infinite;
  pointer-events: none;
  box-shadow: 0 0 12px rgba(0,200,255,0.4);
}
@keyframes jvScan {
  0%   { top: 0%; }
  100% { top: 100%; }
}

/* ── Center content ── */
.jv-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0 160px;
}

.jv-label {
  font-family: var(--f-mono);
  font-size: 0.55rem;
  letter-spacing: 0.35em;
  color: rgba(0,180,255,0.5);
  opacity: 0;
  transition: opacity 0.5s 0.3s ease;
}
#jarvis-splash.active .jv-label { opacity: 1; }

/* ── ASCII art ── */
.jv-ascii {
  font-family: 'Share Tech Mono', monospace;
  font-size: clamp(0.38rem, 0.9vw, 0.6rem);
  line-height: 1.25;
  color: #00cfff;
  text-shadow: 0 0 8px rgba(0,207,255,0.6);
  white-space: pre;
  margin: 0;
  min-height: 130px;
  text-align: center;
}

/* ── Terminal ── */
.jv-terminal {
  font-family: var(--f-mono);
  font-size: 0.62rem;
  color: rgba(0,207,255,0.75);
  line-height: 1.8;
  text-align: left;
  width: 100%;
  max-width: 540px;
  min-height: 150px;
}
.jv-terminal .line { display: block; }
.jv-terminal .cursor {
  display: inline-block;
  width: 7px;
  height: 0.8em;
  background: #00cfff;
  vertical-align: middle;
  animation: jvBlink 0.7s step-end infinite;
}
@keyframes jvBlink { 0%,100%{opacity:1;} 50%{opacity:0;} }

/* ── Reveal ── */
.jv-reveal {
  text-align: center;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.7s ease, transform 0.7s var(--ease-expo);
}
.jv-reveal.visible { opacity: 1; transform: scale(1); }

.jv-reveal__main {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0.22em;
  background: linear-gradient(135deg, #00cfff, #fff, #ffb800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 20px rgba(0,207,255,0.4));
}

.jv-reveal__sub {
  font-family: var(--f-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.4);
  margin-top: 0.4rem;
}

/* ── Status bar ── */
.jv-status {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--f-mono);
  font-size: 0.5rem;
  letter-spacing: 0.25em;
  color: rgba(0,180,255,0.5);
}
.jv-status__dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #00cfff;
  animation: jvPulse 1.2s ease-in-out infinite;
}
@keyframes jvPulse { 0%,100%{opacity:1;box-shadow:0 0 4px #00cfff;} 50%{opacity:0.3;box-shadow:none;} }

/* ── Skip ── */
.jv-skip {
  position: absolute;
  bottom: 24px;
  right: 28px;
  font-family: var(--f-mono);
  font-size: 0.48rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.2);
  animation: jvFadeSkip 2s 1s ease forwards;
  opacity: 0;
}
@keyframes jvFadeSkip { to { opacity: 1; } }

/* ============================================================
   RESPONSIVE — Tablet  ≤ 900px
   ============================================================ */
@media (max-width: 900px) {
  /* Hero */
  .hero { min-height: 80vh; }
  .hero__title-main { white-space: normal; text-align: center; }

  /* Doom clock slightly smaller */
  .doom-clock__svg { width: clamp(150px, 36vw, 200px); height: clamp(150px, 36vw, 200px); }

  /* Controls: wrap more gracefully */
  .controls { padding: 0.6rem 1rem; gap: 0.5rem; }
  .controls__search-box { flex: 0 1 220px; }
  .controls__actions { margin-left: 0; }

  /* Timeline: spine to left, all cards right */
  .tl { padding: 3rem 1rem 5rem; }
  .tl__spine { left: 24px; }
  .card { width: calc(100% - 54px); margin-left: 54px !important; margin-right: 0 !important; }
  .card:nth-child(odd), .card:nth-child(even) {
    align-self: stretch;
    transform: translateX(20px) translateY(10px);
  }
  .card.revealed { transform: translateX(0) translateY(0) !important; }
  .card:nth-child(odd):hover, .card:nth-child(even):hover { transform: translateY(-3px) translateX(2px); }
  .card::before { left: -26px !important; right: auto !important; }
  .card::after  { left: -22px !important; right: auto !important; width: 20px !important;
                  background: linear-gradient(90deg, var(--purple-g), transparent) !important; }

  /* JARVIS splash panels hide */
  .jv-panel { display: none; }
  .jv-center { padding: 0 40px; }

  /* Minigame */
  .minigame { padding: 3rem 1rem; }
}

/* ============================================================
   RESPONSIVE — Large phone  ≤ 640px
   ============================================================ */
@media (max-width: 640px) {
  /* Hero */
  .hero { min-height: 100svh; }
  .hero__content { gap: 1rem; padding: 1.2rem; }
  .hero__badge { font-size: 0.52rem; letter-spacing: 0.28em; padding: 0.3rem 0.8rem; }
  .hero__tagline { font-size: 0.82rem; max-width: 28ch; }

  /* Doom clock */
  .doom-clock__svg { width: clamp(130px, 50vw, 170px); height: clamp(130px, 50vw, 170px); }

  /* Tracker */
  .tracker { padding: 0.4rem 1rem; }
  .tracker__bar { height: 3px; }
  .tracker__stat, .tracker__pct { font-size: 0.55rem; }

  /* Stones row — smaller */
  .tracker__stones { gap: 6px; }
  .tracker__stone { width: 16px; height: 16px; }

  /* Controls — stack vertically */
  .controls { flex-direction: column; align-items: stretch; padding: 0.6rem 0.8rem; gap: 0.5rem; }
  .controls__search-box { flex: 1; }
  .controls__filters { justify-content: flex-start; gap: 4px; }
  .controls__actions { display: flex; gap: 6px; }
  .ctrl-btn { flex: 1; text-align: center; padding: 0.4rem 0.6rem; }

  /* Phase headers */
  .phase-block { margin-bottom: 3.5rem; }
  .phase-block__header { margin-bottom: 1.5rem; }
  .phase-block__icon { font-size: 1.5rem; }
  .phase-block__title { font-size: clamp(1.1rem, 5vw, 1.6rem); }

  /* Cards — full width single col */
  .tl { padding: 2rem 0.75rem 4rem; }
  .tl__spine { left: 14px; }
  .card { width: calc(100% - 36px); margin-left: 36px !important; padding: 0.85rem 1rem; gap: 0.6rem; }
  .card::before { left: -18px !important; width: 6px; height: 6px; }
  .card::after  { left: -14px !important; width: 12px !important; }

  /* Card internals */
  .card__name { font-size: 0.82rem; }
  .card__check { width: 18px; height: 18px; font-size: 0.6rem; }

  /* Terminus */
  .terminus { padding: 4rem 1.5rem; }
  .terminus__title { font-size: clamp(1.4rem, 7vw, 2.5rem); letter-spacing: 0.08em; }
  .terminus__quote { font-size: 0.8rem; }

  /* Minigame */
  .minigame { padding: 2rem 0.75rem; }
  .minigame__title { font-size: clamp(1.4rem, 6vw, 2.2rem); }
  .minigame__sub { font-size: 0.7rem; }

  /* Footer */
  .foot { padding: 2rem 1rem; font-size: 0.7rem; }

  /* JARVIS splash */
  .jv-center { padding: 0 16px; gap: 0.6rem; }
  .jv-ascii  { font-size: clamp(0.28rem, 1.8vw, 0.42rem); min-height: 80px; }
  .jv-terminal { font-size: 0.54rem; min-height: 120px; max-width: 100%; }
  .jv-reveal__main { font-size: clamp(1.4rem, 8vw, 2.5rem); letter-spacing: 0.1em; }
  .jv-reveal__sub  { font-size: 0.5rem; letter-spacing: 0.1em; }
  .jv-corner { width: 35px; height: 35px; }
  .jv-tl { top: 14px; left: 14px; } .jv-tr { top: 14px; right: 14px; }
  .jv-bl { bottom: 14px; left: 14px; } .jv-br { bottom: 14px; right: 14px; }
}

/* ============================================================
   RESPONSIVE — Small phone  ≤ 420px
   ============================================================ */
@media (max-width: 420px) {
  .hero__title-main { font-size: clamp(2.8rem, 15vw, 4rem); }

  /* Hide spine entirely */
  .tl__spine { display: none; }
  .card { width: 100% !important; margin-left: 0 !important; }
  .card::before, .card::after { display: none; }

  /* Pill filters — 2-per-row grid */
  .controls__filters { display: grid; grid-template-columns: repeat(2, 1fr); }
  .pill { text-align: center; }

  /* Doom clock — even smaller */
  .doom-clock__svg { width: 120px; height: 120px; }

  /* JARVIS ascii — minimal */
  .jv-ascii { font-size: 0.24rem; min-height: 60px; }
  .jv-label { font-size: 0.42rem; letter-spacing: 0.18em; }
  .jv-terminal { font-size: 0.48rem; }
}
