/* bk8.es — hoja de estilos única (sin framework). Tokens en :root. */
:root {
  --bg: #000a1f;
  --surface: #031331;
  --surface-2: #0a2250;
  --primary: #0025bf;
  --primary-hover: #1f45e0;
  --accent: #f5c542;
  --text: #ffffff;
  --muted: #a9b8d6;
  --link: #8fb0ff;
  --border: rgba(255, 255, 255, 0.12);
  --success: #5fd39a;
  --danger: #ff8a8a;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --container: 1200px;
  --gutter: 16px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --font-display: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.25; margin: 0 0 var(--s4); letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.6vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 1.9rem); font-weight: 700; }
h3 { font-size: 1.125rem; font-weight: 600; }
p { margin: 0 0 var(--s4); }
ul, ol { margin: 0 0 var(--s4); padding-left: 1.25rem; }
li { margin-bottom: var(--s2); }
strong { font-weight: 700; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: #b9cdff; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--s4); top: -100px; z-index: 100;
  background: var(--accent); color: var(--bg); font-weight: 700;
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm); text-decoration: none;
}
.skip-link:focus { top: var(--s3); }

/* ---------- Contenedor ---------- */
.container,
main > section, main > aside, main > nav {
  width: min(100% - 2 * var(--gutter), var(--container));
  margin-inline: auto;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--radius-pill);
  font-weight: 700; font-size: 1rem; text-decoration: none; border: 2px solid transparent;
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus-visible { background: var(--primary-hover); color: #fff; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover, .btn-ghost:focus-visible { border-color: var(--link); color: #fff; }
.btn-sm { min-height: 40px; padding: 0 var(--s4); font-size: .95rem; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(0, 10, 31, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: var(--s4); min-height: var(--header-h); position: relative; }
.logo { display: inline-flex; align-items: center; margin-right: auto; border-radius: var(--radius-sm); }
.logo img { width: 112px; height: auto; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.main-nav li { margin: 0; }
.main-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s2);
  color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; border-radius: var(--radius-sm);
}
.main-nav a:hover { color: var(--accent); }
.main-nav a[aria-current="page"] { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }
.header-cta { order: 3; }
.menu-toggle {
  order: 4; display: none; width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--border); color: var(--text); cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-bars, .menu-bars::before, .menu-bars::after {
  display: block; width: 20px; height: 2px; background: currentColor; border-radius: 2px; position: relative; transition: transform .2s ease;
}
.menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
.menu-bars::before { top: -6px; }
.menu-bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1023.98px) {
  .header-inner { flex-wrap: wrap; }
  .main-nav { order: 5; width: 100%; padding-bottom: var(--s3); }
  .js .menu-toggle { display: inline-flex; }
  .js .main-nav {
    display: none; position: absolute; top: 100%; left: calc(-1 * var(--gutter)); right: calc(-1 * var(--gutter));
    width: auto; background: var(--surface); border-bottom: 1px solid var(--border);
    padding: var(--s3) var(--gutter) var(--s4); box-shadow: 0 16px 32px rgba(0, 0, 0, .45);
  }
  .js .main-nav.is-open { display: block; }
  .js .main-nav ul { flex-direction: column; gap: 0; }
  .js .main-nav a { width: 100%; min-height: 48px; padding: 0 var(--s3); border-bottom: 1px solid var(--border); border-radius: 0; }
  .js .main-nav li:last-child a { border-bottom: 0; }
  .js .main-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--accent); }
  .header-cta { min-height: 40px; padding: 0 var(--s4); font-size: .9rem; }
}
@media (max-width: 359.98px) { .header-cta { display: none; } }

/* ---------- Migas ---------- */
.breadcrumb { padding-top: var(--s4); font-size: .875rem; color: var(--muted); }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: var(--s2); color: var(--muted); }
.breadcrumb a { color: var(--muted); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: grid; align-items: center; overflow: hidden;
  margin-top: var(--s5);
  border-radius: calc(var(--radius) * 1.5); border: 1px solid var(--border);
  background: var(--surface);
}
.hero-text { position: relative; z-index: 1; padding: var(--s5) var(--s5) var(--s6); }
.hero h1 { margin-bottom: var(--s3); }
.hero .lead { font-size: 1.075rem; color: #e6ecff; max-width: 62ch; margin-bottom: 0; }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s5); }
.hero-media { order: -1; }
.hero-image {
  width: 100%; max-height: 340px; aspect-ratio: 16 / 9;
  object-fit: cover; object-position: 65% center;
}
.byline { font-size: .875rem; color: var(--muted); margin-bottom: var(--s4); }
.byline time { color: var(--text); }
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); min-height: 360px; }
  .hero-text { padding: var(--s7) var(--s6) var(--s7) var(--s7); }
  .hero-media { position: absolute; inset: 0 0 0 42%; }
  .hero-media::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--surface), rgba(3, 19, 49, .94) 26%, rgba(3, 19, 49, .34) 52%, transparent 83%);
  }
  .hero-image { height: 100%; max-height: none; }
  .hero.notfound { min-height: 288px; }
}

/* ---------- Secciones ---------- */
.section { padding-block: var(--s7) 0; }
.section > p, .section > ul:not(.cards):not(.related-list), .section > ol, .section > .note { max-width: 78ch; }
.section-lead { color: #dfe6f8; }
.note { font-size: .9rem; color: var(--muted); }

/* ---------- Lo esencial ---------- */
.esencial {
  margin-top: var(--s7); padding: var(--s5); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent);
}
.esencial h2 { font-size: 1.25rem; margin-bottom: var(--s3); }
.esencial ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.esencial li { position: relative; padding-left: 28px; margin: 0; }
.esencial li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); box-shadow: inset 0 0 0 4px var(--surface);
  border: 2px solid var(--accent);
}
@media (min-width: 900px) { .esencial ul { grid-template-columns: 1fr 1fr; column-gap: var(--s6); } }

/* ---------- Tarjetas ---------- */
.cards {
  list-style: none; padding: 0; margin: var(--s5) 0 var(--s4);
  display: grid; gap: var(--s4); grid-template-columns: 1fr;
}
.cards > li { margin: 0; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) {
  .cards--3 { grid-template-columns: repeat(3, 1fr); }
  .cards--4 { grid-template-columns: repeat(4, 1fr); }
}
.card {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); text-decoration: none; overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--primary-hover); box-shadow: 0 10px 28px rgba(0, 37, 191, .35); color: var(--text); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.card-photo {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  background: var(--surface-2);
}
.card-photo--original { object-position: center 33%; }
.card-slot-art { aspect-ratio: 16 / 9; flex: none; overflow: hidden; }
.card-slot-art .card-photo { width: 112.5%; max-width: none; margin-inline: -6.25%; aspect-ratio: auto; }
.card-badge {
  position: absolute; top: var(--s3); left: var(--s3); z-index: 2;
  background: var(--accent); color: var(--bg); font-size: .75rem; font-weight: 700; line-height: 1;
  padding: 6px 10px; border-radius: var(--radius-pill);
}
.card-body { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); flex: 1; }
.card-title { font-size: 1.075rem; margin: 0; }
.card-desc { margin: 0; color: var(--muted); font-size: .94rem; line-height: 1.55; flex: 1; }
.card-cta {
  align-self: flex-start; margin-top: var(--s2); display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: .95rem;
  min-height: 40px; padding: 0 var(--s4); border-radius: var(--radius-pill);
}
.card:hover .card-cta { background: var(--primary-hover); }

/* ---------- Tablas ---------- */
.table-wrap { overflow-x: auto; margin: var(--s4) 0 var(--s5); border: 1px solid var(--border); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 560px; }
caption { text-align: left; padding: var(--s3) var(--s4); color: var(--muted); font-size: .875rem; caption-side: top; }
th, td { padding: var(--s3) var(--s4); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
thead th { background: var(--surface-2); font-family: var(--font-display); font-weight: 600; font-size: .9rem; }
tbody tr:nth-child(even) td, tbody tr:nth-child(even) th { background: rgba(3, 19, 49, .65); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tbody th { font-weight: 600; }

/* ---------- Listas especiales ---------- */
.steps { list-style: none; counter-reset: paso; padding: 0; display: grid; gap: var(--s3); }
.steps > li {
  counter-increment: paso; position: relative; margin: 0; padding: var(--s4) var(--s4) var(--s4) 64px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.steps > li::before {
  content: counter(paso); position: absolute; left: var(--s4); top: var(--s4);
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 700; font-family: var(--font-display);
}
.checklist { list-style: none; padding: 0; }
.checklist > li { position: relative; padding-left: 30px; }
.checklist > li::before {
  content: ""; position: absolute; left: 4px; top: .45em; width: 8px; height: 14px;
  border: solid var(--accent); border-width: 0 3px 3px 0; transform: rotate(45deg);
}
.tags { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.tags > li { margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); font-size: .9rem; }

/* ---------- Ventajas / desventajas ---------- */
.proscons { display: grid; gap: var(--s4); margin: var(--s4) 0; }
@media (min-width: 768px) { .proscons { grid-template-columns: 1fr 1fr; } }
.proscons > div { padding: var(--s5); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.proscons h3 { display: flex; align-items: center; gap: var(--s2); }
.proscons .pros h3 { color: var(--success); }
.proscons .cons h3 { color: var(--danger); }
.proscons ul { margin: 0; padding-left: 1.1rem; }

/* ---------- FAQ ---------- */
.faq-list { display: grid; gap: var(--s3); margin: var(--s4) 0; max-width: 900px; }
.faq-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-item summary {
  cursor: pointer; list-style: none; position: relative;
  padding: var(--s4) 56px var(--s4) var(--s4); font-weight: 600; font-family: var(--font-display); font-size: 1rem;
  border-radius: var(--radius);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-q { display: inline; font-size: 1rem; font-weight: 600; line-height: 1.4; margin: 0; letter-spacing: 0; }
.faq-item summary::after {
  content: "+"; position: absolute; right: var(--s4); top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--accent); font-size: 1.25rem; line-height: 1;
}
.faq-item[open] summary::after { content: "−"; }
.faq-answer { padding: 0 var(--s4) var(--s2); color: #e3e9f7; }

/* ---------- Autor ---------- */
.author-box {
  display: flex; gap: var(--s4); align-items: flex-start; margin-top: var(--s7);
  padding: var(--s5); border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.author-avatar {
  flex: none; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--surface-2)); color: var(--accent);
}
.author-avatar svg { width: 26px; height: 26px; }
.author-name { font-family: var(--font-display); font-weight: 700; margin-bottom: var(--s1); }
.author-box p { margin-bottom: var(--s2); }
.author-box .updated { font-size: .875rem; color: var(--muted); margin: 0; }

/* ---------- Relacionadas ---------- */
.related-list { list-style: none; padding: 0; display: grid; gap: var(--s3); grid-template-columns: 1fr; }
@media (min-width: 640px) { .related-list { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related-list { grid-template-columns: repeat(3, 1fr); } }
.related-list > li { margin: 0; }
.related-list a {
  display: block; height: 100%; padding: var(--s4); border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: var(--text);
}
.related-list a:hover { border-color: var(--link); }
.related-list strong { display: block; color: var(--link); margin-bottom: var(--s1); }
.related-list span { color: var(--muted); font-size: .92rem; }

/* ---------- Banda final ---------- */
.cta-band {
  margin-top: var(--s7); padding: var(--s6) var(--s5); text-align: center; border-radius: calc(var(--radius) * 1.5);
  background: radial-gradient(circle at 50% 0%, rgba(31, 69, 224, .65), transparent 70%), var(--surface-2);
  border: 1px solid var(--border);
}
.cta-title { font-family: var(--font-display); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.7rem); font-weight: 700; margin-bottom: var(--s2); }
.cta-band p { max-width: 60ch; margin-inline: auto; }
.cta-band .note { margin-top: var(--s4); margin-bottom: 0; }

/* ---------- Pie ---------- */
.site-footer { margin-top: var(--s8); background: #00081a; border-top: 1px solid var(--border); padding: var(--s7) 0 var(--s6); font-size: .94rem; }
.footer-top { display: grid; gap: var(--s6); }
@media (min-width: 900px) { .footer-top { grid-template-columns: 1.3fr 2fr; } }
.footer-brand img { width: 112px; margin-bottom: var(--s3); }
.footer-brand p { color: var(--muted); max-width: 46ch; }
.footer-cols { display: grid; gap: var(--s5); grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer-title { font-family: var(--font-display); font-weight: 700; margin-bottom: var(--s2); color: var(--text); }
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols li { margin-bottom: var(--s1); }
.footer-cols a { color: var(--muted); text-decoration: none; display: inline-block; padding: 4px 0; }
.footer-cols a:hover { color: var(--text); text-decoration: underline; }
.coins { list-style: none; padding: 0; margin: var(--s6) 0 0; display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.coins li { margin: 0; }
.coins .coins-label { color: var(--muted); margin-right: var(--s2); }
.coin { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); font-weight: 700; font-size: .85rem; letter-spacing: .03em; }
.coin::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.rg {
  display: flex; gap: var(--s4); align-items: flex-start; margin-top: var(--s5); padding: var(--s4);
  border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface);
}
.age-badge {
  flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--danger); color: var(--text); font-weight: 700; font-family: var(--font-display);
}
.rg p { margin: 0; color: var(--muted); }
.rg strong { color: var(--text); }
.legal { margin-top: var(--s5); color: var(--muted); font-size: .85rem; }
.legal p { margin-bottom: var(--s2); max-width: 110ch; }

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
}
