/* ============================================
   DOOMSDAY — APOCALYPTIC DESIGN SYSTEM
   Palette: Volcanic Glass + Blood Red
   Fonts: Bebas Neue + Share Tech Mono
   ============================================ */

:root {
  --black:       #0A0A0A;
  --dark:        #111111;
  --dark-mid:    #1A1A1A;
  --mid:         #2A2A2A;
  --ash:         #3C3C3C;
  --smoke:       #666666;
  --bone:        #C8C0B0;
  --fire:        #FF2020;
  --ember:       #FF6B2B;
  --glow:        #FFB088;
  --amber:       #FFA500;
  --red-dim:     rgba(255, 32, 32, 0.15);
  --red-glow:    rgba(255, 32, 32, 0.4);
  --ember-glow:  rgba(255, 107, 43, 0.3);
  --font-display: 'Bebas Neue', sans-serif;
  --font-mono:    'Share Tech Mono', monospace;
  --font-body:    'Oswald', sans-serif;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background-color: var(--black);
  color: var(--bone);
  font-family: var(--font-mono);
  overflow-x: hidden;
  cursor: crosshair;
  min-height: 100vh;
}

/* ---- PARTICLE CANVAS ---- */
#particleCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

/* ---- SCANLINES ---- */
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0,0,0,0.18) 3px,
    rgba(0,0,0,0.18) 4px
  );
}

/* ---- VIGNETTE ---- */
.vignette {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(0,0,0,0.75) 100%
  );
}

/* ---- ALERT BANNER ---- */
.alert-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--fire);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  white-space: nowrap;
  border-bottom: 2px solid #fff;
}

.alert-icon {
  flex-shrink: 0;
  padding: 0 12px;
  font-size: 1rem;
  animation: alertPulse 0.8s ease-in-out infinite alternate;
}

.alert-text {
  display: inline-block;
  animation: marquee 22s linear infinite;
  padding-right: 80px;
}

@keyframes marquee {
  0%   { transform: translateX(100vw); }
  100% { transform: translateX(-100%); }
}

@keyframes alertPulse {
  from { opacity: 1; }
  to   { opacity: 0.3; }
}

/* ---- MAIN CONTAINER ---- */
.main-container {
  position: relative;
  z-index: 10;
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px 60px;
}

/* ---- HERO ---- */
.hero {
  text-align: center;
  padding: 80px 0 40px;
}

.glitch-wrapper {
  position: relative;
  display: inline-block;
}

.glitch-title {
  font-family: var(--font-display);
  font-size: clamp(5rem, 18vw, 14rem);
  letter-spacing: 0.04em;
  line-height: 0.9;
  color: var(--bone);
  position: relative;
  text-shadow:
    0 0 30px rgba(255,107,43,0.5),
    0 0 80px rgba(255,32,32,0.2);
  animation: glitchMain 4s infinite;
}

.glitch-title::before,
.glitch-title::after {
  content: attr(data-text);
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  font-family: var(--font-display);
  font-size: inherit;
  letter-spacing: inherit;
}

.glitch-title::before {
  color: var(--fire);
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
  animation: glitchTop 3s infinite;
  opacity: 0.8;
}

.glitch-title::after {
  color: var(--ember);
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
  animation: glitchBot 3.5s infinite;
  opacity: 0.8;
}

@keyframes glitchMain {
  0%, 90%, 100% { transform: translate(0); }
  91%  { transform: translate(-3px, 1px); }
  93%  { transform: translate(3px, -1px); }
  95%  { transform: translate(-2px, 2px); }
  97%  { transform: translate(2px, -2px); }
}

@keyframes glitchTop {
  0%, 88%, 100% { transform: translate(0); opacity: 0; }
  89% { transform: translate(-4px, 0); opacity: 0.8; }
  91% { transform: translate(4px, 0); opacity: 0.8; }
  93% { transform: translate(0); opacity: 0; }
}

@keyframes glitchBot {
  0%, 85%, 100% { transform: translate(0); opacity: 0; }
  86% { transform: translate(4px, 0); opacity: 0.8; }
  88% { transform: translate(-4px, 0); opacity: 0.8; }
  90% { transform: translate(0); opacity: 0; }
}

.hero-subtitle {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  letter-spacing: 0.5em;
  color: var(--ember);
  margin-top: 16px;
  text-transform: uppercase;
  animation: fadeInUp 1.2s ease 0.3s both;
}

.divider-line {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fire), transparent);
  margin: 32px auto 0;
  animation: fadeInUp 1.2s ease 0.5s both;
}

/* ---- COUNTDOWN ---- */
.countdown-section {
  text-align: center;
  padding: 60px 0;
  border-top: 1px solid var(--ash);
  border-bottom: 1px solid var(--ash);
  margin: 20px 0 60px;
  position: relative;
  animation: fadeInUp 1s ease 0.6s both;
}

.countdown-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(255,32,32,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.countdown-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--fire);
  margin-bottom: 32px;
  animation: textFlicker 5s infinite;
}

.countdown-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 120px;
}

.count-number {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 1;
  color: var(--bone);
  text-shadow:
    0 0 20px rgba(255,107,43,0.6),
    0 0 60px rgba(255,32,32,0.3);
  transition: color 0.1s;
  display: block;
  min-width: 2ch;
  text-align: center;
}

.count-number.tick {
  color: var(--fire);
  text-shadow: 0 0 30px var(--fire), 0 0 80px var(--fire);
}

.count-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--smoke);
  text-transform: uppercase;
}

.countdown-sep {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 6rem);
  color: var(--fire);
  line-height: 1;
  margin-bottom: 28px;
  animation: sepBlink 1s step-end infinite;
}

@keyframes sepBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.1; }
}

.countdown-target {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--smoke);
  margin-top: 28px;
}

/* ---- SECTION TITLES ---- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: 0.12em;
  color: var(--bone);
  margin-bottom: 40px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--fire);
}

/* ---- THREAT BARS ---- */
.threat-section {
  padding: 60px 0;
  animation: fadeInUp 1s ease 0.8s both;
}

.threat-bars {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.threat-item {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  align-items: center;
  gap: 16px;
}

.threat-name {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--bone);
  text-align: right;
}

.threat-bar-wrap {
  height: 8px;
  background: var(--mid);
  border-radius: 0;
  overflow: hidden;
  position: relative;
}

.threat-bar {
  height: 100%;
  width: 0%;
  background: var(--bar-color, var(--fire));
  transition: width 2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  box-shadow: 0 0 12px var(--bar-color, var(--fire));
}

.threat-bar::after {
  content: '';
  position: absolute;
  right: 0; top: 0;
  width: 4px; height: 100%;
  background: #fff;
  opacity: 0.8;
  animation: barPulse 1.5s ease-in-out infinite;
}

@keyframes barPulse {
  0%, 100% { opacity: 0.8; }
  50%       { opacity: 0.2; }
}

.threat-pct {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--fire);
  letter-spacing: 0.05em;
}

/* ---- SIGNS GRID ---- */
.signs-section {
  padding: 60px 0;
  animation: fadeInUp 1s ease 1s both;
}

.signs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2px;
}

.sign-card {
  background: var(--dark-mid);
  border: 1px solid var(--ash);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, background 0.3s;
  cursor: default;
}

.sign-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 0;
  background: var(--fire);
  transition: height 0.4s ease;
}

.sign-card:hover {
  border-color: var(--fire);
  background: rgba(255,32,32,0.05);
}

.sign-card:hover::before {
  height: 100%;
}

.sign-icon {
  font-size: 2.2rem;
  display: block;
  margin-bottom: 16px;
  filter: grayscale(0.3);
}

.sign-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.1em;
  color: var(--bone);
  margin-bottom: 12px;
}

.sign-desc {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--smoke);
  margin-bottom: 20px;
}

.sign-status {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.25em;
  padding: 4px 12px;
  border: 1px solid;
}

.sign-status.critical {
  color: var(--fire);
  border-color: var(--fire);
  background: rgba(255,32,32,0.1);
  animation: statusBlink 1.5s step-end infinite;
}

.sign-status.warning {
  color: var(--amber);
  border-color: var(--amber);
  background: rgba(255,165,0,0.1);
}

.sign-status.monitoring {
  color: var(--smoke);
  border-color: var(--smoke);
}

@keyframes statusBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.3; }
}

/* ---- SURVIVAL SECTION ---- */
.survival-section {
  padding: 60px 0;
  animation: fadeInUp 1s ease 1.1s both;
}

.survival-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.survival-item {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 24px;
  padding: 28px 0;
  border-bottom: 1px solid var(--ash);
  align-items: start;
  transition: background 0.3s;
}

.survival-item:hover {
  background: rgba(255,107,43,0.04);
  padding-left: 12px;
}

.survival-num {
  font-family: var(--font-display);
  font-size: 3rem;
  color: var(--ash);
  line-height: 1;
  transition: color 0.3s;
}

.survival-item:hover .survival-num {
  color: var(--fire);
}

.survival-content h4 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  color: var(--bone);
  margin-bottom: 8px;
}

.survival-content p {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.8;
  color: var(--smoke);
}

/* ---- FINAL SECTION ---- */
.final-section {
  padding: 80px 0 40px;
  text-align: center;
  animation: fadeInUp 1s ease 1.2s both;
}

.final-box {
  position: relative;
  display: inline-block;
  padding: 60px 48px;
  border: 1px solid var(--ash);
  max-width: 700px;
}

.final-box::before,
.final-box::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--fire);
  border-style: solid;
}

.final-box::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}

.final-box::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
}

.final-quote {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: clamp(1rem, 2.5vw, 1.3rem);
  line-height: 1.8;
  color: var(--bone);
  font-style: italic;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.final-author {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.3em;
  color: var(--smoke);
}

.pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 300px; height: 300px;
  border-radius: 50%;
  border: 1px solid var(--fire);
  opacity: 0;
  animation: pulseRing 3s ease-out infinite;
  pointer-events: none;
  z-index: -1;
}

@keyframes pulseRing {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 0.4; }
  100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

/* ---- FOOTER ---- */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--ash);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--ash);
  line-height: 2;
}

.footer-coords {
  color: var(--smoke);
  margin-top: 6px;
}

.signal-blink {
  color: var(--fire);
  animation: statusBlink 1s step-end infinite;
}

/* ---- UTILITY ANIMATIONS ---- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes textFlicker {
  0%, 95%, 100% { opacity: 1; }
  96%  { opacity: 0.4; }
  97%  { opacity: 1; }
  98%  { opacity: 0.2; }
  99%  { opacity: 1; }
}

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--fire); }

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .threat-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .threat-name { text-align: left; }
  .threat-pct  { text-align: right; }

  .survival-item {
    grid-template-columns: 50px 1fr;
    gap: 16px;
  }
  .survival-num { font-size: 2rem; }

  .final-box { padding: 40px 24px; }

  .countdown-unit { min-width: 80px; }
  .count-number   { font-size: clamp(2.5rem, 12vw, 5rem); }
  .countdown-sep  { font-size: clamp(2rem, 8vw, 4rem); }
}

@media (max-width: 480px) {
  .signs-grid { grid-template-columns: 1fr; }
  .countdown-grid { gap: 4px; }
  .countdown-unit { min-width: 60px; }
}