/* =========================================================
   CARTOGRAFÍA ESTELAR · Portfolio de Albert Sánchez
   Sistema de diseño: cielo nocturno + interfaz de videojuego pixel.
   ---------------------------------------------------------
   1. Tokens y modos (contraste alto del sistema)
   2. Base y accesibilidad
   3. Componentes (marcos pixel, botones, etiquetas, títulos)
   4. Cabecera, menú, opciones, pie
   5. Páginas: inicio, sobre mí, proyectos, ELYA, contacto, 404
   6. Movimiento y modos especiales
   ========================================================= */

/* ---------- 1. TOKENS ---------- */
:root {
    --bg: #0a0f24;
    --bg-deep: #060a1a;
    --panel: rgba(17, 25, 56, 0.86);
    --panel-solid: #111938;
    --panel-2: #18224a;
    --line: #2f3c72;
    --line-strong: #5465ad;
    --text: #eef1ff;
    --muted: #b9c2e6;
    --star: #ffe58a;
    --star-deep: #e9b94a;
    --lav: #d9c3fa;
    --mint: #cafa9d;
    --sky: #88c4ff;
    --coral: #ff9a76;
    --on-accent: #141833;

    --hill-far: #141c3e;
    --hill-mid: #0f1734;

    --font-body: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
    --font-pixel: 'Pixelify Sans', 'Atkinson Hyperlegible', system-ui, sans-serif;
    --font-display: var(--font-body);   /* títulos: siempre legibles */
    --font-deco: var(--font-pixel);      /* pixel: solo decoración */

    --px: 4px;
    --wrap: 1180px;
    --gutter: clamp(16px, 4vw, 32px);
    --header-h: 72px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}


html[data-contrast="high"] {
    --bg: #000;
    --bg-deep: #000;
    --panel: #000;
    --panel-solid: #000;
    --panel-2: #0b0b16;
    --line: #c9d1ff;
    --line-strong: #ffffff;
    --muted: #ffffff;
    --text: #ffffff;
    --hill-far: #0d0d1c;
    --hill-mid: #060612;
}

/* ---------- 2. BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
    color-scheme: dark;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 16px);
    -webkit-text-size-adjust: 100%;
}
html[data-motion="reduce"] { scroll-behavior: auto; }

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 60% 45% at 12% 18%, rgba(120, 90, 200, 0.16), transparent 70%),
        radial-gradient(ellipse 50% 40% at 88% 30%, rgba(40, 140, 160, 0.13), transparent 70%),
        radial-gradient(ellipse 70% 50% at 50% 100%, rgba(60, 80, 170, 0.18), transparent 70%);
    background-attachment: fixed;
    overflow-x: hidden;
}
html[data-contrast="high"] body { background-image: none; }

.sky-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
.pixel { image-rendering: pixelated; }

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
}
p { text-wrap: pretty; }

a { color: var(--sky); text-underline-offset: 0.2em; text-decoration-thickness: 2px; }
a:hover { color: var(--star); }

:focus-visible {
    outline: 3px solid var(--star);
    outline-offset: 3px;
}

.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0);
    white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute;
    left: 16px; top: -100px;
    z-index: 200;
    padding: 12px 18px;
    background: var(--star);
    color: var(--on-accent);
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus { top: 12px; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: var(--gutter);
}

main { display: block; }
.section { padding-block: clamp(40px, 6vw, 80px); }

[hidden] { display: none !important; }

/* ---------- 3. COMPONENTES ---------- */

/* Marco pixel con esquinas recortadas (estilo caja de diálogo RPG) */
.px-box {
    --frame: var(--line-strong);
    --b: var(--px);
    position: relative;
    background: var(--panel);
    margin: var(--b);
    outline: 1px solid transparent; /* visible en modo de colores forzados */
    box-shadow:
        calc(var(--b) * -1) 0 0 0 var(--frame),
        var(--b) 0 0 0 var(--frame),
        0 calc(var(--b) * -1) 0 0 var(--frame),
        0 var(--b) 0 0 var(--frame),
        inset 0 var(--b) 0 0 rgba(255, 255, 255, 0.04);
}

/* Títulos de sección con "kicker" */
.kicker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-deco);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--star);
}
.kicker img { width: 18px; height: 18px; }

.section-head { margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 {
    font-size: clamp(1.9rem, 4.2vw, 2.75rem);
    margin-top: 8px;
}
.section-head p { color: var(--muted); max-width: 62ch; margin-top: 12px; }
.section-head.center { text-align: center; }
.section-head.center p { margin-inline: auto; }

/* Botones */
.btn {
    --btn-bg: var(--star);
    --btn-fg: var(--on-accent);
    --btn-edge: var(--star-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 10px 22px;
    margin: var(--px);
    font-family: var(--font-deco);
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--btn-fg);
    background: var(--btn-bg);
    border: 0;
    border-radius: 0;
    text-decoration: none;
    cursor: pointer;
    outline: 1px solid transparent;
    box-shadow:
        calc(var(--px) * -1) 0 0 0 var(--btn-edge),
        var(--px) 0 0 0 var(--btn-edge),
        0 calc(var(--px) * -1) 0 0 var(--btn-edge),
        0 var(--px) 0 0 var(--btn-edge),
        inset 0 -4px 0 0 rgba(0, 0, 0, 0.18);
    transition: transform .15s var(--ease), background-color .15s;
}
.btn:hover { color: var(--btn-fg); background: #fff0b0; transform: translateY(-2px); }
.btn:active { transform: translateY(1px); }
.btn svg, .btn img { width: 20px; height: 20px; flex: none; }
.btn svg { fill: currentColor; }

.btn--ghost {
    --btn-bg: rgba(17, 25, 56, 0.7);
    --btn-fg: var(--text);
    --btn-edge: var(--line-strong);
}
.btn--ghost:hover { background: var(--panel-2); color: var(--star); --btn-edge: var(--star); }

.btn--sm { min-height: 44px; padding: 8px 16px; font-size: 0.98rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; }

/* Flecha animada en enlaces "ir a" */
.arrow { display: inline-block; transition: transform .2s var(--ease); }
a:hover .arrow, a:focus-visible .arrow { transform: translateX(4px); }

/* Etiquetas: forma + color (legibles también para daltonismo) */
.tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 10px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--line);
}
.tag::before {
    content: "";
    width: 10px; height: 10px;
    flex: none;
    background: currentColor;
}
.tag--type::before { background: var(--lav); transform: rotate(45deg) scale(.85); }
.tag--tech::before { background: var(--sky); border-radius: 50%; }
.tag--genre::before { background: var(--mint); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
html[data-contrast="high"] .tag { border-color: #fff; }

/* Leyenda */
.legend {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
    font-size: 0.95rem; color: var(--muted);
}
.legend .tag { font-weight: 400; }

/* Chips de filtro */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
    min-height: 44px;
    padding: 8px 18px;
    font: inherit;
    font-family: var(--font-deco);
    font-size: 1rem;
    color: var(--text);
    background: rgba(17, 25, 56, 0.75);
    border: 2px solid var(--line-strong);
    cursor: pointer;
    transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--star); color: var(--star); }
.chip[aria-pressed="true"],
.chip[aria-pressed="true"]:hover {
    background: var(--star);
    border-color: var(--star);
    color: var(--on-accent);
}
.chip[aria-pressed="true"]::before { content: "▶ "; }

/* ---------- 4. CABECERA ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(8, 12, 30, 0.92), rgba(8, 12, 30, 0.72));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 2px solid transparent;
    transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
html[data-contrast="high"] .site-header { background: #000; border-bottom-color: #fff; }

.header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    min-height: var(--header-h);
    padding-inline: var(--gutter);
}
.header-end { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    justify-self: start;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-deco);   /* misma letra pixel que el menú */
    font-size: 1.15rem;
    font-weight: 600;
    white-space: nowrap;
}
.brand img { width: 42px; height: 42px; }
.brand:hover { color: var(--star); }

.site-nav { display: flex; align-items: center; justify-content: center; gap: 20px; }
.lang-switch.lang-mobile { display: none; }
.nav-links { display: flex; gap: 4px; padding: 0; list-style: none; }
.nav-links a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 8px 12px;
    color: var(--text);
    text-decoration: none;
    font-family: var(--font-deco);
    font-weight: 500;
    font-size: 1.02rem;
    white-space: nowrap;
}
.nav-links a img { width: 20px; height: 20px; }
.nav-links a::after {
    content: "";
    position: absolute;
    left: 12px; right: 12px; bottom: 4px;
    height: 4px;
    background: var(--star);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s var(--ease);
}
.nav-links a:hover { color: var(--star); }
.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after { transform: scaleX(1); }
.nav-links a[aria-current="page"] { color: var(--star); }

.lang-switch {
    display: inline-flex;
    border: 2px solid var(--line-strong);
}
.lang-switch button {
    min-width: 44px;
    min-height: 40px;
    padding: 4px 8px;
    font: inherit;
    font-family: var(--font-deco);
    font-size: 0.95rem;
    color: var(--muted);
    background: transparent;
    border: 0;
    cursor: pointer;
}
.lang-switch button + button { border-left: 2px solid var(--line-strong); }
.lang-switch button:hover { color: var(--star); }
.lang-switch button[aria-pressed="true"] { background: var(--star); color: var(--on-accent); font-weight: 700; }

.icon-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 6px 14px;
    font: inherit;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
    background: rgba(17, 25, 56, 0.7);
    border: 2px solid var(--line-strong);
    cursor: pointer;
}
.icon-btn:hover { color: var(--star); border-color: var(--star); }
.icon-btn svg { width: 20px; height: 20px; flex: none; }

.menu-toggle { display: none; }

@media (max-width: 1099px) {
    .header-inner { grid-template-columns: auto 1fr; }
    .lang-switch.lang-desktop { display: none; }
    .lang-switch.lang-mobile { display: inline-flex; }
    .menu-toggle { display: inline-flex; }
    .site-nav {
        position: absolute;
        top: 100%;
        left: 0; right: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px var(--gutter) 24px;
        background: var(--panel-solid);
        border-bottom: 4px solid var(--line-strong);
        box-shadow: 0 24px 40px rgba(0, 0, 0, 0.45);
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }
    .site-header.is-open .site-nav { display: flex; }
    .nav-links { flex-direction: column; gap: 4px; }
    .nav-links a { min-height: 56px; font-size: 1.15rem; padding: 12px 8px; }
    .nav-links a img { width: 26px; height: 26px; }
    .nav-links a::after { left: 8px; right: auto; width: 40px; }
    .lang-switch { align-self: flex-start; }
    .lang-switch button { min-width: 64px; min-height: 48px; font-size: 1.05rem; }
}
@media (max-width: 480px) {
    .brand-name {
        position: absolute; width: 1px; height: 1px;
        overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .header-inner { gap: 10px; }
    .icon-btn { padding: 6px 10px; }
}
@media (max-width: 360px) {
    .icon-btn .btn-label { display: none; }
}

/* ---------- PIE ---------- */
.site-footer {
    position: relative;
    margin-top: 40px;
    padding: 48px 0 40px;
    background: linear-gradient(to bottom, transparent, rgba(6, 10, 26, 0.9) 40%);
    border-top: 2px dashed var(--line);
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: start;
}
.footer-brand { display: flex; gap: 16px; align-items: center; }
.footer-brand img { width: 56px; height: 56px; }
.footer-brand strong { font-family: var(--font-display); font-size: 1.3rem; display: block; }
.footer-brand span { color: var(--muted); font-size: 1rem; }
.footer-mail { margin-top: 18px; font-size: 1.05rem; }
.footer-mail a { word-break: break-all; }
.socials { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; justify-content: flex-end; }
.socials a {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    min-width: 76px; padding: 10px 8px;
    color: var(--muted); text-decoration: none; font-size: 0.85rem; font-weight: 700;
    border: 2px solid transparent;
}
.socials a svg { width: 26px; height: 26px; fill: currentColor; }
.socials a:hover { color: var(--star); border-color: var(--line-strong); }
.footer-bottom {
    display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
    margin-top: 32px; padding-top: 20px;
    border-top: 2px solid var(--line);
    color: var(--muted); font-size: 0.95rem;
}
.footer-actions { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 760px) {
    .footer-grid { grid-template-columns: 1fr; }
    .socials { justify-content: flex-start; }
}

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    left: 50%; bottom: 24px;
    z-index: 300;
    padding: 12px 20px;
    font-family: var(--font-deco);
    color: var(--on-accent);
    background: var(--star);
    transform: translate(-50%, 140%);
    transition: transform .3s var(--ease);
}
.toast.is-shown { transform: translate(-50%, 0); }

/* =========================================================
   5. PÁGINAS
   ========================================================= */

/* ---------- INICIO: pantalla de título ---------- */
.title-screen {
    position: relative;
    min-height: max(620px, calc(100svh - var(--header-h)));
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(48px, 10vh, 110px) var(--gutter) 0;
    text-align: center;
    overflow: hidden;
    isolation: isolate;
}
.title-wrap { position: relative; z-index: 2; max-width: 900px; }
.game-title {
    font-family: var(--font-display);
    letter-spacing: -0.01em;
    margin: 14px 0 10px;
    font-size: clamp(2.8rem, 9vw, 6rem);
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-shadow:
        0 0 28px rgba(255, 229, 138, 0.35),
        5px 5px 0 #2d2a6e;
}
html[data-contrast="high"] .game-title { text-shadow: 4px 4px 0 #333; }
.game-sub {
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
    color: var(--muted);
    max-width: 34ch;
    margin: 0 auto 32px;
}
.btn-start {
    font-size: clamp(1.1rem, 2.2vw, 1.35rem);
    padding: 14px 30px;
    letter-spacing: 0.06em;
}
.btn-start .caret { animation: blink 1.1s steps(1) infinite; }

.moon {
    position: absolute;
    top: clamp(24px, 9vh, 90px);
    right: clamp(20px, 9vw, 140px);
    width: clamp(56px, 8vw, 112px);
    z-index: 1;
    filter: drop-shadow(0 0 26px rgba(255, 229, 138, 0.4));
    animation: bob 7s ease-in-out infinite;
}

@media (max-width: 640px) {
    .title-screen { padding-top: 96px; }
    .moon { top: 18px; right: 18px; width: 48px; }
}

.landscape {
    position: absolute;
    left: 0; bottom: 0;
    width: 100%;
    height: clamp(210px, 32vw, 400px);
    z-index: 1;
}
.landscape .hill-far { fill: var(--hill-far); }
.landscape .pines { fill: var(--hill-mid); }
.landscape .hill-near, .landscape .sil { fill: var(--bg); }
.landscape .win { fill: #ffd27a; animation: flicker 5s steps(1) infinite; }
.landscape .win-2 { animation-delay: -2.3s; }
.landscape .lamp-light { fill: #fff3c4; }
.landscape .lamp-glow { animation: glow 4s ease-in-out infinite; }
.landscape .albert-b { opacity: 0; }
.landscape .albert-a { animation: strum-a .9s steps(1) infinite; }
.landscape .albert-b { animation: strum-b .9s steps(1) infinite; }
.landscape .float-note {
    opacity: 0;
    transform-box: fill-box;
    animation: note-up 3.6s ease-out infinite;
}
.landscape .fn-2 { animation-delay: 1.2s; }
.landscape .fn-3 { animation-delay: 2.4s; }
.title-screen::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 40px;
    z-index: 1;
    background: linear-gradient(to bottom, transparent, var(--bg));
}
/* fundido del suelo hacia el cielo de la siguiente sección */
.ground-fade {
    height: 120px;
    margin-top: -1px;
    background: linear-gradient(to bottom, var(--bg), transparent);
}

/* ---------- INICIO: mapa estelar ---------- */
.star-map { padding-top: 24px; }
.constellations {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 0;
    list-style: none;
}
/* desfase vertical con transform: las cajas mantienen todas el mismo tamaño */
.constellations { padding-bottom: 72px; }
.constellations li:nth-child(2) { transform: translateY(56px); }
.constellations li:nth-child(3) { transform: translateY(8px); }
.constellations li:nth-child(4) { transform: translateY(72px); }

.const-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 12px 16px 24px;
    color: var(--text);
    text-decoration: none;
    text-align: center;
    border: 2px solid transparent;
    transition: border-color .2s, background-color .2s;
}
.const-link:hover, .const-link:focus-visible {
    background: radial-gradient(circle at 50% 35%, rgba(255, 229, 138, 0.08), transparent 70%);
    border-color: var(--line);
    color: var(--text);
}
.const-art { width: 100%; max-width: 240px; aspect-ratio: 4 / 3; overflow: visible; }
.const-art .c-line {
    fill: none;
    stroke: var(--lav);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-opacity: 0.45;
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
    transition: stroke .3s, stroke-opacity .3s;
}
.const-art .c-star { fill: #fff; transition: fill .3s; transform-box: fill-box; transform-origin: center; }
.const-art .c-star.big { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .8)); }
.const-link:hover .c-line, .const-link:focus-visible .c-line { stroke: var(--star); stroke-opacity: 1; }
.const-link:hover .c-star, .const-link:focus-visible .c-star { fill: var(--star); }
.const-link:hover .const-art, .const-link:focus-visible .const-art { filter: drop-shadow(0 0 6px rgba(255, 229, 138, .45)); }
html.js .reveal .const-art .c-line { stroke-dashoffset: 1; }
html.js .reveal.is-visible .const-art .c-line { animation: draw 1.6s var(--ease) 1.2s forwards; }
html.js .reveal:not(.is-visible) .const-art .c-star { transform: scale(0); }
html.js .reveal.is-visible .const-art .c-star { animation: pop .45s var(--ease) backwards; }

.const-name {
    display: inline-flex; align-items: center; gap: 10px;
    margin-top: 10px;
    font-family: var(--font-deco);
    font-size: 1.45rem;
    font-weight: 600;
    line-height: 1.2;
}
.const-name img { width: 26px; height: 26px; }
.const-desc { margin-top: 8px; color: var(--muted); font-size: 1rem; max-width: 30ch; }
.const-go {
    margin-top: 12px;
    font-family: var(--font-deco);
    font-size: 0.98rem;
    color: var(--star);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

@media (max-width: 1000px) {
    .constellations { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
    .constellations { padding-bottom: 0; }
    .constellations li:nth-child(n) { transform: none; }
}
@media (max-width: 560px) {
    .constellations { grid-template-columns: 1fr; gap: 12px; }
    .const-link {
        display: grid;
        grid-template-columns: 110px 1fr;
        grid-template-rows: auto auto auto;
        column-gap: 16px;
        align-items: center;
        text-align: left;
        padding: 12px;
        border-color: var(--line);
        background: rgba(17, 25, 56, 0.45);
    }
    .const-art { grid-row: 1 / 4; }
    .const-name { margin-top: 0; font-size: 1.3rem; text-align: left; }
    .const-desc { margin-top: 4px; }
    .const-go { margin-top: 6px; }
}

/* ---------- INICIO: caja de diálogo ---------- */
.rpg {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
    padding: clamp(28px, 4vw, 44px);
    --frame: var(--lav);
}
.rpg-portrait { position: relative; }
.rpg-portrait .px-box { --frame: var(--lav); background: var(--panel-2); overflow: hidden; }
.rpg-portrait img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: 47% 24%;
    transform: scale(1.7);
    transform-origin: 45% 24%;
}
.name-tag {
    position: absolute;
    top: -20px; left: 16px;
    z-index: 2;
    padding: 4px 14px;
    font-family: var(--font-deco);
    font-weight: 700;
    color: var(--on-accent);
    background: var(--lav);
}
.rpg-text p + p { margin-top: 14px; }
.rpg-text p:first-child { font-size: 1.25rem; color: #fff; }
.rpg-text .btn-row { margin-top: 24px; }
.rpg-next {
    position: absolute;
    right: 20px; bottom: 14px;
    color: var(--lav);
    font-size: 1rem;
    animation: bob-small 1s steps(2) infinite;
}
@media (max-width: 720px) {
    .rpg { grid-template-columns: 1fr; }
    .rpg-portrait { max-width: 220px; }
}

/* ---------- INICIO: destacados ---------- */
.featured-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}
.feature-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(20px, 3vw, 36px);
    align-items: center;
    padding: clamp(24px, 3.5vw, 40px);
    --frame: var(--star);
}
.feature-card h3 { font-size: clamp(1.5rem, 3vw, 2rem); margin: 10px 0 12px; }
.feature-card p { color: var(--muted); }
.feature-card .tags { margin: 18px 0 22px; }
/* Portada del disco en tarjetas */
.cover-art {
    display: block;
    width: clamp(150px, 18vw, 220px);
    aspect-ratio: 1;
    flex: none;
    box-shadow: 0 0 0 4px var(--line-strong), 0 18px 40px rgba(0, 0, 0, .45);
    transition: box-shadow .2s;
}
.cover-art img { width: 100%; height: 100%; object-fit: cover; }
.cover-art:hover, .cover-art:focus-visible { box-shadow: 0 0 0 4px var(--star), 0 18px 40px rgba(0, 0, 0, .45); }
.more-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    padding: clamp(24px, 3vw, 36px);
    color: var(--text);
    text-decoration: none;
    transition: transform .2s var(--ease);
}
.more-card img { width: 64px; }
.more-card h3 { font-size: 1.45rem; }
.more-card p { color: var(--muted); }
.more-card:hover { color: var(--text); --frame: var(--star); }
.more-card .const-go { margin-top: 4px; }
@media (max-width: 900px) {
    .featured-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .feature-card { grid-template-columns: 1fr; }
}

/* ---------- PÁGINAS INTERIORES: cabecera ---------- */
.page-hero {
    position: relative;
    padding: clamp(56px, 10vw, 120px) 0 clamp(32px, 6vw, 64px);
    overflow: hidden;
}
.page-hero .wrap { position: relative; }
.page-hero h1 {
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    font-weight: 700;
    margin: 12px 0 14px;
    text-shadow: 4px 4px 0 #2d2a6e;
    max-width: 16ch;
}
html[data-contrast="high"] .page-hero h1 { text-shadow: none; }
.page-hero .lead { font-size: clamp(1.15rem, 2.2vw, 1.4rem); color: var(--muted); max-width: 46ch; }
.hero-constellation {
    position: absolute;
    right: var(--gutter);
    top: 50%;
    width: clamp(180px, 30vw, 380px);
    transform: translateY(-50%);
    opacity: .55;
    pointer-events: none;
}
.hero-constellation .c-line { stroke-opacity: .5; }
@media (max-width: 760px) {
    .hero-constellation { opacity: .22; right: -20px; }
}

/* ---------- SOBRE MÍ ---------- */
.char-sheet {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: clamp(28px, 5vw, 56px);
    align-items: start;
}
.char-card { padding: 16px; --frame: var(--lav); }
.char-card img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: 46% 28%;
}
.char-plate { padding: 16px 6px 4px; }
.char-plate strong { display: block; font-family: var(--font-display); font-size: 1.6rem; line-height: 1.2; }
.alias { display: flex; align-items: center; gap: 10px; margin-top: 6px; color: var(--lav); font-weight: 700; }
.alias img { width: 24px; height: 24px; }

.stats { display: grid; gap: 0; }
.stats div {
    display: grid;
    grid-template-columns: minmax(110px, 170px) 1fr;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 2px dashed var(--line);
}
.stats dt {
    font-family: var(--font-deco);
    color: var(--star);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: 0.98rem;
    padding-top: 2px;
}
.stats dt::before { content: "▸ "; }
.stats dd { font-weight: 700; }
.stats dd a { color: var(--sky); }
.quote {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: start;
    margin-top: 28px;
    padding: 22px 24px;
    --frame: var(--coral);
}
.quote img { width: 44px; margin-top: 4px; }
.quote blockquote p { font-size: 1.15rem; font-style: italic; }
.quote cite { display: block; margin-top: 8px; color: var(--coral); font-style: normal; font-weight: 700; }

.story {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(28px, 5vw, 64px);
    align-items: center;
}
.story-text p + p { margin-top: 16px; }
.story-text p:first-child { font-size: 1.22rem; color: #fff; }
.story-photo { padding: 14px 14px 18px; --frame: var(--sky); }
.story-photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

/* Conocimientos: un único cielo; cada ámbito es una constelación de logos */
.skill-sky {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 56px 40px;
    align-items: start;
}
.skill-group { display: flex; flex-direction: column; align-items: center; }
.skill-group h3 {
    order: 2;
    display: flex; align-items: center; gap: 8px;
    margin-top: 14px;
    font-family: var(--font-deco);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--lav);
    text-align: center;
}
.skill-group h3::before, .skill-group h3::after {
    content: "";
    width: 8px; height: 8px; flex: none;
    background: var(--star);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}
.skill-const { position: relative; width: 100%; }
.skill-links {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    overflow: visible;
    pointer-events: none;
}
.skill-links line {
    stroke: var(--lav);
    stroke-width: 1.3;
    stroke-opacity: .55;
    stroke-dasharray: 3 4;
}
.skill-const ul {
    position: relative;
    display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 6px;
    padding: 0; list-style: none;
}
.skill-const li {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: 72px;
}
.skill-const li:nth-child(even) { margin-top: 22px; }
.skill-node { display: grid; place-items: center; width: 36px; height: 36px; }
.skill-node img {
    width: 30px; height: 30px; object-fit: contain;
    filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .6)) drop-shadow(0 0 8px rgba(255, 240, 200, .3));
}
.skill-node.is-dark img { filter: invert(1) drop-shadow(0 0 8px rgba(255, 240, 200, .35)); }
.skill-name { font-size: 0.82rem; font-weight: 700; line-height: 1.2; text-align: center; color: var(--muted); }
.stat-line { display: block; }
.stat-line + .stat-line { margin-top: 4px; }

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    grid-auto-rows: 1fr;
    gap: 16px;
    padding: 0;
    list-style: none;
}
.link-card {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 100%;
    min-height: 76px;
    padding: 14px 18px;
    color: var(--text);
    text-decoration: none;
    background: var(--panel);
    border: 2px solid var(--line);
    transition: border-color .2s, transform .2s var(--ease);
}
.link-card svg { width: 30px; height: 30px; flex: none; fill: currentColor; color: var(--sky); }
.link-card strong { display: block; font-family: var(--font-display); font-size: 1.15rem; font-weight: 700; }
.link-card > span { min-width: 0; }
.link-card span span { color: var(--muted); font-size: 0.98rem; overflow-wrap: anywhere; }
.link-card:hover { color: var(--text); border-color: var(--star); }
.link-card:hover svg { color: var(--star); }

.collection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 20px;
    padding: 0;
    list-style: none;
}
.collect {
    display: block;
    height: 100%;
    padding: 10px 10px 14px;
    color: var(--text);
    text-decoration: none;
    background: var(--panel);
    border: 2px solid var(--line);
    transition: transform .2s var(--ease), border-color .2s;
}
.collect img { width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--panel-2); }
.collect h3 { font-family: var(--font-body); font-size: 1.02rem; font-weight: 700; margin: 10px 0 6px; line-height: 1.3; }
.collect .tag { font-size: 0.8rem; padding: 2px 8px; }
.collect:hover { color: var(--text); border-color: var(--star); transform: translateY(-4px) rotate(-0.6deg); }

@media (max-width: 860px) {
    .char-sheet, .story { grid-template-columns: 1fr; }
    .char-card { max-width: 420px; }
    .story-photo { max-width: 380px; }
}
@media (max-width: 520px) {
    .stats div { grid-template-columns: 1fr; gap: 2px; }
    .collection { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

/* ---------- PROYECTOS ---------- */
.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    margin-bottom: 20px;
}
.toolbar-label { font-family: var(--font-deco); color: var(--star); margin-right: 6px; }
.filter-status { color: var(--muted); font-size: 0.98rem; min-height: 1.6em; }

.special-level {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
    padding: clamp(24px, 4vw, 44px);
    margin-bottom: clamp(40px, 6vw, 64px);
    --frame: var(--star);
}
.special-level h3 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); margin: 12px 0; }
.special-level p { color: var(--muted); max-width: 70ch; }
.special-level .tags { margin: 18px 0 24px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
    padding: 3px 12px;
    font-family: var(--font-deco);
    font-size: 0.95rem;
    color: var(--on-accent);
    background: var(--star);
}
.badge--alt { background: var(--lav); }

.level-group + .level-group { margin-top: clamp(48px, 7vw, 72px); }
.level-group h2 {
    display: flex; align-items: center; gap: 14px;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 24px;
}
.level-group h2::after { content: ""; flex: 1; height: 2px; background: repeating-linear-gradient(to right, var(--line) 0 8px, transparent 8px 14px); }

.levels {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 28px;
    padding: 0;
    list-style: none;
}
.level {
    display: flex;
    flex-direction: column;
    height: calc(100% - 2 * var(--px));
    transition: transform .2s var(--ease);
}
.level:hover, .level:focus-within { --frame: var(--star); }
/* el botón que hace clicable toda la tarjeta no se mueve: si se desplazara, su capa
   invisible (::after) se encogería al tamaño del botón y el cursor parpadearía */
.level .stretch:hover, .level .stretch:active { transform: none; }
.level-top {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 10px 16px;
    font-family: var(--font-deco);
    font-size: 0.95rem;
    color: var(--star);
    border-bottom: 2px solid var(--line);
}
.level-top > span:last-child { color: var(--muted); }
.level-art {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0b1128;
}
.level-art::before {
    content: "";
    position: absolute;
    inset: -20px;
    background-image: var(--art);
    background-size: cover;
    background-position: center;
    filter: blur(22px) saturate(1.2);
    opacity: .5;
}
.level-art img {
    position: relative;
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 12px;
}
.level-body { display: flex; flex-direction: column; gap: 12px; flex: 1; padding: 18px 20px 22px; }
.level-body h3 { font-size: 1.4rem; }
.level-body p { color: var(--muted); font-size: 1.02rem; }
.level-body .btn { align-self: flex-start; margin-top: auto; }
/* toda la tarjeta clicable a través del botón */
.level .stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
@media (max-width: 700px) {
    .special-level { grid-template-columns: 1fr; }
}

/* ---------- ELYA ---------- */
.elya-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: calc(100svh - var(--header-h));
    padding: 64px 0;
    overflow: hidden;
    isolation: isolate;
}
.elya-hero-art { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.elya-hero-art img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 30% 62%;
}
.elya-hero-art::after {
    content: "";
    position: absolute; inset: 0;
    background:
        linear-gradient(to left, rgba(10, 15, 36, .94) 0%, rgba(10, 15, 36, .82) 34%, rgba(10, 15, 36, .1) 68%, transparent 80%),
        linear-gradient(to bottom, rgba(10, 15, 36, .45), transparent 14%, transparent 90%, var(--bg));
}
.elya-hero-content { display: grid; grid-template-columns: min(100%, 520px); justify-content: end; }
.elya-hero-content > .elya-logo { width: 96px; height: 96px; margin-bottom: 14px; filter: drop-shadow(0 0 18px rgba(217, 195, 250, .45)); }
.elya-hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); margin: 12px 0 14px; max-width: none; text-shadow: 0 2px 18px rgba(0, 0, 0, .6); }
.elya-hero .lead { color: #dfe4fb; font-size: clamp(1.15rem, 2vw, 1.35rem); }
.elya-hero .chips { margin-top: 26px; }
.elya-hero .chips a { text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.elya-hero .chips img { width: 20px; height: 20px; }
@media (max-width: 800px) {
    .elya-hero { display: block; min-height: 0; padding: 0 0 24px; }
    .elya-hero-art { position: relative; aspect-ratio: 4 / 3; }
    .elya-hero-art::after { background: linear-gradient(to bottom, transparent 55%, var(--bg)); }
    .elya-hero-content { margin-top: -48px; }
    .elya-hero-content { justify-content: start; }
}

/* Disco: portada con vinilo */
.album-row { display: grid; grid-template-columns: auto 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; }
.album-art {
    position: relative;
    display: block;
    width: clamp(180px, 24vw, 280px);
    aspect-ratio: 1;
}
.album-cover {
    width: 100%; height: 100%; object-fit: cover;
    box-shadow: 0 20px 44px rgba(0, 0, 0, .5);
}
@media (max-width: 700px) {
    .album-row { grid-template-columns: 1fr; }
    .album-art { width: min(60vw, 260px); }
}

/* Demo: escenas ilustradas */
.scenes { display: grid; grid-template-columns: 1.55fr 1fr; gap: 24px; margin: 26px 0 8px; align-items: start; }
.scene { margin: 0; }
.scene a { display: block; position: relative; overflow: hidden; background: #000; box-shadow: 0 0 0 2px var(--line); }
.scene img { width: 100%; display: block; }
.scene a { transition: box-shadow .2s; }
.scene a:hover, .scene a:focus-visible { box-shadow: 0 0 0 3px var(--star); }
.scene--cinema img { aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 55%; }
.scene--poster img { aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 62%; }
.letterbox::before, .letterbox::after {
    content: "";
    position: absolute; left: 0; right: 0; z-index: 1;
    height: 9%;
    background: #000;
}
.letterbox::before { top: 0; }
.letterbox::after { bottom: 0; }
.scene figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 10px; }
.scene figcaption strong { font-size: 1.05rem; }
.scene figcaption span { color: var(--muted); font-size: .95rem; }
@media (max-width: 700px) { .scenes { grid-template-columns: 1fr; } }

/* Visor de imágenes */
.lightbox {
    max-width: min(92vw, 1100px);
    max-height: 92vh;
    padding: 0;
    margin: auto;
    border: 0;
    background: transparent;
    overflow: visible;
}
.lightbox::backdrop { background: rgba(3, 6, 18, .88); }
.lightbox img { max-width: min(92vw, 1100px); max-height: 88vh; width: auto; height: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .6); }
.lightbox-close {
    position: absolute; top: -14px; right: -14px;
    width: 44px; height: 44px;
    font-size: 1.5rem; line-height: 1;
    color: var(--on-accent); background: var(--star);
    border: 0; border-radius: 50%; cursor: pointer;
}

.intro-text { font-size: 1.2rem; max-width: 72ch; }
.pillars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 32px;
    padding: 0;
    list-style: none;
}
.pillar { display: flex; flex-direction: column; gap: 12px; height: calc(100% - 2 * var(--px)); padding: 26px 24px; }
.pillar:nth-child(1) { --frame: var(--lav); }
.pillar:nth-child(2) { --frame: var(--star); }
.pillar:nth-child(3) { --frame: var(--mint); }
.pillar img { width: 48px; height: 48px; object-fit: contain; }
.pillar h3 { font-size: 1.45rem; }
.pillar p { color: var(--muted); font-size: 1.02rem; }
.pillar a { margin-top: auto; font-family: var(--font-deco); text-decoration: none; }
@media (max-width: 900px) { .pillars { grid-template-columns: 1fr; } }

.chapter { padding: clamp(24px, 4vw, 48px); }
.chapter + .chapter { margin-top: clamp(40px, 6vw, 64px); }
.chapter-head { margin-bottom: 24px; }
.chapter-num {
    font-family: var(--font-deco);
    color: var(--star);
    text-transform: uppercase;
    letter-spacing: .1em;
    font-size: 0.98rem;
}
.chapter-head h3 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-top: 6px;
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
}
.chapter-head .glyph { color: var(--lav); font-family: 'Segoe UI Symbol', 'DejaVu Sans', var(--font-body); font-weight: 400; font-variant-emoji: text; }
.chapter-head .glyph-img { width: 36px; height: 36px; object-fit: contain; }
#libro { --frame: var(--lav); }
#disco { --frame: var(--star); }
#juego { --frame: var(--mint); }

.book-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 4vw, 48px); }
.synopsis {
    padding: 24px 26px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 4px solid var(--lav);
}
.synopsis h4 { font-size: 1.3rem; margin-bottom: 12px; }
.synopsis p + p { margin-top: 14px; }
.synopsis > p:last-of-type { color: var(--lav); font-style: italic; }
.action-group + .action-group { margin-top: 22px; }
.action-group h4 { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; color: var(--muted); }
.edition { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 14px; }
.fine-print { margin-top: 18px; font-size: 0.95rem; color: var(--muted); font-style: italic; }
@media (max-width: 860px) { .book-grid { grid-template-columns: 1fr; } }

.stream-row { margin-top: 18px; }
.stream-row .btn svg { width: 22px; height: 22px; }
.ico-spotify { color: #1ed760; }
.ico-youtube { color: #ff4e45; }
.ico-ytm { color: #ff6b6b; }
.ico-apple { color: #ff8fb1; }
.btn--ghost:hover .ico-spotify, .btn--ghost:hover .ico-youtube, .btn--ghost:hover .ico-ytm, .btn--ghost:hover .ico-apple { color: inherit; }

.setlist { margin-top: 36px; }
.setlist-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; margin-bottom: 16px; }
.setlist-head h4 { font-size: 1.5rem; }
.setlist-head span { color: var(--muted); font-family: var(--font-deco); }
.setlist .chips { margin-bottom: 8px; }
.tracks { padding: 0; list-style: none; margin-top: 16px; border-top: 2px solid var(--line); }
.track { border-bottom: 2px solid var(--line); }
.track summary, .track-row {
    display: grid;
    grid-template-columns: 3ch 1fr auto 28px;
    gap: 16px;
    align-items: center;
    min-height: 60px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
}
.track summary::-webkit-details-marker { display: none; }
.track summary:hover { background: rgba(255, 229, 138, 0.06); }
.track-row { cursor: default; opacity: .8; grid-template-columns: 3ch 1fr auto; }
.track-num { font-family: var(--font-deco); color: var(--star); font-size: 1.1rem; }
.track-title { font-weight: 700; font-size: 1.1rem; }
.track-title small { display: flex; align-items: center; gap: 6px; font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.track-title small img { width: 14px; height: 14px; }
.track .tag { font-size: 0.82rem; padding: 2px 10px 2px 8px; }
.track-chevron { width: 24px; height: 24px; transition: transform .25s var(--ease); color: var(--muted); }
.track[open] .track-chevron { transform: rotate(90deg); color: var(--star); }
.track[open] summary { background: rgba(255, 229, 138, 0.06); }
.track[open] .track-title { color: var(--star); }
.track-body { padding: 4px 12px 22px calc(3ch + 28px); }
.track-body p { color: var(--muted); max-width: 70ch; }
.track-body .pages { margin-top: 8px; font-size: 0.95rem; color: var(--lav); }
.track-body .btn { margin-top: 14px; }
.tag--cinematic::before { background: var(--lav); transform: rotate(45deg) scale(.85); }
.tag--minigame::before { background: var(--star); border-radius: 50%; }
.tag--stage::before { background: var(--mint); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
@supports (interpolate-size: allow-keywords) {
    .track { interpolate-size: allow-keywords; }
    .track::details-content { height: 0; overflow: clip; transition: height .3s var(--ease), content-visibility .3s allow-discrete; }
    .track[open]::details-content { height: auto; }
}
@media (max-width: 600px) {
    .track summary { grid-template-columns: 2.5ch 1fr 24px; gap: 10px; }
    .track summary .tag { grid-column: 2; grid-row: 2; justify-self: start; }
    .track summary .track-chevron { grid-column: 3; grid-row: 1 / 3; }
    .track-row { grid-template-columns: 2.5ch 1fr; gap: 10px; }
    .track-row .tag { grid-column: 2; justify-self: start; }
    .track-body { padding-left: 12px; }
}

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 18px; padding: 0; list-style: none; }
.feature {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid var(--line);
}
.feature img { width: 40px; height: 40px; object-fit: contain; }
.feature h5 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; }
.feature p { color: var(--muted); font-size: 1rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.chapter h4.sub { font-family: var(--font-body); font-size: 1.1rem; font-weight: 700; margin-top: 26px; color: var(--muted); }

/* ---------- CONTACTO ---------- */
.terminal { --frame: var(--sky); margin-bottom: clamp(32px, 5vw, 48px); }
.terminal-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 20px;
    border-bottom: 2px solid var(--line);
    font-family: var(--font-deco);
    color: var(--sky);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 0.95rem;
}
.terminal-bar .dot { width: 10px; height: 10px; background: var(--mint); }
.terminal-bar .dot:nth-child(2) { background: var(--star); }
.terminal-bar .dot:nth-child(3) { background: var(--coral); margin-right: 8px; }
.terminal-body {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: clamp(20px, 4vw, 40px);
    align-items: center;
    padding: clamp(24px, 5vw, 48px);
}
.terminal-body > img { width: clamp(64px, 10vw, 104px); }
.terminal-body h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); }
.terminal-body p { color: var(--muted); margin: 10px 0 16px; max-width: 60ch; }
.big-mail {
    display: inline-block;
    font-size: clamp(1.2rem, 3.4vw, 1.9rem);
    font-weight: 700;
    color: #fff;
    word-break: break-all;
}
.big-mail::after { content: "_"; color: var(--star); animation: blink 1s steps(1) infinite; }
.terminal .btn-row { margin-top: 20px; }
.btn.is-done { --btn-bg: var(--mint); --btn-edge: #8fd16a; }
.copy-status { min-height: 1.5em; color: var(--mint); margin-top: 6px; font-weight: 700; }
.contact-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.contact-card { padding: clamp(22px, 3.5vw, 36px); }
.contact-card h2 { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; }
.contact-card h2 svg { width: 26px; height: 26px; fill: var(--star); flex: none; }
.contact-card > p { color: var(--muted); margin: 10px 0 20px; }
.contact-card .link-grid { grid-template-columns: 1fr; }
@media (max-width: 860px) {
    .contact-cards { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .terminal-body { grid-template-columns: 1fr; }
}

/* ---------- 404 ---------- */
.lost { text-align: center; padding-top: 12px; }
.lost-code {
    font-family: var(--font-pixel);
    font-size: clamp(5rem, 22vw, 11rem);
    font-weight: 700;
    line-height: 1;
    color: var(--star);
    text-shadow: 6px 6px 0 #2d2a6e;
}
.lost-astro { width: clamp(110px, 14vw, 152px); margin: 0 auto 4px; }
.lost h1 { font-size: clamp(1.8rem, 4.5vw, 2.8rem); margin: 10px 0 12px; }
.lost .lead { color: var(--muted); max-width: 52ch; margin: 0 auto 26px; font-size: 1.2rem; }
.lost .btn-row { justify-content: center; }
.suggest { max-width: 520px; margin: 40px auto 0; padding: 24px 28px; text-align: left; }
.suggest h2 { font-size: 1.3rem; margin-bottom: 10px; }
.suggest ul { padding-left: 1.2em; }
.suggest li { margin: 6px 0; }
.suggest li::marker { content: "★ "; color: var(--star); }

/* =========================================================
   6. MOVIMIENTO
   ========================================================= */
@keyframes blink { 50% { opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bob-small { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pop { from { transform: scale(0); } }
@keyframes flicker { 0%, 100% { opacity: 1; } 42% { opacity: .55; } 44% { opacity: 1; } 71% { opacity: .8; } }
@keyframes glow { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes strum-a { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes strum-b { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes note-up {
    0% { opacity: 0; transform: translate(0, 0); }
    15% { opacity: 1; }
    100% { opacity: 0; transform: translate(-6px, -22px); }
}

/* Reducir movimiento (preferencia del sistema) */
html[data-motion="reduce"] *,
html[data-motion="reduce"] *::before,
html[data-motion="reduce"] *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}
html[data-motion="reduce"] .landscape .float-note { display: none; }
html[data-motion="reduce"] .landscape .albert-a { opacity: 1; }
html[data-motion="reduce"] .landscape .albert-b { opacity: 0; }
html[data-motion="reduce"] .reveal .const-art .c-line { stroke-dashoffset: 0; }

/* Colores forzados (Windows alto contraste) */
@media (forced-colors: active) {
    .px-box, .btn { border: 2px solid CanvasText; }
    .tag::before { forced-color-adjust: none; }
}

/* ---------- Experiencia: registro de misiones ---------- */
.quests {
    position: relative;
    display: grid;
    gap: 28px;
    padding: 0 0 0 36px;
    margin: 0;
    list-style: none;
}
.quests::before {
    content: "";
    position: absolute;
    left: 9px; top: 8px; bottom: 8px;
    border-left: 2px dashed var(--line-strong);
}
.quest { position: relative; }
.quest::before {
    content: "";
    position: absolute;
    left: -36px; top: 2px;
    width: 20px; height: 20px;
    background: var(--star);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    filter: drop-shadow(0 0 6px rgba(255, 229, 138, .6));
}
.quest-date {
    font-family: var(--font-deco);
    color: var(--star);
    letter-spacing: .06em;
    font-size: 0.98rem;
    margin-bottom: 10px;
}
.quest-body { padding: 20px 24px; }
.quest-body h3 { font-size: 1.3rem; }
.quest-org { color: var(--lav); font-weight: 700; margin: 4px 0 10px; }
.quest-body > p:not(.quest-org) { color: var(--muted); }
.quest-tasks { padding-left: 1.1em; display: grid; gap: 8px; color: var(--muted); }
.quest-tasks li::marker { content: "▸ "; color: var(--star); }
.quest-tasks strong { color: var(--text); }
.quest-body .btn-row { margin-top: 16px; }
.quest-body .btn svg { width: 18px; height: 18px; }

/* ---------- Logros de la novela ---------- */
.achievements {
    display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px;
    margin-top: 20px; padding-top: 16px;
    border-top: 2px dashed var(--line);
}
.ach-title {
    flex-basis: 100%;
    font-family: var(--font-deco);
    color: var(--star);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: .95rem;
}
.synopsis .ach {
    flex: 1 1 160px;
    display: flex; flex-direction: column; gap: 2px;
    margin: 0;
    padding: 12px 14px;
    color: var(--text);
    font-style: normal;
    background: rgba(255, 229, 138, .06);
    border: 2px solid rgba(255, 229, 138, .35);
}
.ach strong { font-family: var(--font-deco); font-size: 1.7rem; color: var(--star); line-height: 1.1; }
.ach span { color: var(--muted); font-size: .95rem; }
