:root {
  --bg: #0a0a0a;
  --red: #d5001c;
  --ink: #f4f4f4;
  --mut: #8a8d92;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Archivo', sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---- Fixed 3D canvas ---- */
#scene-container {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
}
#scene-container.ready { opacity: 1; }
#scene-container canvas { display: block; }

/* subtle vignette + grain overlay */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ---- WebGL fallback ---- */
#webgl-fallback {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 2rem;
  background: radial-gradient(circle at 50% 30%, #1a1a1a, #050505);
}
#webgl-fallback h1 { font-size: 30vw; font-weight: 900; letter-spacing: -0.04em; color: var(--red); }
#webgl-fallback p { max-width: 30ch; color: var(--mut); font-size: 1.1rem; }

/* ---- Header ---- */
#header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.2rem clamp(1.2rem, 4vw, 3rem);
  transition: background 0.4s ease, backdrop-filter 0.4s ease;
}
#header.scrolled {
  background: linear-gradient(to bottom, rgba(6,6,6,0.85), transparent);
  backdrop-filter: blur(6px);
}
.wordmark {
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.35em;
  color: var(--ink);
}
#dots { display: flex; gap: 0.75rem; align-items: center; }
.dot {
  width: 9px; height: 9px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.4);
  background: transparent; cursor: pointer;
  transition: all 0.3s ease; padding: 0;
}
.dot:hover { border-color: var(--red); }
.dot.active { background: var(--red); border-color: var(--red); transform: scale(1.3); }

/* ---- Scroll hint ---- */
#scroll-hint {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 20; text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem; letter-spacing: 0.4em;
  color: var(--mut);
  transition: opacity 0.5s ease;
  pointer-events: none;
}
.chevron {
  width: 10px; height: 10px; margin: 0.6rem auto 0;
  border-right: 2px solid var(--mut);
  border-bottom: 2px solid var(--mut);
  transform: rotate(45deg);
  animation: bob 1.6s infinite ease-in-out;
}
@keyframes bob {
  0%,100% { transform: rotate(45deg) translate(0,0); opacity: 0.4; }
  50% { transform: rotate(45deg) translate(3px,3px); opacity: 1; }
}

/* ---- Sound toggle ---- */
#sound-toggle {
  position: fixed; bottom: 1.4rem; right: 1.4rem;
  z-index: 21;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem; letter-spacing: 0.2em;
  color: var(--mut);
  background: rgba(20,20,20,0.6);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 0.5rem 0.75rem; border-radius: 999px;
  cursor: pointer; backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}
#sound-toggle:hover { border-color: var(--red); color: var(--ink); }
#sound-toggle.on { color: var(--red); border-color: var(--red); }

/* ---- Overlay content ---- */
#overlay { position: relative; z-index: 10; }

.panel {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: clamp(1.5rem, 6vw, 6rem);
  pointer-events: none;
}
.content { max-width: 640px; pointer-events: auto; }
.align-left { margin-right: auto; }
.align-right { margin-left: auto; text-align: right; }
.align-center { margin: 0 auto; text-align: center; }

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem; letter-spacing: 0.45em;
  color: var(--red); margin-bottom: 1.4rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(6rem, 26vw, 20rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-shadow: 0 0 60px rgba(213,0,28,0.25);
}

.tagline {
  margin-top: 1rem;
  font-weight: 100;
  font-size: clamp(1rem, 3vw, 1.8rem);
  letter-spacing: 0.05em;
  color: var(--mut);
  transition: opacity 0.35s ease;
}

.panel h2 {
  font-size: clamp(2.6rem, 8vw, 6.5rem);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.02em;
}
.panel h2.small { font-size: clamp(2.4rem, 7vw, 5.5rem); }

.body {
  margin-top: 1.6rem;
  font-weight: 300;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.6;
  color: var(--mut);
  max-width: 44ch;
}
.align-right .body { margin-left: auto; }
.body.center { margin-left: auto; margin-right: auto; }

kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 0.1em 0.5em;
  color: var(--ink);
}

/* ---- Stats ---- */
.stats {
  display: flex; gap: clamp(1.5rem, 5vw, 3.5rem);
  margin-top: 2rem; justify-content: flex-end;
}
.stat { display: flex; flex-direction: column; align-items: flex-end; }
.num {
  font-weight: 900;
  font-size: clamp(2.5rem, 7vw, 5rem);
  line-height: 1;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.unit {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem; letter-spacing: 0.25em;
  color: var(--mut); margin-top: 0.5rem;
}

/* ---- Swatches ---- */
.swatches {
  display: flex; gap: 0.9rem; justify-content: center;
  margin-top: 2.2rem;
}
.swatch {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer; padding: 0;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active {
  border-color: #fff;
  transform: scale(1.18);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.08);
}

/* ---- Reveal animation ---- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.9s cubic-bezier(.16,.8,.28,1),
              transform 0.9s cubic-bezier(.16,.8,.28,1);
  transition-delay: var(--d, 0ms);
}
.reveal.shown { opacity: 1; transform: translateY(0); }

/* ---- Footer ---- */
#footer {
  min-height: 60vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 1rem;
  padding: 3rem;
  pointer-events: auto;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.9));
}
.foot-mark {
  font-weight: 900; font-size: 3rem;
  letter-spacing: 0.3em; color: var(--ink);
}
#footer p { color: var(--mut); font-weight: 300; max-width: 40ch; }
#footer a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; letter-spacing: 0.2em;
  color: var(--red); text-decoration: none;
  border: 1px solid var(--red);
  padding: 0.7rem 1.4rem; border-radius: 999px;
  margin-top: 0.8rem;
  transition: all 0.3s ease;
}
#footer a:hover { background: var(--red); color: #fff; }

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .align-right { text-align: left; margin-left: 0; margin-right: auto; }
  .align-right .body { margin-left: 0; margin-right: auto; }
  .stats { justify-content: flex-start; gap: 1.2rem; }
  .stat { align-items: flex-start; }
  .panel { padding: 1.5rem; }
  #dots { gap: 0.55rem; }
}
</parameter>