/* ══════════ NEBO — THE DEBUT ══════════ */
:root {
  --bg: #0a0a0b;
  --bg-2: #121214;
  --red: #e10600;
  --gold: #d8b86a;
  --fg: #f4f4f5;
  --dim: #8b8b92;
  --line: #26262b;
  --display: 'Anton', 'Titillium Web', sans-serif;
  --body: 'Titillium Web', system-ui, sans-serif;
  --mono: 'Chivo Mono', ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* film grain over everything */
body::after {
  content: '';
  position: fixed; inset: -50%;
  pointer-events: none;
  z-index: 200;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain {
  0% { transform: translate(0,0);} 25% { transform: translate(-2%,3%);}
  50% { transform: translate(3%,-2%);} 75% { transform: translate(-3%,-3%);}
  100% { transform: translate(2%,2%);}
}

.display { font-family: var(--display); text-transform: uppercase; letter-spacing: .01em; line-height: .92; }
.mono { font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.accent { color: var(--red); }

/* ══════════ loader ══════════ */
#loader {
  position: fixed; inset: 0; z-index: 300;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2rem;
}
.start-lights { display: flex; gap: .7rem; }
.light {
  width: 2.2rem; height: 2.2rem; border-radius: 50%;
  background: #1c1c20; border: 2px solid #2c2c31;
  transition: background .12s, box-shadow .12s;
}
.light.on { background: var(--red); box-shadow: 0 0 24px 4px rgba(225,6,0,.55); }
.loader-caption { color: var(--dim); text-align: center; line-height: 1.8; }

/* ══════════ music toggle ══════════ */
#music-toggle {
  position: fixed; top: calc(.9rem + env(safe-area-inset-top)); right: .9rem; z-index: 95;
  width: 2.6rem; height: 2.6rem; border-radius: 99px;
  background: rgba(18,18,20,.72); border: 1px solid var(--line);
  color: var(--fg); font-size: 1rem; cursor: pointer;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  transition: transform .15s;
}
#music-toggle:active { transform: scale(.9); }
#music-toggle.muted { opacity: .55; }

/* before the music has ever started: attention-grabbing labeled pill */
#music-toggle.label {
  width: auto; height: auto;
  padding: .7rem 1.1rem;
  background: var(--red); border-color: var(--red);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .1em;
  color: #fff; white-space: nowrap;
  animation: music-pulse 1.6s ease-in-out infinite;
}
@keyframes music-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225,6,0,.45); }
  50% { box-shadow: 0 0 0 10px rgba(225,6,0,0); }
}

/* ══════════ gauge ══════════ */
#gauge {
  position: fixed; right: .9rem; bottom: .9rem; z-index: 90;
  width: 74px; opacity: 0; transition: opacity .4s;
  display: flex; flex-direction: column; align-items: center;
  pointer-events: none;
}
#gauge.visible { opacity: .92; }
#gauge-arc { stroke-dasharray: 126; stroke-dashoffset: 126; }
#gauge-needle { transform-origin: 50px 55px; transform: rotate(-80deg); }
#gauge-label { font-size: .6rem; color: var(--dim); margin-top: -4px; }

/* ══════════ hero ══════════ */
#hero {
  position: relative; height: 100vh; height: 100svh; min-height: 560px;
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.bg-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.hero-shade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,11,.25) 0%, rgba(10,10,11,0) 35%, rgba(10,10,11,.92) 88%);
}
.hero-content {
  position: relative; z-index: 2;
  padding: 0 1.4rem calc(3.4rem + env(safe-area-inset-bottom));
  width: 100%;
}
.kicker { color: var(--red); margin-bottom: .8rem; }
#hero h1 { font-size: clamp(5.2rem, 26vw, 12rem); }
.subtitle { font-weight: 700; letter-spacing: .18em; color: var(--dim); margin-top: .5rem; }
.pill {
  margin-top: 1.4rem;
  font-family: var(--mono); font-size: .78rem; letter-spacing: .1em;
  background: var(--red); color: #fff; border: 0; border-radius: 99px;
  padding: .85rem 1.5rem; cursor: pointer;
  transition: transform .15s;
}
.pill:active { transform: scale(.94); }
.scroll-hint {
  position: absolute; z-index: 2; bottom: .9rem; left: 50%; transform: translateX(-50%);
  color: var(--dim); animation: bob 1.6s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translate(-50%, 6px); } }

/* film overlay */
#film-overlay {
  position: fixed; inset: 0; z-index: 250; background: #000;
  display: flex; align-items: center; justify-content: center;
}
#film-overlay[hidden] { display: none; }
#film-video { width: 100%; height: 100%; object-fit: contain; }
#close-film { position: absolute; top: calc(1rem + env(safe-area-inset-top)); right: 1rem; background: rgba(255,255,255,.12); }

/* ══════════ sections ══════════ */
.section { padding: 4.6rem 1.4rem; position: relative; }
.section-tag { color: var(--red); margin-bottom: 1rem; }
.section-title { font-size: clamp(2.6rem, 11vw, 4.6rem); margin-bottom: 2rem; }

/* cards */
.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  margin-bottom: 1.6rem;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px);
}
.card-media { position: relative; aspect-ratio: 4/5; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-number {
  position: absolute; right: .6rem; bottom: .2rem;
  font-size: 6rem; color: var(--red);
  text-shadow: 0 2px 24px rgba(0,0,0,.6);
}
.card-body { padding: 1.4rem; }
.card-body h2 { font-size: 2.2rem; margin-bottom: 1.1rem; }
.specs { list-style: none; }
.specs li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: .65rem 0; border-top: 1px solid var(--line);
}
.specs span { color: var(--dim); }
.specs b { text-align: right; }
.tagline { text-align: center; color: var(--dim); margin-top: 1.4rem; }

/* ══════════ timing tower ══════════ */
#timing-tower { list-style: none; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
#timing-tower li {
  display: grid; grid-template-columns: 2.2rem 1fr auto; align-items: center; gap: .8rem;
  padding: .8rem .9rem; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  transform: translateX(-100%);
}
#timing-tower li:last-child { border-bottom: 0; }
#timing-tower .pos {
  font-family: var(--display); font-size: 1.1rem; text-align: center;
  background: var(--fg); color: var(--bg); border-radius: 5px; padding: .15rem 0;
}
#timing-tower li.purple .pos { background: #a855f7; color: #fff; }
#timing-tower .stat-label { font-size: .82rem; line-height: 1.3; }
#timing-tower .stat-value { font-family: var(--mono); font-weight: 700; color: var(--gold); font-size: .95rem; white-space: nowrap; }

/* ══════════ seasons rail ══════════ */
.rail {
  display: flex; gap: 1rem;
  overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 1rem;
  margin: 0 -1.4rem; padding-left: 1.4rem; padding-right: 1.4rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.season {
  flex: 0 0 78%; max-width: 340px; scroll-snap-align: center;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.season img {
  width: 100%; aspect-ratio: 4/5; object-fit: cover; display: block;
  filter: grayscale(.35) contrast(1.08) sepia(.14) hue-rotate(-18deg) saturate(1.35);
}
.season-body { padding: 1rem 1.1rem 1.2rem; }
.season-body .mono { color: var(--red); }
.season-body h3 { font-family: var(--display); font-size: 1.5rem; text-transform: uppercase; margin: .35rem 0 .4rem; }
.season-body p { color: var(--dim); font-size: .88rem; line-height: 1.45; }
.rail-hint { text-align: center; color: var(--dim); }

/* ══════════ P1 section ══════════ */
.gold { background: linear-gradient(180deg, var(--bg) 0%, #15120c 18%, #15120c 82%, var(--bg) 100%); }
.gold .section-tag { color: var(--gold); }
.gold .section-title { color: var(--gold); }
.p1-photo { border-radius: 14px; overflow: hidden; border: 1px solid #3a3222; }
.p1-photo img { width: 100%; display: block; filter: sepia(.25) contrast(1.05) saturate(1.1); }
.p1-intro {
  color: var(--dim); font-size: 1rem; line-height: 1.5;
  margin: -0.6rem 0 1.4rem;
}
.trophy-list { list-style: none; margin-top: 1.4rem; }
.trophy-list li {
  position: relative;
  padding: .7rem 0 .7rem 2.2rem;
  border-top: 1px solid #3a3222;
  color: var(--gold); font-weight: 600; font-size: 1.02rem;
}
.trophy-list li::before {
  content: '🏆';
  position: absolute; left: 0; top: .65rem;
}
.p1-line {
  margin-top: 2.2rem; text-align: center;
  font-size: 1.25rem; font-style: italic; color: var(--gold);
}

/* ══════════ team radio ══════════ */
#radio-feed { display: flex; flex-direction: column; gap: 1rem; }
.radio-msg {
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.1rem;
  opacity: 0; transform: translateY(18px);
}
.radio-msg .radio-head {
  display: flex; align-items: center; gap: .5rem;
  color: var(--red); margin-bottom: .5rem;
}
.radio-msg .radio-head .wave { animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
.radio-msg .radio-text { font-size: .95rem; line-height: 1.55; min-height: 1.5em; }
.radio-msg .radio-text .caret { border-right: 2px solid var(--red); animation: blink .7s steps(2) infinite; }

/* ══════════ finale ══════════ */
#finale { min-height: 92vh; min-height: 92svh; display: flex; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
#confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.finale-content { position: relative; z-index: 2; }
#finale h2 { font-size: clamp(3.4rem, 16vw, 7rem); margin: 1rem 0; }

footer { text-align: center; color: var(--dim); padding: 2.2rem 1rem calc(2.2rem + env(safe-area-inset-bottom)); }

/* reveal helper — pure CSS so it works even if JS animation ticker stalls */
.reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .8s cubic-bezier(.22,1,.36,1), transform .8s cubic-bezier(.22,1,.36,1);
  animation: reveal-auto .8s cubic-bezier(.22,1,.36,1) 7.5s forwards; /* last-resort if JS is dead */
}
body.loaded .reveal { opacity: 1; transform: none; animation: none; }
body.loaded .reveal:nth-child(2) { transition-delay: .12s; }
body.loaded .reveal:nth-child(3) { transition-delay: .24s; }
body.loaded .reveal:nth-child(4) { transition-delay: .36s; }
@keyframes reveal-auto { to { opacity: 1; transform: none; } }

#loader {
  transition: opacity .6s ease .3s;
  animation: loader-autohide .6s ease 7s forwards; /* last-resort if JS is dead */
}
#loader.done { opacity: 0; pointer-events: none; }
@keyframes loader-autohide { to { opacity: 0; visibility: hidden; } }

/* no-GSAP fallback: content that GSAP would have animated in must be visible */
body.no-anim #timing-tower li { transform: none; }
body.no-anim .radio-msg { opacity: 1; transform: none; }

/* desktop niceties */
@media (min-width: 760px) {
  .card { display: grid; grid-template-columns: 1fr 1.1fr; }
  .card-media { aspect-ratio: auto; }
  .card-alt { grid-template-columns: 1.1fr 1fr; }
  .card-alt .card-media { order: 2; }
  .section { max-width: 880px; margin: 0 auto; }
  #hero h1 { font-size: clamp(8rem, 18vw, 14rem); }
}
