/* ==========================================================================
   Otra Era. Mockups fase 1.
   Tokens de diseño: única fuente de verdad visual. En Astro pasarán a @theme.
   Sin radios, sin sombras. El relieve lo dan la línea, el color y el tamaño.
   ========================================================================== */
/* Fuentes propias (sin Google Fonts: más rápido y sin enviar la IP de nadie a terceros). Licencia OFL. */
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap; src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2"); }
@font-face { font-family: "Figtree"; font-style: italic; font-weight: 300 900; font-display: swap; src: url("fonts/figtree-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 700; font-display: swap; src: url("fonts/fraunces-latin-wght-italic.woff2") format("woff2"); }
@font-face { font-family: "Gloock"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/gloock-latin-400-normal.woff2") format("woff2"); }
:root {
  --ink: #1d1a17;
  --ink-soft: #4d4842;
  --ink-mute: #8a847b;
  --paper: #ffffff;
  --cream: #f7f4ee;
  --line: rgba(29, 26, 23, 0.16);
  --line-strong: rgba(29, 26, 23, 0.45);

  --red: #e07a77; /* Ronda 5: rojo del fallo del juego */
  --red-2: #c95f5c;
  --red-3: #f0b4b2;
  --red-tint: #f4e4e3;
  --green: #6fbf86; /* Ronda 5: verde del acierto del juego */
  --on-color: #1d1a17; /* Texto sobre rojo y verde: estos tonos claros piden tinta, no blanco (contraste AA) */
  --green-2: #cbecd1;
  --green-tint: #e6f5e9;
  --ochre: #e0b35a;

  --font-body: "Figtree", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Gloock", serif; /* Elegida en la ronda 5 */
  --display-weight: 400;
  --display-scale: .92;

  --max: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
  --header-h: 64px;
  --gap-grid: clamp(14px, 1.8vw, 24px); /* Aire entre módulos (ronda 5) */
}

/* Modo oscuro por bloque: cualquier sección con .dark invierte los tokens */
.dark {
  --ink: #f3eee4;
  --ink-soft: #cfc8ba;
  --ink-mute: #8f887c;
  --paper: #121110;
  --cream: #1c1a17;
  --line: rgba(243, 238, 228, 0.16);
  --line-strong: rgba(243, 238, 228, 0.45);
  --red-tint: #3a1f1e;
  --green-tint: #17291c;
  --green-2: #244a30;
  background: var(--paper);
  color: var(--ink);
}

/* Candidatas de titular (barra de mockup). Ninguna de feria: serifas con carácter histórico. */
html[data-display="gloock"] { --font-display: "Gloock", serif; --display-weight: 400; --display-scale: .92; }
html[data-display="grenze"] { --font-display: "Grenze", serif; --display-weight: 500; --display-scale: 1; }
html[data-display="cinzel"] { --font-display: "Cinzel", serif; --display-weight: 600; --display-scale: .8; }
html[data-display="fraunces"] { --font-display: "Fraunces", serif; --display-weight: 500; --display-scale: .94; }
html[data-display="cormorant"] { --font-display: "Cormorant Garamond", serif; --display-weight: 600; --display-scale: 1.06; }
html[data-display="gotisch"] { --font-display: "Grenze Gotisch", serif; --display-weight: 500; --display-scale: 1.08; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.1; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------- Tipografía ---------- */
.display { font-family: var(--font-display); font-weight: var(--display-weight); line-height: .95; }
/* Ronda 5: tamaño que cabe en una línea en escritorio; si tiene que partirse, se reparte sin palabra huérfana */
.display-xl { font-size: calc(clamp(2.6rem, 6.2vw, 5.8rem) * var(--display-scale)); line-height: .9; }
h1, h2, h3, .display { text-wrap: balance; }
.display-l  { font-size: calc(clamp(2.4rem, 5.4vw, 4.8rem) * var(--display-scale)); }
.display-m  { font-size: calc(clamp(1.9rem, 3.4vw, 3rem) * var(--display-scale)); }
.display-s  { font-size: calc(clamp(1.45rem, 2.2vw, 1.9rem) * var(--display-scale)); }
.eyebrow { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); }
.lead { font-size: clamp(1.05rem, 1.5vw, 1.25rem); color: var(--ink-soft); max-width: 60ch; }
.muted { color: var(--ink-mute); }
.small { font-size: .9rem; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(72px, 10vw, 144px); }
.section-tight { padding-block: clamp(32px, 5vw, 64px); }

/* ---------- Hilo conductor: línea fina con fases ---------- */
.thread { position: relative; padding-left: 28px; }
.thread::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.thread > li { position: relative; padding-bottom: 18px; }
.thread > li::before { content: ""; position: absolute; left: -25px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); }
.thread > li.is-on::before { background: var(--green); border-color: var(--green); }
.thread > li.is-bad::before { background: var(--red); border-color: var(--red); }

.timeline-h { display: flex; overflow-x: auto; scrollbar-width: none; }
.timeline-h::-webkit-scrollbar { display: none; }
.timeline-h .tl-node { position: relative; flex: 1 0 auto; min-width: 140px; padding-top: 18px; font-size: .85rem; white-space: nowrap; }
.timeline-h .tl-node::before { content: ""; position: absolute; top: 4px; left: 0; right: 0; height: 1px; background: var(--line-strong); }
.timeline-h .tl-node::after { content: ""; position: absolute; top: 0; left: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--paper); border: 1.5px solid var(--ink); }
.timeline-h .tl-node strong { display: block; font-weight: 600; }
.timeline-h .tl-node span { color: var(--ink-mute); }
.timeline-h .tl-node.is-red::after { background: var(--red); border-color: var(--red); }
.timeline-h .tl-node.is-green::after { background: var(--green); border-color: var(--green); }

/* ==========================================================================
   Botón único de Otra Era: .ob
   Una forma (píldora), una letra (Figtree 650), una animación (la ola).
   Colores:   .ob-red (principal) · .ob-ink · .ob-cream (sobre negro) · .ob-green (avanzar) · .ob-line (secundario)
   Tamaños:   .ob-sm (40) · normal (48) · .ob-lg (60) · .ob-full (ancho completo)
   Flecha:    un <svg class="arrow"> hijo directo se convierte en el círculo de la derecha.
   Anfitrión: una tarjeta-enlace con .ob-host dispara la ola de la .ob que lleva dentro.

   La ola: una sola capa cruza de izquierda a derecha con el borde en una única curva, de arriba
   abajo. Al salir, la ola sigue hacia la derecha y se va (mock.js añade .ob-out); sin JS, se
   retira por donde vino.
   ========================================================================== */
.ob {
  --ob-h: 48px; --ob-px: 22px; --ob-fs: 1rem; --ob-ic: 36px; --ob-gap: 12px;
  --ob-bg: var(--red); --ob-fg: #1d1a17; --ob-bd: transparent;
  --ob-fill: #1d1a17; --ob-hfg: #f3eee4;
  --ob-icbg: #1d1a17; --ob-icfg: #f3eee4; --ob-hicbg: var(--red); --ob-hicfg: #1d1a17;
  --ob-ring: #e0b35a;
  --ob-ease: cubic-bezier(.7, 0, .25, 1);
  --ob-wR: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 100' preserveAspectRatio='none'%3E%3Cpath d='M0 0H4C19 25 19 75 4 100H0Z'/%3E%3C/svg%3E");
  --ob-wL: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 100' preserveAspectRatio='none'%3E%3Cpath d='M20 0H4C19 25 19 75 4 100H20Z'/%3E%3C/svg%3E");
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ob-gap);
  height: var(--ob-h); padding: 0 var(--ob-px); border: 0; border-radius: 999px;
  background: var(--ob-bg); color: var(--ob-fg); box-shadow: inset 0 0 0 1.5px var(--ob-bd);
  font-family: var(--font-body); font-weight: 650; font-size: var(--ob-fs); letter-spacing: -.005em; line-height: 1;
  white-space: nowrap; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: color .22s ease .16s, box-shadow .3s ease .1s, transform .12s ease;
}
/* Con flecha: el círculo queda a la misma distancia del borde arriba, abajo y a la derecha */
.ob:has(> .arrow) { padding-right: calc((var(--ob-h) - var(--ob-ic)) / 2); }
/* La ola: una sola capa (::after); su borde es una única curva de arriba abajo. ::before no se usa */
.ob::before { content: none; }
.ob::after {
  content: ""; position: absolute; z-index: -1; top: 0; bottom: 0; left: -20px; width: calc(100% + 40px);
  -webkit-mask: var(--ob-wL) left 0 top 0 / 20px 100% no-repeat, linear-gradient(#000 0 0) center / calc(100% - 38px) 100% no-repeat, var(--ob-wR) right 0 top 0 / 20px 100% no-repeat;
          mask: var(--ob-wL) left 0 top 0 / 20px 100% no-repeat, linear-gradient(#000 0 0) center / calc(100% - 38px) 100% no-repeat, var(--ob-wR) right 0 top 0 / 20px 100% no-repeat;
  background: var(--ob-fill); transform: translateX(-100%); pointer-events: none;
  transition: transform .62s var(--ob-ease);
}
/* Entrar: hover, foco de teclado o la tarjeta que lo contiene */
.ob:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"]), .ob-host:is(:hover, :focus-visible) .ob { color: var(--ob-hfg); box-shadow: inset 0 0 0 1.5px var(--ob-fill); }
.ob:is(:hover, :focus-visible):not(:disabled, [aria-disabled="true"])::after, .ob-host:is(:hover, :focus-visible) .ob::after { transform: translateX(0); }
/* Salir hacia la derecha (mock.js) */
.ob.ob-out::after { animation: ob-exit .62s var(--ob-ease) both; }
.ob.ob-snap::after { transition: none !important; }
@keyframes ob-exit { from { transform: translateX(0); } to { transform: translateX(100%); } }
/* Flecha en círculo */
.ob > .arrow { box-sizing: border-box; flex: none; width: var(--ob-ic); height: var(--ob-ic); padding: calc(var(--ob-ic) * .27); border-radius: 50%; background: var(--ob-icbg); color: var(--ob-icfg); overflow: visible; transition: background-color .22s ease .16s, color .22s ease .16s; }
.ob > .arrow :is(use, path) { transition: transform .4s var(--ob-ease); }
.ob:is(:hover, :focus-visible) > .arrow, .ob-host:is(:hover, :focus-visible) .ob > .arrow { background: var(--ob-hicbg); color: var(--ob-hicfg); }
.ob:is(:hover, :focus-visible) > .arrow :is(use, path), .ob-host:is(:hover, :focus-visible) .ob > .arrow :is(use, path) { transform: translateX(3px); }
.ob:active:not(:disabled) { transform: scale(.97); }
.ob:focus-visible { outline: 2px solid var(--ob-ring); outline-offset: 3px; }
.ob:disabled, .ob[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
/* Colores (.ob-red es el de serie) */
.ob-ink { --ob-bg: #1d1a17; --ob-fg: #f3eee4; --ob-fill: var(--red); --ob-hfg: #1d1a17; --ob-icbg: #f3eee4; --ob-icfg: #1d1a17; --ob-hicbg: #1d1a17; --ob-hicfg: #f3eee4; }
.ob-cream { --ob-bg: #f3eee4; --ob-fg: #1d1a17; --ob-fill: var(--red); --ob-hfg: #1d1a17; --ob-icbg: #1d1a17; --ob-icfg: #f3eee4; --ob-hicbg: #1d1a17; --ob-hicfg: #f3eee4; }
.ob-green { --ob-bg: var(--green); --ob-fg: #1d1a17; --ob-fill: #1d1a17; --ob-hfg: #f3eee4; --ob-icbg: #1d1a17; --ob-icfg: #f3eee4; --ob-hicbg: var(--green); --ob-hicfg: #1d1a17; }
.ob-line { --ob-bg: transparent; --ob-fg: var(--ink); --ob-bd: var(--line-strong); --ob-fill: var(--ink); --ob-hfg: var(--paper); --ob-icbg: var(--ink); --ob-icfg: var(--paper); --ob-hicbg: var(--red); --ob-hicfg: #1d1a17; }
/* Sobre negro un relleno oscuro desaparecería: se llena de crema con la ola de tinta delante */
.dark .ob-red { --ob-fill: #f3eee4; --ob-hfg: #1d1a17; --ob-hicbg: #1d1a17; --ob-hicfg: #f3eee4; }
.dark .ob-green { --ob-fill: #f3eee4; --ob-hfg: #1d1a17; --ob-hicbg: #1d1a17; --ob-hicfg: #f3eee4; }
.dark .ob-ink { --ob-bg: #f3eee4; --ob-fg: #1d1a17; --ob-icbg: #1d1a17; --ob-icfg: #f3eee4; }
/* Tamaños */
.ob-sm { --ob-h: 40px; --ob-px: 16px; --ob-fs: .9rem; --ob-ic: 30px; --ob-gap: 10px; }
.ob-lg { --ob-h: 60px; --ob-px: 30px; --ob-fs: 1.15rem; --ob-ic: 46px; --ob-gap: 16px; }
.ob-full { display: flex; width: 100%; }
.ob-full:has(> .arrow) { justify-content: space-between; padding-left: calc(var(--ob-px) + 4px); }
/* Solo icono (cerrar): círculo del alto del botón */
.ob-icon { width: var(--ob-h); padding: 0 !important; }
.ob-icon > svg:not(.arrow) { width: 16px; height: 16px; flex: none; }
/* Progreso del avance automático: un velo suave que crece; el texto sigue legible */
.ob > .ob-prog { position: absolute; z-index: -2; left: 0; top: 0; bottom: 0; width: calc(var(--prog, 0) * 100%); background: color-mix(in srgb, var(--ob-fg) 13%, transparent); pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .ob::after { transform: none !important; opacity: 0; transition: opacity .2s; animation: none !important; -webkit-mask: none; mask: none; }
  .ob:is(:hover, :focus-visible)::after, .ob-host:is(:hover, :focus-visible) .ob::after { opacity: 1; }
  .ob, .ob > .arrow { transition-duration: .15s; transition-delay: 0s; }
}

/* ---------- Etiquetas ---------- */
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; font-size: .74rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; border: 1px solid var(--line-strong); background: transparent; }
.pill-red { border-color: var(--red); color: var(--red); }
.pill-green { border-color: var(--green); color: var(--green); }
.pill-ink, .pill.is-active { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header .wrap { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand svg { width: 34px; height: 34px; }
.brand .brand-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(1.7rem * var(--display-scale)); line-height: 1; }
/* Menú compacto (nomonkey): grupo cerrado, el activo se nota */
.nav { position: relative; isolation: isolate; display: flex; gap: 2px; margin-left: auto; margin-right: auto; padding: 3px; border: 1px solid var(--line-strong); font-weight: 500; font-size: .86rem; }
.nav a { position: relative; z-index: 1; padding: 7px 14px; line-height: 1; transition: color .2s ease; }
.nav a.is-hot { color: var(--paper); }
/* Sin JS, el activo se marca solo con subrayado; con JS, el blanco sigue al indicador negro */
.nav a.is-current:not(.is-hot) { text-decoration: underline; text-underline-offset: 4px; }
.nav .nav-ind { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 0; width: 0; background: var(--ink); opacity: 0; transition: left .35s cubic-bezier(.2,.8,.2,1), width .35s cubic-bezier(.2,.8,.2,1), opacity .2s ease; }
.nav .nav-ind.is-on { opacity: 1; }
.nav .soon { color: var(--ink-mute); font-size: .64rem; margin-left: 4px; }
.header-actions { margin-left: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 40px; height: 40px; display: inline-grid; place-items: center; border: 1px solid var(--line-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.burger { display: none; }
@media (max-width: 900px) { .nav { display: none; } .burger { display: inline-grid; } .header-actions .ob { display: none; } }
.mobile-menu { display: grid; gap: 0; padding: 8px var(--gutter) 20px; border-top: 1px solid var(--line); background: var(--paper); }
.mobile-menu[hidden] { display: none; }
.mobile-menu > a { padding: 14px 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(1.8rem * var(--display-scale)); border-bottom: 1px solid var(--line); }
.mobile-menu > a.ob { margin-top: 16px; border-bottom: 0; font-family: var(--font-body); }

/* ---------- Bandas y cortes ---------- */
.band { position: relative; }
.band-cream { background: var(--cream); }
.band-green { background: var(--green-2); }
.band-green-tint { background: var(--green-tint); }
.band-red { background: var(--red); color: var(--on-color); }
.band-red-tint { background: var(--red-tint); }
.cut { display: block; width: 100%; height: 48px; }
.cut-top { margin-bottom: -1px; }
.cut-bottom { margin-top: -1px; transform: scaleY(-1); }
@media (max-width: 700px) { .cut { height: 30px; } }

/* ---------- Placeholders de imagen (texturas) ---------- */
.ph { position: relative; overflow: hidden; background: var(--cream); aspect-ratio: 16 / 10; }
.ph svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ph .ph-label { position: absolute; left: 12px; bottom: 10px; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: #1d1a17; background: rgba(255,255,255,.85); padding: 4px 8px; }
.ph-square { aspect-ratio: 1; } .ph-tall { aspect-ratio: 4 / 5; } .ph-wide { aspect-ratio: 21 / 9; }

/* ---------- Bloques de color (sustituyen a la heráldica) ---------- */
.block { display: flex; flex-direction: column; justify-content: space-between; padding: 22px 24px; min-height: 240px; color: var(--ink); }
.block .n { font-size: .82rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.block .n b { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.6rem; margin-right: 8px; }
.block.has-art { position: relative; overflow: hidden; }
.block.has-art .fl { position: absolute; inset: 0; }
.block.has-art .fl::before, .block.has-art .fl::after { content: ""; position: absolute; width: 70%; aspect-ratio: 1; border-radius: 50%; filter: blur(34px); opacity: .9; animation: drift 16s ease-in-out infinite alternate; }
.block.has-art .fl::before { left: -20%; top: -20%; background: var(--fa, #e07a77); }
.block.has-art .fl::after { right: -20%; bottom: -25%; background: var(--fb, #46699a); animation-delay: -8s; }
.block.has-art .art { position: absolute; right: 6%; top: 16%; width: 38%; height: auto; }
.block.has-art > * { position: relative; }
.block.has-art .fl, .block.has-art .art { z-index: 0; }
.block.has-art .n, .block.has-art .t, .block.has-art p, .block.has-art div { z-index: 1; }
.block .t { font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(clamp(1.6rem, 2.4vw, 2.2rem) * var(--display-scale)); line-height: 1; }
.block p { margin: 14px 0 0; font-size: .95rem; max-width: 30ch; color: inherit; opacity: .85; }
.block-year { display: grid; place-items: center; aspect-ratio: 1; width: 92px; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.35rem; line-height: 1; letter-spacing: -.01em; text-align: center; }
.block-year.sm { width: 48px; font-size: .74rem; }
.bk-ink { background: #1d1a17; color: #f3eee4; } .bk-red { background: var(--red); color: var(--on-color); } .bk-green { background: var(--green); color: var(--on-color); }
.bk-sand { background: #efe7d6; } .bk-tint-red { background: #f4e4e3; } .bk-tint-green { background: #e6f5e9; } .bk-cream { background: #f7f4ee; } .bk-sky { background: #dbe7f3; } .bk-ochre { background: #e9d4a3; } .bk-plum { background: #683d57; color: #f3eee4; }
.blocks { display: grid; gap: var(--gap-grid); }
.blocks-3 { grid-template-columns: repeat(3, 1fr); }
.blocks-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .blocks-3, .blocks-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .blocks-3, .blocks-4 { grid-template-columns: 1fr; } .block { min-height: 0; } }

/* Fluido: manchas de color que se mueven (CSS). En producción, isla WebGL opcional con respeto a reduced-motion. */
.fluid { position: relative; overflow: hidden; background: #efe7d6; }
.fluid::before, .fluid::after, .fluid > .blob { content: ""; position: absolute; width: 72%; aspect-ratio: 1; border-radius: 42% 58% 55% 45% / 50% 40% 60% 50%; filter: blur(38px); opacity: .85; animation: drift 14s ease-in-out infinite alternate, morph 11s ease-in-out infinite alternate; }
.fluid::before { left: -15%; top: -10%; background: radial-gradient(circle at 40% 40%, #f0b4b2, #e07a77 60%, transparent 72%); }
.fluid::after { right: -20%; bottom: -20%; background: radial-gradient(circle at 60% 60%, #cbecd1, #6fbf86 60%, transparent 72%); animation-delay: -7s, -4s; animation-duration: 18s, 13s; }
.fluid > .blob { left: 30%; top: 30%; width: 55%; background: radial-gradient(circle at 50% 50%, #f0c66a, #e0b35a 55%, transparent 72%); opacity: .7; animation-delay: -3s, -9s; animation-duration: 21s, 9s; }
@keyframes morph { 0% { border-radius: 42% 58% 55% 45% / 50% 40% 60% 50%; } 50% { border-radius: 60% 40% 45% 55% / 45% 60% 40% 55%; } 100% { border-radius: 50% 50% 40% 60% / 60% 45% 55% 40%; } }
.fluid.dark { background: #121110; }
.fluid.dark::before { background: radial-gradient(circle at 40% 40%, #e07a77, #683d57 60%, transparent 72%); }
.fluid.dark::after { background: radial-gradient(circle at 60% 60%, #6fbf86, #46699a 60%, transparent 72%); }
@keyframes drift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(12%, 18%) scale(1.15); } 100% { transform: translate(-8%, 6%) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .fluid::before, .fluid::after, .fluid > .blob { animation: none; } }

/* ---------- Cards e índice ---------- */
.card { border: 1px solid var(--line); background: var(--paper); overflow: hidden; }
.card-body { padding: 20px; }
.card h3 { font-size: 1.15rem; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: .82rem; color: var(--ink-mute); }

.index { border-top: 1px solid var(--line-strong); }
.index-row { display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 20px; padding: 18px 8px; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.index-row:hover { background: var(--ink); color: var(--paper); }
.index-row:hover .c, .index-row:hover .d, .index-row:hover .n { color: inherit; }
.index-row .n { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.4rem; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.index-row .t { font-weight: 600; font-size: 1.1rem; }
.index-row .c { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.index-row .d { font-size: .82rem; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .index-row { grid-template-columns: 1fr auto; gap: 6px 12px; } .index-row .n { display: none; } .index-row .c { grid-column: 1; } .index-row .d { grid-row: 1; grid-column: 2; } }

.badge-review { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border: 1px solid var(--line-strong); font-size: .82rem; background: var(--paper); color: var(--ink); }
.badge-review .seal { width: 26px; height: 26px; background: #1d1a17; color: #fff; display: grid; place-items: center; }
.badge-review .seal svg { width: 14px; height: 14px; }
.badge-review b { font-weight: 600; }

/* ---------- Tarjetas de simulador (Brandlos) ---------- */
.sim-card { position: relative; width: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 0 28px 0 0; overflow: hidden; border: 1px solid var(--line); background: var(--paper); transition: background .2s ease; }
.sim-card .block-year { align-self: stretch; height: auto; aspect-ratio: auto; width: 120px; font-size: 1.6rem; }
.sim-card:hover { background: var(--cream); }
.sim-card .tex { position: absolute; inset: 0; z-index: 0; }
.sim-card > div { min-width: 0; }
.sim-card .tex svg { width: 100%; height: 100%; }
.sim-card > * { position: relative; z-index: 1; }
.sim-card h3 { font-size: 1.5rem; line-height: 1.15; }
.sim-card .meta { margin-top: 6px; }
@media (max-width: 700px) { .sim-card { grid-template-columns: auto 1fr; padding: 0 16px 16px 0; gap: 14px; } .sim-card .block-year { width: 84px; font-size: 1.1rem; } .sim-card .meta span:nth-child(2) { display: none; } .sim-card h3 { font-size: 1.2rem; } .sim-card .btn { grid-column: 1 / -1; justify-content: center; margin-left: 16px; } }

/* ---------- Footer: escena en parallax (nomonkey) y bloque negro ---------- */
.site-footer { margin-top: clamp(56px, 8vw, 120px); overflow: hidden; }
/* Ronda 6: la escena de siluetas en parallax se retira; el footer es solo el bloque negro */
.footer-dark { background: #121110; color: #f3eee4; }
.footer-dark .footer-top { padding-top: 48px; }
.footer-top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; padding-top: 64px; }
.footer-top h4 { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 14px; color: var(--ink-mute); }
.footer-top li { margin-bottom: 8px; font-size: .95rem; }
.footer-top li a:hover { color: var(--red-3); }
.footer-search { display: flex; align-items: center; border: 1px solid var(--line-strong); max-width: 320px; margin-top: 18px; }
.footer-search input { border: 0; outline: 0; flex: 1; font: inherit; background: transparent; color: inherit; padding: 10px 14px; min-width: 0; }
.footer-search button { width: 42px; height: 42px; background: var(--red); color: var(--on-color); display: grid; place-items: center; }
.footer-search button svg { width: 16px; height: 16px; }
.footer-tape { display: none; margin-top: 40px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; }
.tape-track { display: flex; width: max-content; animation: tape 48s linear infinite; }
.tape-track span { display: inline-flex; align-items: baseline; gap: 10px; padding: 12px 28px; font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(clamp(1.2rem, 2vw, 1.8rem) * var(--display-scale)); line-height: 1; white-space: nowrap; border-right: 1px solid var(--line); color: var(--ink-mute); }
.tape-track span b { font-weight: inherit; color: var(--ink); }
.tape-track span:nth-child(5n) b, .tape-track span:nth-child(5n) { color: var(--red); }
@keyframes tape { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .tape-track { animation: none; } }
.footer-legal { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .78rem; color: var(--ink-mute); padding: 16px 0 24px; border-top: 1px solid var(--line); }
@media (max-width: 900px) { .footer-top { grid-template-columns: 1fr 1fr; } .footer-top > div:first-child { grid-column: 1 / -1; } .site-footer { min-height: 0; } }

/* ---------- CTA in-text (tiller / mobilitylab): bloque con presencia ---------- */
.cta-block { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 36px 40px; margin: 2.2em 0; background: var(--deep-red); color: #f3eee4; }
.cta-block .deco { position: absolute; right: -60px; top: -60px; width: 320px; height: 320px; pointer-events: none; opacity: .9; }
.cta-block .deco circle { fill: none; stroke: var(--red); stroke-width: 1.2; }
.cta-block .k { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: #8f887c; margin-bottom: 10px; }
.cta-block h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(clamp(1.8rem, 3vw, 2.8rem) * var(--display-scale)); line-height: 1; max-width: 18ch; }
.cta-block p { margin: 10px 0 0; color: #cfc8ba; max-width: 44ch; }
.cta-block .go { position: relative; display: inline-flex; align-items: center; background: var(--red); color: var(--on-color); font-weight: 700; padding-left: 20px; white-space: nowrap; }
.cta-block .go i { display: grid; place-items: center; width: 52px; height: 52px; margin-left: 20px; border-left: 1px solid rgba(255,255,255,.35); }
.cta-block .go i svg { width: 20px; height: 20px; }
.cta-block.light { background: var(--cream); color: var(--ink); }
.cta-block.light .k { color: var(--ink-mute); } .cta-block.light p { color: var(--ink-soft); }
.cta-block.light .deco { opacity: .6; } .cta-block.light .deco path { fill: none; stroke: var(--green); stroke-width: 1; }
.cta-block.light .go { background: var(--ink); }
@media (max-width: 700px) { .cta-block { grid-template-columns: 1fr; padding: 24px 20px; } .cta-block .deco { width: 220px; height: 220px; } }

/* ---------- Isla flotante de filtros (Pichot) ---------- */
.island { position: sticky; bottom: 18px; z-index: 30; display: flex; justify-content: center; pointer-events: none; }
.island > div { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--red); color: var(--on-color); font-size: .9rem; font-weight: 600; }
.island button { padding: 8px 12px; border: 1px solid rgba(29,26,23,.45); color: var(--on-color); }
.island button.is-on { background: #1d1a17; color: #f3eee4; border-color: #1d1a17; }
.island .count { padding: 8px 12px; background: #1d1a17; color: #f3eee4; }

/* ---------- Barra de mockup (no es diseño final) ---------- */
.mockbar { position: fixed; left: 14px; bottom: 14px; z-index: 100; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 12px; background: #1d1a17; color: #fff; font-size: .72rem; font-family: var(--font-body); }
.mockbar span { opacity: .7; margin-right: 4px; }
.mockbar button { padding: 6px 10px; border: 1px solid rgba(255,255,255,.3); color: #fff; font-size: .72rem; }
.mockbar button.is-on { background: #fff; color: #1d1a17; border-color: #fff; }
.mockbar a { padding: 6px 10px; background: #e07a77; color: #1d1a17; }
@media (max-width: 700px) { .mockbar span { display: none; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 200; }

/* ---------- Utilidades ---------- */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.flex { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; } .mt-5 { margin-top: 64px; }
.mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 40px; }
.center { text-align: center; }
.measure { max-width: 68ch; }
.show-mobile { display: none; }
@media (max-width: 700px) { .hide-mobile { display: none !important; } .show-mobile { display: block; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Grano sobre el difuminado, para que el fondo parezca impreso y no un degradado de pantalla */
.grain::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .22; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* ---------- Túnel G (ronda 5): la marca sube desde el suelo, de fuera adentro ----------
   Mismo dibujo que #logo-mark, en línea para poder animar cada arco.
   .tunel.is-in  sube una vez (carga de página, hover del logo)
   .tunel.is-loop sube, aguanta y se hunde en bucle (pantallas de carga) */
.tunel { overflow: hidden; }
.tunel .a1, .tunel .a2, .tunel .a3 { transform-box: view-box; }
.tunel.is-in .a1, .tunel.is-in .a2, .tunel.is-in .a3 { animation: tunel-in .9s cubic-bezier(.2,.9,.25,1) both; }
.tunel.is-in .a2 { animation-delay: .14s; }
.tunel.is-in .a3 { animation-delay: .32s; }
@keyframes tunel-in { from { transform: translateY(40px); } to { transform: translateY(0); } }
.tunel.is-loop .a1, .tunel.is-loop .a2, .tunel.is-loop .a3 { animation: tunel-loop 2.4s infinite both; }
.tunel.is-loop .a2 { animation-delay: .2s; }
.tunel.is-loop .a3 { animation-delay: .45s; }
@keyframes tunel-loop {
  0% { transform: translateY(40px); animation-timing-function: cubic-bezier(.2,.9,.25,1); }
  30%, 70% { transform: translateY(0); animation-timing-function: cubic-bezier(.65,0,.9,.35); }
  92%, 100% { transform: translateY(40px); }
}
.brand:hover .tunel .a1, .brand:hover .tunel .a2, .brand:hover .tunel .a3,
.brand:focus-visible .tunel .a1, .brand:focus-visible .tunel .a2, .brand:focus-visible .tunel .a3 { animation: tunel-in .7s cubic-bezier(.2,.9,.25,1) both; }
.brand:hover .tunel .a2, .brand:focus-visible .tunel .a2 { animation-delay: .1s; }
.brand:hover .tunel .a3, .brand:focus-visible .tunel .a3 { animation-delay: .22s; }

/* Pantalla de carga: panel rojo, túnel en bucle, línea de progreso; al terminar el telón se parte */
.oe-loader { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; color: #f3eee4; pointer-events: none; }
.oe-loader .half { position: absolute; left: 0; right: 0; height: 50.5%; background: var(--red); transition: transform .7s cubic-bezier(.7,0,.2,1); }
.oe-loader .half.t { top: 0; } .oe-loader .half.b { bottom: 0; }
.oe-loader .in { position: relative; display: grid; justify-items: center; gap: 22px; transition: opacity .25s ease; }
.oe-loader .tunel { width: 120px; height: 120px; }
.oe-loader .tunel .a3 { fill: #1d1a17; }
.oe-loader .bar { position: relative; width: 220px; height: 1px; background-image: linear-gradient(90deg, currentColor 50%, transparent 0); background-size: 6px 1px; }
.oe-loader .bar i { position: absolute; left: 0; top: -.5px; height: 2px; width: 100%; background: currentColor; transform-origin: left; animation: oe-bar var(--oe-ms, 1400ms) linear both; }
.oe-loader .lbl { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }
@keyframes oe-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.oe-loader.is-open .half.t { transform: translateY(-100%); }
.oe-loader.is-open .half.b { transform: translateY(100%); }
.oe-loader.is-open .in { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .tunel .a1, .tunel .a2, .tunel .a3 { animation: none !important; }
  .oe-loader .half { transition: none; }
}

/* ---------- Oscuros de la misma gama (ronda 5) ----------
   Fondo muy oscuro teñido del color vivo y el color vivo encima: coral sobre granate, verde sobre verde noche.
   Se combinan con .dark (heredan los tokens oscuros) o como bloque suelto (.bk-deep-*). */
:root { --deep-red: #35120f; --deep-red-2: #4a1a16; --deep-green: #0f2618; --deep-green-2: #173622; }
.dark.dark-red { --paper: var(--deep-red); --cream: var(--deep-red-2); --ink: #f6e3e1; --ink-soft: #f0b4b2; --ink-mute: #c98c89; --line: rgba(224,122,119,.22); --line-strong: rgba(224,122,119,.5); background: var(--deep-red); }
.dark.dark-green { --paper: var(--deep-green); --cream: var(--deep-green-2); --ink: #e3f3e7; --ink-soft: #a9dbb6; --ink-mute: #7fb38f; --line: rgba(111,191,134,.22); --line-strong: rgba(111,191,134,.5); background: var(--deep-green); }
.dark-red .display, .dark-red h1, .dark-red h2, .dark-red .eyebrow { color: var(--red); }
.dark-green .display, .dark-green h1, .dark-green h2, .dark-green .eyebrow { color: var(--green); }
.bk-deep-red { background: var(--deep-red); color: var(--red); }
.bk-deep-green { background: var(--deep-green); color: var(--green); }
.bk-deep-red p, .bk-deep-green p { color: #f3eee4; opacity: .8; }

/* En el simulador, en móvil, la barra de mockup no debe tapar los botones fijos del juego */
@media (max-width: 700px) { body[data-page="simuladores"] .mockbar { display: none; } }

/* ==========================================================================
   Prefooter de toda la web (ronda 6). Dos bloques apilados encima del footer:
   1) «La pregunta»: difuminado con grano, siete portadas en ventanas de puerta y botón Puerta suave.
      Su parte baja se funde en el negro del footer, sin costura.
   2) «El túnel»: los arcos del logo a escala de pared, sobre el negro del footer, suben al
      entrar en pantalla; el botón «Pasa» vive en el arco rojo y las patas de los arcos
      llegan hasta el footer, que queda como el otro lado de la puerta.
   Lo inyecta mock.js (o lo pinta dentro de [data-oe-prefooter]). Ritmo vertical: --oe-gap.
   ========================================================================== */
:root { --oe-gap: clamp(64px, 9vw, 128px); --oe-night: #121110; }

/* 1 · La pregunta */
.oe-pf { --ink: #1d1a17; position: relative; isolation: isolate; overflow: hidden; margin-top: var(--oe-gap); padding-block: var(--oe-gap) calc(var(--oe-gap) * 1.9); color: #1d1a17; text-align: center; }
.oe-pf .oe-pf-gr { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.oe-pf .oe-pf-fade { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: calc(var(--oe-gap) * 2.6); background: linear-gradient(to bottom, rgba(18,17,16,0), rgba(18,17,16,.12) 25%, rgba(18,17,16,.45) 50%, rgba(18,17,16,.82) 75%, var(--oe-night)); pointer-events: none; }
.oe-pf > .wrap { position: relative; z-index: 2; }
.oe-pf .oe-pf-eb { color: #4d4842; }
.oe-pf .oe-pf-t { margin: 12px auto 16px; max-width: 14ch; color: #1d1a17; font-size: calc(clamp(2.8rem, 7vw, 6.6rem) * var(--display-scale)); line-height: .9; }
.oe-pf .oe-pf-lead { margin: 0 auto; max-width: 40ch; color: #4d4842; font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.oe-pf-doors { display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(10px, 1.4vw, 18px); margin: clamp(36px, 4vw, 56px) 0 clamp(36px, 4vw, 52px); }
.oe-pf-doors a { display: grid; gap: 10px; justify-items: center; align-content: start; width: clamp(96px, 10vw, 136px); font-size: .78rem; font-weight: 600; line-height: 1.2; color: #1d1a17; text-wrap: balance; }
.oe-pf-doors .win { display: block; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; border-radius: 999px 999px 6px 6px; box-shadow: 0 0 0 0 #1d1a17; transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .3s; }
.oe-pf-doors .win svg { display: block; width: 100%; height: 100%; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.oe-pf-doors a:is(:hover, :focus-visible) .win { transform: translateY(-10px); box-shadow: 0 0 0 3px #1d1a17; }
.oe-pf-doors a:hover .win svg { transform: scale(1.08); }
.oe-pf-doors a:focus-visible { outline: none; }
.oe-pf-doors a > span:last-child { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.oe-pf-doors a:hover > span:last-child { transform: translateY(-6px); }


/* 2 · El túnel: sobre el negro del footer, pegado a él */
.oe-tn { position: relative; overflow: hidden; margin-top: -1px; padding-top: calc(var(--oe-gap) * .5); background: var(--oe-night); color: #f3eee4; text-align: center; }
.oe-tn + .site-footer { margin-top: 0; }
.oe-tn .oe-tn-eb { color: #8f887c; }
.oe-tn .oe-tn-t { margin: 12px auto 0; max-width: 14ch; color: #f3eee4; font-size: calc(clamp(2.4rem, 5.6vw, 5.2rem) * var(--display-scale)); line-height: .92; }
.oe-tn .oe-tn-lead { margin: 14px auto 0; max-width: 34ch; color: #cfc8ba; font-size: clamp(1.05rem, 1.5vw, 1.25rem); }
.oe-tn-door { position: relative; width: min(640px, calc(100% - 2 * var(--gutter))); margin: clamp(36px, 5vw, 64px) auto 0; }
.oe-tn-door > svg { display: block; width: 100%; height: auto; overflow: visible; }
.oe-tn-door .t1, .oe-tn-door .t2, .oe-tn-door .t3 { transform-box: view-box; transition: transform 1s cubic-bezier(.2,.9,.25,1); }
.oe-tn-door .t2 { transition-delay: .14s; } .oe-tn-door .t3 { transition-delay: .3s; }
.oe-tn.is-wait .oe-tn-door .t1, .oe-tn.is-wait .oe-tn-door .t2, .oe-tn.is-wait .oe-tn-door .t3 { transform: translateY(130px); }
.oe-tn:has(.oe-pd:hover) .oe-tn-door .t1 { transform: translateY(-5px); }
.oe-tn:has(.oe-pd:hover) .oe-tn-door .t2 { transform: translateY(-10px); }
.oe-tn:has(.oe-pd:hover) .oe-tn-door .t3 { transform: translateY(-16px); }
.oe-tn-door .oe-pd { position: absolute; left: 50%; bottom: 9%; translate: -50% 0; transition: color .22s ease .16s, opacity .5s ease .8s, transform .12s; }
.oe-tn.is-wait .oe-tn-door .oe-pd { opacity: 0; }

@media (max-width: 700px) {
  .oe-pf-doors { gap: 14px 8px; }
  .oe-pf-doors a { width: calc((100% - 24px) / 4); font-size: .7rem; }
  .oe-tn-door { width: 150%; margin-left: -25%; }
  .oe-tn-door .oe-pd { bottom: 7%; }
}
@media (prefers-reduced-motion: reduce) {
  .oe-tn.is-wait .oe-tn-door .t1, .oe-tn.is-wait .oe-tn-door .t2, .oe-tn.is-wait .oe-tn-door .t3, .oe-tn:has(.oe-pd:hover) .oe-tn-door path { transform: none; }
  .oe-tn.is-wait .oe-tn-door .oe-pd { opacity: 1; }
}

/* Pregunta del prefooter: hover de puerta en las ventanas (antes solo en simuladores) */
.oe-pf-doors .win { position: relative; }
.oe-pf-doors .win::before, .oe-pf-doors .win::after { content: ""; position: absolute; left: 50%; bottom: 0; z-index: 2; border-radius: 999px 999px 0 0; border: 3px solid #f3eee4; border-bottom: 0; translate: -50% 101%; pointer-events: none; transition: translate .6s cubic-bezier(.2,.9,.25,1), box-shadow .4s; }
.oe-pf-doors .win::before { width: 78%; height: 72%; box-shadow: 0 0 0 200px rgba(18,17,16,0); }
.oe-pf-doors .win::after { width: 30%; height: 30%; border-width: 3px; background: #e07a77; transition-delay: .14s; }
.oe-pf-doors .win svg { transition: transform .8s cubic-bezier(.2,.8,.2,1), filter .4s; }
.oe-pf-doors a:is(:hover, :focus-visible) .win svg, body:has(.board.force-hover) .oe-pf-doors a:nth-child(2) .win svg { filter: brightness(.6) saturate(.85); }
.oe-pf-doors a:is(:hover, :focus-visible) .win::before { translate: -50% 0; box-shadow: 0 0 0 200px rgba(18,17,16,.5); }
.oe-pf-doors a:is(:hover, :focus-visible) .win::after { translate: -50% 0; }
body:has(.board.force-hover) .oe-pf-doors a:nth-child(2) .win::before { translate: -50% 0; box-shadow: 0 0 0 200px rgba(18,17,16,.5); } body:has(.board.force-hover) .oe-pf-doors a:nth-child(2) .win::after { translate: -50% 0; }
@media (prefers-reduced-motion: reduce) { .oe-pf-doors .win::before, .oe-pf-doors .win::after { transition: none; } }

/* ===== Páginas de documento: legales y docentes (ronda 19) ===== */
.doc-hero { padding-block: clamp(40px, 6vw, 80px) 8px; max-width: 900px; }
.doc-hero h1 { margin: 12px 0 14px; }
.doc-upd { margin: 10px 0 0; font-size: .85rem; color: var(--ink-soft); }
.doc-body { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; padding-block: 32px clamp(48px, 7vw, 96px); align-items: start; }
.doc-toc { position: sticky; top: 96px; font-size: .9rem; }
.doc-toc p { margin: 0 0 8px; font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.doc-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.doc-toc a { color: var(--ink-soft); text-decoration: none; } .doc-toc a:hover { color: var(--ink); text-decoration: underline; }
.doc-text { max-width: 72ch; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; }
.doc-text section { min-width: 0; }
.doc-text section { scroll-margin-top: 96px; }
.doc-text h2 { margin: 0 0 12px; font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(1.7rem * var(--display-scale)); line-height: 1.1; }
.doc-text p, .doc-text li, .doc-text dd { color: var(--ink-soft); }
.doc-text p { margin: 0 0 12px; }
.doc-text ul, .doc-text ol { margin: 0 0 12px; padding-left: 1.2em; display: grid; gap: 8px; }
.doc-text a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.doc-text code { font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--red-tint); color: var(--ink); word-break: break-all; }
.doc-dl { display: grid; grid-template-columns: minmax(120px, 190px) minmax(0, 1fr); gap: 10px 20px; margin: 0; }
.doc-dl dt { font-weight: 700; color: var(--ink); } .doc-dl dd { margin: 0; }
.doc-ok { list-style: none; padding-left: 0 !important; }
.doc-ok li { position: relative; padding-left: 28px; } .doc-ok li::before { content: "✓"; position: absolute; left: 0; top: 0; font-weight: 800; color: #3f8f57; }
.doc-acts li b { color: var(--ink); }
.doc-table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-m, 12px); }
.doc-table table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.doc-table th, .doc-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc-table th { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-page mark.todo { background: #ffe9a8; color: #1d1a17; padding: 0 4px; border-radius: 4px; font-weight: 700; }
.doc-cta { padding-block: 0 clamp(48px, 7vw, 96px); }
.doc-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
@media (max-width: 900px) { .doc-body { grid-template-columns: minmax(0, 1fr); gap: 24px; } .doc-toc { position: static; } .doc-toc ol { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .doc-dl { grid-template-columns: 1fr; gap: 2px; } .doc-dl dd { margin-bottom: 10px; } .doc-toc ol { grid-template-columns: 1fr; } }

/* ===== Aviso de cookies (services/consent.js) ===== */
.oe-cc { position: fixed; left: 16px; bottom: 16px; z-index: 300; width: min(480px, calc(100vw - 32px)); }
.oe-cc[hidden] { display: none; }
.oe-cc-in { display: grid; gap: 12px; padding: 20px 20px 18px; border-radius: 16px; background: #1d1a17; color: #f3eee4; box-shadow: 0 18px 50px rgba(0,0,0,.35), inset 0 0 0 1px rgba(243,238,228,.12); }
.oe-cc-t { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight); font-size: 1.35rem; line-height: 1.1; }
.oe-cc-x { margin: 0; font-size: .92rem; color: #cfc8ba; } .oe-cc-x a { color: #f3eee4; text-decoration: underline; }
.oe-cc-opts { display: grid; gap: 10px; } .oe-cc-opts[hidden] { display: none; }
.oe-cc-o { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start; font-size: .86rem; color: #cfc8ba; }
.oe-cc-o input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: #e07a77; } .oe-cc-o label { cursor: pointer; } .oe-cc-o b { display: block; color: #f3eee4; }
.oe-cc-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.oe-cc-btns .ob { flex: 1 1 0; justify-content: center; } /* mismo formato y tamaño para aceptar y rechazar (AEPD) */
.oe-cc .ob-line { --ob-fg: #f3eee4; color: #f3eee4; box-shadow: inset 0 0 0 1.5px rgba(243,238,228,.55); }
.oe-cc [hidden] { display: none !important; }
@media (max-width: 560px) {
  .oe-cc { left: 12px; right: 12px; bottom: 12px; width: auto; }
  /* Rechazar y Aceptar, lado a lado y del mismo tamaño; Configurar o Guardar, debajo */
  .oe-cc-btns { display: grid; grid-template-columns: 1fr 1fr; }
  .oe-cc-btns [data-cc="reject"] { order: 1; } .oe-cc-btns [data-cc="accept"] { order: 2; }
  .oe-cc-btns [data-cc="config"], .oe-cc-btns [data-cc="save"] { order: 3; grid-column: 1 / -1; }
}

/* ---------- Tarjeta de artículo (ronda 58): portada del blog y home; la generan editorial/tools/portada.js ---------- */
.fcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap-grid); }
@media (max-width: 900px) { .fcards { grid-template-columns: 1fr; } }
.fcard { display: flex; flex-direction: column; background: var(--paper); color: var(--ink); border: 0; }
.fcard .fimg { aspect-ratio: 16 / 9; overflow: hidden; background: #e9e4da; }
.fcard .fimg > svg { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.8,.2,1); }
.fcard:hover .fimg > * { transform: scale(1.04); }
.fcard .body { flex: 1; display: flex; flex-direction: column; padding: 18px 20px 22px; border: 1px solid var(--line); border-top: 0; }
.fcard .eb { font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.fcard h3 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: calc(1.9rem * var(--display-scale)); line-height: .95; margin: 10px 0 8px; }
.fcard p { margin: 0 0 14px; font-size: .95rem; line-height: 1.45; color: var(--ink-soft, #4a453f); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fcard .body .small { margin-top: auto; }

/* Ronda 67: ocho épocas en el prefooter "¿Qué vida te habría tocado?". En escritorio y tableta, las ocho puertas en una fila del mismo tamaño;
   en móvil siguen en 4 x 2 (regla de 700 px de arriba) */
@media (min-width: 701px) {
  .oe-pf-doors { flex-wrap: nowrap; }
  .oe-pf-doors a { flex: 0 1 auto; width: min(128px, calc((100% - 7 * clamp(10px, 1.4vw, 18px)) / 8)); min-width: 0; }
}

/* Ronda 75: catorce épocas en el prefooter. Escritorio y tableta: dos filas de siete puertas iguales, en orden cronológico;
   móvil: cuatro por fila (la última fila, centrada) */
@media (min-width: 701px) {
  .oe-pf-doors { flex-wrap: wrap; max-width: calc(7 * 124px + 6 * clamp(10px, 1.4vw, 18px)); margin-left: auto; margin-right: auto; row-gap: clamp(18px, 2vw, 28px); }
  .oe-pf-doors a { flex: 0 0 auto; width: min(124px, calc((100% - 6 * clamp(10px, 1.4vw, 18px)) / 7)); }
}

/* Ronda 86: botones sin círculo ni flecha dentro (salvo los que solo son un icono) y con hover en todos */
.ob:not(.ob-icon) > .arrow { display: none !important; }
.ob:not(.ob-icon):has(> .arrow) { padding-right: var(--ob-px) !important; }
button:not(.ob) { transition: filter .15s, background-color .15s, box-shadow .15s, transform .15s; }
button:not(.ob):not(:disabled):hover { filter: brightness(1.15); }
button:not(.ob):not(:disabled):active { transform: scale(.97); }

/* Ronda 105: cláusula de prevalencia del español en las páginas legales inglesas (la escribe traducir.js) */
.doc-prev { max-width: 80ch; }
.doc-prev a { text-decoration: underline; text-underline-offset: 2px; }

/* Ronda 111: selector de idioma. Dos posiciones (ES y EN) con el lenguaje del menú principal: caja con borde fino y la
   activa en tinta. Mide lo mismo que los botones pequeños (40 px) y deja aire antes de "Jugar una vida". En el pie va
   con su rótulo y hereda los colores invertidos de .dark. */
.lang-sw { display: inline-flex; align-items: stretch; gap: 2px; height: 40px; padding: 3px; border: 1px solid var(--line-strong); font-weight: 650; font-size: .78rem; letter-spacing: .06em; line-height: 1; flex: none; }
.lang-sw .ls-op { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 0 9px; color: var(--ink); transition: background-color .2s ease, color .2s ease; }
.lang-sw .ls-op.is-on { background: var(--ink); color: var(--paper); cursor: default; }
.lang-sw a.ls-op:hover, .lang-sw a.ls-op:focus-visible { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.lang-sw a.ls-op:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.header-actions .lang-sw { margin-right: 14px; }
.ft-lang { display: inline-flex; align-items: center; gap: 12px; margin-left: auto; }
.ft-lang-l { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.lang-sw-pie { height: 36px; }
@media (max-width: 900px) {
  /* En móvil "Jugar una vida" se oculta: el selector queda junto al menú, con el mismo alto táctil */
  .header-actions .lang-sw { margin-right: 4px; }
  .lang-sw .ls-op { min-width: 38px; }
}
@media (max-width: 600px) {
  .ft-lang { margin-left: 0; width: 100%; }
}
@media (max-width: 480px) {
  /* Móvil estrecho: la marca en una línea y el selector compacto, sin perder el alto táctil */
  .site-header .wrap { gap: 12px; }
  .site-header .brand { gap: 8px; min-width: 0; }
  .site-header .brand .brand-name { white-space: nowrap; font-size: calc(1.3rem * var(--display-scale)); }
  .site-header .brand svg { width: 30px; height: 30px; flex: none; }
  .header-actions { gap: 8px; }
  .header-actions .lang-sw { margin-right: 0; }
  .lang-sw .ls-op { min-width: 32px; padding: 0 7px; }
}
