:root {
  /* Dynamic Theme Tokens (Light Mode Defaults) */
  --bg-dark: #F8FAF8;       /* Pearl White Sage */
  --bg-main: #FFFFFF;
  --bg-card: rgba(0, 0, 0, 0.03);
  
  --primary: #2D4F2D;       /* Deep Forest Moss */
  --primary-glow: rgba(45, 79, 45, 0.2);
  --secondary: #5D6D50;     /* Olive Slate */
  --secondary-glow: rgba(93, 109, 80, 0.15);
  
  --text-main: #1A1F1A;     /* Obsidian Dark */
  --text-muted: #5A635A;
  
  --accent-gold: #B48A00;   /* Rich Brass */
  --accent-earth: #4F5D2F;
  
  /* Status Colors (Accessible Light) */
  --status-ok: #388E3C;
  --status-warn: #F57C00;
  --status-risk: #D32F2F;
  
  /* Glassmorphism 2.0 (Light) */
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-blur: 40px;
  
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 12px;
  
  --shadow-premium: 0 10px 30px rgba(45, 79, 45, 0.08);
  --shadow-tactical: 0 20px 40px rgba(0, 0, 0, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  --section-dot-grid: radial-gradient(rgba(45, 79, 45, 0.1) 1px, transparent 1px);
}

[data-theme="dark"] {
  --bg-dark: #070907;
  --bg-main: #0B0E0B;
  --bg-card: rgba(255, 255, 255, 0.02);
  
  --primary: #B5D6B2;       /* Ultra-Light Silvery Sage */
  --primary-glow: rgba(181, 214, 178, 0.4);
  --secondary: #D9E4D1;     /* Desaturated Pale Mint */
  --secondary-glow: rgba(200, 215, 186, 0.25);
  
  --text-main: #F4F7F4;
  --text-muted: #8E9C8E;
  
  --accent-gold: #FFC107;   /* Glowing Gold */
  
  --glass-bg: rgba(15, 20, 15, 0.65);
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-blur: 32px;
  
  --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.5);
  --section-dot-grid: radial-gradient(rgba(139, 168, 136, 0.15) 1px, transparent 1px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-dark);
  background-image: var(--section-dot-grid);
  background-size: 40px 40px;
  background-attachment: fixed;
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.section {
  padding: 5.5rem 0;
  position: relative;
}

.section-alt {
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.02),
    rgba(255, 255, 255, 0.05)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.control-section {
  background:
    radial-gradient(circle at top left, rgba(252, 163, 17, 0.12), transparent 36%),
    radial-gradient(circle at bottom right, rgba(64, 164, 214, 0.12), transparent 34%);
}

.eyebrow {
  color: var(--secondary);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.75rem;
  margin-bottom: 1rem;
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: rgba(0, 255, 157, 0.05);
  border-radius: 4px;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  max-width: 20ch;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--text-main), var(--primary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Glassmorphism Refined */
.glass-pane {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-premium);
  transition: all 0.4s ease;
}

.glass-pane:hover {
  border-color: var(--primary-glow);
  transform: translateY(-4px);
}

/* Quantum Mesh Background */
.quantum-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  background: var(--bg-dark);
}

.mesh-blob {
  position: absolute;
  width: 60vmax;
  height: 60vmax;
  filter: blur(100px);
  opacity: 0.15;
  border-radius: 50%;
  pointer-events: none;
}

[data-theme="dark"] .mesh-blob {
  opacity: 0.25;
}

.blob-1 {
  background: var(--primary);
  top: -10%;
  left: -10%;
  animation: drift 25s infinite alternate ease-in-out;
}

.blob-2 {
  background: var(--secondary);
  bottom: -15%;
  right: -5%;
  animation: drift 30s infinite alternate-reverse ease-in-out;
}

.blob-3 {
  background: var(--accent-gold);
  top: 40%;
  left: 30%;
  width: 40vmax;
  height: 40vmax;
  opacity: 0.08;
  animation: drift 20s infinite alternate ease-in-out 2s;
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(10%, 15%) scale(1.1) rotate(10deg); }
  100% { transform: translate(-5%, -10%) scale(0.9) rotate(-10deg); }
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-auto-rows: minmax(100px, auto);
  gap: 1.5rem;
  padding: 2rem 0;
}

.bento-cell {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Responseive Bento Spans */
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }

.row-2 { grid-row: span 2; }
.row-3 { grid-row: span 3; }
.row-4 { grid-row: span 4; }

@media (max-width: 1024px) {
  .span-8, .span-6, .span-4, .span-3 { grid-column: span 6; }
  .bento-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 768px) {
  .span-8, .span-6, .span-4, .span-3 { grid-column: span 12; }
  .bento-grid { grid-template-columns: 1fr; }
  .row-2, .row-3, .row-4 { grid-row: auto; }
}

/* Glassmorphism 3.0 */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  box-shadow: var(--shadow-tactical);
  transition: transform 0.1s ease-out, border-color 0.3s ease;
  will-change: transform;
}

.glass-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), transparent 40%, rgba(255,255,255,0.05));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

.glass-card:hover {
  border-color: var(--primary);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
  transition: all 0.3s ease;
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  padding: 0.9rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: #FFFFFF;
  text-decoration: none;
  transition: all 0.3s ease;
}

.brand-logo {
  height: 60px;
  width: auto;
  display: block;
  filter: drop-shadow(0 0 12px rgba(139, 168, 136, 0.4));
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand:hover .brand-logo {
  transform: scale(1.08) translateY(-2px);
  filter: drop-shadow(0 0 20px rgba(139, 168, 136, 0.6));
}

/* Dashboard Telemetry Footer */
.dashboard-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: rgba(10, 15, 10, 0.85);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 2rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  z-index: 1000;
  transition: all 0.3s ease;
}

.footer-sync-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sync-pulse {
  width: 8px;
  height: 8px;
  background: var(--ok);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--ok);
  animation: syncBreath 2s infinite alternate;
}

@keyframes syncBreath {
  from { opacity: 0.4; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1.1); }
}

.footer-meta {
  display: flex;
  gap: 2rem;
  font-family: 'Space Mono', monospace;
  letter-spacing: 0.05em;
}

.footer-meta span strong {
  color: var(--primary);
}

body.has-dashboard-footer {
  padding-bottom: 48px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 0 20px var(--primary-glow);
  transform: rotate(45deg);
  animation: pulse-brand 3s infinite;
}

@keyframes pulse-brand {
  0%, 100% { transform: rotate(45deg) scale(1); }
  50% { transform: rotate(45deg) scale(1.2); filter: brightness(1.2); }
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: var(--ok);
  background: rgba(128, 237, 153, 0.1);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.6rem;
  border: 1px solid rgba(128, 237, 153, 0.2);
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--ok);
  border-radius: 50%;
  animation: pulse-live 1.5s infinite;
}

@keyframes pulse-live {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  color: var(--muted);
}

.nav-links a:hover {
  color: var(--text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2.2rem;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  background: linear-gradient(135deg, var(--primary), #5D6D50);
  color: #fff;
  box-shadow: 0 8px 15px var(--primary-glow);
}

.btn:hover {
  transform: translateY(-3px);
  background: var(--secondary);
  box-shadow: 0 20px 50px var(--primary-glow);
}

.btn-small {
  padding: 0.6rem 1.2rem;
  font-size: 0.85rem;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  box-shadow: none;
  backdrop-filter: blur(var(--glass-blur));
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 2rem;
  align-items: start;
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 4rem);
  max-width: 14ch;
}

.hero-lead {
  margin: 1rem 0 1.5rem;
  color: var(--muted);
  max-width: 58ch;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.hero-metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.hero-metrics li {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 0.8rem;
  background: var(--surface);
}

.metric-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
}

.metric-label {
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.hero-panel h2 {
  font-size: 1.2rem;
}

.hero-panel > p {
  color: var(--muted);
  margin: 0.6rem 0 1.1rem;
}

.score-panel .score-label {
  font-size: 0.92rem;
}

.score-panel {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.score-label {
  margin: 0;
  color: var(--muted);
}

.score-value {
  font-size: 3rem;
  margin: 0.4rem 0 0.1rem;
  font-family: "Sora", "Trebuchet MS", sans-serif;
}

.score-state {
  margin: 0 0 0.7rem;
  font-weight: 700;
  color: var(--risk);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

select,
input[type="text"],
input[type="number"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(5, 20, 29, 0.75);
  color: var(--text);
  padding: 0.8rem 0.9rem;
  font: inherit;
  outline: none;
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="range"]:focus-visible {
  border-color: rgba(255, 209, 102, 0.75);
  box-shadow: 0 0 0 3px rgba(255, 209, 102, 0.16);
}

.control-shell {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 1.1rem;
}

.control-panel,
.command-output {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: calc(var(--radius) + 2px);
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4), inset 0 0 0 1px rgba(255,255,255,0.05);
}

.panel-head h3,
.card-heading h3 {
  font-size: 1.1rem;
}

.panel-head p,
.card-heading p {
  color: var(--muted);
  margin: 0.45rem 0 0;
}

.control-stack {
  display: grid;
  gap: 0.85rem;
  margin-top: 1rem;
}

.field-group {
  display: grid;
  gap: 0.45rem;
}

.field-group label {
  color: var(--muted);
  font-size: 0.92rem;
}

.toggle-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
}

.toggle-pill input {
  accent-color: var(--accent);
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.status-chip {
  border-radius: 16px;
  padding: 0.95rem 1rem;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.11);
}

.status-chip strong {
  display: block;
  font-size: 1.45rem;
  margin: 0.2rem 0 0.1rem;
}

.status-chip small,
.status-label {
  color: var(--muted);
}

.status-label {
  display: inline-block;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1rem;
}

.dashboard-card {
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 1rem;
  min-height: 180px;
}

.dashboard-span-2 {
  grid-column: span 2;
}

.card-heading {
  margin-bottom: 0.9rem;
}

.detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.detail-list li {
  padding: 0.8rem 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-list li[data-tone="risk"] {
  color: #ffe0e0;
  border-color: rgba(255, 107, 107, 0.26);
}

.detail-list li[data-tone="relief"] {
  color: #ddf6e4;
  border-color: rgba(128, 237, 153, 0.26);
}

.detail-list strong {
  color: var(--text);
}

.region-grid {
  display: grid;
  gap: 0.65rem;
}

.region-node {
  display: grid;
  gap: 0.18rem;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.region-node[data-state="stable"] {
  border-color: rgba(128, 237, 153, 0.28);
}

.region-node[data-state="watch-zone"] {
  border-color: rgba(255, 209, 102, 0.28);
}

.region-node[data-state="high-alert"] {
  border-color: rgba(255, 107, 107, 0.3);
}

.region-role,
.region-node small {
  color: var(--muted);
}

.region-score {
  color: var(--text);
  font-weight: 700;
}

.live-map {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.map-tile {
  padding: 0.9rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: grid;
  gap: 0.3rem;
}

.map-tile strong {
  font-size: 1.6rem;
}

.map-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.map-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--ok), var(--accent), var(--risk));
}

.map-tile[data-state="stable"] .map-bar span {
  background: linear-gradient(90deg, rgba(128, 237, 153, 0.95), rgba(128, 237, 153, 0.6));
}

.map-tile[data-state="watch-zone"] .map-bar span {
  background: linear-gradient(90deg, rgba(255, 209, 102, 0.95), rgba(252, 163, 17, 0.72));
}

.map-tile[data-state="high-alert"] .map-bar span {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.96), rgba(255, 107, 107, 0.64));
}

.range-legend {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.85rem;
}

.problem-grid,
.feature-grid {
  display: grid;
  gap: 1rem;
}

.problem-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card,
.feature-card,
.timeline-item,
.dashboard-card,
.hq-panel,
.stat-card,
.live-status-card,
.ai-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-premium);
}

.card:hover,
.feature-card:hover,
.stat-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--primary);
  background: rgba(139, 168, 136, 0.08);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.card h3,
.feature-card h3 {
  font-size: 1.03rem;
  margin-bottom: 0.45rem;
}

.card p,
.feature-card p {
  margin: 0;
  color: var(--muted);
}

.impact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.impact-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.impact-list li {
  margin-bottom: 0.6rem;
  color: var(--muted);
}

.ai-briefing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: stretch;
}

.ai-briefing-copy {
  padding: 1.4rem 0;
}

.ai-briefing-copy p:not(.eyebrow) {
  max-width: 58ch;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.ai-briefing-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 0 0 1.25rem;
}

.ai-briefing-meta span {
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  color: var(--text-muted);
  font-size: 0.82rem;
}

.ai-briefing-panel {
  padding: 1.5rem;
  min-height: 100%;
}

.ai-briefing-grid > .ai-briefing-panel {
  grid-column: span 1;
}

.ai-briefing-copy {
  grid-column: 1 / -1;
}

@media (min-width: 981px) {
  .ai-briefing-copy {
    grid-column: span 2;
  }
}

.brief-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-muted);
}

.brief-list li {
  margin-bottom: 0.7rem;
}

.impact-visual {
  min-height: 280px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  padding: 0.8rem;
}

.heat-cell {
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-weight: 700;
}

.hot {
  background: rgba(255, 107, 107, 0.4);
}

.warm {
  background: rgba(255, 209, 102, 0.35);
  color: #261f00;
}

.balanced {
  background: rgba(82, 204, 164, 0.35);
}

.surplus {
  background: rgba(104, 196, 255, 0.33);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.phase {
  margin: 0;
  color: var(--accent);
  font-size: 0.83rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.timeline-item h3 {
  margin: 0.5rem 0;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
}

.cta-section {
  padding-top: 4rem;
}

.cta-box {
  background: linear-gradient(120deg, rgba(252, 163, 17, 0.2), rgba(64, 164, 214, 0.2));
  text-align: center;
  padding: 2.2rem;
}

.cta-box h2 {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
}

.cta-box p {
  color: var(--muted);
  max-width: 66ch;
  margin: 0.9rem auto 1.4rem;
}

.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.3rem 0 2rem;
}

.footer-wrap {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 10;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--text);
  border-radius: 10px;
  transition: all 0.3s linear;
  position: relative;
  transform-origin: 1px;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--bg);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right 0.4s cubic-bezier(0.77,0.2,0.05,1.0);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.mobile-nav a {
  font-size: 1.8rem;
  font-weight: 700;
  font-family: "Sora", sans-serif;
  color: var(--muted);
  transition: color 0.3s;
}

.mobile-nav a:hover {
  color: var(--accent);
}

@media (max-width: 980px) {
  .hero-grid,
  .impact-grid,
  .ai-briefing-grid {
    grid-template-columns: 1fr;
  }

  .control-shell,
  .dashboard-grid,
  .status-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-span-2 {
    grid-column: span 1;
  }

  .problem-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-links {
    display: none;
  }

  /* Dashboard Adjustments */
  .hq-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
  .wh-layout {
    grid-template-columns: 1fr !important;
  }
  .wh-sidebar {
    display: none; /* Hide sidebar in favor of bottom nav */
  }
}

@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.8rem;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero-metrics,
  .problem-grid,
  .feature-grid,
  .timeline,
  .impact-visual,
  .live-map {
    grid-template-columns: 1fr;
  }

  .mobile-hide { display: none !important; }
  .mobile-show { display: block !important; }

  /* Body padding to account for bottom nav */
  body.has-bottom-nav {
    padding-bottom: 70px;
  }
}

/* ─────────────────────────────────────────────────────────────
   Bottom Navigation (Android Friendly)
   ───────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(10, 13, 10, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  display: none; /* Desktop hidden */
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.7rem;
  font-weight: 500;
  gap: 4px;
  transition: all 0.2s ease;
}

.bottom-nav-item svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item:active {
  background: rgba(139, 168, 136, 0.1);
  border-radius: 12px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: clamp(0.75rem, 3vh, 1.5rem);
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: rgba(10, 25, 36, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 90%;
  max-width: 440px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(255, 255, 255, 0.05);
  transform: translateY(30px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  max-height: min(92vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  text-align: center;
  margin-bottom: 2rem;
}

.modal-header h2 {
  font-size: 1.8rem;
  background: linear-gradient(120deg, #fff, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-roles {
  display: grid;
  gap: 1rem;
}

.role-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.role-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
  box-shadow: 0 0 15px rgba(255, 209, 102, 0.2);
  transform: translateY(-2px);
}

.role-btn svg {
  width: 24px;
  height: 24px;
  fill: var(--accent);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.5rem;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

@keyframes pulse-dot {
  0% { box-shadow: 0 0 10px var(--accent); }
  50% { box-shadow: 0 0 20px var(--accent), 0 0 30px var(--accent-strong); }
}

.pulse-loading {
  opacity: 0.6;
  pointer-events: none;
  animation: pulse-out 0.6s infinite alternate;
}

@keyframes pulse-out {
  0% { opacity: 0.6; filter: blur(0px); }
  100% { opacity: 0.3; filter: blur(2px); }
}

.modal-form {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.modal-form label {
  font-size: 0.9rem;
  color: var(--muted);
}

.form-input {
  width: 100%;
  padding: 0.85rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  margin-top: 0.4rem;
  box-sizing: border-box;
  font-size: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
}

/* ─────────────────────────────────────────────────────────────
   OpenStreetMap / Leaflet Container
   ───────────────────────────────────────────────────────────── */
.osm-map-container {
  height: 390px;
  border-radius: 14px;
  overflow: hidden;
  background: #0d1f2d;
}

/* Dark-themed Leaflet popups to match NSCNS glassmorphism */
.leaflet-popup-content-wrapper {
  background: rgba(10, 25, 36, 0.92) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 14px !important;
  backdrop-filter: blur(16px) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6) !important;
  color: var(--text) !important;
  font-family: "Space Grotesk", sans-serif !important;
}

.leaflet-popup-tip {
  background: rgba(10, 25, 36, 0.92) !important;
}

.leaflet-popup-close-button {
  color: var(--muted) !important;
}

.tezflow-popup {
  min-width: 180px;
  font-size: 0.9rem;
}

.tezflow-popup .popup-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.tezflow-popup .popup-sub {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.8rem;
}

.tezflow-popup .popup-row {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.tezflow-popup .popup-row:last-child {
  border-bottom: none;
}

.tezflow-popup .popup-row strong {
  color: var(--text-main);
}

.route-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  width: fit-content;
}

.route-status.ok {
  color: var(--ok);
  border-color: rgba(128, 237, 153, 0.45);
}

.route-status.warn {
  color: var(--warn);
  border-color: rgba(255, 209, 102, 0.45);
}

/* Leaflet control positioning overrides */
.leaflet-control-zoom {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(10, 25, 36, 0.85) !important;
  border-radius: 10px !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  background: transparent !important;
  color: var(--text) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 30px !important;
}

.leaflet-control-zoom a:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.leaflet-control-attribution {
  background: rgba(6, 22, 31, 0.75) !important;
  color: var(--muted) !important;
  font-size: 0.7rem !important;
}

.leaflet-control-attribution a {
  color: var(--accent) !important;
}

/* Driver truck pin + pulsing ring */
.driver-map-pin {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffd166;
  border: 3px solid #fff;
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.9);
  position: relative;
}

.driver-map-pin-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 209, 102, 0.5);
  animation: driver-pin-pulse 1.8s ease-out infinite;
}

@keyframes driver-pin-pulse {
  0%   { transform: scale(1);   opacity: 0.8; }
  70%  { transform: scale(1.8); opacity: 0; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ─────────────────────────────────────────────────────────────
   Punjab Flood Demo Button
   ───────────────────────────────────────────────────────────── */
.btn-flood {
  background: linear-gradient(120deg, #ff6b6b, #c92a2a);
  color: #fff;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  font-weight: 700;
  animation: flood-pulse 2.5s infinite;
}

.btn-flood:hover {
  background: linear-gradient(120deg, #ff8888, #e84343);
  transform: translateY(-2px);
  box-shadow: 0 0 24px rgba(255, 107, 107, 0.5);
}

@keyframes flood-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
  50%       { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
}

/* ─────────────────────────────────────────────────────────────
   Feature Panels (Crisis Prediction, Heatmap, Self-Heal)
   ───────────────────────────────────────────────────────────── */
.pred-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.pred-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.pred-row:last-child { border-bottom: none; }

.pred-row strong {
  font-weight: 700;
  color: var(--text);
}

.heatmap-panel {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.5rem 0;
}

.heatmap-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--muted);
  gap: 0.5rem;
}

.heatmap-row:last-child { border-bottom: none; }
.heatmap-row strong { font-size: 0.78rem; }

/* ─────────────────────────────────────────────────────────────
   Flood Demo Console
   ───────────────────────────────────────────────────────────── */
.demo-step-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  animation: fadeIn 0.3s ease;
}

.demo-step-item:last-child { border-bottom: none; }

.demo-step-badge {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.demo-step-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.demo-step-feature {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* Tactical Authentication Modal (Stitch Inspired) */
.tactical-modal {
  background: rgba(51, 53, 52, 0.6) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border: 1px solid rgba(67, 72, 65, 0.15) !important;
  border-radius: 8px !important;
  padding: 2.5rem !important;
  width: 90% !important;
  max-width: 440px !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5) !important;
  color: #e2e3e0;
  max-height: min(92vh, 760px) !important;
  overflow-y: auto !important;
}

.tactical-header h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #e2e3e0;
  letter-spacing: -0.02em;
  background: none;
  -webkit-text-fill-color: #e2e3e0;
}

.tactical-header p {
  color: #c3c8bf !important;
  font-size: 0.85rem !important;
  font-weight: 500;
  margin-top: 0 !important;
}

.tactical-badge {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.65rem;
  color: #b0cfad;
  border: 1px solid rgba(176, 207, 173, 0.3);
  background: rgba(176, 207, 173, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 2px;
}

.tactical-form {
  margin-top: 2.5rem !important;
}

.tactical-form .field-group label {
  font-size: 0.65rem !important;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  color: #c3c8bf;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.35rem;
  display: block;
}

.tactical-input-wrapper {
  position: relative;
}

.tactical-input {
  width: 100%;
  background: #333534 !important;
  border: none !important;
  border-radius: 0 !important;
  color: #e2e3e0 !important;
  padding: 0.75rem 1rem !important;
  font-family: 'Space Grotesk', sans-serif !important;
  font-size: 0.95rem !important;
  letter-spacing: 0.05em;
  outline: none;
}

.tactical-input::placeholder {
  color: rgba(195, 200, 191, 0.3);
}

.input-glow-line {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: #b0cfad;
  transition: width 0.3s ease;
}

.tactical-input:focus ~ .input-glow-line,
.tactical-input:active ~ .input-glow-line {
  width: 100%;
}

.tactical-btn {
  background: linear-gradient(135deg, #8ba888 0%, #b0cfad 100%) !important;
  color: #1d361e !important;
  border: none;
  padding: 1rem !important;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  border-radius: 4px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none !important;
}

.tactical-btn:hover {
  filter: brightness(1.1);
  transform: scale(0.98);
}

.key-icon {
  width: 18px;
  height: 18px;
}

.tactical-footer {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(67, 72, 65, 0.1);
}

.demo-box {
  background: #1a1c1b;
  padding: 1rem;
  border-radius: 4px;
}

.demo-title {
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.6rem;
  color: rgba(195, 200, 191, 0.6);
  text-transform: uppercase;
}

.demo-creds {
  display: flex;
  justify-content: space-between;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.7rem;
  color: rgba(195, 200, 191, 0.4);
}

.meta-tags {
  display: flex;
  justify-content: space-between;
  margin-top: 1.5rem;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.6rem;
  color: rgba(195, 200, 191, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

@media (max-width: 640px) {
  .modal-content,
  .tactical-modal {
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem !important;
    max-height: 88vh !important;
  }

  .modal-header h2,
  .tactical-header h2 {
    font-size: 1.2rem;
  }

  .tactical-form {
    margin-top: 1.3rem !important;
  }

  .tactical-footer {
    margin-top: 1.3rem;
    padding-top: 1rem;
  }

  .demo-creds,
  .meta-tags {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
  }
}

.tactical-close {
  top: 1rem !important;
  right: 1.5rem !important;
  color: #8d928a !important;
}
.tactical-close:hover {
  color: #e2e3e0 !important;
}
