:root {
  --bg: #010503;
  --panel: rgba(2, 12, 7, 0.56);
  --green: #ff1a4b;
  --green-soft: #ff6688;
  --green-dim: rgba(255, 26, 75, 0.28);
  --line: rgba(255, 26, 75, 0.22);
  --text: #ffd0da;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 25%, rgba(58, 16, 27, .2), transparent 30%),
    radial-gradient(circle at 50% 75%, rgba(29, 7, 14, .28), transparent 42%),
    var(--bg);
  color: var(--text);
  font-family: "Share Tech Mono", monospace;
}

#stars, .noise, .scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
#stars { z-index: 0; }
.noise {
  z-index: 2;
  opacity: .05;
  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='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}
.scanlines {
  z-index: 3;
  opacity: .12;
  background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(255,50,90,.1) 4px);
}

.frame {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  margin: 18px;
  border: 1px solid var(--line);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
  background: linear-gradient(180deg, rgba(2,10,6,.56), rgba(1,5,3,.78));
  box-shadow: inset 0 0 80px rgba(0, 0, 0, .8), 0 0 30px rgba(255,26,75,.04);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 30px;
  padding: 44px 48px 0;
  font-size: .76rem;
  letter-spacing: .14em;
}
.status-block, .system-block { display: flex; flex-direction: column; gap: 8px; }
.system-block { text-align: right; }
.transmission-label { display: flex; align-items: center; gap: 15px; white-space: nowrap; font-size: .9rem; letter-spacing: .28em; }
.transmission-label .line { width: 46px; border-top: 1px dashed var(--green); opacity: .75; }
.dot { display: inline-block; width: 9px; height: 9px; margin-left: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }

.hero {
  position: relative;
  width: min(980px, calc(100% - 40px));
  min-height: calc(100vh - 135px);
  margin: 0 auto;
  padding: 58px 20px 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.corner { position: absolute; width: 28px; height: 28px; opacity: .8; }
.corner-tl { top: 72px; left: 0; border-top: 1px solid var(--green); border-left: 1px solid var(--green); }
.corner-tr { top: 72px; right: 0; border-top: 1px solid var(--green); border-right: 1px solid var(--green); }
.corner-bl { bottom: 92px; left: 0; border-bottom: 1px solid var(--green); border-left: 1px solid var(--green); }
.corner-br { bottom: 92px; right: 0; border-bottom: 1px solid var(--green); border-right: 1px solid var(--green); }

.alien-wrap { width: min(260px, 48vw); filter: drop-shadow(0 0 22px rgba(255,26,75,.28)); animation: signalPulse 3.8s ease-in-out infinite; }
.alien { width: 100%; height: auto; opacity: .92; }
.eyebrow { margin: 16px 0 6px; font-size: clamp(.85rem, 1.3vw, 1.2rem); letter-spacing: .3em; }
.days-value {
  position: relative;
  margin: 0;
  font-family: "Space Mono", monospace;
  font-size: clamp(5.5rem, 12vw, 10rem);
  line-height: .92;
  color: var(--green-soft);
  text-shadow: 0 0 8px rgba(255,26,75,.65), 0 0 34px rgba(255,26,75,.24);
}
.days-label { margin: 12px 0 30px; font-size: 1.05rem; letter-spacing: .35em; }

.timer { display: grid; grid-template-columns: repeat(7, auto); align-items: center; gap: clamp(16px, 3vw, 34px); }
.unit { min-width: 86px; }
.unit span { display: block; font-size: clamp(1.65rem, 3vw, 2.6rem); letter-spacing: .12em; text-shadow: 0 0 12px rgba(255,26,75,.35); }
.unit small { display: block; margin-top: 8px; font-size: .62rem; letter-spacing: .15em; opacity: .8; }
.divider { height: 62px; border-left: 1px solid var(--green-dim); }

.waveform { width: min(720px, 88vw); height: 70px; margin-top: 26px; }
.waveform svg { width: 100%; height: 100%; overflow: visible; }
.waveform path { fill: none; stroke: var(--green); stroke-width: 1.2; filter: drop-shadow(0 0 5px var(--green)); opacity: .85; }
.message { margin: 6px 0 0; line-height: 1.55; letter-spacing: .26em; font-size: .9rem; }
.scroll-indicator { margin-top: 14px; color: var(--green); text-decoration: none; font-size: 2rem; animation: float 1.8s ease-in-out infinite; }

.footer-data {
  position: absolute;
  left: 48px;
  right: 48px;
  bottom: 38px;
  display: flex;
  justify-content: space-between;
  font-size: .72rem;
  letter-spacing: .14em;
}
.footer-data div { display: flex; flex-direction: column; gap: 6px; }
.footer-data strong { font-weight: 400; }
.power { text-align: right; }

.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
}
.glitch::before { transform: translateX(2px); color: #ff9aad; }
.glitch::after { transform: translateX(-2px); color: #ff2b4d; }
.glitch.active::before { animation: glitchA .18s steps(2) 2; opacity: .7; }
.glitch.active::after { animation: glitchB .18s steps(2) 2; opacity: .55; }

@keyframes signalPulse { 0%,100% { opacity: .72; transform: scale(.995); } 50% { opacity: 1; transform: scale(1.012); } }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(7px); } }
@keyframes glitchA { 0% { clip-path: inset(10% 0 70% 0); } 50% { clip-path: inset(55% 0 15% 0); } 100% { clip-path: inset(20% 0 50% 0); } }
@keyframes glitchB { 0% { clip-path: inset(70% 0 8% 0); } 50% { clip-path: inset(15% 0 60% 0); } 100% { clip-path: inset(45% 0 30% 0); } }

@media (max-width: 800px) {
  .frame { margin: 8px; min-height: calc(100vh - 16px); }
  .topbar { grid-template-columns: 1fr 1fr; padding: 24px 22px 0; }
  .transmission-label { grid-column: 1 / -1; grid-row: 1; justify-content: center; font-size: .72rem; }
  .status-block, .system-block { font-size: .58rem; }
  .hero { min-height: calc(100vh - 110px); padding-top: 36px; }
  .timer { grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; }
  .divider { display: none; }
  .unit { min-width: 0; }
  .unit span { font-size: 1.55rem; }
  .unit small { font-size: .5rem; }
  .footer-data { left: 22px; right: 22px; bottom: 22px; }
}

@media (max-width: 480px) {
  .system-block span:first-child, .status-block span:first-child { display: none; }
  .transmission-label .line { width: 22px; }
  .eyebrow { letter-spacing: .2em; }
  .message { font-size: .72rem; }
}

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