:root {
  color-scheme: dark;
  --bg: #050505;
  --text: #f4efe6;
  --muted: #8d8982;
  --gold: #e9b949;
  --red: #ff3b30;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

#app, section {
  position: fixed;
  inset: 0;
}

.hidden { display: none !important; }

.start-screen {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 45%, rgba(135, 25, 25, .12), transparent 38%),
    linear-gradient(135deg, #080808, #020202);
}

.start-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .12;
  background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(circle, black, transparent 70%);
}

.start-glow {
  position: absolute;
  width: 28rem;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 40, 40, .08);
  filter: blur(80px);
  animation: breathe 4s ease-in-out infinite;
  z-index: -1;
}

.eyebrow, .reveal-kicker {
  margin: 0 0 1.2rem;
  color: var(--gold);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .32em;
  text-transform: uppercase;
}

.start-screen h1 {
  margin: 0;
  max-width: 800px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 8vw, 7.5rem);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.055em;
}

#beginButton, .replay {
  margin-top: 3rem;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 999px;
  padding: .9rem 1.4rem;
  color: var(--text);
  background: rgba(255,255,255,.06);
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

#beginButton {
  display: flex;
  align-items: center;
  gap: 3.2rem;
  padding-left: 1.7rem;
}

#beginButton:hover, .replay:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.6);
  background: rgba(255,255,255,.12);
}

.button-arrow { color: var(--gold); font-size: 1.3rem; }

.sound-toggle, .skip {
  position: absolute;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.sound-toggle { bottom: 2rem; }
.skip { right: 2rem; bottom: 1.6rem; z-index: 20; }
.sound-toggle:hover, .skip:hover { color: var(--text); }

.intro {
  display: grid;
  place-items: center;
  isolation: isolate;
  background: #010101;
}

.noise {
  position: absolute;
  inset: -50%;
  z-index: 4;
  opacity: .055;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  animation: grain .18s steps(2) infinite;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 3;
  box-shadow: inset 0 0 13rem 4rem #000;
  pointer-events: none;
}

.letterbox { position: absolute; left: 0; width: 100%; height: 9vh; z-index: 10; background: #000; }
.letterbox.top { top: 0; }
.letterbox.bottom { bottom: 0; }

.orb {
  position: absolute;
  width: 40vw;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(110px);
  opacity: .16;
  animation: drift 7s ease-in-out infinite alternate;
}

.orb-one { left: -8vw; background: #ff1f00; }
.orb-two { right: -8vw; background: #7857ff; animation-delay: -3s; }

.intro-copy {
  position: relative;
  z-index: 6;
  padding: 2rem;
  text-align: center;
}

.chapter {
  margin: 0 0 1.4rem;
  color: var(--gold);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .36em;
  text-transform: uppercase;
}

.intro h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.8rem, 7vw, 7rem);
  font-weight: 400;
  line-height: .97;
  letter-spacing: -.045em;
}

.intro-copy.enter { animation: titleIn 1s cubic-bezier(.16, 1, .3, 1) both; }
.intro-copy.exit { animation: titleOut .65s ease-in both; }

.countdown {
  position: absolute;
  z-index: 7;
  font-family: Georgia, serif;
  font-size: clamp(10rem, 32vw, 30rem);
  color: rgba(255,255,255,.07);
  line-height: 1;
  pointer-events: none;
}

.countdown.pulse { animation: numberPulse .9s ease-out both; }

.reveal {
  display: grid;
  place-content: center;
  justify-items: center;
  padding: 2rem;
  text-align: center;
  isolation: isolate;
  background: radial-gradient(circle at 50% 45%, #39110d 0, #0b0504 38%, #010101 72%);
  animation: revealIn .75s ease both;
}

#particles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

.flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  animation: flash .6s ease-out;
}

.reveal-glow {
  position: absolute;
  width: min(70vw, 650px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 70, 30, .15);
  filter: blur(70px);
  z-index: -1;
  animation: breathe 2.5s ease-in-out infinite;
}

.finger {
  font-size: clamp(9rem, 29vw, 23rem);
  line-height: .9;
  filter: drop-shadow(0 1.2rem 2rem rgba(0,0,0,.55));
  animation: fingerIn 1s cubic-bezier(.16, 1, .3, 1) both;
  user-select: none;
}

.reveal h2 {
  margin: 1.2rem 0 .2rem;
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 4.2rem);
  font-weight: 400;
  letter-spacing: -.04em;
}

.subline { margin: .25rem 0 0; color: var(--muted); }
.replay { margin-top: 1.8rem; font-size: .82rem; }
.shake { animation: screenShake .5s linear; }

@keyframes breathe { 50% { transform: scale(1.15); opacity: .7; } }
@keyframes grain { 0% { transform: translate(0,0); } 25% { transform: translate(3%,-2%); } 50% { transform: translate(-2%,3%); } 75% { transform: translate(2%,2%); } 100% { transform: translate(-3%,-3%); } }
@keyframes drift { to { transform: translateY(12vh) scale(1.18); } }
@keyframes titleIn { from { opacity: 0; transform: translateY(35px) scale(.98); filter: blur(12px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes titleOut { to { opacity: 0; transform: scale(1.05); filter: blur(10px); } }
@keyframes numberPulse { from { opacity: 0; transform: scale(1.3); } 30% { opacity: 1; } to { opacity: 0; transform: scale(.85); } }
@keyframes revealIn { from { filter: brightness(3); } to { filter: brightness(1); } }
@keyframes flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fingerIn { from { opacity: 0; transform: scale(.25) rotate(-18deg); filter: blur(18px); } 65% { transform: scale(1.08) rotate(2deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes screenShake { 0%,100% { transform: none; } 15% { transform: translate(-10px,5px) rotate(-.4deg); } 30% { transform: translate(8px,-6px) rotate(.3deg); } 50% { transform: translate(-6px,-2px); } 70% { transform: translate(4px,4px); } }

@media (max-width: 600px) {
  .letterbox { height: 5vh; }
  .skip { right: 1rem; bottom: 1rem; }
  .start-screen h1 { font-size: clamp(3rem, 14vw, 5rem); }
}

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