/* Bit a Bit — hoja de estilos */
:root {
  --paper: #f3f5f8;
  --surface: #ffffff;
  --ink: #131a26;
  --muted: #566174;
  --line: #dce1e9;
  --accent: #1f4fd8;
  --accent-hover: #173ca8;
  --accent-soft: #e6ecfc;
  --on-accent: #ffffff;
  --signal: #e39a2d;
  --key-top: #ffffff;
  --key-edge: #c3cad6;
  --shadow: 0 1px 2px rgba(19, 26, 38, .05), 0 8px 24px rgba(19, 26, 38, .06);

  --f-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --f-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;

  --wrap: 1120px;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0f1319;
    --surface: #161b23;
    --ink: #e7ebf1;
    --muted: #9aa4b6;
    --line: #283040;
    --accent: #88a7ff;
    --accent-hover: #a9c0ff;
    --accent-soft: #1b2745;
    --on-accent: #0f1319;
    --signal: #f0b252;
    --key-top: #1e2430;
    --key-edge: #39424f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0f1319;
  --surface: #161b23;
  --ink: #e7ebf1;
  --muted: #9aa4b6;
  --line: #283040;
  --accent: #88a7ff;
  --accent-hover: #a9c0ff;
  --accent-soft: #1b2745;
    --on-accent: #0f1319;
  --signal: #f0b252;
  --key-top: #1e2430;
  --key-edge: #39424f;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.0625rem;
  line-height: 1.7;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.2; letter-spacing: -0.015em; text-wrap: balance; margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 16px; color: #fff; }

/* Teclas: el elemento de identidad del sitio */
kbd {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 0.82em;
  font-weight: 500;
  line-height: 1.4;
  color: var(--ink);
  background: var(--key-top);
  border: 1px solid var(--key-edge);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 1px 7px;
  white-space: nowrap;
  vertical-align: 0.05em;
}

/* Etiquetas y rótulos */
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.tag::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--signal) 22%, transparent);
}
a.tag { text-decoration: none; align-self: flex-start; }
a.tag:hover { color: var(--accent); }

.section-label, .eyebrow {
  font-family: var(--f-mono); font-size: 0.75rem; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0;
}
.meta { font-size: 0.875rem; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: 700 0.95rem/1 var(--f-body);
  background: var(--accent); color: var(--on-accent); text-decoration: none;
  border: 1px solid var(--accent); border-radius: 10px;
  padding: 12px 20px; cursor: pointer; transition: background .15s, transform .15s;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent); }

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-block: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.logo-key {
  display: grid; place-items: center; width: 34px; height: 34px;
  background: var(--accent); color: #fff; font-size: 1.05rem;
  border-radius: 9px; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22);
}
.nav { display: flex; gap: 4px 22px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; padding-block: 4px; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* Portada */
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 40px; align-items: center; padding-block: 64px 48px; }
.hero-text { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; max-width: 16ch; }
.hero-sub { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin: 0; }
.shortcut {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; display: flex; flex-direction: column; gap: 14px;
}
.shortcut-label { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0; }
.keys { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
.keys kbd { font-size: 1.15rem; padding: 8px 14px; border-radius: 9px; border-bottom-width: 4px; }
.plus { color: var(--muted); font-family: var(--f-mono); }
.shortcut-text { margin: 0; }
.shortcut a { font-weight: 700; }

.featured { display: flex; flex-direction: column; gap: 14px; padding-bottom: 56px; }
.feature {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(20px, 3vw, 32px);
}
.feature h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); max-width: 28ch; }
.feature h2 a, .card h3 a { color: var(--ink); text-decoration: none; }
.feature h2 a:hover, .card h3 a:hover { color: var(--accent); }
.feature .btn { margin-top: 8px; }

/* Temas */
.topics { display: flex; flex-direction: column; gap: 14px; padding-bottom: 56px; }
.topic-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.topic {
  height: 100%; display: flex; flex-direction: column; gap: 10px;
  padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s, box-shadow .2s;
}
.topic:hover { border-color: var(--accent); color: var(--ink); transform: translateY(-3px); box-shadow: var(--shadow); }
.topic-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); transition: transform .2s; }
.topic:hover .topic-icon { transform: rotate(-6deg) scale(1.06); }
.topic-name { font-family: var(--f-display); font-weight: 600; font-size: 1.1rem; }
.topic-count { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.related .topic-list { padding-block: 20px 64px; }

.cat-head { display: flex; flex-direction: column; gap: 12px; padding-block: 40px 16px; border-bottom: 1px solid var(--line); }
.cat-head .breadcrumb { margin-bottom: 8px; }
.cat-head h1 { font-size: clamp(2rem, 5vw, 3rem); font-weight: 800; letter-spacing: -0.03em; }

.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px 24px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 1.6rem; }
.cats { display: flex; gap: 18px; flex-wrap: wrap; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 0 32px; padding-block: 8px 64px; }
.card { display: flex; flex-direction: column; gap: 10px; padding-block: 26px; border-bottom: 1px solid var(--line); }
.card h3 { font-size: 1.2rem; }
.card p:not(.meta) { color: var(--muted); margin: 0; font-size: 0.97rem; }
.card .meta { margin-top: auto; }

/* Artículos */
.article-layout { display: grid; grid-template-columns: minmax(0, 720px) 240px; gap: 56px; justify-content: center; padding-block: 40px 24px; }
.article { min-width: 0; }
.article.page { max-width: 720px; margin-inline: auto; padding-block: 40px 72px; }
.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 28px; }
.breadcrumb a { color: var(--muted); }
.article-head { display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-size: clamp(1.9rem, 4.4vw, 2.75rem); font-weight: 800; letter-spacing: -0.025em; }

.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.1em; }
.prose p, .prose ul, .prose ol { margin-block: 0; }
.prose * + p, .prose * + ul, .prose * + ol, .prose * + .tip, .prose * + .table-scroll, .prose * + .contact-box { margin-top: 1.1em; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose li + li { margin-top: 0.45em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li::marker { color: var(--accent); }
.prose code { font-family: var(--f-mono); font-size: 0.88em; background: var(--accent-soft); padding: 2px 6px; border-radius: 5px; overflow-wrap: anywhere; }
.lead { font-size: 1.2rem; color: var(--muted); line-height: 1.6; margin-top: 1.4em !important; }
.tip { background: var(--accent-soft); border-radius: 10px; padding: 16px 20px; }
.note { margin-top: 48px; padding: 18px 22px; border: 1px dashed var(--key-edge); border-radius: 10px; color: var(--muted); max-width: 68ch; }

.toc { position: sticky; top: 96px; align-self: start; display: flex; flex-direction: column; gap: 12px; padding-top: 64px; }
.toc ol { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 8px; counter-reset: toc; }
.toc li { font-size: 0.88rem; line-height: 1.4; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.related { border-top: 1px solid var(--line); padding-top: 40px; }
.related h2 { font-size: 1.5rem; }

/* Tabla (política de cookies) */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--f-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }

/* Contacto */
.contact-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.contact-email { font-family: var(--f-display); font-size: clamp(1.2rem, 3.5vw, 1.6rem); font-weight: 600; margin: 0 !important; overflow-wrap: anywhere; }
.contact-email a { text-decoration: none; }
.copy-status { font-size: 0.9rem; color: var(--muted); margin: 0 !important; min-height: 1.4em; }

/* 404 */
.notfound { text-align: left; display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.notfound .keys kbd { font-size: 2rem; padding: 10px 18px; }
.notfound h1 { font-size: 2.2rem; }
.notfound p { margin: 0; color: var(--muted); max-width: 52ch; }

/* Pie */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 24px; }
.foot { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) minmax(0, 1fr); gap: 24px 48px; padding-block: 40px; }
.foot-brand { display: flex; flex-direction: column; gap: 12px; }
.foot-brand p { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 44ch; }
.foot-links { display: flex; flex-direction: column; gap: 10px; align-content: start; }
.foot-links a { color: var(--muted); font-size: 0.95rem; text-decoration: none; }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.foot-copy { grid-column: 1 / -1; margin: 0; padding-top: 20px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); }

/* Aviso de cookies */
.cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  max-width: 760px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
  padding: 18px 20px; display: flex; gap: 14px 20px; align-items: center; flex-wrap: wrap; font-size: 0.93rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1 1 320px; }
.cookie-banner .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.cookie-banner .btn { padding: 10px 16px; font-size: 0.9rem; }

/* ---------- Capa dinámica ---------- */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.btn.small { padding: 9px 14px; font-size: 0.88rem; }

/* Cabecera: menú + botón de tema */
.bar-end { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; }
.theme-toggle {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  transition: border-color .2s, transform .3s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.theme-toggle:active { transform: rotate(20deg) scale(.94); }
.icon-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .icon-sun { display: block; } :root:not([data-theme="light"]) .icon-moon { display: none; } }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }

/* Barra de progreso de lectura */
.site-header { position: sticky; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; pointer-events: none; }
.progress span { display: block; height: 100%; width: 100%; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

/* Volver arriba */
.to-top {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: pop-in .25s ease-out;
}
.to-top[hidden] { display: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* Portada: entrada suave y señales de confianza */
.hero-text > *, .shortcut { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; }
.hero-text > :nth-child(2) { animation-delay: .06s; }
.hero-text > :nth-child(3) { animation-delay: .12s; }
.hero-text > :nth-child(4) { animation-delay: .18s; }
.hero-text > :nth-child(5) { animation-delay: .24s; }
.shortcut { animation-delay: .2s; }
.trust { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 0.92rem; }
.trust li { display: inline-flex; align-items: center; gap: 7px; }
.trust .icon { color: var(--accent); }

/* Atajo del día */
.shortcut-actions { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; }
.keys kbd { transition: transform .12s, border-bottom-width .12s, background .12s, color .12s; }
.keys kbd.pressed { transform: translateY(3px); border-bottom-width: 1px; background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.keys.swap kbd, .keys.swap .plus { animation: key-in .38s cubic-bezier(.2,.7,.2,1) both; }
.keys.swap > :nth-child(3) { animation-delay: .05s; }
.keys.swap > :nth-child(5) { animation-delay: .1s; }
.shortcut-text.swap { animation: fade .35s ease-out both; }

/* Imágenes */
.card-img, .feature-img, .cover { display: block; overflow: hidden; border-radius: 12px; background: var(--accent-soft); }
.card-img img, .feature-img img, .cover img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; transition: transform .5s cubic-bezier(.2,.7,.2,1); }
.card:hover .card-img img, .feature:hover .feature-img img { transform: scale(1.04); }
.cover { margin-block: 4px 12px; }
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px 36px; align-items: center; }
.feature-body { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.feature-body > p:not(.meta) { color: var(--muted); margin: 0; font-size: 1.05rem; }

/* Buscador y filtros */
.finder { display: flex; flex-direction: column; gap: 14px; padding-block: 20px 4px; }
.search {
  display: flex; align-items: center; gap: 10px; max-width: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; padding-block: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  font: 500 0.88rem/1 var(--f-body); padding: 9px 14px; border-radius: 99px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted); transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* Tarjetas compactas */
.grid.compact { gap: 28px; padding-block: 24px 16px; }
.grid.compact .card { padding-block: 0 20px; gap: 10px; }
.card.is-hidden { display: none; }
.card.appear { animation: rise .45s cubic-bezier(.2,.7,.2,1) both; }
.badge-new { display: inline-block; margin-left: 10px; font-family: var(--f-mono); font-size: 0.66rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--on-accent); background: var(--accent); border-radius: 99px; padding: 2px 8px; vertical-align: middle; }
.more-wrap { display: flex; justify-content: center; padding-bottom: 40px; }
.empty { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 24px; margin-bottom: 56px; border: 1px dashed var(--key-edge); border-radius: 12px; color: var(--muted); }
.empty[hidden] { display: none; }
.empty p { margin: 0; }

/* Índice: sección activa y versión móvil */
.toc a.active { color: var(--accent); font-weight: 700; }
.toc-mobile { display: none; margin-block: 8px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.toc-mobile summary { cursor: pointer; padding: 14px 18px; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary::after { content: "+"; font-family: var(--f-mono); color: var(--accent); font-size: 1.2rem; transition: transform .2s; }
.toc-mobile[open] summary::after { transform: rotate(45deg); }
.toc-mobile ol { margin: 0; padding: 0 18px 16px 36px; display: flex; flex-direction: column; gap: 8px; }
.toc-mobile a { color: var(--ink); text-decoration: none; }
.toc-mobile a:hover { color: var(--accent); }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes key-in { from { opacity: 0; transform: translateY(-10px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }

/* ---------- Componentes interactivos de las guías ---------- */
:root { --good: #1f9d63; --bad: #d4453c; --good-soft: #e3f6ec; --bad-soft: #fde6e4; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --good: #4fd394; --bad: #ff8078; --good-soft: #15352a; --bad-soft: #3d1f1f; } }
:root[data-theme="dark"] { --good: #4fd394; --bad: #ff8078; --good-soft: #15352a; --bad-soft: #3d1f1f; }

/* Quiz ¿Real o estafa? */
.quiz { display: flex; flex-direction: column; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.quiz-msg { display: flex; flex-direction: column; gap: 6px; background: var(--paper); border-radius: 14px 14px 14px 4px; padding: 14px 16px; font-size: 1rem; line-height: 1.5; }
.quiz-from { font-family: var(--f-mono); font-size: 0.72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.quiz-options { display: none; gap: 10px; flex-wrap: wrap; }
.js-quiz .quiz-options { display: flex; }
.quiz-options button {
  flex: 1 1 140px; font: 700 0.95rem/1 var(--f-body); padding: 13px 16px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: border-color .2s, background .2s, transform .15s;
}
.quiz-options button:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.quiz-options button:disabled { cursor: default; opacity: .55; }
.quiz-options button.is-right { background: var(--good-soft); border-color: var(--good); color: var(--good); opacity: 1; }
.quiz-options button.is-wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); opacity: 1; }
.quiz-explain { margin: 0 !important; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); }
.js-quiz .quiz-explain { display: none; }
.js-quiz .quiz.answered .quiz-explain { display: block; animation: rise .35s ease-out both; }
.quiz.answered.right .quiz-explain { background: var(--good-soft); }
.quiz.answered.wrong .quiz-explain { background: var(--bad-soft); }
.quiz-result { font-weight: 700; }
.quiz.right .quiz-result { color: var(--good); }
.quiz.wrong .quiz-result { color: var(--bad); }
.quiz-score { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 20px; border-radius: 14px; background: var(--ink); color: var(--paper); }
.quiz-score[hidden] { display: none; }
.quiz-score strong { font-family: var(--f-display); font-size: 2.2rem; line-height: 1; }
.quiz-score p { margin: 0; flex: 1 1 220px; }

/* Tarjetas Mito o realidad */
.myth { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.myth + .myth { margin-top: 12px; }
.myth:hover { border-color: var(--accent); }
.myth[open] { box-shadow: var(--shadow); }
.myth summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 18px; }
.myth summary::-webkit-details-marker { display: none; }
.myth-q { font-weight: 700; font-size: 1.02rem; }
.myth-hint { flex-shrink: 0; font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); padding: 5px 10px; border: 1px solid var(--accent); border-radius: 99px; }
.myth[open] .myth-hint { display: none; }
.myth p { margin: 0 !important; padding: 0 18px 18px; animation: flip-in .4s cubic-bezier(.2,.7,.2,1) both; }
.verdict { display: inline-block; margin-right: 8px; font-family: var(--f-mono); font-size: 0.72rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 6px; }
.verdict.mito { background: var(--bad-soft); color: var(--bad); }
.verdict.realidad { background: var(--good-soft); color: var(--good); }

/* Lista de tareas con progreso */
.checklist { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 10px; }
.checklist li { margin: 0 !important; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.checklist label { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; }
.checklist input { appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 24px; height: 24px; margin-top: 2px; border: 2px solid var(--key-edge); border-radius: 7px; background: var(--surface); cursor: pointer; transition: background .2s, border-color .2s, transform .15s; display: grid; place-items: center; }
.checklist input::after { content: ""; width: 10px; height: 6px; border: solid var(--on-accent); border-width: 0 0 3px 3px; transform: rotate(-45deg) scale(0); margin-top: -3px; transition: transform .2s; }
.checklist input:checked { background: var(--good); border-color: var(--good); }
.checklist input:checked::after { transform: rotate(-45deg) scale(1); }
.checklist input:active { transform: scale(.9); }
.checklist li.done { border-color: var(--good); background: var(--good-soft); }
.checklist li.done .item-text { opacity: .75; }
.check-progress { display: flex; align-items: center; gap: 14px; margin-top: 1.1em; font-weight: 700; font-size: 0.95rem; }
.check-progress .track { flex: 1; height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.check-progress .fill { display: block; height: 100%; width: 0; background: var(--good); border-radius: 99px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.check-progress.complete { color: var(--good); }

/* Caja Pruébalo */
.try { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--key-edge); }
.try::before { content: "Pruébalo"; font-family: var(--f-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.try code { font-size: 1rem !important; background: var(--accent-soft); padding: 6px 10px !important; }
.try-actions { display: flex; gap: 8px; margin-left: auto; }
.try-actions a, .try-actions button { font: 700 0.85rem/1 var(--f-body); padding: 9px 12px; border-radius: 8px; border: 1px solid var(--accent); cursor: pointer; text-decoration: none; }
.try-actions a { background: var(--accent); color: var(--on-accent); }
.try-actions a:hover { background: var(--accent-hover); color: var(--on-accent); }
.try-actions button { background: transparent; color: var(--accent); }

@keyframes flip-in { from { opacity: 0; transform: perspective(600px) rotateX(-25deg); transform-origin: top; } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 960px) {
  .article-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .toc-mobile { display: block; }
}
@media (max-width: 760px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-block: 40px 36px; gap: 28px; }
  .foot { grid-template-columns: minmax(0, 1fr); }
  .feature { grid-template-columns: minmax(0, 1fr); }
  .nav { gap: 4px 16px; }
  .wrap { padding-inline: 16px; }
}
