/* style.css */
/* Fuentes autohospedadas — subset latin (generado desde Google Fonts) */
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/atkinson-hyperlegible-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/atkinson-hyperlegible-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Atkinson Hyperlegible';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/atkinson-hyperlegible-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/orbitron-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/orbitron-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Orbitron';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('assets/fonts/orbitron-900.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/space-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Space Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/space-mono-700.woff2') format('woff2');
}

:root {
  /* ── Colors ── */
  --bg-primary:   #050a14;
  --bg-secondary: #0a1628;
  --bg-card:      #0d1f35;
  --cyan:   #00d4ff;
  --green:  #00ff88;
  --orange: #f59e0b;
  --red:    #ef4444;
  --purple: #a78bfa;
  --text-primary:   #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted:     #7a8aa0;  /* AA: 5.6:1 sobre bg-primary, 4.7:1 sobre bg-card */

  /* ── Typography ── */
  --font-title: 'Orbitron', sans-serif;
  --font-mono:  'Space Mono', monospace;
  --font-body:  'Atkinson Hyperlegible', system-ui, sans-serif;

  /* ── Spacing ── */
  --sp-2: 8px;

  /* ── Layout ── */
  --nav-height:  60px;
  /* Columna de contenido de máx 1000px SIEMPRE centrada. El tope de 12%
     anterior dejaba de centrar en pantallas anchas (>~1400px): el contenedor
     seguía creciendo y el contenido quedaba cargado a la izquierda. */
  --section-pad: 72px max(5%, calc((100vw - 1000px) / 2));
  --radius:      8px;
  --transition:  0.3s cubic-bezier(0.4, 0, 0.2, 1);
  /* Ease-out con carácter para transforms (entradas y press feedback) */
  --ease-out-strong: cubic-bezier(0.23, 1, 0.32, 1);

  /* ── Z-index scale ── */
  --z-nav:     1000;
  --z-overlay: 9998;
  --z-top:     9999;
}

/* ── Light theme ── */
[data-theme="light"] {
  --bg-primary:   #f0f5fb;
  --bg-secondary: #dce8f5;
  --bg-card:      #ffffff;
  --cyan:         #0066a8;  /* AA: 4.9:1 sobre bg-secondary (0070b8 daba 4.2) */
  --green:        #007a4c;
  --orange:       #b45309;
  --red:          #b91c1c;
  --purple:       #6d28d9;
  --text-primary:   #0c1b2e;
  --text-secondary: #2d4a6a;
  --text-muted:     #4a6783;  /* AA: 4.75:1 sobre el fondo claro más tenue */
}

[data-theme="light"] body { background: var(--bg-primary); }

[data-theme="light"] #nav {
  background: rgba(240, 245, 251, 0.90);
  border-bottom-color: rgba(0, 112, 184, 0.18);
}

[data-theme="light"] #nav-links a:hover {
  background: rgba(0, 112, 184, 0.10);
}

[data-theme="light"] #nav-links a.active {
  background: rgba(0, 112, 184, 0.14);
}

[data-theme="light"] .data-card {
  border-color: rgba(0, 112, 184, 0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

[data-theme="light"] .data-card:hover {
  border-color: rgba(0, 112, 184, 0.40);
}

[data-theme="light"] #hamburger span { background: var(--text-primary); }



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

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  overflow-x: hidden;
}

button, a { touch-action: manipulation; }

/* ── Navigation ── */
#nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  display: flex;
  align-items: center;
  padding: 0 5%;
  z-index: var(--z-nav);
  gap: 16px;
}

.nav-controls {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

#nav .logo {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 3px;
  text-decoration: none;
  flex-shrink: 0;
}

#nav-links {
  display: flex;
  gap: 2px;
  list-style: none;
  flex-wrap: nowrap;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
#nav-links::-webkit-scrollbar { display: none; }

#nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  position: relative;
}

#nav-links a:hover { color: var(--text-primary); background: rgba(0,212,255,0.08); }

#nav-links a.active {
  color: var(--cyan);
  background: rgba(0,212,255,0.12);
}

#theme-toggle {
  background: transparent;
  border: 1px solid rgba(0, 212, 255, 0.25);
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-secondary);
  transition: border-color var(--transition), background var(--transition), color var(--transition),
              transform 0.16s var(--ease-out-strong);
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

#theme-toggle:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
}

#theme-toggle .icon-light { display: none; }
#theme-toggle .icon-dark  { display: block; }
[data-theme="light"] #theme-toggle .icon-light { display: block; }
[data-theme="light"] #theme-toggle .icon-dark  { display: none; }
[data-theme="light"] #theme-toggle {
  border-color: rgba(0, 112, 184, 0.30);
}
[data-theme="light"] #theme-toggle:hover {
  border-color: var(--cyan);
  background: rgba(0, 112, 184, 0.08);
}

#hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

#hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Sections base ── */
section {
  padding: var(--section-pad);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

section:first-of-type { padding-top: calc(var(--nav-height) + 20px); }

.section-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 12px;
  opacity: 0.8;
}

/* Caption de figura: mismo registro mono que .section-label pero sin
   dot ni regla — etiqueta una visualización, no abre una sección */
.figure-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Tarjeta de diagrama (pasadas ASC/DESC): celda con borde tintado por acento */
.diagram-card {
  flex: 1;
  min-width: 220px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: var(--radius);
  padding: 20px;
}
.diagram-card--orange { border-color: rgba(245, 158, 11, 0.18); }
.diagram-card--green  { border-color: rgba(0, 255, 136, 0.18); }
.diagram-card .dc-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--cyan);
  margin-bottom: 12px;
}
.diagram-card--orange .dc-label { color: var(--orange); }
.diagram-card--green .dc-label  { color: var(--green); }

/* Etiqueta de slider (simulador de backscatter) */
.slider-label {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 1px;
  display: block;
  margin-bottom: 8px;
}

h2.section-title {
  font-family: var(--font-title);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 20px;
}

/* ── Animate on scroll ── */
/* Progressive enhancement: sin JS el contenido queda visible (no opacity:0) */
.aos {
  /* Entrada: ease-out (arranca rápido = se siente responsivo) */
  transition: opacity 0.6s ease, transform 0.6s var(--ease-out-strong);
}
.js .aos {
  opacity: 0;
  transform: translateY(24px);
}
.js .aos.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Cards grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.data-card {
  background: var(--bg-card);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition), transform var(--transition);
}

.data-card:hover {
  border-color: rgba(0,212,255,0.35);
  transform: translateY(-2px);
}

.data-card .card-icon { color: var(--cyan); margin-bottom: 10px; }
.data-card .card-icon svg { display: block; }
.data-card .card-label { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.data-card .card-value { font-family: var(--font-mono); font-size: 18px; color: var(--cyan); font-weight: 700; }
.data-card .card-desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* ── Content blocks ── */
.content-body {
  max-width: 780px;
  margin-bottom: 40px;
}

.content-body p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.content-body p:last-child { margin-bottom: 0; }

.content-body strong { color: var(--text-primary); font-weight: 600; }

.fact-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 28px 0;
}

.fact-item {
  background: var(--bg-card);
  border: 1px solid rgba(0,212,255,0.12);
  border-radius: var(--radius);
  padding: 16px 20px;
  flex: 1;
  min-width: 140px;
}

.fact-item .fi-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--cyan);
  line-height: 1.1;
  margin-bottom: 4px;
}

.fact-item .fi-label {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Símbolos científicos dentro de etiquetas uppercase: γ⁰ no debe volverse Γ⁰
   (la mayúscula cambia el significado del símbolo) */
.sym { text-transform: none; }

.fact-item.accent-green .fi-value  { color: var(--green); }
.fact-item.accent-green            { border-color: rgba(0,255,136,0.15); }
.fact-item.accent-orange .fi-value { color: var(--orange); }
.fact-item.accent-orange           { border-color: rgba(245,158,11,0.15); }
.fact-item.accent-red .fi-value    { color: var(--red); }
.fact-item.accent-red              { border-color: rgba(239,68,68,0.15); }
.fact-item.accent-purple .fi-value { color: var(--purple); }
.fact-item.accent-purple           { border-color: rgba(167,139,250,0.15); }

.callout {
  border: 1px solid rgba(0,212,255,0.30);
  background: rgba(0,212,255,0.05);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 780px;
}

.callout.green  { border-color: rgba(0,255,136,0.32);  background: rgba(0,255,136,0.04); }
.callout.orange { border-color: rgba(245,158,11,0.34); background: rgba(245,158,11,0.04); }
.callout.red    { border-color: rgba(239,68,68,0.36);  background: rgba(239,68,68,0.04); }
.callout.purple { border-color: rgba(167,139,250,0.36); background: rgba(167,139,250,0.04); }

.callout strong { color: var(--text-primary); }

.section-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
  max-width: 1100px;
  margin-bottom: 32px;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-list li {
  display: flex;
  gap: 12px;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-list li::before {
  content: '▸';
  color: var(--cyan);
  flex-shrink: 0;
  font-size: 12px;
  margin-top: 3px;
}

.info-list.green li::before  { color: var(--green); }
.info-list.orange li::before { color: var(--orange); }
.info-list.red li::before    { color: var(--red); }

.source-note {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  margin-top: 8px;
}

/* Evita overflow de canvases en cualquier pantalla */
canvas { max-width: 100%; }

/* ── Orbit canvas ── */
#orbit-canvas { width: 100%; max-width: 100%; height: auto !important; }

/* ── Layout de dos columnas que colapsa en móvil ── */
.grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
#backscatter-layout { gap: 40px; max-width: 800px; }
@media (max-width: 860px) {
  .grid-2col { grid-template-columns: 1fr; }
}

/* ── Controles del simulador de backscatter ── */
.bs-slider-group { margin-bottom: 24px; }
.preset-btn {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 4px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.16s var(--ease-out-strong);
}
.preset-btn[data-preset="water"]   { color: var(--cyan); }
.preset-btn[data-preset="wetsoil"] { color: var(--green); }
.preset-btn[data-preset="forest"]  { color: var(--orange); }
.preset-btn[data-preset="urban"]   { color: var(--purple); }

/* ── Orbit canvas controls ── */
.orbit-btn {
  padding: 8px 14px;
  background: rgba(4,12,26,0.72);
  border: 1px solid rgba(0,212,255,0.35);
  color: var(--cyan);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s, border-color 0.2s, transform 0.16s var(--ease-out-strong);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  white-space: nowrap;
  touch-action: manipulation;
}
.orbit-btn--mexico {
  border-color: rgba(200,144,10,0.55);
  color: #c8900a;
}
[data-theme="light"] .orbit-btn--mexico { color: #a06000; border-color: rgba(160,96,0,0.45); }
.orbit-btn:hover { background: rgba(0,212,255,0.16); border-color: var(--cyan); }
.orbit-btn.active { background: rgba(0,212,255,0.20); border-color: var(--cyan); }

[data-theme="light"] .orbit-btn {
  background: rgba(240,248,255,0.90);
  border-color: rgba(0,85,160,0.35);
  color: var(--cyan);
}
[data-theme="light"] .orbit-btn:hover { background: rgba(0,85,160,0.12); }

/* ── HUD del globo 3D (overlay HTML) ── */
.globe-hud {
  position: absolute;
  top: 12px; right: 12px;
  min-width: 196px;
  padding: 10px 12px;
  background: rgba(1, 5, 14, 0.86);
  border: 1px solid rgba(0, 184, 217, 0.25);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.8;
  color: var(--text-secondary);
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.globe-hud .hud-title { color: var(--cyan); font-weight: bold; letter-spacing: 1px; }
.globe-hud .hud-dir   { color: var(--cyan); font-weight: bold; }
[data-theme="light"] .globe-hud {
  background: rgba(234, 246, 255, 0.92);
  border-color: rgba(0, 85, 160, 0.25);
}

/* ── Botones ámbar generados por JS (pasos SAR y pestañas de modo) ── */
.amber-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--text-secondary);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  /* Propiedades explícitas: `transition: 0.2s` animaba `all` */
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease,
              transform 0.16s var(--ease-out-strong);
}
.amber-btn--lg {
  padding: 8px 16px;
  font-size: 12px;
  border-color: rgba(245, 158, 11, 0.25);
}
.amber-btn.active {
  border-color: #f59e0b;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

/* ── Botones de filtro (pasadas y similares) ── */
.tag-btn {
  padding: 6px 14px;
  background: transparent;
  border: 1px solid;
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-mono);
  cursor: pointer;
  letter-spacing: 1px;
  transition: opacity 0.2s, border-color 0.2s, transform 0.16s var(--ease-out-strong);
}
.tag-btn--cyan   { color: var(--cyan);   border-color: var(--cyan); }
.tag-btn--orange { color: var(--orange); border-color: var(--orange); }
.tag-btn--gold   { color: #c8900a;       border-color: #c8900a; }
.tag-btn--red    { color: var(--red);    border-color: var(--red); }
[data-theme="light"] .tag-btn--gold { color: #8a5800; border-color: #8a5800; }
.tag-btn:not(.active) { opacity: 0.62; }
.tag-btn.active { font-weight: bold; }

/* ── Press feedback: todo elemento presionable responde al toque ── */
.orbit-btn:active, .amber-btn:active, .preset-btn:active, .tag-btn:active,
#theme-toggle:active, #hamburger:active {
  transform: scale(0.97);
}

/* ── Cursor en canvas interactivos ── */
#passes-canvas, #pol-sar-canvas, #flood-canvas { cursor: crosshair; }
#orbit-canvas { cursor: grab; }

/* ── Mapa Leaflet en tema oscuro ──
   Los paneles de visualización conservan fondo oscuro en ambos temas
   (DESIGN.md); los tiles OSM se invierten para no romper la inmersión.
   El popup y la atribución quedan claros: legibilidad primero. */
html:not([data-theme="light"]) #endho-map {
  background: var(--bg-card);
}
html:not([data-theme="light"]) #endho-map .leaflet-tile {
  filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9) saturate(0.5);
}


/* ── Responsive — 768px ── */
@media (max-width: 768px) {
  /* Sections */
  section { padding: 52px 5% 48px; }
  .section-content-grid { grid-template-columns: 1fr; }

  /* Fact row → 2 columnas en grid */
  .fact-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--sp-2);
  }
  .fact-item { min-width: 0; }

  /* Nav — menú dropdown */
  #nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: rgba(5,10,20,0.97);
    padding: 16px 5%;
    border-bottom: 1px solid rgba(0,212,255,0.15);
    gap: 4px;
  }
  #nav-links.open { display: flex; }
  /* Touch target ≥44px: 13px de texto + 2×13px de padding + line-height 1.4 ≈ 49px */
  #nav-links a { font-size: 13px; padding: 13px 12px; display: block; }
  #hamburger {
    display: flex;
    flex-direction: column;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
  }
  [data-theme="light"] #nav-links {
    background: rgba(240,245,251,0.98);
    border-bottom-color: rgba(0,112,184,0.18);
  }

  /* Hero */
  #hero-chips { font-size: 11px; letter-spacing: 1px; margin-bottom: 20px; }
  #hero-sub { margin-bottom: 32px; }

  /* Orbit */
  #orbit-container { flex-direction: column; gap: 20px; }
  .orbit-globe-wrap { width: 100%; }
  .orbit-info-panel { min-width: 0; padding-top: 0; }
  #orbit-day-counter { font-size: 30px; }
  .orbit-day-sub { font-size: 12px; margin-bottom: 16px; }
  #orbit-info { font-size: 13px; }
  /* Touch targets (44×44 mínimo) */
  .orbit-btn { min-height: 44px; padding: 10px 12px; font-size: 9px; }
  .tag-btn, .preset-btn, .amber-btn { min-height: 44px; padding: 10px 14px; }
  #theme-toggle { min-height: 44px; min-width: 44px; }

  /* HUD del globo: compacto para no tapar el canvas */
  .globe-hud { min-width: 0; font-size: 9px; padding: 6px 8px; line-height: 1.6; }

  /* Más superficie táctil: reset, zoom de Leaflet, links del footer y sliders */
  .orbit-btn { min-width: 44px; }
  .leaflet-control-zoom a { width: 40px !important; height: 40px !important; line-height: 40px !important; }
  footer a { display: inline-block; padding: 8px 4px; }
  input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }
  #back-to-top { bottom: 20px; right: 14px; }

  /* Section label */
  .section-label { letter-spacing: 2px; }

  /* Footer */
  #site-footer { flex-direction: column; align-items: flex-start; }
  .footer-meta { text-align: left; }
  .footer-links { gap: 16px; }
}

/* ── Responsive — 480px (teléfonos pequeños) ── */
@media (max-width: 480px) {
  section { padding: 40px 4% 36px; }

  /* Fact row → 1 columna en pantallas muy pequeñas */
  .fact-row { grid-template-columns: 1fr; gap: var(--sp-2); }

  /* Tipografía */
  h2.section-title { font-size: clamp(22px, 7vw, 36px); }
  .content-body p { font-size: 15px; }
  .fi-value { font-size: 18px; }

  /* Cards más compactas */
  .data-card { padding: 14px 16px; }
  .card-value { font-size: 15px; }

  /* Orbit */
  #orbit-day-counter { font-size: 24px; }

  /* Callout */
  .callout { font-size: 14px; padding: 14px 16px; }
}

/* En táctil, :hover dispara con el tap (falso positivo): sin efectos de movimiento */
@media (hover: none), (pointer: coarse) {
  .data-card:hover, .fact-item:hover { transform: none; box-shadow: none; }
  .fact-item:hover::after { transform: scaleX(0); }
  .info-list li:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .aos { opacity: 1 !important; transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════════
   World-class polish layer
   ═══════════════════════════════════════════════════════════════ */

/* ── Grain texture — depth and tactility ── */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='250' height='250'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.78' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='250' height='250' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: 0.030;
  pointer-events: none;
  z-index: var(--z-overlay);
}
[data-theme="light"] body::after { opacity: 0.016; }

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,212,255,0.28); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,212,255,0.55); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(0,112,184,0.22); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(0,112,184,0.50); }

/* ── Text selection ── */
::selection { background: rgba(0,212,255,0.22); }
[data-theme="light"] ::selection { background: rgba(0,112,184,0.18); }

/* ── Hero: atmospheric upwelling glow ── */
#hero {
  position: relative;
  min-height: 100vh;    /* fallback */
  min-height: 100dvh;   /* iOS Safari: excludes browser chrome */
  background:
    radial-gradient(ellipse 110% 55% at 50% 105%, rgba(0,212,255,0.07) 0%, transparent 65%),
    radial-gradient(ellipse 35% 25% at 12% 35%, rgba(0,212,255,0.03) 0%, transparent 55%);
}
[data-theme="light"] #hero {
  background:
    radial-gradient(ellipse 110% 55% at 50% 105%, rgba(0,112,184,0.07) 0%, transparent 65%);
}

/* ── Hero ── */
#hero-chips {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 2px;
  margin-bottom: 32px;
}
@keyframes title-reveal {
  from { opacity: 0; letter-spacing: 20px; filter: blur(6px); }
  to   { opacity: 1; letter-spacing: clamp(2px, 0.8vw, 5px); filter: blur(0); }
}
#hero-title {
  font-family: var(--font-title);
  font-size: clamp(36px, 10vw, 120px);
  font-weight: 900;
  letter-spacing: clamp(3px, 1.5vw, 8px);
  color: var(--cyan);
  text-shadow: 0 0 40px rgba(0,212,255,0.4);
  margin-bottom: 20px;
  animation: title-reveal 1.4s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
#hero-sub {
  font-size: clamp(15px, 2.5vw, 22px);
  color: var(--text-secondary);
  margin-bottom: 48px;
  letter-spacing: 0.5px;
}

/* ── Hero: composición A (texto izquierda, satélite 3D derecha) ── */
#hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 5%;
  text-align: left;          /* composición A: texto a la izquierda */
}
#hero-content #hero-title,
#hero-content #hero-sub,
#hero-content #hero-chips {
  max-width: 56%;
}
/* El nombre nunca se parte en dos líneas */
#hero-content #hero-title {
  white-space: nowrap;
  max-width: none;
  font-size: clamp(32px, 7vw, 84px);
  letter-spacing: clamp(2px, 0.8vw, 5px);
}
@media (max-width: 768px) {
  #hero-content { text-align: center; }
  #hero-content #hero-title,
  #hero-content #hero-sub,
  #hero-content #hero-chips { max-width: 100%; }
  #hero-content #hero-title { font-size: clamp(30px, 9vw, 56px); }
}

/* ── Orbit layout ── */
#orbit-container {
  display: flex;
  gap: 36px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.orbit-globe-wrap { position: relative; flex-shrink: 0; }
.orbit-info-panel { flex: 1; min-width: 200px; padding-top: 12px; }
#orbit-day-counter {
  font-family: var(--font-mono);
  font-size: 42px;
  color: var(--cyan);
  line-height: 1.1;
}
.orbit-day-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
  margin-bottom: 24px;
}
#orbit-info { font-size: 14px; color: var(--text-secondary); line-height: 1.9; }

/* ── Section label: dot marker + trailing rule ── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.section-label::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
}
.section-label::after {
  content: '';
  display: inline-block;
  width: 36px;
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent);
  flex-shrink: 0;
}

/* ── Data card: glass wash on hover ── */
.data-card {
  position: relative;
  overflow: hidden;
}
.data-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(0,212,255,0.07) 0%, transparent 55%);
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.data-card:hover::before { opacity: 1; }
.data-card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.20), 0 0 0 1px rgba(0,212,255,0.16) inset;
}

/* ── Fact item: lift + sweep line ── */
.fact-item {
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition), transform 0.2s var(--ease-out-strong),
              box-shadow 0.2s ease;
}
.fact-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  transform: scaleX(0);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.fact-item:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.18); }
.fact-item:hover::after { transform: scaleX(1); }

/* Variante sobria: para cifras de víctimas y daños humanos.
   Sin lift, sin línea de neón, sin gamificación */
.fact-item--sober:hover { transform: none; box-shadow: none; }
.fact-item--sober::after { display: none; }
.fact-item.accent-green::after  { background: linear-gradient(90deg, transparent, var(--green),  transparent); }
.fact-item.accent-orange::after { background: linear-gradient(90deg, transparent, var(--orange), transparent); }
.fact-item.accent-red::after    { background: linear-gradient(90deg, transparent, var(--red),    transparent); }
.fact-item.accent-purple::after { background: linear-gradient(90deg, transparent, var(--purple), transparent); }

/* ── Callout: glow on left border ── */
.callout         { box-shadow: -3px 0 14px rgba(0,212,255,0.08);  transition: box-shadow var(--transition); }
.callout.green   { box-shadow: -3px 0 14px rgba(0,255,136,0.08);  }
.callout.orange  { box-shadow: -3px 0 14px rgba(245,158,11,0.08); }
.callout.red     { box-shadow: -3px 0 14px rgba(239,68,68,0.08);  }
.callout.purple  { box-shadow: -3px 0 14px rgba(167,139,250,0.08);}
.callout:hover          { box-shadow: -3px 0 20px rgba(0,212,255,0.18);  }
.callout.green:hover    { box-shadow: -3px 0 20px rgba(0,255,136,0.18);  }
.callout.orange:hover   { box-shadow: -3px 0 20px rgba(245,158,11,0.18); }
.callout.red:hover      { box-shadow: -3px 0 20px rgba(239,68,68,0.18);  }
.callout.purple:hover   { box-shadow: -3px 0 20px rgba(167,139,250,0.18);}

/* ── Info list: row separator + hover shift ── */
.info-list li {
  /* transform en vez de padding-left: no dispara layout */
  transition: color var(--transition), transform 0.2s var(--ease-out-strong);
  padding-top: 5px;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
[data-theme="light"] .info-list li { border-bottom-color: rgba(0,0,0,0.05); }
.info-list li:last-child { border-bottom: none; }
.info-list li:hover { transform: translateX(5px); color: var(--text-primary); }

/* ── AOS: slightly stronger lift (solo con JS) ── */
.js .aos:not(.visible) { transform: translateY(28px); }

/* ── Source note: top rule ── */
.source-note {
  border-top: 1px solid rgba(255,255,255,0.06);
  padding-top: 10px;
}
[data-theme="light"] .source-note { border-top-color: rgba(0,0,0,0.07); }

/* ── Footer ── */
#site-footer {
  padding: 36px 5% 30px;
  background: var(--bg-secondary);
  border-top: 1px solid rgba(0,212,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
[data-theme="light"] #site-footer { border-top-color: rgba(0,112,184,0.10); }

.footer-brand {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 900;
  color: var(--cyan);
  letter-spacing: 5px;
  text-decoration: none;
}

.footer-links {
  display: flex;
  gap: 24px;
  list-style: none;
  flex-wrap: wrap;
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--cyan); }

.footer-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-align: right;
  line-height: 2.0;
}


/* ─── UX Layer: Accessibility, Navigation, Feedback ─── */

/* Skip link for keyboard users */
.skip-link {
  position: fixed;
  top: -100px;
  left: 16px;
  background: var(--cyan);
  color: #000;
  padding: 10px 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 0 0 var(--radius) var(--radius);
  z-index: var(--z-top);
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; }

/* Global focus-visible ring */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 3px;
}
button:focus-visible,
a:focus-visible { border-radius: 4px; }

/* Anchor link offset compensation for fixed nav */
section[id] { scroll-margin-top: calc(var(--nav-height) + 16px); }

/* Reading progress bar (scaleX: solo transform, sin layout por frame) */
#reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan) 0%, var(--green) 100%);
  z-index: calc(var(--z-nav) + 1);
  pointer-events: none;
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.08s linear;
}

/* Back to top button */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.30);
  color: var(--cyan);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.2s var(--ease-out-strong), background 0.2s, border-color 0.2s;
  z-index: calc(var(--z-nav) - 3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top.visible:active { transform: translateY(0) scale(0.94); }
#back-to-top:hover {
  background: rgba(0,212,255,0.20);
  border-color: var(--cyan);
  box-shadow: 0 0 14px rgba(0,212,255,0.30);
}
[data-theme="light"] #back-to-top {
  background: rgba(0,112,184,0.08);
  border-color: rgba(0,112,184,0.25);
  color: var(--cyan);
}

/* Active nav link indicator */
#nav-links a.active {
  color: var(--cyan);
  position: relative;
}
#nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

/* Improved body text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Section paragraph readability */
section p {
  line-height: 1.75;
  max-width: 68ch;
}

/* Light mode reading progress */
[data-theme="light"] #reading-progress {
  background: linear-gradient(90deg, #0070b8 0%, #00a86b 100%);
}


/* ─── Sticky sidebar layout (patrón aihero) ─── */
.sticky-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}
.sticky-main { min-width: 0; }
.sticky-panel {
  position: sticky;
  top: calc(var(--nav-height) + 20px);
}

.spec-card {
  background: var(--bg-card);
  border: 1px solid rgba(0,212,255,0.15);
  border-radius: 12px;
  padding: 24px 22px;
  overflow: hidden;
  /* word-break: break-word partía palabras a la mitad ("Band/a C") dentro
     de los li flex; overflow-wrap solo rompe tokens que de verdad desbordan */
  overflow-wrap: break-word;
}
[data-theme="light"] .spec-card {
  background: #fff;
  border-color: rgba(0,112,184,0.14);
  box-shadow: 0 2px 20px rgba(0,0,0,0.07);
}
.spec-card-title {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(0,212,255,0.12);
}
.spec-card .info-list li {
  font-size: 13px;
  line-height: 1.6;
  padding: 9px 0;
}

@media (max-width: 960px) {
  .sticky-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .sticky-panel { position: static; }
}
