/* 
TRACE COMPILER - VISUAL DESIGN SYSTEM
Appalachian Mountains + Coal Towns + Opioid Crisis

Color psychology:
- Deep earth tones (coal, mountain stone)
- Blood rust (oxidized rails, abandoned mines)
- Warning amber (pill bottles, emergency lights)
- Ash gray (what's left after extraction)
- Forest decay (what dies when treatment centers never come)

Typography:
- Sharp, institutional serif for data (courthouse documents)
- Industrial sans for impact numbers (factory signage)
- Condensed for density (like tightly packed lies)

Motion:
- Slow, heavy reveals (like uncovering bodies)
- Data that accumulates like harm
- Contradictions that SNAP into view
*/

:root {
  /* APPALACHIAN EARTH PALETTE */
  --coal-black: #0a0a0a;
  --slate-deep: #1a1d23;
  --mountain-stone: #2d3139;
  --ash-gray: #4a4d56;
  
  /* EXTRACTION RUST */
  --blood-rust: #8b3a3a;
  --iron-oxide: #a94b4b;
  --rail-rust: #c85a54;
  
  /* CRISIS AMBER */
  --pill-bottle: #d4a15f;
  --warning-amber: #f4b860;
  --emergency-yellow: #ffd666;
  
  /* DECAY GREEN */
  --forest-rot: #3d4d3d;
  --moss-decay: #5a6d5a;
  
  /* INSTITUTIONAL WHITE */
  --document-white: #f8f8f8;
  --courthouse-cream: #e8e6e0;
  
  /* DATA ALERT */
  --contradiction-red: #d93636;
  --zero-beds-red: #ff4444;
  
  /* Fonts */
  --font-data: 'IBM Plex Mono', 'Courier New', monospace;
  --font-impact: 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-serif: 'Crimson Pro', Georgia, serif;
}

/* BASE DARK THEME */
body {
  background: linear-gradient(135deg, 
    var(--coal-black) 0%, 
    var(--slate-deep) 50%,
    var(--mountain-stone) 100%
  );
  background-attachment: fixed;
  color: var(--document-white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* TEXTURE OVERLAY (coal dust, mountain fog) */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(ellipse at 20% 30%, rgba(139, 58, 58, 0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(93, 109, 90, 0.02) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* HERO SECTION - Like your UVRK gradient but darker, heavier */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 4rem 2rem;
  position: relative;
  background: 
    radial-gradient(ellipse at top, var(--blood-rust) 0%, transparent 60%),
    radial-gradient(ellipse at bottom, var(--forest-rot) 0%, transparent 60%);
}

.hero h1 {
  font-family: var(--font-impact);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 0.9;
  margin: 0 0 1rem 0;
  background: linear-gradient(135deg, 
    var(--document-white) 0%,
    var(--warning-amber) 50%,
    var(--blood-rust) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 1.2s ease-out;
}

.hero .tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  font-style: italic;
  color: var(--pill-bottle);
  margin-bottom: 3rem;
  opacity: 0.9;
  animation: fadeInUp 1.4s ease-out 0.2s backwards;
}

.hero .subtitle {
  font-family: var(--font-data);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ash-gray);
  margin-bottom: 2rem;
  animation: fadeInUp 1.6s ease-out 0.4s backwards;
}

/* BIG IMPACT NUMBERS - Like Persephone's metric cards */
.impact-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1400px;
  margin: 4rem auto;
  padding: 0 2rem;
}

.metric-card {
  background: linear-gradient(145deg, 
    rgba(42, 45, 52, 0.8) 0%, 
    rgba(26, 29, 35, 0.6) 100%
  );
  border: 1px solid rgba(169, 75, 75, 0.2);
  border-radius: 12px;
  padding: 2.5rem 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, 
    var(--blood-rust), 
    var(--contradiction-red)
  );
  opacity: 0;
  transition: opacity 0.3s;
}

.metric-card:hover {
  transform: translateY(-8px);
  border-color: rgba(169, 75, 75, 0.5);
  box-shadow: 
    0 20px 60px rgba(139, 58, 58, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-value {
  font-family: var(--font-data);
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--warning-amber);
  line-height: 1;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.metric-label {
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ash-gray);
  margin-bottom: 1rem;
}

.metric-description {
  font-size: 0.95rem;
  color: var(--courthouse-cream);
  opacity: 0.8;
  line-height: 1.5;
}

/* CONTRADICTION CARDS - These need to HIT HARD */
.contradiction-card {
  background: linear-gradient(145deg,
    rgba(139, 58, 58, 0.15) 0%,
    rgba(217, 54, 54, 0.05) 100%
  );
  border: 2px solid var(--blood-rust);
  border-radius: 16px;
  padding: 2.5rem;
  margin: 2rem 0;
  position: relative;
  animation: pulseAlert 2s ease-in-out infinite;
}

.contradiction-card::before {
  content: '⚠';
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  color: var(--contradiction-red);
  animation: pulse 1.5s ease-in-out infinite;
}

.contradiction-title {
  font-family: var(--font-impact);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--contradiction-red);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1.5rem;
}

.contradiction-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 1.5rem;
}

.claim-side {
  border-left: 3px solid var(--warning-amber);
  padding-left: 1.5rem;
}

.reality-side {
  border-left: 3px solid var(--contradiction-red);
  padding-left: 1.5rem;
}

.side-label {
  font-family: var(--font-data);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ash-gray);
  margin-bottom: 0.75rem;
}

.side-content {
  font-size: 1.1rem;
  line-height: 1.4;
  color: var(--document-white);
}

.gap-value {
  font-family: var(--font-data);
  font-size: 2rem;
  font-weight: 700;
  color: var(--zero-beds-red);
  margin-top: 1rem;
}

/* COUNTY REPORT CARDS - Like your system comparisons */
.county-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
}

.county-card {
  background: rgba(26, 29, 35, 0.7);
  border: 1px solid rgba(74, 77, 86, 0.3);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.county-card:hover {
  border-color: var(--blood-rust);
  transform: scale(1.02);
}

.county-name {
  font-family: var(--font-impact);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--document-white);
  margin-bottom: 1rem;
}

.county-stats {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(74, 77, 86, 0.2);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--ash-gray);
}

.stat-value {
  font-family: var(--font-data);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--warning-amber);
}

.stat-value.zero {
  color: var(--zero-beds-red);
  font-weight: 700;
}

/* SEASONAL PIE CHARTS - Like your Persephone system cards */
.season-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(139, 58, 58, 0.2);
  border-radius: 20px;
  font-family: var(--font-data);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.season-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blood-rust);
  animation: pulse 2s ease-in-out infinite;
}

/* BUTTONS - Forensic action buttons */
.btn-primary {
  font-family: var(--font-impact);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1.2rem 2.5rem;
  background: linear-gradient(135deg, 
    var(--blood-rust) 0%, 
    var(--contradiction-red) 100%
  );
  color: var(--document-white);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(139, 58, 58, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(139, 58, 58, 0.5);
}

.btn-secondary {
  font-family: var(--font-data);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 1rem 2rem;
  background: transparent;
  color: var(--warning-amber);
  border: 2px solid var(--warning-amber);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(244, 184, 96, 0.1);
  transform: translateY(-2px);
}

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

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulseAlert {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(217, 54, 54, 0.4);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(217, 54, 54, 0);
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .contradiction-split {
    grid-template-columns: 1fr;
  }
  
  .hero h1 {
    font-size: 3rem;
  }
  
  .county-grid {
    grid-template-columns: 1fr;
  }
}
