/* Geometry Dash ES — Sistema visual "Editorial Claro + Escenario Arcade"
   Contraste limpio: cabecera y escenario hero en azul pizarra profundo (#0B1023),
   cuerpo editorial en papel claro (#F4F6FB / #FFFFFF) con acentos Cobalto (#2563EB),
   Lima Arcade (#A3E635) y Cian (#06B6D4). Cero estilos inline (CSP strict). */

:root {
  --bg-page: #f3f5fa;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --surface-tint: #eff4ff;
  --ink: #0f172a;
  --ink-body: #1e293b;
  --ink-muted: #475569;
  --ink-subtle: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --stage-bg: #0b1023;
  --stage-bg-2: #121a36;
  --stage-border: rgba(148, 163, 184, 0.22);
  --stage-text: #f8fafc;
  --stage-muted: #cbd5e1;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --lime: #a3e635;
  --lime-hover: #bef264;
  --cyan: #06b6d4;
  --amber: #d97706;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.06);
  --shadow-hover: 0 14px 32px rgba(15, 23, 42, 0.11);
  --header-h: 68px;
}

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

html {
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink-body);
  background-color: var(--bg-page);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

.wrap {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Skip link accesible */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lime);
  color: #091302;
  padding: 11px 18px;
  z-index: 200;
  border-radius: 0 0 8px 0;
  font-weight: 800;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* Barra de progreso de lectura (CSP-safe) */
.read-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 120;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  pointer-events: none;
}
.read-progress::-webkit-progress-bar {
  background: transparent;
}
.read-progress::-webkit-progress-value {
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--lime));
}
.read-progress::-moz-progress-bar {
  background: linear-gradient(90deg, var(--accent), var(--cyan), var(--lime));
}

/* Cabecera oscura de alto contraste */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--stage-bg);
  border-bottom: 1px solid #1e293b;
  box-shadow: 0 4px 20px rgba(2, 6, 23, 0.16);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-h);
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
  font-size: 18.5px;
  flex: 0 0 auto;
}
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: transform 0.18s ease;
}
.brand:hover .brand-logo {
  transform: rotate(-4deg) scale(1.04);
}
.brand-texto {
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-texto strong {
  color: var(--lime);
}
.brand-texto small {
  display: block;
  color: #94a3b8;
  font-size: 11.5px;
  font-weight: 600;
  margin-top: 2px;
}

.nav-principal {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.nav-principal a {
  color: #cbd5e1;
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  padding: 8px 11px;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-principal a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.nav-principal a.is-active,
.nav-principal a[aria-current="page"] {
  color: #ffffff;
  background: rgba(37, 99, 235, 0.28);
  box-shadow: inset 0 -2px 0 var(--cyan);
}
.nav-principal a.nav-cta {
  color: #091302;
  font-weight: 800;
  background: var(--lime);
  padding: 8px 14px;
  margin-left: 4px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18);
}
.nav-principal a.nav-cta:hover {
  background: var(--lime-hover);
  color: #091302;
}

.nav-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  cursor: pointer;
  padding: 8px 10px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #ffffff;
  border-radius: 2px;
  margin: 4px 0;
}

/* Barra superior sobre fondo claro */
.page-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 12px 0 10px;
}
.migajas {
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.migajas a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.migajas a:hover {
  text-decoration: underline;
}
.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
}
.page-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--accent);
}

/* Rejilla de 2 columnas */
.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 24px;
  align-items: start;
}

/* Contenedor principal de artículo (dos tonos: hero oscuro + cuerpo blanco) */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-width: 0;
  margin: 0 0 24px;
}

/* Escenario Hero oscuro dentro del artículo */
.article-hero {
  background:
    radial-gradient(640px 320px at 90% 10%, rgba(6, 182, 212, 0.16), transparent 65%),
    radial-gradient(520px 280px at 12% 0%, rgba(37, 99, 235, 0.22), transparent 65%),
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(165deg, var(--stage-bg) 0%, var(--stage-bg-2) 100%);
  background-size: 100% 100%, 100% 100%, 36px 36px, 36px 36px, 100% 100%;
  color: var(--stage-text);
  padding: clamp(24px, 3.6vw, 38px);
  border-bottom: 3px solid var(--lime);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 26px;
  align-items: center;
}

.article-hero h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  line-height: 1.12;
  margin: 0 0 18px;
  letter-spacing: -0.03em;
  font-weight: 800;
  color: #ffffff;
}

/* Caja de resumen / intención inmediata dentro del hero */
.intro-resumen {
  padding: 16px 18px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-left: 4px solid var(--cyan);
}
.intro-resumen p {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.6;
  color: #e2e8f0;
}
.intro-resumen p:last-child {
  margin-bottom: 0;
  color: #ffffff;
}
.intro-resumen a {
  color: var(--lime);
  font-weight: 600;
}
.intro-resumen a:hover {
  color: #d9f99d;
}

.intro-resumen ol {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
  counter-reset: toc-num;
}
.intro-resumen ol li {
  counter-increment: toc-num;
  margin: 0;
}
.intro-resumen ol li a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.intro-resumen ol li a::before {
  content: counter(toc-num);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 800;
  color: #091302;
  background: var(--lime);
}
.intro-resumen ol li a:hover {
  border-color: var(--cyan);
  background: rgba(6, 182, 212, 0.18);
}

/* Figura en el Hero (o dentro del cuerpo en páginas de juego) */
img {
  max-width: 100%;
  height: auto;
}
.article-figure {
  margin: 0;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.42);
}
.article-body .article-figure {
  margin: 24px 0 28px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.figure-frame {
  overflow: hidden;
  border-radius: 8px;
}
.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.article-figure figcaption {
  padding: 9px 6px 2px;
  font-size: 13px;
  line-height: 1.45;
  color: #cbd5e1;
  text-align: center;
}
.article-body .article-figure figcaption {
  color: var(--ink-muted);
}

/* Cuerpo editorial claro */
.article-body {
  padding: clamp(24px, 3.6vw, 40px);
  overflow-wrap: break-word;
}
.article-body > h2:first-child {
  margin-top: 0;
}

.article-body h2 {
  scroll-margin-top: 90px;
  font-size: clamp(21px, 2.4vw, 27px);
  line-height: 1.25;
  margin: 40px 0 14px;
  padding: 0 0 10px 14px;
  border-left: 4px solid var(--accent);
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 800;
}
.article-body h3 {
  scroll-margin-top: 90px;
  font-size: 19.5px;
  line-height: 1.32;
  margin: 26px 0 10px;
  color: var(--ink);
  font-weight: 700;
}
.article-body h4 {
  scroll-margin-top: 90px;
  font-size: 13.5px;
  margin: 20px 0 8px;
  color: var(--accent-hover);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 800;
}

p {
  margin: 0 0 16px;
}
.article-body p {
  color: var(--ink-body);
}
.article-body a {
  color: var(--accent-hover);
  font-weight: 600;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}
.article-body a:hover {
  color: #1e40af;
}

/* Listas editoriales */
.article-body > ul {
  margin: 0 0 20px;
  padding-left: 0;
  list-style: none;
}
.article-body > ul li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 9px;
}
.article-body > ul li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.62em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent);
}

.article-body > ol {
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
  counter-reset: step-counter;
  display: grid;
  gap: 10px;
}
.article-body > ol li {
  counter-increment: step-counter;
  position: relative;
  padding: 13px 16px 13px 50px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  border: 1px solid var(--border);
  margin: 0;
}
.article-body > ol li::before {
  content: counter(step-counter);
  position: absolute;
  left: 14px;
  top: 13px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  background: var(--ink);
}

/* Tablas claras y estructuradas */
.table-wrap {
  margin: 20px 0 26px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
}
.table-wrap table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  margin: 0;
  font-size: 15px;
}
.table-wrap th,
.table-wrap td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.table-wrap thead th {
  background: #f1f5f9;
  color: var(--ink);
  font-weight: 800;
  font-size: 13.5px;
  letter-spacing: 0.02em;
  border-bottom: 2px solid var(--border-strong);
}
.table-wrap tbody tr:nth-child(even) {
  background: #fafbfd;
}
.table-wrap tbody tr:hover {
  background: var(--surface-tint);
}
.table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  background: var(--surface-tint);
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
}

/* Botones táctiles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 14.5px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  touch-action: manipulation;
  transition: transform 0.14s ease, background 0.16s ease, box-shadow 0.16s ease;
}
.btn-primario {
  color: #091302;
  background: var(--lime);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.20), 0 4px 14px rgba(163, 230, 53, 0.25);
}
.btn-primario:hover {
  color: #091302;
  background: var(--lime-hover);
  transform: translateY(-1px);
}
.btn-primario:active {
  transform: translateY(1px);
}
.btn-cristal {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.20);
}
.btn-cristal:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--cyan);
}
.btn-cristal:active {
  transform: translateY(1px);
}

/* Rail lateral fijo (TOC claro + tarjeta arcade oscura) */
.guide-rail {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: grid;
  gap: 16px;
}
.rail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.rail-title {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-subtle);
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
}
.toc-list a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  border-left: 2.5px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 13.5px;
  line-height: 1.38;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.toc-list a:hover {
  color: var(--ink);
  background: var(--surface-muted);
}
.toc-list a.is-current {
  color: var(--accent-hover);
  font-weight: 700;
  background: var(--surface-tint);
  border-left-color: var(--accent);
}

.rail-arcade {
  background: var(--stage-bg);
  border-color: #1e293b;
  color: #f8fafc;
}
.rail-arcade .rail-title {
  color: var(--cyan);
}
.rail-arcade p {
  font-size: 14px;
  line-height: 1.5;
  color: var(--stage-muted);
  margin: 0 0 14px;
}
.rail-arcade .btn {
  width: 100%;
}

.rail-keys {
  display: grid;
  gap: 8px;
  margin: 0;
}
.rail-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-muted);
}
kbd {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface-muted);
  border: 1px solid var(--border-strong);
  box-shadow: 0 1px 0 var(--border-strong);
}
.article-hero kbd {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.4);
}

/* Tarjetas de FAQ y Guías relacionadas */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(22px, 3.2vw, 32px);
  margin: 0 0 24px;
}

.faq h2,
.rel h2 {
  margin: 0 0 16px;
  font-size: clamp(20px, 2.4vw, 25px);
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.faq details {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 10px 0 0;
  overflow: hidden;
  transition: border-color 0.16s ease, background 0.16s ease;
}
.faq details[open] {
  background: var(--surface);
  border-color: var(--accent);
}
.faq summary {
  padding: 15px 46px 15px 18px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  list-style: none;
  position: relative;
  color: var(--ink);
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary:hover {
  background: rgba(37, 99, 235, 0.04);
}
.faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 21px;
  font-weight: 700;
  color: var(--accent);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}
.faq .faq-respuesta {
  padding: 0 18px 16px;
  color: var(--ink-muted);
  font-size: 15.5px;
  line-height: 1.65;
}
.faq .faq-respuesta p:last-child {
  margin-bottom: 0;
}

/* Guías relacionadas con miniatura */
.related-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.related-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.related-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}
.related-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--stage-bg);
  border-bottom: 1px solid var(--border);
}
.related-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}
.related-card:hover .related-thumb img {
  transform: scale(1.04);
}
.related-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px 15px;
  flex: 1 1 auto;
}
.related-body span {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--ink);
}
.related-body strong {
  font-size: 13.5px;
  color: var(--accent-hover);
  font-weight: 700;
}

/* Pie de página oscuro */
.site-footer {
  margin-top: 48px;
  background: var(--stage-bg);
  color: #cbd5e1;
  border-top: 3px solid var(--accent);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: 26px;
  padding: 38px 24px 24px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  text-decoration: none;
  font-size: 18.5px;
  font-weight: 800;
  margin-bottom: 12px;
}
.footer-brand strong {
  color: var(--lime);
}
.footer-brand img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.footer-desc {
  color: #94a3b8;
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
}
.footer-titulo {
  font-weight: 800;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
  margin: 0 0 10px;
}
.site-footer nav a {
  display: block;
  color: #cbd5e1;
  text-decoration: none;
  padding: 4px 0;
  font-size: 14.5px;
  transition: color 0.15s ease, transform 0.15s ease;
}
.site-footer nav a:hover {
  color: var(--lime);
  transform: translateX(3px);
}
.footer-legal {
  border-top: 1px solid #1e293b;
  padding: 16px 24px 28px;
  font-size: 13px;
  color: #94a3b8;
}
.footer-legal p {
  margin: 0;
  color: #94a3b8;
}

/* Página 404 */
.error-card {
  max-width: 680px;
  margin: 44px auto;
  text-align: center;
}
.error-logo {
  width: 104px;
  height: 104px;
  object-fit: cover;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  margin-bottom: 14px;
}
.error-card h1 {
  color: var(--ink);
  font-size: clamp(28px, 4vw, 38px);
  margin: 0 0 12px;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.error-actions .btn-cristal {
  color: var(--ink);
  background: var(--surface-muted);
  border-color: var(--border-strong);
}

/* Animación de entrada */
.revelar {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.revelar.visible {
  opacity: 1;
  transform: none;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .revelar {
    opacity: 1;
    transform: none;
  }
}

/* Breakpoints */
@media (max-width: 1040px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .guide-rail {
    position: static;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    margin-bottom: 24px;
  }
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 920px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 880px) {
  .nav-toggle {
    display: block;
  }
  .nav-principal {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    background: var(--stage-bg);
    padding: 14px 20px 20px;
    border-bottom: 1px solid #1e293b;
    box-shadow: 0 22px 44px rgba(2, 6, 23, 0.45);
  }
  .nav-principal.abierto {
    display: flex;
  }
  .nav-principal a {
    padding: 12px 14px;
    font-size: 16px;
  }
  .nav-principal a.nav-cta {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .wrap {
    padding: 0 14px;
  }
  body {
    font-size: 16px;
  }
  .brand-logo {
    width: 38px;
    height: 38px;
  }
  .brand-texto {
    font-size: 16.5px;
  }
  .brand-texto small {
    display: none;
  }
  .page-top {
    margin: 14px 0 10px;
  }
  .article-hero,
  .article-body,
  .glass-card {
    padding: 20px 16px;
  }
  .article-hero h1 {
    font-size: 1.7rem;
    line-height: 1.16;
  }
  .article-body > ol li {
    padding: 11px 12px 11px 44px;
  }
  .related-grid {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .btn {
    min-height: 46px;
  }
}

/* Hub Arcade de Inicio (acceso rápido por categorías) */
.hub-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: clamp(20px, 3vw, 30px);
  margin: 0 0 24px;
}

.hub-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 18px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.hub-eyebrow {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-hover);
  margin: 0 0 4px;
}

.hub-header h2 {
  margin: 0;
  font-size: clamp(20px, 2.3vw, 24px);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 800;
}

.hub-sub {
  margin: 0;
  font-size: 14px;
  color: var(--ink-muted);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.hub-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.hub-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--accent-hover);
  background: #e0e7ff;
}

.hub-card--arcade .hub-tag {
  color: #091302;
  background: var(--lime);
}

.hub-arrow {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  transition: transform 0.16s ease;
}

.hub-card:hover .hub-arrow {
  transform: translateX(3px);
}

.hub-card h3 {
  margin: 0 0 5px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--ink);
}

.hub-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
}

/* Refinamientos sutiles en cabecera, tarjetas y pie */
.site-header {
  border-bottom: 1px solid rgba(56, 189, 248, 0.16);
}

.article-body h2 {
  border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.04) 0%, transparent 55%);
  padding: 6px 0 8px 14px;
  border-radius: 0 6px 0 0;
}

.rail-card {
  transition: border-color 0.16s ease;
}

.rail-card:hover {
  border-color: var(--border-strong);
}

.site-footer {
  border-top: 3px solid var(--cyan);
}

@media (max-width: 960px) {
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* Índice compacto para móvil y tableta */
.mobile-toc {
  display: none;
}
@media (max-width: 1040px) {
  .mobile-toc {
    display: block;
    margin: 0 0 18px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
  }
  .mobile-toc summary {
    cursor: pointer;
    font-weight: 800;
    color: var(--ink);
  }
  .mobile-toc .toc-list {
    margin-top: 12px;
  }
}
