:root {
  --bg: #050608;
  --bg-soft: #0a0c10;
  --ink: #d9d8d1;
  --ink-dim: rgba(217, 216, 209, 0.72);
  --muted: rgba(189, 194, 182, 0.56);
  --line: rgba(206, 216, 200, 0.12);
  --green: rgba(168, 204, 157, 0.88);
  --green-soft: rgba(168, 204, 157, 0.18);
  --cyan-soft: rgba(111, 170, 199, 0.15);
  --magenta-soft: rgba(174, 88, 136, 0.12);
  --amber-soft: rgba(172, 128, 79, 0.14);
  --shadow: rgba(0, 0, 0, 0.76);
  --maxw: 1080px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "American Typewriter", "Noto Serif SC", "Songti SC", serif;
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 18%, var(--cyan-soft), transparent 18%),
    radial-gradient(circle at 82% 28%, var(--magenta-soft), transparent 16%),
    radial-gradient(circle at 50% 84%, rgba(103, 144, 120, 0.08), transparent 20%),
    linear-gradient(180deg, #040507 0%, #090b0d 32%, #050608 100%);
  letter-spacing: 0.01em;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.018) 0,
    rgba(255,255,255,0.018) 1px,
    transparent 2px,
    transparent 5px
  );
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0.12;
  z-index: 5;
}

#noise, #glyphs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

#noise { opacity: 0.11; mix-blend-mode: screen; }
#glyphs { opacity: 0.22; }

.topbar, .footer {
  position: relative;
  z-index: 20;
  width: min(calc(100% - 32px), var(--maxw));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(200, 206, 194, 0.54);
}

.topbar {
  padding: 18px 0 0;
  position: sticky;
  top: 0;
  mix-blend-mode: screen;
}

.topbar__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(160, 202, 149, 0.7);
  box-shadow: 0 0 10px rgba(160, 202, 149, 0.38);
  animation: pulse 2.2s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.42; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.08); }
}

.topic-page {
  position: relative;
  z-index: 10;
  width: min(calc(100% - 32px), var(--maxw));
  margin: 0 auto;
  padding-bottom: 10vh;
}

section {
  position: relative;
  padding: 12vh 0;
}

.hero {
  min-height: 100svh;
  display: grid;
  align-content: center;
  gap: 18px;
}

.hero__meta, .section-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(195, 201, 190, 0.55);
}

.hero__prelude {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.9rem, 1vw + 0.6rem, 1rem);
}

.hero__title {
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: clamp(2.2rem, 6vw, 5.2rem);
  line-height: 0.96;
  letter-spacing: 0.01em;
  text-shadow: 0 0 24px var(--shadow);
}

.hero__subtitle {
  margin: 0;
  width: min(34rem, 100%);
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  line-height: 1.7;
}

.hero__gate {
  position: absolute;
  right: 2%;
  top: 22%;
  width: min(24vw, 220px);
  aspect-ratio: 0.68 / 1;
  min-width: 160px;
  opacity: 0.88;
  filter: drop-shadow(0 0 26px rgba(0,0,0,0.7));
}

.hero__gate-frame {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(196, 220, 205, 0.15);
  outline: 1px solid rgba(108, 159, 175, 0.08);
  outline-offset: 8px;
  background:
    linear-gradient(180deg, rgba(7,10,12,0.65), rgba(2,3,4,0.94)),
    repeating-linear-gradient(180deg, rgba(255,255,255,0.02) 0 1px, transparent 1px 5px);
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.82),
    0 0 18px rgba(102, 164, 146, 0.14),
    0 0 60px rgba(72, 97, 131, 0.1);
}

.hero__gate-frame::before {
  content: "";
  position: absolute;
  inset: 6% 9%;
  background:
    radial-gradient(circle at 50% 28%, rgba(160, 214, 170, 0.08), transparent 24%),
    radial-gradient(circle at 50% 78%, rgba(178, 98, 140, 0.08), transparent 22%),
    linear-gradient(180deg, rgba(5,8,11,0.6), rgba(1,2,4,0.95));
  border: 1px solid rgba(187, 214, 200, 0.08);
}

.hero__gate-crack {
  position: absolute;
  top: 9%;
  bottom: 9%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(182, 227, 194, 0.18), rgba(114, 177, 168, 0.58), rgba(180, 88, 136, 0.22), transparent);
  box-shadow: 0 0 16px rgba(124, 195, 182, 0.3);
  animation: crackGlow 6s ease-in-out infinite;
}

@keyframes crackGlow {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.broadcast__quote {
  margin: 20px 0 0;
  padding: 28px 28px 24px;
  border: 1px solid rgba(205, 214, 200, 0.1);
  background:
    linear-gradient(180deg, rgba(10,12,15,0.9), rgba(6,7,9,0.96));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.02), 0 0 24px rgba(0,0,0,0.28);
}

.broadcast__quote p {
  margin: 0.2em 0;
  font-size: clamp(1.15rem, 2vw, 1.7rem);
  line-height: 1.55;
}

.facts__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.fact-card {
  padding: 18px 18px 16px;
  border: 1px solid rgba(204, 214, 202, 0.08);
  background: rgba(9, 11, 14, 0.82);
}

.fact-card--wide { grid-column: span 2; }
.fact-card__label {
  margin-bottom: 8px;
  font-size: 11px;
  color: rgba(197, 203, 193, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

.fact-card__value {
  font-size: clamp(1rem, 1.4vw, 1.2rem);
  line-height: 1.55;
}

.facts__summary {
  width: min(44rem, 100%);
  margin: 24px 0 0;
  color: var(--ink-dim);
  font-size: clamp(1rem, 1.2vw, 1.12rem);
  line-height: 1.9;
}

.analysis__body {
  width: min(50rem, 100%);
  margin-top: 18px;
  display: grid;
  gap: 20px;
}

.analysis__body p,
.door__copy p {
  margin: 0;
  font-size: clamp(1rem, 1.25vw, 1.14rem);
  line-height: 1.95;
  color: rgba(219, 217, 210, 0.88);
}

.signals {
  position: relative;
  min-height: 42svh;
  overflow: hidden;
  border-top: 1px solid rgba(208, 216, 203, 0.06);
  border-bottom: 1px solid rgba(208, 216, 203, 0.06);
}

.signal {
  position: absolute;
  font-size: clamp(0.84rem, 1vw + 0.2rem, 1.04rem);
  color: rgba(199, 205, 194, 0.46);
  letter-spacing: 0.06em;
  opacity: 0;
  animation: driftBlink var(--dur) ease-in-out infinite;
  animation-delay: var(--delay);
}

.signal--strong { color: rgba(175, 208, 161, 0.74); }
.signal--bleed { color: rgba(189, 131, 164, 0.54); }

@keyframes driftBlink {
  0%, 100% { opacity: 0; transform: translateY(10px); }
  12%, 28% { opacity: 0.76; transform: translateY(0); }
  34% { opacity: 0.18; }
  41%, 54% { opacity: 0.58; }
  60% { opacity: 0; }
}

.door {
  position: relative;
  min-height: 72svh;
  overflow: hidden;
  display: grid;
  align-content: center;
}

.door__copy {
  width: min(46rem, 100%);
  position: relative;
  z-index: 2;
}

.door__close {
  margin-top: 24px !important;
  color: var(--green) !important;
  font-size: clamp(1.15rem, 1.8vw, 1.5rem) !important;
}

.door__light {
  position: absolute;
  right: 0;
  bottom: 10%;
  width: min(16vw, 100px);
  height: min(24vw, 160px);
  border: 1px solid rgba(195, 225, 204, 0.14);
  background: linear-gradient(180deg, rgba(10,14,18,0.15), rgba(2,3,5,0.92));
  box-shadow:
    0 0 22px rgba(111, 174, 152, 0.12),
    0 0 60px rgba(62, 94, 148, 0.1),
    inset 0 0 30px rgba(0,0,0,0.88);
}

.door__light::after {
  content: "";
  position: absolute;
  top: 18%;
  bottom: 18%;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, rgba(171, 226, 183, 0.54), rgba(94, 157, 172, 0.28), transparent);
  box-shadow: 0 0 18px rgba(142, 203, 176, 0.36);
}

.footer {
  padding: 0 0 24px;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 820px) {
  .topbar, .footer, .topic-page { width: min(calc(100% - 24px), var(--maxw)); }
  .hero { min-height: auto; padding-top: 12vh; }
  .hero__gate {
    position: relative;
    right: auto;
    top: auto;
    margin-top: 28px;
    width: min(56vw, 240px);
  }
  .facts__grid { grid-template-columns: 1fr; }
  .fact-card--wide { grid-column: span 1; }
  .door__light {
    position: relative;
    margin: 36px auto 0;
    width: 72px;
    height: 112px;
    right: auto;
    bottom: auto;
  }
  .signals { min-height: 48svh; }
  .topbar, .footer {
    flex-direction: column;
    gap: 8px;
  }
}
