/* ==========================================================================
   RAFAEL CORREA DELGADO · PORTAL BIOGRÁFICO Y BLOG EDITORIAL FUTURISTA
   Dominio: rafaelcorreadelgado.com | Contacto: locadelatico@rafaelcorreadelgado.com
   ========================================================================== */

:root {
  --bg-void: #050811;
  --bg-surface: rgba(11, 18, 32, 0.78);
  --bg-surface-strong: rgba(14, 22, 40, 0.94);
  --bg-elevated: rgba(20, 31, 56, 0.85);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-glow: rgba(0, 242, 254, 0.36);

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --cyan: #00f2fe;
  --gold: #f59e0b;
  --emerald: #10b981;
  --violet: #8b5cf6;
  --crimson: #ef4444;

  --shadow-card: 0 20px 50px -20px rgba(0, 0, 0, 0.75);
  --grid-line: rgba(255, 255, 255, 0.032);

  --font-display: 'Space Grotesk', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

[data-theme="light"] {
  --bg-void: #f4f7fb;
  --bg-surface: rgba(255, 255, 255, 0.92);
  --bg-surface-strong: #ffffff;
  --bg-elevated: #eef3fa;
  --border-subtle: rgba(15, 23, 42, 0.12);
  --border-glow: rgba(2, 132, 199, 0.38);

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;

  --cyan: #0284c7;
  --gold: #d97706;
  --emerald: #059669;
  --violet: #7c3aed;
  --crimson: #dc2626;

  --shadow-card: 0 18px 42px -18px rgba(15, 23, 42, 0.14);
  --grid-line: rgba(15, 23, 42, 0.045);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  font-family: var(--font-sans);
  background: var(--bg-void);
  color: var(--text-main);
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  background-color: var(--bg-void);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(0, 242, 254, 0.12), transparent 36%),
    radial-gradient(circle at 88% 18%, rgba(245, 158, 11, 0.1), transparent 34%),
    radial-gradient(circle at 50% 85%, rgba(16, 185, 129, 0.08), transparent 40%),
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: auto, auto, auto, 40px 40px, 40px 40px;
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: clip;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; max-width: 100%; }

.w-full { width: 100%; max-width: 100%; }
.h-auto { height: auto; }
.w-20 { width: 4.5rem; }
.h-14 { height: 3.25rem; }
.shrink-0 { flex-shrink: 0; }

.container-shell {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container-shell { padding: 0 1.4rem; }
}

.hero-grid > *,
.grid-2 > *,
.grid-3 > *,
.atlas-grid > *,
.blog-grid > *,
.telemetry-grid > *,
.timeline-list > * {
  min-width: 0;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.28); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--cyan); }
* { scrollbar-width: thin; scrollbar-color: rgba(148, 163, 184, 0.3) transparent; }

/* Header & Top Dispatch Bar */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 8, 17, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .site-header {
  background: rgba(244, 247, 251, 0.92);
}

.top-utility-bar {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 242, 254, 0.06);
  font-size: 0.74rem;
  padding: 0.35rem 0;
}

.top-utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 64px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex-shrink: 1;
}

.brand-text-wrap {
  min-width: 0;
  overflow: hidden;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-glow);
  box-shadow: 0 0 22px rgba(0, 242, 254, 0.2);
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.02em;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--cyan);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-links {
  display: none;
  align-items: center;
  gap: 1.05rem;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--cyan);
}

@media (min-width: 1180px) {
  .nav-links { display: flex; }
  .mobile-toggle { display: none !important; }
  .brand-title { font-size: 1.02rem; }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.44rem 0.78rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.pill-btn:hover {
  border-color: var(--border-glow);
  transform: translateY(-1px);
}

.pill-btn.primary-glow {
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: #04101f;
  border-color: transparent;
  font-weight: 800;
}

[data-theme="light"] .pill-btn.primary-glow {
  color: #ffffff;
}

.hide-sm { display: none; }
@media (min-width: 640px) {
  .hide-sm { display: inline-flex; }
}

/* Mobile Drawer Nav */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.9rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-strong);
}

.mobile-nav.is-open { display: flex; }
.mobile-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text-muted);
}
.mobile-nav a:hover { background: var(--bg-elevated); color: var(--cyan); }

/* Glass Cards & Sections */
.glass-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
}

.section-block {
  padding: 3.75rem 0;
  position: relative;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--cyan);
  background: rgba(0, 242, 254, 0.08);
  border: 1px solid rgba(0, 242, 254, 0.25);
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.section-heading {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  margin: 0 0 0.65rem;
}

.section-sub {
  color: var(--text-muted);
  max-width: 72ch;
  margin: 0 0 2rem;
  font-size: 0.98rem;
}

/* Hero Showcase */
.hero-section {
  padding: 3rem 0 2.5rem;
}

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

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1.28fr 0.92fr;
    gap: 2.25rem;
  }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 4.4vw, 3.65rem);
  font-weight: 800;
  line-height: 1.07;
  letter-spacing: -0.03em;
  margin: 0.6rem 0 1rem;
}

.gradient-accent {
  background: linear-gradient(95deg, var(--gold) 0%, var(--cyan) 52%, var(--emerald) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  color: var(--text-muted);
  font-size: 0.97rem;
}

.source-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 1.1rem 0;
}

.official-email-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.95rem 1.1rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0, 242, 254, 0.11), rgba(245, 158, 11, 0.08));
  border: 1px solid var(--border-glow);
  margin-top: 1.2rem;
}

.email-mono {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  word-break: break-all;
}

/* Portrait & Executive HUD */
.hud-card {
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.hud-top {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 0.9rem;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.hud-top > * { min-width: 0; }

.portrait-frame {
  position: relative;
  width: 100px;
  height: 124px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border-glow);
  box-shadow: 0 0 28px rgba(0, 242, 254, 0.18);
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.signature-box {
  margin-top: 0.55rem;
  padding: 0.35rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.signature-box img {
  height: 26px;
  width: auto;
}

.hud-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.95rem 0;
}

.tab-pill {
  padding: 0.38rem 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.tab-pill.is-active {
  background: var(--cyan);
  color: #031120;
  border-color: transparent;
}

[data-theme="light"] .tab-pill.is-active {
  color: #ffffff;
}

.hud-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 0.3rem;
}

.hud-item {
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  font-size: 0.83rem;
}

.hud-item-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
}

.hud-emblem {
  width: 24px;
  height: 24px;
  object-fit: contain;
  background: rgba(255,255,255,0.92);
  border-radius: 6px;
  padding: 2px;
  flex-shrink: 0;
}

/* Citation Chip */
.ref-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(0, 242, 254, 0.1);
  border: 1px solid rgba(0, 242, 254, 0.28);
  border-radius: 6px;
  padding: 0.05rem 0.34rem;
  margin: 0 0.1rem;
  vertical-align: baseline;
  transition: transform 0.14s ease, background 0.14s ease;
}

.ref-chip:hover {
  background: var(--cyan);
  color: #04111f;
  transform: translateY(-1px);
}

/* Blog Grid */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.35rem;
}

@media (min-width: 768px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 520px) {
  .brand-lockup { flex: 1 1 0%; min-width: 0; gap: 0.45rem; }
  .brand-sub { display: none; }
  .brand-title { font-size: 0.82rem; }
  .brand-mark { width: 30px; height: 30px; }
  .pill-btn { padding: 0.34rem 0.56rem; font-size: 0.7rem; }
  .header-actions { gap: 0.28rem; }
  .hud-top { grid-template-columns: 84px 1fr; gap: 0.75rem; }
  .portrait-frame { width: 84px; height: 104px; }
  .top-utility-bar { font-size: 0.66rem; }
}

@media (min-width: 1120px) {
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-grid .blog-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.05fr 1.35fr;
  }
  .blog-grid .blog-card:first-child .blog-cover {
    height: 100%;
    min-height: 260px;
  }
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
}

.blog-cover {
  position: relative;
  height: 205px;
  overflow: hidden;
  background: #0b1325;
}

.blog-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 0.35s ease;
}

.blog-card:hover .blog-cover img { transform: scale(1.04); }

.blog-badge {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(5, 8, 17, 0.82);
  color: #00f2fe;
  border: 1px solid rgba(0, 242, 254, 0.4);
  backdrop-filter: blur(8px);
}

.blog-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.7rem;
}

.blog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.blog-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
}

.blog-excerpt {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin: 0;
}

.featured-highlights {
  margin: 0.25rem 0;
  padding: 0.85rem 1rem 0.85rem 1.8rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.84rem;
  color: var(--text-main);
}

.blog-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 2D Vector Canvas & Telemetry */
.atlas-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 1024px) {
  .atlas-grid { grid-template-columns: 1.45fr 0.85fr; }
}

.vector-canvas {
  background: radial-gradient(circle at 50% 50%, rgba(0, 242, 254, 0.06), rgba(6, 10, 20, 0.55));
  border-radius: 18px;
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .vector-canvas {
  background: radial-gradient(circle at 50% 50%, rgba(2, 132, 199, 0.06), rgba(226, 232, 240, 0.45));
}

.svg-node { cursor: pointer; }
.svg-city-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  fill: var(--text-main);
}
.svg-year-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  fill: var(--cyan);
}
.svg-region-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.12em;
  fill: var(--text-dim);
}
.svg-pct-win {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  fill: var(--cyan);
}
.svg-pct-run {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  fill: var(--text-muted);
}
.svg-bar-sub, .svg-axis-label {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}
.svg-year-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--text-main);
}
.svg-gauge-label {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  fill: var(--text-dim);
}
.svg-gauge-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
}
.svg-gauge-val-muted {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  fill: var(--text-muted);
}

.pulse-ring {
  animation: svgPulse 2.4s infinite ease-out;
  transform-origin: center;
}

@keyframes svgPulse {
  0% { stroke-opacity: 0.85; r: 16; }
  100% { stroke-opacity: 0; r: 29; }
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
}

@media (min-width: 900px) {
  .telemetry-grid { grid-template-columns: repeat(3, 1fr); }
}

.telemetry-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.telemetry-body h4 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 0.98rem;
}

.telemetry-body p {
  margin: 0 0 0.55rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.telemetry-refs {
  font-size: 0.76rem;
  color: var(--text-dim);
}

/* Timeline */
.timeline-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .timeline-list { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1120px) {
  .timeline-list { grid-template-columns: repeat(3, 1fr); }
}

.timeline-card {
  padding: 1.05rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
}

.timeline-year {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold);
}

/* Tables & Works */
.data-table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th, .data-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cyan);
  background: var(--bg-elevated);
}

.data-table tr:last-child td { border-bottom: none; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 1rem;
}

.gallery-item {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
}

.gallery-item img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  object-position: center 20%;
}

.gallery-caption {
  padding: 0.75rem 0.9rem;
  font-size: 0.82rem;
}

/* Modals / Drawers */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(3, 6, 14, 0.8);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.is-open { display: flex; }

.modal-sheet {
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 24px;
  background: var(--bg-surface-strong);
  border: 1px solid var(--border-glow);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
  padding: 1.5rem;
  position: relative;
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-weight: 800;
}

.input-field {
  width: 100%;
  padding: 0.72rem 0.95rem;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
}

.input-field:focus {
  outline: none;
  border-color: var(--cyan);
}

.toast-banner {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 120;
  padding: 0.8rem 1.15rem;
  border-radius: 14px;
  background: var(--bg-surface-strong);
  border: 1px solid var(--emerald);
  color: var(--text-main);
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
  display: none;
}

.toast-banner.is-visible { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Self-contained Layout & Component Helpers */
.flex-row { display: flex; align-items: center; gap: 0.65rem; flex-wrap: wrap; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.grid-3 { display: grid; grid-template-columns: 1fr; gap: 1.1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); gap: 0.85rem; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.card-pad { padding: 1.25rem; }
.card-pad-lg { padding: 1.5rem; }
.mt-1 { margin-top: 0.35rem; }
.mt-2 { margin-top: 0.75rem; }
.mt-3 { margin-top: 1.15rem; }
.mb-2 { margin-bottom: 0.75rem; }
.mb-3 { margin-bottom: 1.2rem; }
.text-xs { font-size: 0.76rem; }
.text-sm { font-size: 0.87rem; }
.text-muted { color: var(--text-muted); }
.text-cyan { color: var(--cyan); }
.text-gold { color: var(--gold); }
.text-emerald { color: var(--emerald); }
.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }
.fw-700 { font-weight: 700; }

.stat-chip {
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.stat-chip strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--cyan);
}
.stat-chip span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stop-detail-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
}

.stop-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tenure-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.tenure-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
  margin-top: 0.3rem;
}

.tenure-fill {
  height: 100%;
  border-radius: 999px;
}

.emblem-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.85rem;
  margin-top: 1.25rem;
}

.emblem-card {
  padding: 0.9rem;
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.emblem-card img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 9px;
  padding: 4px;
  flex-shrink: 0;
}

.article-reader-hero {
  width: 100%;
  max-height: 310px;
  object-fit: cover;
  object-position: center 22%;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  margin: 0.75rem 0;
}

.article-paragraph {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

.article-paragraph h4 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  color: var(--cyan);
  font-size: 1rem;
}

.article-paragraph p {
  margin: 0;
  font-size: 0.93rem;
  color: var(--text-main);
}

.ref-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 900px) {
  .ref-list-grid { grid-template-columns: repeat(2, 1fr); }
}

.ref-item-card {
  padding: 0.75rem 0.95rem;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-strong);
  padding: 2.5rem 0;
  margin-top: 2rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

