/* ──────────────────────────────────────────────────────────────
   RAWHALL — maintenance page (neon CRT boot)
   Layer order (back → front):
     0 #stage          black canvas, owns the vignette
     1 .doodle         red neon banana-peel sketch
     2 .wordmark       RAW(white) HALL(red) + glitch ghosts
     3 .hero-h1        secondary CRT headline
     4 .content-panel  note + sub + CTAs
     5 .tagline        UNDER MAINTENANCE label
     6 #static-canvas  TV snow during warm-up + glitches
     7 #scanlines      fixed scanline overlay
     8 #crt-line       horizontal CRT turn-on/off bar
     9 #vignette       soft black edge falloff
    10 #flash          full-screen power-on flash
   ────────────────────────────────────────────────────────────── */

:root {
  --bg:        #000;
  --white:     #ffffff;
  --red:       #c80000;
  --red-hot:   #ff2a14;
  --red-soft:  rgba(200, 0, 0, 0.55);
  --dim:       rgba(220, 215, 210, 0.78);
  --dim-2:     rgba(180, 175, 170, 0.55);

  --font-display: 'VT323', 'Courier New', monospace;

  --logo-size: clamp(54px, 11vw, 156px);
  --doodle-w:  clamp(240px, 42vw, 480px);

  /* Master timeline (ms) — change here to retime the whole intro */
  --t-flash:   240;
  --t-static:  900;
  --t-pinch:  1500;
  --t-bloom:  2100;
  --t-settle: 2700;
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  overflow: hidden;
  cursor: default;
}

body {
  font-family: var(--font-display);
  color: var(--white);
}

/* ── Stage ─────────────────────────────────────────────────── */
#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(
      ellipse at center,
      #0a0604 0%,
      #050303 45%,
      #000 100%
    );
}

.scene {
  position: relative;
  width: min(100vw, 1400px);
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 2.6vh, 36px);
  padding: clamp(16px, 3vh, 44px) clamp(16px, 4vw, 60px);
  opacity: 0;
  transform: scale(0.985);
  filter: blur(1.5px);
  transition:
    opacity 600ms ease-out,
    transform 600ms ease-out,
    filter 600ms ease-out;
  overflow-y: auto;
}
.scene.live {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}

/* ── Hero stack (wordmark + h1) ────────────────────────────── */
.hero-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(8px, 1.4vh, 22px);
  width: 100%;
}

.wordmark-area {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Doodle (neon banana-peel sketch behind wordmark) ──────── */
.doodle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateY(-2%);
  width: var(--doodle-w);
  aspect-ratio: 1.07 / 1;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  animation: neonHum 5.4s ease-in-out infinite;
  will-change: opacity, filter;
}

.doodle svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.doodle .neon-base {
  fill: none;
  stroke: var(--red-hot);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 1.5px var(--red-hot))
    drop-shadow(0 0 6px var(--red-hot))
    drop-shadow(0 0 18px var(--red))
    drop-shadow(0 0 42px var(--red-soft))
    drop-shadow(0 0 80px rgba(200, 0, 0, 0.28));
}

.doodle .neon-core-group {
  fill: none;
  stroke: #ffd9d2;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.doodle .pip {
  fill: var(--red-hot);
  filter: drop-shadow(0 0 4px var(--red-hot)) drop-shadow(0 0 10px var(--red));
}

.doodle .pip-core {
  fill: #fff2ee;
}

/* ── Wordmark ──────────────────────────────────────────────── */
.wordmark {
  position: relative;
  display: inline-flex;
  line-height: 0.85;
  letter-spacing: -0.01em;
  font-size: var(--logo-size);
  white-space: nowrap;
  user-select: none;
  z-index: 1;
}

.wordmark .layer {
  position: relative;
  display: inline-flex;
  z-index: 2;
}

.wordmark .raw {
  color: var(--white);
  text-shadow:
    0 0 4px rgba(255, 255, 255, 0.85),
    0 0 14px rgba(255, 255, 255, 0.45),
    0 0 30px rgba(255, 255, 255, 0.18);
}

.wordmark .hall {
  color: var(--red);
  text-shadow:
    0 0 3px #ffb6ad,
    0 0 8px var(--red-hot),
    0 0 22px var(--red),
    0 0 50px var(--red-soft);
}

.wordmark .ghost {
  position: absolute;
  inset: 0;
  display: inline-flex;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
  transition: opacity 60ms linear, transform 60ms linear;
  z-index: 1;
}
.wordmark .ghost.r .raw  { color: #ff2a14; text-shadow: none; }
.wordmark .ghost.r .hall { color: #ff2a14; text-shadow: none; }
.wordmark .ghost.b .raw  { color: #00b3ff; text-shadow: none; }
.wordmark .ghost.b .hall { color: #00b3ff; text-shadow: none; }

/* ── Hero H1 (THIS SECTION IS STILL BEING BUILT.) ──────────── */
.hero-h1 {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.8vw, 38px);
  line-height: 1.04;
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
  color: var(--white);
  font-weight: 400;
  text-shadow:
    0 0 4px rgba(255,255,255,0.6),
    0 0 12px rgba(255,255,255,0.3);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 700ms ease 600ms, transform 700ms ease 600ms;
}

.hero-h1 .hot {
  color: var(--red);
  text-shadow:
    0 0 4px #ffb6ad,
    0 0 10px var(--red-hot),
    0 0 22px var(--red),
    0 0 44px var(--red-soft);
}

.scene.live .hero-h1 {
  opacity: 1;
  transform: translateY(0);
}

/* ── Content panel (note + sub + actions) ──────────────────── */
.content-panel {
  width: min(560px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: clamp(12px, 1.8vh, 22px);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 700ms ease 1000ms, transform 700ms ease 1000ms;
}

.scene.live .content-panel {
  opacity: 1;
  transform: translateY(0);
}

.note {
  width: 100%;
  border-top: 1px solid var(--red);
  border-bottom: 1px solid rgba(200, 0, 0, 0.25);
  padding: 14px 18px;
  background: rgba(10, 6, 6, 0.55);
  box-shadow: 0 0 22px rgba(200, 0, 0, 0.12);
}

.note p {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.45vw, 19px);
  line-height: 1.5;
  color: var(--dim);
  letter-spacing: 0.04em;
}

.sub {
  font-family: var(--font-display);
  font-size: clamp(13px, 1.15vw, 17px);
  letter-spacing: 0.08em;
  color: var(--dim-2);
  line-height: 1.5;
}

.actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  display: inline-block;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.35vw, 19px);
  letter-spacing: 0.18em;
  padding: 10px 22px;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms, color 200ms, border-color 200ms,
              box-shadow 200ms, transform 80ms;
}

.btn-primary {
  background: var(--red);
  color: var(--white);
  border: 1px solid var(--red);
  box-shadow:
    0 0 6px rgba(255, 42, 20, 0.45),
    0 0 18px rgba(200, 0, 0, 0.35);
}
.btn-primary:visited { color: var(--white); }
.btn-primary:hover {
  background: var(--red-hot);
  border-color: var(--red-hot);
  box-shadow:
    0 0 10px rgba(255, 42, 20, 0.7),
    0 0 28px rgba(255, 42, 20, 0.5);
}
.btn-primary:active { transform: translateY(1px); }

.btn-secondary {
  background: transparent;
  color: var(--dim);
  border: 1px solid rgba(220, 215, 210, 0.32);
}
.btn-secondary:visited { color: var(--dim); }
.btn-secondary:hover {
  color: var(--white);
  border-color: var(--red);
  box-shadow:
    0 0 6px rgba(255, 42, 20, 0.45),
    0 0 18px rgba(200, 0, 0, 0.25);
}
.btn-secondary:active { transform: translateY(1px); }

/* ── Tagline (UNDER MAINTENANCE) ───────────────────────────── */
.tagline {
  font-family: var(--font-display);
  font-size: clamp(14px, 1.4vw, 22px);
  letter-spacing: 0.42em;
  color: rgba(220, 210, 200, 0.55);
  white-space: nowrap;
  margin-top: 4px;
  opacity: 0;
  transition: opacity 800ms ease 1400ms;
}
.scene.live .tagline { opacity: 1; }

/* ── Static / TV snow ──────────────────────────────────────── */
#static-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}

/* ── Scanlines (always on, subtle) ─────────────────────────── */
#scanlines {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px,
      transparent 2px,
      rgba(0, 0, 0, 0.22) 2px,
      rgba(0, 0, 0, 0.22) 3px
    );
  mix-blend-mode: multiply;
  opacity: 0.85;
}

#scanlines::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(255, 255, 255, 0.025) 50%,
    transparent 100%
  );
  background-size: 100% 220px;
  animation: scanShimmer 7s linear infinite;
}

/* ── CRT power line ────────────────────────────────────────── */
#crt-line {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  height: 2px;
  background: #fff;
  transform: translateY(-50%) scaleX(0.05);
  transform-origin: 50% 50%;
  box-shadow:
    0 0 12px 3px rgba(255, 255, 255, 0.95),
    0 0 28px 8px rgba(255, 220, 200, 0.55);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
}

/* ── Vignette ──────────────────────────────────────────────── */
#vignette {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse at center,
      transparent 55%,
      rgba(0, 0, 0, 0.55) 90%,
      #000 100%
    );
}

/* ── Power-on flash ────────────────────────────────────────── */
#flash {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ── Replay control ────────────────────────────────────────── */
#replay {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 120;
  background: rgba(0,0,0,0.55);
  color: #d8d4cf;
  border: 1px solid rgba(255,255,255,0.18);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.12em;
  padding: 8px 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 400ms ease, color 200ms, border-color 200ms;
}
#replay.show { opacity: 0.7; }
#replay:hover { opacity: 1; color: #fff; border-color: rgba(255,255,255,0.5); }

/* ── Animations ────────────────────────────────────────────── */
@keyframes neonHum {
  0%, 100% { opacity: 1; }
  6%       { opacity: 0.55; }
  7%       { opacity: 0.95; }
  44%      { opacity: 0.85; }
  46%      { opacity: 0.4;  }
  47%      { opacity: 0.92; }
  78%      { opacity: 0.78; }
  79%      { opacity: 0.45; }
  80%      { opacity: 0.95; }
}

@keyframes scanShimmer {
  0%   { background-position: 0 -220px; }
  100% { background-position: 0 100vh; }
}

@keyframes wordmarkBreath {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.05); }
}
.scene.live .wordmark .layer:not(.ghost) {
  animation: wordmarkBreath 4.2s ease-in-out infinite;
}

/* ── Reduced motion: skip warm-up, hold the final frame ────── */
@media (prefers-reduced-motion: reduce) {
  .scene,
  .hero-h1,
  .content-panel,
  .tagline {
    transition: none;
  }
  .doodle {
    animation: none;
    opacity: 1;
  }
  .scene.live .wordmark .layer:not(.ghost) {
    animation: none;
  }
}

/* ── Mobile / narrow viewports ─────────────────────────────── */
@media (max-width: 640px) {
  :root {
    --logo-size: clamp(50px, 13vw, 96px);
    --doodle-w:  clamp(220px, 56vw, 320px);
  }
  .scene {
    gap: clamp(10px, 1.8vh, 22px);
    padding: clamp(12px, 2vh, 28px) 16px;
  }
  .hero-wrap {
    gap: clamp(6px, 1vh, 14px);
  }
  .hero-h1 {
    letter-spacing: 0.12em;
  }
  .actions {
    flex-direction: column;
    width: 100%;
  }
  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
  .tagline {
    letter-spacing: 0.32em;
  }
}

/* ── Short viewports: shrink hero so content fits ──────────── */
@media (max-height: 760px) {
  :root {
    --logo-size: clamp(46px, 9vw, 116px);
    --doodle-w:  clamp(220px, 38vw, 380px);
  }
}

@media (max-height: 560px) {
  :root {
    --logo-size: clamp(40px, 7.5vw, 84px);
    --doodle-w:  clamp(180px, 32vw, 300px);
  }
  .scene { gap: clamp(8px, 1.4vh, 16px); }
}
