/* Portafolio 16 bits. Estética de la saga de Zorzalito (Zorzal Costero):
   ventanas RPG con borde pixelado, tramado Bayer, cielo/mar/arena en franjas,
   transiciones por pasos. Pixel Operator (CC0) para títulos; texto largo en fuente del sistema. */

@font-face {
  font-family: "Pixel Operator";
  src: url("assets/fonts/PixelOperator.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Pixel Operator";
  src: url("assets/fonts/PixelOperator-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Pixel Operator Mono";
  src: url("assets/fonts/PixelOperatorMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  /* ===== SPRITES DE ZORZALITO =====
     Tiras en assets/zorzalito/ (ver manifest.json). Para cambiarlas basta editar este bloque:
     url = tira horizontal, w/h = tamaño de UN cuadro en px de la imagen, n = cuadros,
     escala = factor ENTERO (pixel art), dur = n / fps sugerido. */
  --spr-vuela-url: url("assets/zorzalito/vuela_16bit.png");
  --spr-vuela-w: 59;
  --spr-vuela-h: 66;
  --spr-vuela-n: 6;
  --spr-vuela-escala: 2;
  --spr-vuela-dur: .6s;

  --spr-camina-url: url("assets/zorzalito/camina_16bit.png");
  --spr-camina-w: 88;
  --spr-camina-h: 78;
  --spr-camina-n: 4;
  --spr-camina-escala: 2;
  --spr-camina-dur: .5s;

  --spr-idle-url: url("assets/zorzalito/idle_16bit.png");
  --spr-idle-w: 88;
  --spr-idle-h: 78;
  --spr-idle-n: 4;
  --spr-idle-escala: 2;
  --spr-idle-dur: 1.333s;

  --spr-canta-url: url("assets/zorzalito/canta_16bit.png");
  --spr-canta-w: 88;
  --spr-canta-h: 78;
  --spr-canta-n: 4;
  --spr-canta-escala: 2;
  --spr-canta-dur: .667s;

  --spr-busto-url: url("assets/zorzalito/busto_16bit.png");
  --spr-busto-w: 52;
  --spr-busto-h: 42;
  --spr-busto-n: 1;
  --spr-busto-escala: 3;
  --spr-busto-dur: 1s;
  /* ===== fin sprites ===== */

  --px: 4px;                         /* un pixel lógico de la saga (lienzo x4) */
  --fuente-px: "Pixel Operator", ui-monospace, "Courier New", monospace;
  --fuente-num: "Pixel Operator Mono", "Pixel Operator", ui-monospace, monospace;
  --fuente-texto: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* ===== ISLAS DE LA SELECCIÓN DE ETAPA =====
     Tiras de 2 cuadros (la espuma alterna) en assets/ui/isla_<n>_<tema>.png.
     1 estación meteorológica, 2 faro, 3 volcán. Escala ENTERA. */
  --isla-w: 48;
  --isla-h: 32;
  --isla-n: 2;
  --isla-escala: 4;
  --isla-dur: 2.4s;
  --isla-agua: 24;                   /* fila de arte donde empieza el agua */

  /* Paleta azul, verde y gris (la del curso CROCO llevada a 16 bits) */
  /* Día */
  --bg: #e3e9ec;
  --bg-punto: #d2dbe0;
  --text: #17212b;
  --muted: #44515c;
  --ink: #17212b;
  --win: #f6f9fa;
  --win-luz: #ffffff;
  --win-sombra: #d3dee4;
  --sombra-px: rgba(23, 33, 43, .28);
  --accent: #1d5f99;
  --accent-txt: #ffffff;
  --kind: #2f7034;
  --verde: #3f9a3a;
  --nivel-medio: #4a90c8;
  --chip: #cfe2f3;
  --oscura: #1a2631;
  --oscura-txt: #ffffff;
  --oscura-num: #9fd97a;
  --oscura-num-luz: #c2eba6;
  --oscura-borde: #e3e9ec;
  --titulo-fill: #ffffff;
  --titulo-borde: #17212b;

  --cielo: url("assets/ui/cielo_dia.png");
  --cielo-fondo: #c3e8f6;
  --mar: url("assets/ui/mar_dia.png");
  --mar-fondo: #1d5a94;
  --nube: url("assets/ui/nube_dia.png");
  --isla-1: url("assets/ui/isla_1_dia.png");
  --isla-2: url("assets/ui/isla_2_dia.png");
  --isla-3: url("assets/ui/isla_3_dia.png");
  --astro: url("assets/ui/sol.png");
  --astro-w: 88px;
  --estrellas: none;
  --arena: #e9d39b;
  --arena-punto: #d3b878;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    /* Noche 16 bits */
    --bg: #10151b;
    --bg-punto: #19212a;
    --text: #e7edf1;
    --muted: #aab7c2;
    --ink: #d8e2e8;
    --win: #1a232c;
    --win-luz: #2a3742;
    --win-sombra: #121920;
    --sombra-px: rgba(0, 0, 0, .55);
    --accent: #8cc4f0;
    --accent-txt: #10151b;
    --kind: #8fd065;
    --verde: #6fcf5a;
    --nivel-medio: #5ea8e0;
    --chip: #24384c;
    --oscura: #0a0f14;
    --oscura-txt: #e7edf1;
    --oscura-num: #9fdc7c;
    --oscura-num-luz: #c2eba6;
    --oscura-borde: #d8e2e8;
    --titulo-fill: #e9f5ff;
    --titulo-borde: #000000;

    --cielo: url("assets/ui/cielo_noche.png");
    --cielo-fondo: #22386b;
    --mar: url("assets/ui/mar_noche.png");
    --mar-fondo: #081b3a;
    --nube: url("assets/ui/nube_noche.png");
    --isla-1: url("assets/ui/isla_1_noche.png");
    --isla-2: url("assets/ui/isla_2_noche.png");
    --isla-3: url("assets/ui/isla_3_noche.png");
    --astro: url("assets/ui/luna.png");
    --astro-w: 64px;
    --estrellas: url("assets/ui/estrellas.png");
    --arena: #4a4430;
    --arena-punto: #3a3524;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  color: var(--text);
  font: 17px/1.65 var(--fuente-texto);
  /* Arena con tramado ordenado (dos puntos por baldosa de 8 px) */
  background-color: var(--bg);
  background-image:
    conic-gradient(at 2px 2px, transparent 75%, var(--bg-punto) 0),
    conic-gradient(at 2px 2px, transparent 75%, var(--bg-punto) 0);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

/* Texto pixel: sin suavizado para que se vea nítido */
.brand, .menu, h1, h2, h3, h4, .kind, .tags, .links, .btn, .eyebrow, .subtitulo,
.dialogo-nombre, .hud, .etapas, .etapa-num, .filtros, .nivel, .hab, .when, .job-titulo,
.pista, .gracias, .controles kbd, .zonas span, .toast, .role {
  font-family: var(--fuente-px);
  -webkit-font-smoothing: none;
  font-smooth: never;
}

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { width: min(100% - 32px, 1000px); margin-inline: auto; }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; background: var(--win); padding: 8px 12px; z-index: 40; }

:focus-visible { outline: 3px dashed var(--accent); outline-offset: 4px; }

/* ---------- Ventanas RPG ----------
   Borde de 4 px hecho con cuatro sombras desplazadas: deja las esquinas sin pixel,
   como las ventanas de consola. Luz arriba-izquierda, sombra abajo-derecha. */
.ventana {
  position: relative;
  background: var(--win);
  border-radius: 0;
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink),
    -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 var(--win-luz), inset -4px -4px 0 0 var(--win-sombra),
    8px 8px 0 0 var(--sombra-px);
  margin: 4px;
}
.ventana-oscura {
  position: relative;
  background: var(--oscura);
  color: var(--oscura-txt);
  box-shadow:
    0 -4px 0 0 var(--oscura-borde), 0 4px 0 0 var(--oscura-borde),
    -4px 0 0 0 var(--oscura-borde), 4px 0 0 0 var(--oscura-borde),
    0 0 0 4px var(--oscura) inset,
    8px 8px 0 0 var(--sombra-px);
  margin: 4px;
}

/* ▼ que parpadea al final de un bloque de texto (dibujado, la fuente no trae el glifo) */
.continua {
  display: inline-block;
  width: 12px; height: 8px;
  margin-left: 8px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  vertical-align: middle;
}

/* ---------- Transición entre páginas: fundido por pasos ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: .28s steps(4) both salir-pagina; }
  ::view-transition-new(root) { animation: .36s steps(5) both entrar-pagina; }
}
@keyframes salir-pagina { to { opacity: 0; } }
@keyframes entrar-pagina { from { opacity: 0; } }
.top { view-transition-name: cabecera; }

/* ---------- Navegación ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--oscura);
  box-shadow: 0 4px 0 0 var(--ink);
}
.top.compacta { box-shadow: 0 4px 0 0 var(--ink), 0 8px 0 0 var(--sombra-px); }
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  transition: padding .2s steps(3);
}
.top.compacta .nav { padding: 6px 0; }
.brand { font-size: 24px; font-weight: 700; color: var(--oscura-num) !important; white-space: nowrap; text-decoration: none; }
.menu { position: relative; display: flex; gap: 20px; margin: 0; padding: 0; list-style: none; }
.menu a {
  position: relative;
  display: inline-block;
  color: var(--oscura-txt);
  text-decoration: none;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.menu a::before {
  /* cursor ▶ al pasar */
  content: "";
  position: absolute; left: -12px; top: 50%;
  width: 6px; height: 10px;
  margin-top: -5px;
  background: var(--oscura-num);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0;
}
.menu a:hover::before, .menu a:focus-visible::before, .menu a.activo::before { opacity: 1; }
.menu a.activo { color: var(--oscura-num); }
.menu-indicador {
  position: absolute; left: 0; bottom: -6px; height: 4px; width: 0;
  background: var(--oscura-num); opacity: 0; pointer-events: none;
  transition: transform .4s steps(6), width .4s steps(6), opacity .2s steps(2);
}

/* ---------- Pantalla de título ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 0;
  color: var(--text);
  background: var(--cielo) top left / 16px 640px repeat-x, var(--cielo-fondo);
  image-rendering: pixelated;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--estrellas) 0 0 / 256px 192px;
  pointer-events: none;
}
.astro {
  position: absolute;
  right: 9%; top: 48px;
  width: var(--astro-w); height: var(--astro-w);
  background: var(--astro) center / contain no-repeat;
}
.nube {
  position: absolute;
  width: 104px; height: 44px;
  background: var(--nube) 0 0 / 100% 100% no-repeat;
  pointer-events: none;
}
.nube.n1 { top: 36px; left: 6%; }
.nube.n2 { top: 150px; right: 22%; transform: scale(1.5); transform-origin: top right; }
.nube.n3 { top: 300px; left: 62%; }
.hero-texto { position: relative; z-index: 2; }

.eyebrow {
  display: inline-block;
  margin: 0 0 16px;
  padding: 4px 10px;
  background: var(--oscura);
  color: var(--oscura-num);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.titulo {
  margin: 0;
  font-size: 80px;
  line-height: .95;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--titulo-fill);
  letter-spacing: .02em;
  /* contorno grueso de 4 px + sombra a bloques, como el título de los reels */
  text-shadow:
    4px 0 0 var(--titulo-borde), -4px 0 0 var(--titulo-borde), 0 4px 0 var(--titulo-borde), 0 -4px 0 var(--titulo-borde),
    4px 4px 0 var(--titulo-borde), -4px -4px 0 var(--titulo-borde), 4px -4px 0 var(--titulo-borde), -4px 4px 0 var(--titulo-borde),
    8px 8px 0 var(--titulo-borde), 8px 12px 0 rgba(0, 0, 0, .35);
}
.palabra { display: inline-block; }
.subtitulo {
  display: inline-block;
  margin: 20px 0 24px;
  padding: 4px 10px;
  background: var(--kind);
  color: #ffffff;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .06em;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .subtitulo { color: #0a0f14; }
}

.dialogo {
  max-width: 720px;
  padding: 26px 24px 18px;
  margin-bottom: 28px;
}
.dialogo-nombre {
  position: absolute;
  top: -18px; left: 16px;
  margin: 0;
  padding: 2px 10px;
  background: var(--oscura);
  color: var(--oscura-num);
  font-size: 16px;
  text-transform: uppercase;
}
.tipeo { margin: 0; }
.tipeo strong { display: block; margin-bottom: 6px; font-size: 19px; }
.tipeo .car { visibility: hidden; }
.tipeo .car.vis { visibility: visible; }

.actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 0 0 32px; }
.btn {
  display: inline-block;
  padding: 10px 18px 8px;
  border: 0;
  background: var(--win);
  color: var(--text);
  font-family: var(--fuente-px);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink),
    -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset -4px -4px 0 0 var(--win-sombra),
    6px 6px 0 0 var(--ink);
  margin: 4px 10px 10px 4px;
  transition: transform .08s steps(2), box-shadow .08s steps(2);
}
.btn:hover { background: var(--win-luz); }
/* botón de consola: al presionarlo baja y pierde su sombra */
.btn:active {
  transform: translate(6px, 6px);
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink),
    -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 var(--win-sombra);
}
.btn-start { background: var(--oscura-num); color: #17212b; }
.btn-start:hover { background: var(--oscura-num-luz); }
.btn-start::before {
  content: "";
  display: inline-block;
  width: 8px; height: 12px;
  margin-right: 10px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.hud {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px 32px;
  /* deja aire para que las islas (y su cursor) asomen sobre el horizonte */
  margin: 0 0 104px 4px;
  padding: 12px 20px;
  list-style: none;
}
.hud li { display: flex; flex-direction: column; }
.hud-etq { font-size: 16px; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.hud strong {
  font-family: var(--fuente-num);
  font-size: 48px;
  line-height: 1;
  color: var(--oscura-num);
  -webkit-font-smoothing: none;
}

/* Mar con olas pixeladas y selección de etapa sobre islas */
.mar {
  /* --flotacion: cuánto bajo el borde del mar queda la línea de agua de cada isla */
  --flotacion: 36px;
  position: relative;
  z-index: 2;
  padding: 0 0 28px;
  background: var(--mar) 0 0 / 128px 96px repeat-x, var(--mar-fondo);
}
.etapas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: min(100% - 32px, 1000px);
  margin: 0 auto;
}
.etapas a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
}
.etapas a:focus-visible { outline: none; }
/* Cada isla asoma sobre el horizonte y apoya su línea de agua dentro del mar */
.isla {
  --s: var(--isla-escala);
  position: relative;
  display: block;
  width: calc(var(--isla-w) * var(--s) * 1px);
  height: calc(var(--isla-h) * var(--s) * 1px);
  margin-top: calc(var(--flotacion) - var(--isla-agua) * var(--s) * 1px);
  background: var(--url) 0 0 / calc(var(--isla-w) * var(--isla-n) * var(--s) * 1px) 100% no-repeat;
  image-rendering: pixelated;
}
.etapas a:nth-child(1) .isla { --url: var(--isla-1); }
.etapas a:nth-child(2) .isla { --url: var(--isla-2); }
.etapas a:nth-child(3) .isla { --url: var(--isla-3); }
/* cursor ▼ de selección de etapa sobre la isla */
.isla::after {
  content: "";
  position: absolute;
  left: 50%; top: -28px;
  width: 20px; height: 12px;
  margin-left: -10px;
  background: var(--oscura-num);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 4px 0 var(--ink));
  opacity: 0;
}
.etapas a:hover .isla::after, .etapas a:focus-visible .isla::after { opacity: 1; }
/* El cartel cuelga del islote: se monta sobre el reflejo, pegado a la espuma */
.etq {
  position: relative;
  margin-top: calc(var(--px) * -4);
  padding: 6px 12px 4px;
  background: var(--oscura);
  color: var(--oscura-txt);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: .04em;
  box-shadow:
    0 -4px 0 0 var(--oscura-borde), 0 4px 0 0 var(--oscura-borde),
    -4px 0 0 0 var(--oscura-borde), 4px 0 0 0 var(--oscura-borde),
    8px 8px 0 0 rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.etq b { color: var(--oscura-num); margin-right: 6px; }
.etapas a:hover .etq, .etapas a:focus-visible .etq { background: var(--accent); color: var(--accent-txt); }
.etapas a:hover .etq b, .etapas a:focus-visible .etq b { color: inherit; }

/* Zorzalito volando por la portada */
.vuelo {
  position: absolute;
  top: 22%;
  left: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
}

/* ---------- Sprites (todo sale del bloque --spr-* de :root) ---------- */
.sprite {
  display: block;
  width: calc(var(--w) * var(--s) * 1px);
  height: calc(var(--h) * var(--s) * 1px);
  background-image: var(--url);
  background-repeat: no-repeat;
  background-size: calc(var(--w) * var(--n) * var(--s) * 1px) calc(var(--h) * var(--s) * 1px);
  background-position: 0 0;
  image-rendering: pixelated;
}
.sprite.vuela {
  --url: var(--spr-vuela-url); --w: var(--spr-vuela-w); --h: var(--spr-vuela-h);
  --n: var(--spr-vuela-n); --s: var(--spr-vuela-escala); --dur: var(--spr-vuela-dur);
}
.sprite.camina {
  --url: var(--spr-camina-url); --w: var(--spr-camina-w); --h: var(--spr-camina-h);
  --n: var(--spr-camina-n); --s: var(--spr-camina-escala); --dur: var(--spr-camina-dur);
}
.sprite.canta {
  --url: var(--spr-canta-url); --w: var(--spr-canta-w); --h: var(--spr-canta-h);
  --n: var(--spr-canta-n); --s: var(--spr-canta-escala); --dur: var(--spr-canta-dur);
}
.sprite.idle {
  --url: var(--spr-idle-url); --w: var(--spr-idle-w); --h: var(--spr-idle-h);
  --n: var(--spr-idle-n); --s: var(--spr-idle-escala); --dur: var(--spr-idle-dur);
}
.sprite.busto {
  --url: var(--spr-busto-url); --w: var(--spr-busto-w); --h: var(--spr-busto-h);
  --n: var(--spr-busto-n); --s: var(--spr-busto-escala); --dur: var(--spr-busto-dur);
}

/* ---------- Secciones ---------- */
section.seccion { padding: 72px 0 8px; }
.etapa-cab { display: flex; align-items: center; gap: 16px; margin: 0 0 12px; }
.etapa-num {
  display: inline-grid;
  place-items: center;
  min-width: 48px; height: 48px;
  padding: 0 6px;
  background: var(--oscura);
  color: var(--oscura-num);
  font-size: 32px;
  font-weight: 700;
  box-shadow: 4px 4px 0 0 var(--kind);
}
h2 {
  margin: 0;
  font-size: 40px;
  line-height: 1.1;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.section-intro { margin: 0 0 32px; color: var(--muted); max-width: 66ch; }

.grid {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fill, minmax(min(100% - 12px, 290px), 1fr));
}
.card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  transition: transform .12s steps(2), box-shadow .12s steps(2);
}
.card:hover, .card:focus-within {
  transform: translate(-4px, -4px);
  box-shadow:
    0 -4px 0 0 var(--ink), 0 4px 0 0 var(--ink),
    -4px 0 0 0 var(--ink), 4px 0 0 0 var(--ink),
    inset 4px 4px 0 0 var(--win-luz), inset -4px -4px 0 0 var(--win-sombra),
    12px 12px 0 0 var(--sombra-px);
}
.card h3 { margin: 0 0 8px; font-size: 32px; line-height: 1.05; font-weight: 700; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 16px; }
.card .links { margin: auto 0 0; }
.kind {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px !important;
  color: var(--kind) !important;
  font-size: 16px !important;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.vivo { width: 8px; height: 8px; background: var(--verde); box-shadow: 0 0 0 2px var(--ink); }

.tags { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; padding: 0 2px; list-style: none; }
.tags li {
  padding: 2px 8px 0;
  font-size: 16px;
  background: var(--chip);
  color: var(--text);
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
}

.links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 16px; font-weight: 700; text-transform: uppercase; }
.links a { position: relative; padding-left: 14px; text-decoration: none; }
.links a::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 7px; height: 11px;
  margin-top: -6px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.links a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.links a:hover::before { transform: translateX(3px); }

/* ---------- Divulgación: Zorzalito en la playa ---------- */
.seccion > .card + .card { margin-top: 28px; }
.card.feature {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 28px;
  align-items: stretch;
}
.feature-texto { display: flex; flex-direction: column; }
/* Logo de CROCO sobre una baldosa clara (es azul sobre transparente y se pierde en el fondo oscuro) */
.logo-croco {
  display: grid;
  place-items: center;
  padding: 28px;
  background: #eef7fa;
  box-shadow: 0 0 0 4px var(--ink);
  margin: 4px;
}
.logo-croco img { display: block; width: min(100%, 260px); height: auto; }
.escenario {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  image-rendering: pixelated;
  box-shadow: 0 0 0 4px var(--ink);
  background:
    conic-gradient(at 2px 2px, transparent 75%, var(--arena-punto) 0) 0 0 / 8px 8px,
    var(--arena);
}
.escenario::before {
  /* cielo tramado arriba */
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 52%;
  background: var(--cielo) bottom left / 8px 320px repeat-x, var(--cielo-fondo);
}
.escenario::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--estrellas) 0 0 / 128px 96px;
  pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 52%, transparent 52%);
  mask: linear-gradient(#000 0 52%, transparent 52%);
}
.esc-astro {
  position: absolute; right: 14%; top: 16px; z-index: 1;
  width: calc(var(--astro-w) * .6); height: calc(var(--astro-w) * .6);
  background: var(--astro) center / contain no-repeat;
}
.esc-nube {
  position: absolute; left: 10%; top: 30px; z-index: 1;
  width: 78px; height: 33px;
  background: var(--nube) 0 0 / 100% 100% no-repeat;
}
.esc-mar {
  position: absolute; left: 0; right: 0; top: 52%; height: 48px; z-index: 1;
  background: var(--mar) 0 0 / 64px 48px repeat-x, var(--mar-fondo);
}
.paseo {
  position: absolute;
  left: 8px;
  bottom: 30px;
  z-index: 2;
}
.zorzalito {
  position: relative;
  display: block;
  width: calc(max(var(--spr-camina-w) * var(--spr-camina-escala), var(--spr-canta-w) * var(--spr-canta-escala)) * 1px);
  height: calc(max(var(--spr-camina-h) * var(--spr-camina-escala), var(--spr-canta-h) * var(--spr-canta-escala)) * 1px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.zorzalito .sprite { position: absolute; bottom: 0; left: 0; }
/* Sin animación se ve en reposo (idle); camina solo existe con .animar */
.zorzalito .canta, .zorzalito .camina { visibility: hidden; }
.zorzalito.cantando .camina, .zorzalito.cantando .idle { visibility: hidden !important; opacity: 0 !important; }
.zorzalito.cantando .canta { visibility: visible; }
.nota {
  position: absolute; top: -20px; right: -12px;
  font-size: 24px; font-weight: 700;
  color: #17212b;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff;
  opacity: 0;
}
.zorzalito:hover { filter: drop-shadow(0 0 0 #fff) drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff); }
.pista {
  position: absolute;
  left: 0; right: 0; bottom: 6px; z-index: 2;
  margin: 0 !important;
  text-align: center;
  font-size: 16px !important;
  color: #3d2f12 !important;
  text-transform: uppercase;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pista { color: #f4e7c5 !important; }
}

/* ---------- Juego ---------- */
.juego {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 360px) minmax(0, 1fr);
  grid-template-areas: "manual consola controles";
  gap: 28px;
  align-items: center;
}
.juego > .consola { grid-area: consola; }
.juego > .manual { grid-area: manual; }
.juego > .manual-controles { grid-area: controles; }
.consola { padding: 16px 16px 12px; }
.pantalla {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  background: #000;
  overflow: hidden;
  box-shadow: 0 0 0 4px #000;
}
.pantalla img, .pantalla iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  image-rendering: pixelated;
}
.pantalla img { object-fit: cover; filter: brightness(.7); }
.btn-jugar {
  position: absolute;
  left: 50%; top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-size: 24px;
  padding: 12px 22px 10px;
}
.btn-jugar:active { transform: translate(calc(-50% + 6px), calc(-50% + 6px)); }
.consola-pie { margin: 12px 0 0; text-align: center; font-family: var(--fuente-px); font-size: 16px; text-transform: uppercase; }
.consola-pie a { color: var(--oscura-num); }
.manual { padding: 20px 22px 18px; }
.manual h3 { margin: 0 0 8px; font-size: 32px; line-height: 1.05; }
.manual > p { color: var(--muted); font-size: 16px; }
.manual > p:last-child { margin-bottom: 0; }
.manual-controles { padding: 20px 22px 18px; }
.manual-controles h4 { margin-top: 0; }
/* Zonas y jefes: plegado, para que el manual muestre solo la intro */
.manual details { margin-top: 14px; border-top: 4px dotted var(--ink); padding-top: 10px; }
.manual summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--fuente-px);
  font-size: 20px;
  text-transform: uppercase;
  -webkit-font-smoothing: none;
}
.manual summary::-webkit-details-marker { display: none; }
.manual summary::after { content: " ▼"; font-size: 14px; }
.manual details[open] summary::after { content: " ▲"; }
.manual details .zonas { margin-top: 10px; }
.manual h4 {
  margin: 22px 0 10px;
  font-size: 24px;
  text-transform: uppercase;
  border-bottom: 4px dotted var(--ink);
  padding-bottom: 4px;
}
.controles { margin: 0; display: grid; gap: 8px; }
.controles > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: center; }
.controles dt { display: flex; flex-wrap: wrap; gap: 6px; }
.controles dd { margin: 0; color: var(--muted); font-size: 16px; }
kbd {
  display: inline-block;
  min-width: 28px;
  padding: 2px 6px 0;
  text-align: center;
  background: var(--win-sombra);
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink), inset 0 -3px 0 0 rgba(0, 0, 0, .18);
}
.zonas { margin: 0; padding: 0; list-style: none; counter-reset: zona; display: grid; gap: 6px; }
.zonas li { counter-increment: zona; display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 16px; color: var(--muted); }
.zonas li::before {
  content: counter(zona);
  display: inline-grid; place-items: center;
  width: 24px; height: 24px;
  background: var(--oscura); color: var(--oscura-num);
  font-family: var(--fuente-px); font-size: 16px;
  flex: none;
}
.zonas span { color: var(--text); font-weight: 700; font-size: 20px; text-transform: uppercase; min-width: 9.5ch; }

/* Pronóstico de 7 días (app.js bloque 13). Los íconos son SVG de píxeles dibujados desde
   bitmaps en JS; los colores salen de estas variables para que sirvan de día y de noche. */
.pronostico {
  --px-K: var(--ink);        /* contorno */
  --px-W: #ffffff;           /* nube */
  --px-G: #b9c7e0;           /* sombra de nube */
  --px-Y: #ffd23f;           /* sol */
  --px-B: #3f9bd8;           /* lluvia */
  --px-L: #ffd23f;           /* rayo */
  margin-top: 28px;
  padding: 20px 20px 8px;
}
.pron-dias {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  margin: 8px 0 20px;
  padding: 0;
  list-style: none;
}
.pron-estado { grid-column: 1 / -1; color: var(--muted); }
.pron-dia {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  padding: 10px 4px 12px;
  background: var(--win-sombra);
  text-align: center;
  box-shadow: 0 -2px 0 0 var(--ink), 0 2px 0 0 var(--ink), -2px 0 0 0 var(--ink), 2px 0 0 0 var(--ink);
}
.pron-dia.hoy { background: var(--oscura); color: var(--oscura-txt); box-shadow: 0 -2px 0 0 var(--oscura-num), 0 2px 0 0 var(--oscura-num), -2px 0 0 0 var(--oscura-num), 2px 0 0 0 var(--oscura-num); }
.pron-nombre { font-family: var(--fuente-px); font-size: 20px; font-weight: 700; letter-spacing: .06em; -webkit-font-smoothing: none; }
.pron-dia.hoy .pron-nombre { color: var(--oscura-num); }
.pron-fecha { margin-top: -6px; font-size: 14px; opacity: .8; }
.pron-icono { width: 56px; height: 48px; shape-rendering: crispEdges; }
.pron-icono .K { fill: var(--px-K); } .pron-icono .W { fill: var(--px-W); } .pron-icono .G { fill: var(--px-G); }
.pron-icono .Y { fill: var(--px-Y); } .pron-icono .B { fill: var(--px-B); } .pron-icono .L { fill: var(--px-L); }
.pron-dia.hoy .pron-icono .K { fill: var(--oscura-borde); }
.pron-temp { display: flex; gap: 8px; align-items: baseline; font-family: var(--fuente-num); font-size: 24px; line-height: 1; -webkit-font-smoothing: none; }
.pron-temp .min { font-size: 18px; opacity: .65; }
.pron-extra { display: grid; gap: 2px; font-size: 14px; line-height: 1.2; }
.pron-extra .lluvia { color: var(--accent); font-weight: 700; }
.pron-dia.hoy .pron-extra .lluvia { color: #8fd0f5; }
.pron-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.pron-pie p { margin: 0 0 10px; flex: 1 1 240px; font-size: 14px; color: var(--muted); }

/* ---------- Contacto y pie ---------- */
.contacto { padding: 22px 24px; }
.contacto p { margin: 0 0 14px; }
.contacto p:last-child { margin: 0; }
.foot {
  margin-top: 72px;
  padding: 28px 0 44px;
  border-top: 4px dotted var(--ink);
  color: var(--muted);
  font-size: 15px;
  text-align: center;
}
.foot p { margin: 0; }
.gracias { font-size: 24px; font-weight: 700; color: var(--text); text-transform: uppercase; margin-bottom: 6px !important; }

/* ---------- CV ---------- */
.cv { padding: 44px 0 0; }
.cv section.seccion { padding: 0; margin-top: 52px; }
.cv h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 32px;
  color: var(--text);
  border-bottom: 4px dotted var(--ink);
  padding-bottom: 6px;
  margin-bottom: 22px;
}
.cv h2::before {
  content: "";
  width: 16px; height: 16px;
  background: var(--kind);
  box-shadow: 4px 4px 0 0 var(--ink);
  flex: none;
}
.cv-head {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: flex-start; justify-content: space-between;
  padding: 24px;
}
.cv-head h1 { margin: 0; font-family: var(--fuente-px); font-size: 48px; line-height: 1; font-weight: 700; -webkit-font-smoothing: none; }
.role { margin: 8px 0 10px; font-size: 20px; font-weight: 700; color: var(--accent); text-transform: uppercase; }
.meta { margin: 0; color: var(--muted); font-size: 15px; overflow-wrap: anywhere; }
.cv-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.cv-datos { flex: 1 1 320px; }
/* Retrato de Bruno (pixel art de 16 bits) como foto del panel RPG */
.avatar {
  flex: none;
  display: block;
  line-height: 0;
  background: var(--cielo-fondo);
  box-shadow: 0 0 0 4px var(--ink);
  margin: 4px;
  image-rendering: pixelated;
}
.avatar .foto { display: block; width: 168px; height: auto; image-rendering: pixelated; }

/* Filtros: menú de consola con cursor ▶ en la opción elegida */
.filtros { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0 0 28px 4px; padding: 10px 14px; }
.filtros button {
  position: relative;
  padding: 6px 8px 4px 22px;
  border: 0;
  background: transparent;
  color: var(--oscura-txt);
  font-family: var(--fuente-px);
  font-size: 16px;
  text-transform: uppercase;
  cursor: pointer;
}
.filtros button::before {
  content: "";
  position: absolute; left: 6px; top: 50%;
  width: 8px; height: 12px;
  margin-top: -7px;
  background: var(--oscura-num);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
  opacity: 0;
}
.filtros button:hover::before { opacity: .5; }
.filtros button[aria-pressed="true"] { color: var(--oscura-num); }
.filtros button[aria-pressed="true"]::before { opacity: 1; }

/* Línea de tiempo pixelada: el trazo se llena con el scroll (--avance lo pone app.js) */
.linea {
  --avance: 1;
  position: relative;
  margin: 0;
  padding: 0 0 0 40px;
  list-style: none;
}
.linea::before, .linea::after {
  content: "";
  position: absolute;
  left: 10px; top: 12px; bottom: 12px;
  width: 4px;
}
.linea::before {
  background: repeating-linear-gradient(to bottom, var(--ink) 0 8px, transparent 8px 12px);
  opacity: .35;
}
.linea::after {
  background: var(--accent);
  transform-origin: top;
  transform: scaleY(var(--avance));
}
.job { position: relative; margin-bottom: 20px; transition: opacity .3s steps(3), filter .3s steps(3); }
.job::before {
  content: "";
  position: absolute;
  left: -38px; top: 20px;
  width: 16px; height: 16px;
  background: var(--win);
  box-shadow: 0 0 0 4px var(--ink);
  z-index: 1;
}
.job:hover::before { background: var(--oscura-num); }
.job.hito::before { background: var(--kind); }
.job.atenuado { opacity: .35; filter: grayscale(1); }
.job details { padding: 16px 18px 12px; margin: 0 4px 4px 4px; }
.job summary { display: block; cursor: pointer; list-style: none; position: relative; padding-right: 28px; }
.job summary::-webkit-details-marker { display: none; }
.job summary::after {
  content: "";
  position: absolute; right: 2px; top: 6px;
  width: 12px; height: 8px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.job details[open] summary::after { transform: rotate(180deg); }
.job-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 16px; align-items: baseline; }
.job-titulo { font-weight: 700; font-size: 24px; line-height: 1.1; }
.when { color: var(--kind); font-size: 16px; white-space: nowrap; font-weight: 700; }
.org { display: block; margin-top: 4px; color: var(--muted); font-style: italic; font-size: 15px; }
.job ul { margin: 10px 0 2px; padding-left: 20px; }
.job li { margin: 4px 0; }
.job li::marker { color: var(--kind); }
@keyframes desplegar { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0); } }
.animar .job details.abriendo[open] ul { animation: desplegar .3s steps(5); }

/* Medidores de nivel: barras de HP/XP */
.niveles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 16px 32px;
  margin: 0 0 28px;
  padding: 0 4px;
  list-style: none;
}
.niveles li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "hab nivel" "medidor medidor";
  gap: 4px 12px;
  align-items: baseline;
}
.hab { grid-area: hab; font-size: 20px; font-weight: 700; }
.nivel { grid-area: nivel; color: var(--muted); font-size: 16px; text-transform: uppercase; }
.medidor {
  grid-area: medidor;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  background: var(--oscura);
  box-shadow: 0 0 0 4px var(--ink);
  margin: 4px;
}
.medidor i { height: 12px; background: rgba(255, 255, 255, .12); position: relative; overflow: hidden; }
.medidor i::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--verde);
  box-shadow: inset 0 3px 0 0 rgba(255, 255, 255, .35);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s steps(4);
}
.medidor[data-nivel="2"] i::after { background: var(--nivel-medio); }
.medidor i:nth-child(2)::after { transition-delay: .3s; }
.medidor i:nth-child(3)::after { transition-delay: .6s; }
.medidor.lleno[data-nivel="1"] i:nth-child(-n+1)::after,
.medidor.lleno[data-nivel="2"] i:nth-child(-n+2)::after,
.medidor.lleno[data-nivel="3"] i:nth-child(-n+3)::after { transform: scaleX(1); }
:root:not(.animar) .medidor i::after { transition: none; }

.skills { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.skills dt { font-family: var(--fuente-px); font-size: 20px; font-weight: 700; -webkit-font-smoothing: none; }
.skills dd { margin: 0; color: var(--muted); }
.lista { margin: 0; padding-left: 20px; }
.lista li { margin: 6px 0; }
.lista li::marker { color: var(--kind); }
.muted { color: var(--muted); }

.toast {
  position: fixed;
  left: 50%; bottom: 24px;
  z-index: 30;
  padding: 10px 18px 8px;
  background: var(--oscura);
  color: var(--oscura-num);
  font-size: 16px;
  text-transform: uppercase;
  box-shadow: 0 0 0 4px var(--oscura-borde), 6px 6px 0 4px var(--sombra-px);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s steps(3), transform .2s steps(3);
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animaciones (solo con .animar) ---------- */
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes caer-palabra {
  0% { opacity: 0; transform: translateY(-48px); }
  60% { opacity: 1; transform: translateY(8px); }
  100% { opacity: 1; transform: none; }
}
@keyframes cuadros { to { background-position: calc(var(--w) * var(--n) * var(--s) * -1px) 0; } }
@keyframes olas { to { background-position: -128px 0, 0 0; } }
@keyframes olas-chicas { to { background-position: -64px 0, 0 0; } }
@keyframes parpadeo { 50% { opacity: 0; } }
@keyframes nube-va { from { translate: -40vw 0; } to { translate: 120vw 0; } }
@keyframes flotar { 50% { transform: translateY(-4px); } }
@keyframes espuma { to { background-position: calc(var(--isla-w) * var(--isla-n) * var(--s) * -1px) 0; } }
@keyframes cruzar {
  0% { transform: translate(-140px, 0); opacity: 1; }
  25% { transform: translate(25vw, -16px); }
  50% { transform: translate(52vw, 8px); }
  75% { transform: translate(78vw, -12px); }
  100% { transform: translate(calc(100vw + 40px), 0); opacity: 1; }
}
/* Paseo con pausas: reposo (idle) en cada extremo, camina entre medio */
@keyframes pasear {
  0%, 12% { left: 8px; transform: scaleX(1); }
  44%, 50% { left: calc(100% - var(--spr-camina-w) * var(--spr-camina-escala) * 1px - 8px); transform: scaleX(1); }
  50.01%, 56% { left: calc(100% - var(--spr-camina-w) * var(--spr-camina-escala) * 1px - 8px); transform: scaleX(-1); }
  88%, 99.99% { left: 8px; transform: scaleX(-1); }
  100% { left: 8px; transform: scaleX(1); }
}
@keyframes ver-camina {
  0%, 12% { visibility: hidden; }
  12.01%, 44% { visibility: visible; }
  44.01%, 56% { visibility: hidden; }
  56.01%, 88% { visibility: visible; }
  88.01%, 100% { visibility: hidden; }
}
@keyframes ver-idle {
  0%, 12% { visibility: visible; }
  12.01%, 44% { visibility: hidden; }
  44.01%, 56% { visibility: visible; }
  56.01%, 88% { visibility: hidden; }
  88.01%, 100% { visibility: visible; }
}
@keyframes nota {
  0% { opacity: 0; transform: translate(0, 6px); }
  25% { opacity: 1; }
  100% { opacity: 0; transform: translate(10px, -22px); }
}
/* revelado tipo persiana: la pieza se descubre de arriba abajo en escalones */
@keyframes persiana {
  from { clip-path: inset(-20px -20px 100% calc(var(--ext-izq, 20px) * -1)); opacity: 0; }
  to { clip-path: inset(-20px -20px -20px calc(var(--ext-izq, 20px) * -1)); opacity: 1; }
}

.animar .sprite { animation: cuadros var(--dur) steps(var(--n)) infinite; }

/* Pantalla de título */
.animar .titulo .palabra { animation: caer-palabra .5s steps(6) both; animation-delay: calc(var(--i) * .18s + .1s); }
.animar .eyebrow { animation: aparecer .3s steps(3) both; }
.animar .subtitulo { animation: aparecer .3s steps(3) .5s both; }
.animar .dialogo { animation: persiana .4s steps(6) .65s both; }
.animar .actions { animation: aparecer .3s steps(3) .9s both; }
.animar .hud { animation: persiana .4s steps(5) 1s both; }
.animar .btn-start:not(.btn-jugar) { animation: parpadeo 1.2s steps(1) 1.6s infinite; }
.animar .btn-start:hover, .animar .btn-start:focus-visible { animation: none; }
.animar .continua { animation: parpadeo 1s steps(1) infinite; }
.animar .mar { animation: olas 2.4s steps(8) infinite; }
.animar .esc-mar { animation: olas-chicas 2s steps(8) infinite; }
.animar .nube.n1 { animation: nube-va 70s steps(280) -20s infinite; }
.animar .nube.n2 { animation: nube-va 95s steps(380) -60s infinite; }
.animar .nube.n3 { animation: nube-va 80s steps(320) -5s infinite; }
/* las islas no flotan: solo la espuma alterna entre sus 2 cuadros (y el faro destella) */
.animar .isla { animation: espuma var(--isla-dur) steps(var(--isla-n)) infinite; }
.animar .etapas a:nth-child(2) .isla { animation-delay: -.8s; }
.animar .etapas a:nth-child(3) .isla { animation-delay: -1.6s; }
.animar .etapas a:hover .isla::after,
.animar .etapas a:focus-visible .isla::after { animation: flotar .6s steps(2) infinite; }
.animar .vuelo { animation: cruzar 16s steps(160) 1.5s infinite; }
.animar .hero.fuera *, .animar .hero.fuera { animation-play-state: paused !important; }

.animar .vivo { animation: parpadeo 1.4s steps(1) infinite; }

/* Zorzalito: camina de lado a lado; al cantar se detiene */
.animar .paseo { animation: pasear 16s steps(320) infinite; }
.animar .zorzalito .camina { animation: cuadros var(--dur) steps(var(--n)) infinite, ver-camina 16s infinite; }
.animar .zorzalito .idle { animation: cuadros var(--dur) steps(var(--n)) infinite, ver-idle 16s infinite; }
.animar .zorzalito.cantando .nota { animation: nota 1.2s steps(6) infinite; }
.animar .escenario:has(.cantando) .paseo,
.animar .escenario.fuera .paseo,
.animar .escenario.fuera .sprite,
.animar .escenario.fuera .esc-mar { animation-play-state: paused; }

/* Contenido que se revela al entrar en pantalla (app.js pone .revelar / .revelado) */
.animar .revelar { opacity: 0; }
.animar .revelar.revelado {
  opacity: 1;
  animation: persiana .45s steps(6) both;
  animation-delay: var(--retardo, 0s);
}
.animar .job.revelar { --ext-izq: 48px; }
.animar .job.revelar.revelado.atenuado { opacity: .35; }
.animar .cv-head .entra { animation: aparecer .3s steps(3) both; }
.animar .cv-head .entra + .entra { animation-delay: .15s; }

/* ---------- Pantallas medianas y chicas ---------- */
@media (max-width: 860px) {
  .isla { --s: 3; }
  .hud { margin-bottom: 84px; }
  .juego { grid-template-columns: 1fr; grid-template-areas: "consola" "manual" "controles"; }
  .consola { width: min(100% - 8px, 360px); margin-inline: auto; }
  .titulo { font-size: 64px; }
}
@media (max-width: 720px) {
  .pron-dias { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .card.feature { grid-template-columns: 1fr; }
  .escenario { min-height: 260px; }
}
@media (max-width: 560px) {
  .pron-dias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pronostico { padding: 16px 12px 4px; }
  .brand { font-size: 16px; }
  .menu { gap: 18px; }
  .menu .opcional { display: none; }
  .titulo { font-size: 48px; }
  .hero { padding-top: 40px; }
  .nube.n2 { transform: none; }
  .nube.n3 { display: none; }
  .astro { right: 4%; top: 20px; width: calc(var(--astro-w) * .7); height: calc(var(--astro-w) * .7); }
  .dialogo { padding: 24px 16px 16px; }
  .hud { display: flex; gap: 6px 24px; padding: 10px 14px; margin-bottom: 64px; }
  .hud strong { font-size: 32px; }
  .hud-etq { font-size: 16px; }
  .vuelo .sprite.vuela { --s: calc(var(--spr-vuela-escala) / 2); } /* x1 en celular, sigue siendo entero */
  h2 { font-size: 32px; }
  .etapa-num { min-width: 40px; height: 40px; font-size: 24px; }
  .card h3, .manual h3 { font-size: 24px; }
  /* tres islas en fila a escala x2 (sigue siendo entera); el cartel pasa a dos líneas */
  .mar { --flotacion: 24px; padding-bottom: 20px; }
  .etapas { gap: 4px; width: min(100% - 16px, 1000px); }
  .isla { --s: 2; }
  .isla::after { top: -22px; width: 16px; height: 8px; margin-left: -8px; }
  .etq { margin-top: -4px; padding: 4px 8px 2px; line-height: 1.2; text-align: center; white-space: normal; }
  .etq b { display: block; margin: 0; }
  .cv-head h1 { font-size: 32px; }
  .cv h2 { font-size: 24px; }
  .job-titulo { font-size: 20px; }
  .skills { grid-template-columns: 1fr; gap: 2px; }
  .skills dd { margin-bottom: 10px; }
  .linea { padding-left: 34px; }
  .linea::before, .linea::after { left: 6px; }
  .job::before { left: -36px; width: 12px; height: 12px; }
}

/* ---------- Impresión del CV: limpia y sobria ---------- */
@media print {
  .top, .foot, .cv-acciones, .filtros, .skip, .toast, .avatar { display: none !important; }
  :root {
    --bg: #fff; --bg-punto: #fff; --win: #fff; --text: #000; --muted: #333;
    --accent: #0b4f60; --kind: #0b4f60; --ink: #999;
  }
  body { background: #fff; font-size: 10.5pt; line-height: 1.4; }
  .wrap { width: 100%; }
  .cv { padding: 0; }
  .cv section.seccion { margin-top: 14px; }
  .cv h1, .cv h2, .job-titulo, .when, .role, .hab, .nivel, .skills dt, .kind {
    font-family: var(--fuente-texto) !important;
    -webkit-font-smoothing: auto;
    text-transform: none;
  }
  .cv-head { padding: 0; }
  .cv-head h1 { font-size: 20pt; }
  .role { font-size: 11pt; }
  .cv h2 { font-size: 12pt; border-bottom: 1px solid #999; letter-spacing: .06em; text-transform: uppercase; }
  .cv h2::before, .linea::before, .linea::after, .job::before, .job summary::after { display: none; }
  .ventana, .ventana-oscura { box-shadow: none !important; margin: 0; background: none; }
  .revelar { opacity: 1 !important; animation: none !important; clip-path: none !important; }
  .linea { padding-left: 0; }
  .cv-head .kind { display: none; }
  .job.atenuado { opacity: 1 !important; filter: none !important; }
  .job { break-inside: avoid; margin-bottom: 6px; }
  .job details { padding: 0; }
  .job-titulo { font-size: 11pt; }
  .when { font-size: 10pt; color: #333; font-weight: 400; }
  .hab { font-size: 10.5pt; }
  .nivel { font-size: 9.5pt; }
  .skills dt { font-size: 10.5pt; }
  .medidor { display: none; }
  .niveles { gap: 2px 24px; margin-bottom: 10px; }
  .niveles li { grid-template-areas: "hab nivel"; }
  a { color: inherit; text-decoration: none; }
  @page { margin: 14mm 16mm; }
}
