/* Fonts loaded via HTML <head> with preconnect for optimal performance */

:root {
  /* Canvas & Surfaces */
  --bg:             #0d0f0e;
  --surface:        #131714;
  --surface-alt:    #1a1f1c;
  --surface-hover:  #222820;
  --surface-accent: #0e2220;
  --nav-bg:         rgba(13, 15, 14, 0.92);

  /* Borders & Hairlines */
  --border:         #252c28;
  --border-hover:   #3a4540;
  --border-accent:  #168280;
  --border-gold:    #5c4a24;

  /* Typography Inks */
  --text:           #e8edea;
  --text-secondary: #8fa89a;
  --text-tertiary:  #768d80;

  /* Accent — Ganga Teal */
  --accent:         #168280;
  --accent-light:   #22a8a5;
  --accent-hover:   #1da3a0;
  --accent-dim:     #0f4f4e;

  /* Mauryan Gold, Sandstone & Terracotta */
  --mauryan-gold:   #c9a84c;
  --mauryan-gold-dim: #3d3215;
  --warm-stone:     #b28d5e;
  --warm-stone-dim: #3a2e1e;
  --terracotta:     #d06a20;

  /* Patliputra Verdigris */
  --verdigris:      #2d7a57;

  /* Semantic */
  --success:        #2d7a57;
  --error:          #8b2d2d;
  --warning:        #c9a84c;

  /* RGB Values for alpha blending */
  --bg-rgb:         13, 15, 14;
  --accent-rgb:     22, 130, 128;
  --stone-rgb:      178, 141, 94;
  --gold-rgb:       201, 168, 76;
  --terracotta-rgb: 208, 106, 32;

  /* Spacing Scale */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-24: 96px;

  /* Radius */
  --radius-outer:   8px;
  --radius-inner:   4px;
  --radius-pill:    50px;

  /* Transitions */
  --ease-enter:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-snap:      cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Enhanced Light Mode Overrides with WCAG 2.2 AAA Contrast */
[data-theme="light"] {
  --bg:             #f8faf9;
  --surface:        #ffffff;
  --surface-alt:    #f0f4f2;
  --surface-hover:  #e6ece9;
  --surface-accent: #eaf3f2;
  --nav-bg:         rgba(248, 250, 249, 0.94);
  --border:         #d4ded8;
  --border-hover:   #b0c4b8;
  --border-accent:  #0d5554;
  --border-gold:    #6b4d08;
  --text:           #141a17;
  --text-secondary: #3f5249;   /* 7.56:1 AAA */
  --text-tertiary:  #42554c;   /* 7.10:1 AAA */
  --accent:         #0d5554;   /* 7.18:1 AAA */
  --accent-light:   #0d5554;
  --accent-hover:   #09403f;
  --mauryan-gold:   #6b4d08;   /* 7.86:1 AAA */
  --warm-stone:     #6e4a20;   /* 7.42:1 AAA */
  --terracotta:     #9e4407;   /* 7.02:1 AAA */
  --verdigris:      #1b5e3f;   /* 7.20:1 AAA */

  /* Light mode RGB alphas */
  --bg-rgb:         248, 250, 249;
  --accent-rgb:     13, 85, 84;
  --stone-rgb:      110, 74, 32;
  --gold-rgb:       107, 77, 8;
  --terracotta-rgb: 158, 68, 7;
}

/* === Global Reset & Fluid Layout Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: clamp(15px, 0.9vw + 12px, 16px);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[id] {
  scroll-margin-top: 84px;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  position: relative;
  overflow-x: hidden;
  transition: background-color 200ms ease, color 200ms ease;
}

/* Micro-grain tactile overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 999;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Fluid Typography Base */
h1, h2, h3, h4, h5, h6 {
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  text-wrap: balance;
  overflow-wrap: break-word;
}

p, li, dd {
  text-wrap: pretty;
  overflow-wrap: break-word;
}

img, svg, video {
  max-width: 100%;
  height: auto;
  display: block;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

.hindi-text {
  font-family: 'Tiro Devanagari Hindi', serif;
  vertical-align: baseline;
  font-size: 0.92em;
}

.editorial-serif {
  font-family: 'Playfair Display', Georgia, serif;
}

/* === Containers & Auto-Layout Sections === */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--narrow {
  max-width: 820px;
}

.section {
  padding: var(--space-16) 0;
  border-bottom: 1px solid var(--border);
}

.section:last-of-type {
  border-bottom: none;
}

.section-header {
  margin-bottom: var(--space-8);
}

.section-title {
  font-size: clamp(1.65rem, 3.5vw + 0.5rem, 2.25rem);
  font-weight: 300;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-top: var(--space-2);
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  font-weight: 400;
  max-width: 72ch;
}

/* === Floating Glassmorphic Navbar === */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 68px;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background 200ms ease, border-color 200ms ease;
}

.nav--scrolled {
  border-bottom-color: var(--border-hover);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.nav__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.nav__logo {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.nav__brand-text {
  display: flex;
  flex-direction: column;
}

.nav__title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.1;
}

.nav__subtitle {
  font-family: 'Tiro Devanagari Hindi', serif;
  font-size: 0.75rem;
  color: var(--mauryan-gold);
  line-height: 1;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: clamp(var(--space-3), 2vw, var(--space-6));
  list-style: none;
}

.nav__link {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 6px 0;
  position: relative;
  transition: color 150ms ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-light);
  transition: width 150ms var(--ease-enter);
}

.nav__link:hover,
.nav__link[aria-current="page"] {
  color: var(--accent-light);
}

.nav__link:hover::after,
.nav__link[aria-current="page"]::after {
  width: 100%;
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Living Dateline */
.living-dateline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  text-transform: uppercase;
}

.living-dateline__epoch {
  color: var(--mauryan-gold);
  font-weight: 600;
  letter-spacing: 1px;
}

.living-dateline__divider {
  width: 1px;
  height: 12px;
  background: var(--border-accent);
}

.living-dateline__clock {
  color: var(--accent-light);
  font-weight: 500;
  letter-spacing: 1px;
  font-variant-numeric: tabular-nums;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}

/* Language Toggle Button (Hindi / English) */
.lang-toggle-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
  transition: border-color 150ms ease, background 150ms ease, color 150ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lang-toggle-btn:hover {
  border-color: var(--mauryan-gold);
  color: var(--mauryan-gold);
  background: var(--surface-hover);
}

.nav__toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  min-height: 44px;
  min-width: 44px;
  touch-action: manipulation;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 22px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  border-radius: var(--radius-inner);
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  touch-action: manipulation;
  transition: background 150ms var(--ease-enter),
              color 150ms var(--ease-enter),
              border-color 150ms var(--ease-enter),
              transform 100ms var(--ease-snap),
              box-shadow 150ms ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(22, 130, 128, 0.35);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent-light);
  transform: translateY(-2px);
  background: var(--surface-hover);
}

.btn-gold {
  background: rgba(var(--gold-rgb), 0.12);
  color: var(--mauryan-gold);
  border: 1px solid var(--mauryan-gold);
}

.btn-gold:hover {
  background: var(--mauryan-gold);
  color: #0d0f0e;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(201, 168, 76, 0.3);
}

:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

/* === Badges & Tags === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  background: transparent;
  line-height: 1.4;
}

.tag--accent {
  color: var(--accent-light);
  border-color: var(--accent-dim);
  background: rgba(var(--accent-rgb), 0.12);
}

.tag--gold {
  color: var(--mauryan-gold);
  border-color: var(--mauryan-gold-dim);
  background: rgba(var(--gold-rgb), 0.12);
}

.tag--stone {
  color: var(--warm-stone);
  border-color: var(--warm-stone-dim);
  background: rgba(var(--stone-rgb), 0.12);
}

.tag--terracotta {
  color: var(--terracotta);
  border-color: rgba(var(--terracotta-rgb), 0.35);
  background: rgba(var(--terracotta-rgb), 0.12);
}

.tag--verdigris {
  color: var(--verdigris);
  border-color: var(--verdigris);
  background: rgba(45, 122, 87, 0.15);
}

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-outer);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 200ms var(--ease-enter),
              background 200ms ease,
              transform 200ms var(--ease-enter),
              box-shadow 200ms ease;
}

.card:hover {
  border-color: var(--border-accent);
  background: var(--surface-hover);
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.card--stat {
  background: var(--surface-accent);
  border-color: var(--accent-dim);
  border-left: 4px solid var(--accent);
  padding: var(--space-4) var(--space-6);
}

.card--gold {
  border-color: var(--border-gold);
  border-left: 4px solid var(--mauryan-gold);
}

.card--terracotta {
  border-left: 4px solid var(--terracotta);
}

.card--event {
  background: var(--surface);
  border-left: 4px solid var(--warm-stone);
}

.card-title {
  font-size: 1.1875rem;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-2);
  color: var(--text);
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 72ch;
}

/* === Stat Numbers === */
.stat-number {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: clamp(1.85rem, 4.5vw, 2.75rem);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--space-1);
}

.stat-number--gold {
  color: var(--mauryan-gold);
}

.stat-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* === Fluid Auto-Layout Grids === */
.grid--hub {
  display: grid;
  grid-template-columns: 38.2fr 61.8fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-outer);
  overflow: hidden;
}

.grid--hub > * {
  background: var(--surface);
  padding: clamp(var(--space-4), 3vw, var(--space-8));
}

.grid--2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: var(--space-6);
}

.grid--3col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
}

.grid--4col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--space-4);
}

/* === Weather Dashboard Widget === */
.weather-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-outer);
  padding: var(--space-6);
  margin-top: var(--space-6);
}

.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
  gap: var(--space-2);
}

.weather-main {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.weather-temp {
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  font-weight: 300;
  line-height: 1;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.weather-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: var(--space-3);
  width: 100%;
}

.weather-pill {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 8px 12px;
  font-size: 0.8125rem;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr));
  gap: var(--space-3);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}

.forecast-card {
  text-align: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: var(--space-3);
}

/* === Festival Countdown Banner === */
.festival-banner {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.12) 0%, rgba(208, 106, 32, 0.08) 100%);
  border: 1px solid var(--mauryan-gold);
  border-radius: var(--radius-outer);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.countdown-timer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: clamp(1.125rem, 3vw, 1.5rem);
  font-weight: 600;
  color: var(--mauryan-gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

/* === Interactive Patna Metro Visualizer === */
.metro-visualizer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-outer);
  padding: var(--space-6);
  margin-top: var(--space-6);
}

.metro-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.metro-tab-btn {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
  transition: all 150ms ease;
}

.metro-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.metro-tab-btn--blue.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #ffffff;
}

.station-track {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  padding-left: 28px;
  border-left: 3px solid var(--accent);
  margin-left: 12px;
}

.station-track--blue {
  border-left-color: var(--terracotta);
}

.station-node {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  font-size: 0.875rem;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.station-node::before {
  content: '';
  position: absolute;
  left: -35px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.station-track--blue .station-node::before {
  border-color: var(--terracotta);
}

.station-node--interchange {
  border-color: var(--mauryan-gold);
  background: rgba(var(--gold-rgb), 0.1);
}

.station-node--interchange::before {
  background: var(--mauryan-gold);
  border-color: var(--mauryan-gold);
}

/* Station Pill List for Civic Directory */
.station-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.station-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  padding: 4px 8px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  color: var(--text-secondary);
  line-height: 1.3;
}

.station-pill--interchange {
  border-color: var(--mauryan-gold);
  color: var(--mauryan-gold);
  background: rgba(var(--gold-rgb), 0.08);
  font-weight: 600;
}

/* === Timeline Chronicle (StoryStream) === */
.timeline {
  position: relative;
  padding-left: 72px;
  border-left: 1px dashed var(--border-hover);
  margin-left: 16px;
}

.timeline__entry {
  position: relative;
  margin-bottom: var(--space-8);
}

.timeline__entry:last-child {
  margin-bottom: 0;
}

.timeline__dateline {
  position: absolute;
  left: -88px;
  top: 18px;
  width: 72px;
  text-align: right;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--mauryan-gold);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.timeline__dot {
  position: absolute;
  left: -77px;
  top: 24px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

/* === Emergency Speed Dial Grid === */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-4);
}

.emergency-dial {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-inner);
  text-decoration: none;
  min-height: 56px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(22, 130, 128, 0.2);
  transition: background 150ms ease, border-left-color 150ms ease, transform 150ms ease;
}

.emergency-dial:hover {
  background: var(--surface-hover);
  border-left-color: var(--accent-light);
  transform: translateY(-2px);
}

.emergency-dial:active {
  transform: scale(0.98);
  background: var(--surface-accent);
}

.emergency-dial__number {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 2rem;
  font-weight: 600;
  color: var(--accent-light);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.emergency-dial__label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* === Filter Controls & Search Box === */
.search-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-inner);
  padding: 8px 16px;
  min-height: 44px;
}

.search-box:focus-within {
  border-color: var(--accent);
}

.search-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.875rem;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.filter-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
  transition: all 150ms ease;
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--surface-accent);
  border-color: var(--accent);
  color: var(--accent-light);
}

/* === GNews Pagination Controls === */
.pagination-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-8);
  flex-wrap: wrap;
}

.page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-inner);
  cursor: pointer;
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: all 150ms ease;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-light);
  background: var(--surface-hover);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* === Native HTML5 Lightbox Dialog === */
dialog.lightbox-dialog {
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-outer);
  background: rgba(13, 15, 14, 0.95);
  color: var(--text);
  max-width: 900px;
  width: 90vw;
  padding: var(--space-6);
  margin: auto;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

dialog.lightbox-dialog::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox-close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.25rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: var(--radius-inner);
  border: 1px solid var(--border);
}

.lightbox-caption {
  margin-top: var(--space-4);
  font-size: 0.9375rem;
  color: var(--text-secondary);
  text-align: center;
}

/* === FAQ Accordion === */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-outer);
  overflow: hidden;
  transition: border-color 150ms ease;
}

.faq-item:hover {
  border-color: var(--border-accent);
}

.faq-question {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  background: transparent;
  border: none;
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.faq-icon {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1.25rem;
  color: var(--accent-light);
  transition: transform 200ms ease;
}

.faq-item.open .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  display: none;
  padding: 0 var(--space-6) var(--space-4);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.faq-item.open .faq-answer {
  display: block;
}

/* === Scroll Reveal Animation === */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease-enter),
              transform 0.5s var(--ease-enter);
}

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

/* === Footer === */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-12) 0 var(--space-8);
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.footer__inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}

.footer__col-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: var(--space-4);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer__link:hover {
  color: var(--accent-light);
}

.footer__bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.6875rem;
  color: var(--text-tertiary);
}

/* === Accessibility & Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* === Responsive Breakpoints & Ergonomic Auto-Layout === */
@media (max-width: 960px) {
  .grid--hub {
    grid-template-columns: 1fr;
    background: none;
    gap: 0;
  }
  .nav__links {
    display: none;
  }
  .nav__links.nav__links--open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 68px;
    left: 0;
    width: 100%;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-6);
    gap: var(--space-3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 99;
  }
  .nav__links.nav__links--open .nav__link {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 0;
  }
  .nav__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  /* Compact actions on tablet/mobile: hide the dateline */
  .living-dateline {
    display: none;
  }
  /* Keep theme + lang toggles small and inline */
  .nav__actions {
    gap: var(--space-2);
  }
  .theme-toggle-btn,
  .lang-toggle-btn {
    padding: 6px 10px;
    font-size: 0.625rem;
    min-width: 40px;
    min-height: 40px;
  }
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-10) 0;
  }
  .timeline {
    padding-left: 0;
    border-left: none;
    margin-left: 0;
  }
  .timeline__dateline {
    position: static;
    text-align: left;
    width: auto;
    margin-bottom: var(--space-1);
  }
  .timeline__dot {
    display: none;
  }
}

/* On very small phones, make sure nav__inner doesn't overflow */
@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-4);
  }
  .nav__inner {
    gap: var(--space-2);
  }
  .nav__brand {
    gap: var(--space-2);
  }
  .nav__title {
    font-size: 1rem;
  }
  .nav__subtitle {
    display: none;
  }
  .nav__actions {
    gap: var(--space-1);
  }
  .theme-toggle-btn,
  .lang-toggle-btn {
    padding: 5px 8px;
    font-size: 0.5625rem;
    min-width: 36px;
    min-height: 36px;
  }
  .nav__toggle {
    padding: 5px 8px;
    font-size: 0.6875rem;
    min-width: 36px;
    min-height: 36px;
  }
}

