:root {
  --bg: #050000;
  --bg-2: #0a0203;
  --red: #ff2a2a;
  --red-soft: #ff5a3c;
  --ember: #ffb347;
  --ink: #f5e6e6;
  --ghost: rgba(255, 42, 42, 0.55);
  --glow: 0 0 6px rgba(255, 42, 42, 0.85), 0 0 18px rgba(255, 42, 42, 0.45), 0 0 38px rgba(255, 42, 42, 0.25);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: radial-gradient(ellipse at 50% 110%, #2a0606 0%, var(--bg-2) 38%, var(--bg) 100%);
  color: var(--ink);
  font-family: var(--mono);
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  position: relative;
  isolation: isolate;
}

#emberCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.03) 0px,
    rgba(255, 255, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: overlay;
  animation: scanShift 6s linear infinite;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.7) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(255, 42, 42, 0.12), transparent 60%);
}

.terminal {
  position: relative;
  z-index: 3;
  width: min(100%, 760px);
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid rgba(255, 42, 42, 0.35);
  background: linear-gradient(180deg, rgba(20, 0, 0, 0.65), rgba(8, 0, 0, 0.85));
  box-shadow:
    0 0 0 1px rgba(255, 42, 42, 0.08) inset,
    0 30px 80px rgba(0, 0, 0, 0.8),
    0 0 60px rgba(255, 42, 42, 0.15);
  backdrop-filter: blur(2px);
  animation: terminalFlicker 7s infinite steps(60);
}

.masthead { text-align: center; }

.eyebrow {
  margin: 0;
  font-size: clamp(10px, 1.4vw, 12px);
  letter-spacing: 0.4em;
  color: var(--ghost);
  text-transform: uppercase;
}

.title {
  margin: 8px 0 4px;
  font-size: clamp(28px, 6vw, 54px);
  letter-spacing: 0.15em;
  color: var(--red);
  text-shadow: var(--glow);
  position: relative;
  animation: titleFlicker 4.2s infinite steps(40);
}

.title::before,
.title::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}
.title::before {
  color: #00f0ff;
  transform: translate(-2px, 0);
  opacity: 0.5;
  clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  animation: glitchA 3.6s infinite steps(20);
}
.title::after {
  color: #ff00aa;
  transform: translate(2px, 0);
  opacity: 0.4;
  clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  animation: glitchB 4.1s infinite steps(20);
}

.subtitle {
  margin: 0 0 22px;
  font-size: clamp(12px, 1.8vw, 14px);
  letter-spacing: 0.25em;
  color: rgba(245, 230, 230, 0.7);
  text-transform: uppercase;
}
.hot {
  color: var(--red);
  text-shadow: var(--glow);
}

.countdown {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(4px, 1.5vw, 14px);
  margin: 12px 0 14px;
  flex-wrap: nowrap;
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(56px, 16vw, 110px);
  padding: clamp(8px, 1.6vw, 14px) clamp(6px, 1.4vw, 12px);
  border: 1px solid rgba(255, 42, 42, 0.3);
  background: linear-gradient(180deg, rgba(255, 42, 42, 0.08), rgba(255, 42, 42, 0.02));
  border-radius: 4px;
  box-shadow: inset 0 0 24px rgba(255, 42, 42, 0.12);
}

.value {
  font-size: clamp(28px, 7vw, 58px);
  font-weight: 700;
  color: var(--red);
  text-shadow: var(--glow);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  line-height: 1;
}

.label {
  margin-top: 8px;
  font-size: clamp(9px, 1.2vw, 11px);
  letter-spacing: 0.3em;
  color: rgba(245, 230, 230, 0.6);
}

.sep {
  font-size: clamp(28px, 7vw, 58px);
  color: var(--red);
  text-shadow: var(--glow);
  align-self: center;
  padding-bottom: 22px;
  animation: blink 1s infinite steps(2);
}

.target {
  text-align: center;
  margin: 6px 0 28px;
  font-size: clamp(11px, 1.6vw, 13px);
  letter-spacing: 0.3em;
  color: rgba(255, 90, 60, 0.75);
}

.transmission {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.intercept {
  position: relative;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--red);
  background: linear-gradient(180deg, rgba(255, 42, 42, 0.18), rgba(80, 0, 0, 0.4));
  color: var(--red);
  font-family: var(--mono);
  font-size: clamp(13px, 2vw, 15px);
  font-weight: 700;
  letter-spacing: 0.3em;
  padding: 16px clamp(20px, 5vw, 38px);
  cursor: pointer;
  text-transform: uppercase;
  text-shadow: var(--glow);
  box-shadow:
    inset 0 0 18px rgba(255, 42, 42, 0.35),
    0 0 22px rgba(255, 42, 42, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  transition: transform 80ms ease, color 120ms ease, box-shadow 200ms ease;
}

.intercept:hover {
  color: #fff;
  box-shadow:
    inset 0 0 22px rgba(255, 42, 42, 0.55),
    0 0 30px rgba(255, 42, 42, 0.55),
    0 8px 28px rgba(0, 0, 0, 0.7);
}
.intercept:active { transform: translateY(1px) scale(0.99); }
.intercept:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.btn-glow {
  position: absolute;
  inset: -50% -10%;
  background: radial-gradient(ellipse at center, rgba(255, 90, 60, 0.5), transparent 60%);
  filter: blur(14px);
  pointer-events: none;
  opacity: 0.55;
  animation: pulse 2.8s ease-in-out infinite;
}

.btn-label { position: relative; }

.headline {
  min-height: 64px;
  width: 100%;
  max-width: 620px;
  padding: 14px 16px;
  border: 1px dashed rgba(255, 42, 42, 0.35);
  background: rgba(0, 0, 0, 0.45);
  font-size: clamp(13px, 1.9vw, 16px);
  color: var(--ember);
  text-shadow: 0 0 8px rgba(255, 120, 60, 0.55);
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.5;
  position: relative;
  overflow: hidden;
}

.headline.glitching {
  animation: headlineGlitch 420ms steps(8);
}

.headline-prefix {
  color: var(--ghost);
  letter-spacing: 0.3em;
  font-size: 0.85em;
}

.footnote {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: clamp(10px, 1.3vw, 12px);
  letter-spacing: 0.3em;
  color: rgba(245, 230, 230, 0.45);
  text-transform: uppercase;
}

.blip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 8px var(--red), 0 0 16px rgba(255, 42, 42, 0.6);
  animation: blip 1.4s ease-in-out infinite;
}

@keyframes blink {
  50% { opacity: 0.25; }
}
@keyframes pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 0.85; }
}
@keyframes blip {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.6); opacity: 0.5; }
}
@keyframes scanShift {
  0% { background-position: 0 0; }
  100% { background-position: 0 6px; }
}
@keyframes terminalFlicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.85; }
  98% { opacity: 1; }
  99% { opacity: 0.6; }
}
@keyframes titleFlicker {
  0%, 92%, 100% { opacity: 1; text-shadow: var(--glow); }
  93% { opacity: 0.7; }
  94% { opacity: 1; }
  95% { opacity: 0.55; text-shadow: 0 0 2px rgba(255, 42, 42, 0.5); }
}
@keyframes glitchA {
  0%, 90%, 100% { transform: translate(-2px, 0); }
  91% { transform: translate(-6px, 1px); }
  93% { transform: translate(-2px, -2px); }
  95% { transform: translate(-8px, 0); }
}
@keyframes glitchB {
  0%, 88%, 100% { transform: translate(2px, 0); }
  89% { transform: translate(6px, -1px); }
  91% { transform: translate(2px, 2px); }
  93% { transform: translate(8px, 0); }
}
@keyframes headlineGlitch {
  0% { transform: translate(0, 0); filter: hue-rotate(0deg); }
  20% { transform: translate(-3px, 1px); filter: hue-rotate(-20deg) brightness(1.4); }
  40% { transform: translate(2px, -2px); filter: hue-rotate(15deg) brightness(0.6); }
  60% { transform: translate(-1px, 2px); filter: brightness(1.8) contrast(1.3); }
  80% { transform: translate(2px, 0); filter: hue-rotate(-10deg); }
  100% { transform: translate(0, 0); filter: none; }
}

@media (max-width: 520px) {
  .countdown { gap: 4px; }
  .sep { padding-bottom: 18px; }
  .unit { min-width: 0; flex: 1; }
  .label { letter-spacing: 0.2em; }
  .target { letter-spacing: 0.2em; }
}

@media (prefers-reduced-motion: reduce) {
  .scanlines,
  .terminal,
  .title,
  .title::before,
  .title::after,
  .sep,
  .btn-glow,
  .blip,
  .headline.glitching {
    animation: none !important;
  }
  .intercept { transition: none; }
}
