:root {
    --bg: #e9edf4;
    --text: #121826;
    --muted: #677189;
    --line: rgba(18, 24, 38, 0.12);
    --line-strong: rgba(18, 24, 38, 0.22);
    --accent: #2d7ef7;
    --accent-deep: #1752bf;
    --shadow: 0 30px 80px rgba(19, 30, 52, 0.18);
    --card: rgba(255, 255, 255, 0.82);
    --card-strong: rgba(255, 255, 255, 0.94);
    --screen-text: #101828;
    --screen-muted: #475467;
    --screen-card: rgba(255, 255, 255, 0.72);
    --screen-card-line: rgba(16, 24, 40, 0.1);
    --screen-chip: rgba(16, 24, 40, 0.06);
    --screen-active-bg: linear-gradient(135deg, #1b2540, #2b3550);
    --screen-top: rgba(247, 249, 253, 0.82);
    --game-bg: #eef2f8;
    --game-board: #e2e9f4;
    --game-grid-line: rgba(16, 24, 40, 0.085);
    --game-overlay: rgba(247, 249, 253, 0.9);
    --game-card-back: rgba(16, 24, 40, 0.06);
    --game-board-line: rgba(16, 24, 40, 0.24);
    --lock-bg: radial-gradient(circle at 22% 12%, rgba(90, 150, 255, 0.2), transparent 42%), radial-gradient(circle at 78% 82%, rgba(150, 180, 235, 0.26), transparent 46%), linear-gradient(170deg, #fbfcfe 0%, #dde6f4 100%);
    --lock-text: #101828;
    --lock-muted: rgba(16, 24, 40, 0.62);
    --lock-grip: rgba(16, 24, 40, 0.78);
    color-scheme: light dark;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 14%, rgba(86, 154, 255, 0.28), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(180, 198, 255, 0.32), transparent 20%),
        radial-gradient(circle at 78% 74%, rgba(138, 169, 255, 0.18), transparent 22%),
        linear-gradient(145deg, #f7f9fd 0%, #e7edf7 42%, #dfe7f3 100%);
    min-height: 100vh;
}

html[data-theme="light"] {
    color-scheme: light;
    --screen-text: #101828;
    --screen-muted: #475467;
    --screen-card: rgba(255, 255, 255, 0.72);
    --screen-card-line: rgba(16, 24, 40, 0.1);
    --screen-chip: rgba(16, 24, 40, 0.06);
    --screen-active-bg: linear-gradient(135deg, #1b2540, #2b3550);
    --screen-top: rgba(247, 249, 253, 0.82);
    --game-bg: #eef2f8;
    --game-board: #e2e9f4;
    --game-grid-line: rgba(16, 24, 40, 0.085);
    --game-overlay: rgba(247, 249, 253, 0.9);
    --game-card-back: rgba(16, 24, 40, 0.06);
    --game-board-line: rgba(16, 24, 40, 0.24);
    --lock-bg: radial-gradient(circle at 22% 12%, rgba(90, 150, 255, 0.2), transparent 42%), radial-gradient(circle at 78% 82%, rgba(150, 180, 235, 0.26), transparent 46%), linear-gradient(170deg, #fbfcfe 0%, #dde6f4 100%);
    --lock-text: #101828;
    --lock-muted: rgba(16, 24, 40, 0.62);
    --lock-grip: rgba(16, 24, 40, 0.78);
    --text: #121826;
    --muted: #677189;
    --line: rgba(18, 24, 38, 0.12);
    --line-strong: rgba(18, 24, 38, 0.22);
    --accent: #2d7ef7;
    --accent-deep: #1752bf;
    --shadow: 0 30px 80px rgba(19, 30, 52, 0.18);
    --card: rgba(255, 255, 255, 0.82);
    --card-strong: rgba(255, 255, 255, 0.94);
}

html[data-theme="dark"] {
    color-scheme: dark;
    --screen-text: rgba(244, 247, 251, 0.92);
    --screen-muted: rgba(229, 235, 244, 0.7);
    --screen-card: rgba(255, 255, 255, 0.05);
    --screen-card-line: rgba(255, 255, 255, 0.1);
    --screen-chip: rgba(255, 255, 255, 0.08);
    --screen-active-bg: rgba(255, 255, 255, 0.14);
    --screen-top: transparent;
    --game-bg: #0d1526;
    --game-board: #08101f;
    --game-grid-line: rgba(255, 255, 255, 0.045);
    --game-overlay: rgba(8, 16, 31, 0.86);
    --game-card-back: rgba(255, 255, 255, 0.07);
    --game-board-line: rgba(255, 255, 255, 0.1);
    --lock-bg: radial-gradient(circle at 22% 12%, rgba(110, 168, 255, 0.28), transparent 42%), radial-gradient(circle at 78% 82%, rgba(64, 100, 176, 0.24), transparent 46%), linear-gradient(170deg, #101a2f 0%, #070b15 100%);
    --lock-text: #f4f7fb;
    --lock-muted: rgba(244, 247, 251, 0.72);
    --lock-grip: rgba(255, 255, 255, 0.82);
    --text: #f4f7fb;
    --muted: #aab4c6;
    --line: rgba(255, 255, 255, 0.1);
    --line-strong: rgba(255, 255, 255, 0.18);
    --accent: #6ea8ff;
    --accent-deep: #8cb8ff;
    --shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
    --card: rgba(14, 20, 35, 0.86);
    --card-strong: rgba(18, 25, 43, 0.96);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Iconos Lucide 1.34.0 (ISC) incrustados como SVG: trazo de 2px sobre grilla de 24px. */
.lucide {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.quick-launcher {
    position: fixed;
    bottom: 18px;
    right: 18px;
    z-index: 13;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    background: rgba(15, 23, 40, 0.72);
    color: #fff;
    backdrop-filter: blur(14px);
    box-shadow: 0 14px 30px rgba(15, 23, 40, 0.2);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.quick-launcher:hover,
.quick-launcher:focus-visible {
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-1px);
}

.quick-launcher__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quick-launcher__icon .lucide {
    width: 22px;
    height: 22px;
}

.quick-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11;
    background: rgba(5, 8, 16, 0.28);
    backdrop-filter: blur(4px);
}

.quick-drawer {
    position: fixed;
    bottom: 86px;
    right: 18px;
    z-index: 12;
    width: min(320px, calc(100vw - 36px));
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(16, 23, 40, 0.92), rgba(9, 14, 24, 0.94));
    color: #fff;
    backdrop-filter: blur(18px);
    box-shadow: 0 28px 60px rgba(6, 10, 18, 0.3);
    transform: translateX(calc(100% + 36px));
    opacity: 0;
    pointer-events: none;
    transition: transform 240ms ease, opacity 240ms ease;
}

.quick-drawer.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.quick-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.quick-drawer__title {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.quick-drawer__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.quick-drawer__actions {
    display: grid;
    gap: 10px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 54px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

a.quick-action {
    text-decoration: none;
}

.quick-action:hover,
.quick-action:focus-visible {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(-2px);
}

.quick-action__icon,
.theme-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.95rem;
    line-height: 1;
}

.theme-toggle {
    margin-top: 4px;
    justify-content: flex-start;
    cursor: pointer;
}

.theme-toggle__text {
    flex: 1;
}

.drawer-open,
.lock-open {
    overflow: hidden;
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(-2px);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(115deg, transparent 0 61%, rgba(255, 255, 255, 0.2) 61% 64%, transparent 64% 100%),
        linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.72), transparent 16%),
        radial-gradient(circle at 68% 30%, rgba(255, 255, 255, 0.3), transparent 24%);
    background-size: auto, 48px 48px, 48px 48px, auto, auto;
    opacity: 0.8;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at center, transparent 0 38%, rgba(255, 255, 255, 0.14) 62%, rgba(185, 198, 220, 0.18) 100%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 58%);
    mix-blend-mode: soft-light;
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
}

p {
    line-height: 1.7;
}

.page-shell {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    padding: 8px 0 16px;
}

.site-footer,
.hero {
    position: relative;
    z-index: 1;
}

.hero {
    min-height: calc(100vh - 88px);
    min-height: calc(100dvh - 88px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0 0 20px;
}

.hero-copy {
    backdrop-filter: blur(18px);
}

.hero-copy {
    width: 100%;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 44px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.3));
    box-shadow: var(--shadow);
}

.hero-copy-minimal {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: center;
}

.eyebrow {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(18, 24, 38, 0.7);
}

h1,
h2,
h3,
.metric,
.panel-label {
    font-family: "Space Grotesk", sans-serif;
}

h1 {
    margin: 0;
    font-size: clamp(3.3rem, 7vw, 6rem);
    line-height: 0.9;
    letter-spacing: -0.05em;
}

.iphone-stage {
    width: 100%;
}

.iphone-device {
    position: relative;
    /* --tilt-x / --tilt-y los escribe main.js solo con raton fino. */
    transform: perspective(1500px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
    transition: transform 460ms cubic-bezier(0.22, 1, 0.36, 1);
    width: min(100%, 410px);
    margin: 0 auto;
    padding: 12px;
    border-radius: 48px;
    background: linear-gradient(180deg, #0f1728, #1b2336 55%, #0f1728 100%);
    box-shadow: 0 34px 70px rgba(15, 23, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/*
 * Dynamic Island: el notch se expande para dar avisos (enlace copiado, cambio
 * de tema o idioma). Sustituye a los window.alert() del navegador, que
 * interrumpian con un cuadro del sistema en medio del diseno.
 */
/*
 * Boton lateral del chasis: el equivalente fisico de "bloquear pantalla".
 * Sobresale del marco, asi que .iphone-device no puede recortar su contenido.
 */
.device-side-button {
    position: absolute;
    top: 25%;
    right: -4px;
    width: 5px;
    height: 74px;
    padding: 0;
    border: 0;
    border-radius: 0 5px 5px 0;
    background: linear-gradient(180deg, #56658a, #333f5c 55%, #56658a);
    box-shadow: 1px 0 3px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: background 180ms ease, transform 180ms ease;
}

/*
 * Volumen y silencio: pura decoracion del chasis, como el notch o la barra de
 * inicio. Estan para que el boton de la derecha se lea como un boton fisico y
 * no como un artefacto suelto del diseno.
 */
.device-volume {
    position: absolute;
    top: 22%;
    left: -4px;
    width: 5px;
    height: 30px;
    border-radius: 5px 0 0 5px;
    background: linear-gradient(180deg, #56658a, #333f5c);
    box-shadow: -1px 0 3px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.device-volume::before,
.device-volume::after {
    content: "";
    position: absolute;
    left: 0;
    width: 5px;
    border-radius: 5px 0 0 5px;
    background: inherit;
    box-shadow: inherit;
}

.device-volume::before {
    top: -44px;
    height: 26px;
}

.device-volume::after {
    top: 42px;
    height: 46px;
}

.device-side-button::after {
    /* Area de pulsacion comoda sin engordar el boton dibujado. Se extiende
       hacia dentro, nunca a la derecha: el aparato ya toca el borde de la
       ventana y sobresalir ahi provocaba scroll horizontal en la pagina. */
    content: "";
    position: absolute;
    inset: -14px 0 -14px -18px;
}

.device-side-button:hover,
.device-side-button:focus-visible {
    background: linear-gradient(180deg, #4a5878, #2b3550);
    transform: translateX(1px);
}

.device-side-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.iphone-device[data-tilt="active"] {
    transition: transform 120ms linear;
}

.iphone-notch {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 34%;
    height: 26px;
    padding: 0;
    border-radius: 0 0 18px 18px;
    background: #0a1020;
    overflow: hidden;
    z-index: 6;
    transition: width 420ms cubic-bezier(0.34, 1.32, 0.64, 1),
        height 420ms cubic-bezier(0.34, 1.32, 0.64, 1),
        padding 420ms ease,
        border-radius 320ms ease;
}

/* El selector de atributo gana por especificidad a los cambios de tamano que
   el notch recibe en cada media query, sin depender del orden del archivo. */
.iphone-notch[data-island="active"] {
    width: min(88%, 292px);
    height: 38px;
    padding: 0 16px;
    border-radius: 999px;
}

.island-icon,
.island-message {
    opacity: 0;
    transform: translateY(7px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.iphone-notch[data-island="active"] .island-icon,
.iphone-notch[data-island="active"] .island-message {
    opacity: 1;
    transform: none;
    transition-delay: 140ms;
}

.island-icon {
    display: inline-flex;
    flex: none;
    color: #34c759;
}

.iphone-notch[data-tone="warn"] .island-icon {
    color: #ff9f0a;
}

.island-icon .lucide {
    width: 16px;
    height: 16px;
}

/* Mientras la isla habla, la barra de estado se aparta: si no, la pastilla
   recorta la hora y la bateria. El notch y .iphone-screen son hermanos. */
.iphone-notch[data-island="active"] ~ .iphone-screen .status-bar {
    opacity: 0;
}

.status-bar {
    transition: opacity 220ms ease;
}

.island-message {
    margin: 0;
    /* Red de seguridad: un texto mas largo de lo previsto se corta al final
       con puntos suspensivos, en vez de recortarse por los dos lados. */
    min-width: 0;
    overflow: hidden;
    color: #f4f7fb;
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.iphone-screen {
    position: relative;
    --deck-height: clamp(300px, calc(100vh - 268px), 660px);
    --deck-height: clamp(300px, calc(100dvh - 268px), 660px);
    display: flex;
    flex-direction: column;
    padding: 18px 14px 14px;
    border-radius: 36px;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 28%),
        linear-gradient(180deg, #f7f9fd 0%, #e9eef6 100%);
    overflow: hidden;
}

.iphone-screen::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 44%);
    pointer-events: none;
}

.iphone-header {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 14px;
    padding: 4px 8px 12px;
}

.iphone-header .eyebrow {
    color: rgba(16, 24, 40, 0.62);
}

.iphone-header h1 {
    font-size: clamp(2.7rem, 6vw, 4rem);
    line-height: 0.92;
}

.status-bar {
    position: relative;
    z-index: 5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #101828;
}

.status-icons {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.signal-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 12px;
}

.signal-bars i {
    display: block;
    width: 3px;
    background: currentColor;
    border-radius: 999px;
    opacity: 0.9;
}

.signal-bars i:nth-child(1) {
    height: 4px;
}

.signal-bars i:nth-child(2) {
    height: 6px;
}

.signal-bars i:nth-child(3) {
    height: 9px;
}

.signal-bars i:nth-child(4) {
    height: 12px;
}

.wifi-icon {
    position: relative;
    width: 14px;
    height: 10px;
    border-top: 2px solid currentColor;
    border-left: 2px solid transparent;
    border-right: 2px solid transparent;
    border-radius: 50% 50% 0 0;
    transform: scaleX(1.2);
    opacity: 0.9;
}

.wifi-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    transform: translateX(-50%);
}

.network-label {
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

.battery-icon {
    position: relative;
    width: 22px;
    height: 11px;
    border: 1.8px solid currentColor;
    border-radius: 3px;
}

.battery-icon::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 2px;
    width: 2px;
    height: 5px;
    border-radius: 0 2px 2px 0;
    background: currentColor;
}

/* --battery-level lo escribe main.js: numero sin unidad de 0 a 100. */
.battery-level {
    position: absolute;
    inset: 1.5px auto 1.5px 1.5px;
    width: calc(var(--battery-level, 74) * (100% - 3px) / 100);
    border-radius: 2px;
    background: currentColor;
    transition: width 320ms ease;
}

.battery-icon[data-low="true"] {
    color: #ff6b5e;
}

.battery-bolt {
    color: #34c759;
}

.battery-bolt:not([hidden]) {
    display: inline-flex;
    align-items: center;
}

.battery-bolt svg {
    width: 11px;
    height: 11px;
    fill: currentColor;
}

/* Barras apagadas segun la calidad real del enlace (effectiveType). */
.signal-bars[data-signal="0"] i,
.signal-bars[data-signal="1"] i:nth-child(n + 2),
.signal-bars[data-signal="2"] i:nth-child(n + 3),
.signal-bars[data-signal="3"] i:nth-child(n + 4) {
    opacity: 0.28;
}

.hero-text {
    max-width: none;
    margin: 8px 0 16px;
    padding: 0 8px;
    color: #475467;
    font-size: 1rem;
}

.social-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
    color: var(--text);
    align-content: start;
}

.social-list li {
    min-width: 0;
}

.social-list a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 82px;
    padding: 18px 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(25, 34, 55, 0.96), rgba(36, 47, 72, 0.98));
    color: #fff;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.social-list-large {
    padding: 4px;
    border-radius: 28px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.social-list-large a {
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.social-list-large a:hover,
.social-list-large a:focus-visible {
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 18px 34px rgba(29, 36, 51, 0.2);
}

.social-list a::after {
    content: ">";
    margin-left: auto;
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.78);
}

.social-list li:nth-child(1) a {
    background: linear-gradient(135deg, #0a66c2, #123d72);
}

.social-list li:nth-child(2) a {
    background: linear-gradient(135deg, #111827, #2b3550);
}

.social-list li:nth-child(3) a {
    background: linear-gradient(135deg, #151515, #404040);
}

.social-list li:nth-child(4) a {
    background: linear-gradient(135deg, #c13584, #fd7e32);
}

.social-list li:nth-child(5) a {
    background: linear-gradient(135deg, #1877f2, #103f82);
}

.social-list li:nth-child(6) a {
    background: linear-gradient(135deg, #d7642b, #8f3c13);
}

.social-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(6px);
}

.social-icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.social-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.social-copy em {
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.58);
}

.social-copy strong {
    font-size: 1.02rem;
    line-height: 1.1;
    color: #fff;
    overflow-wrap: anywhere;
}

.social-copy span {
    color: rgba(255, 255, 255, 0.74);
    font-size: 0.92rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.home-indicator {
    width: 138px;
    height: 5px;
    margin: 18px auto 2px;
    border-radius: 999px;
    background: rgba(16, 24, 40, 0.85);
    opacity: 0.82;
}

/*
 * Deck de pantallas: scroll horizontal con snap nativo, asi el gesto de
 * deslizar en tactil sale gratis y el dock solo sincroniza el indicador.
 * Es un grid de una fila, por lo que todas las pantallas comparten alto.
 */
.screen-deck {
    position: relative;
    z-index: 1;
    /*
     * Alto fijo en vez de flex:1. Antes el deck crecia hasta la pantalla mas
     * alta y estiraba el telefono entero; ahora manda la ventana y cada
     * pantalla se desplaza por dentro, como en un aparato de verdad.
     * grid-auto-rows: 100% ata la fila al alto del deck: sin eso la fila se
     * estiraria al contenido y volveriamos al problema anterior.
     */
    flex: none;
    height: var(--deck-height);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    grid-auto-rows: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.screen-deck::-webkit-scrollbar {
    display: none;
}

.screen-page {
    min-width: 0;
    min-height: 0;
    /* Declarar solo overflow-y dejaria el eje X en auto (asi lo resuelve CSS
       cuando el otro eje deja de ser visible), y el translateX del parallax
       sacaba una barra horizontal dentro del panel. Aqui solo se baja. */
    overflow-x: hidden;
    overflow-y: auto;
    /* Solo en vertical: `contain` a secas frenaba tambien el eje X y el gesto
       de deslizar con el dedo no llegaba al deck. */
    overscroll-behavior-y: contain;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    scrollbar-width: thin;
    scrollbar-color: var(--screen-card-line) transparent;
}

/* Barra fina y discreta: es la unica pista de que ahi se puede desplazar. */
.screen-page::-webkit-scrollbar {
    width: 6px;
}

.screen-page::-webkit-scrollbar-track {
    background: transparent;
}

.screen-page::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--screen-card-line);
}

.screen-page::-webkit-scrollbar-thumb:hover {
    background: var(--line-strong);
}

.screen-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 0 8px 8px;
    color: var(--screen-text);
}

/*
 * Con el scroll dentro de cada pantalla el encabezado se perdia al bajar. Se
 * queda fijo arriba, con desenfoque detras como los titulos de iOS. Los
 * margenes negativos lo hacen sangrar hasta el borde del panel: si no, el
 * contenido asomaria por los lados al pasar por debajo.
 */
.screen-panel .page-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: 0 -8px;
    padding: 4px 8px 12px;
    background: var(--screen-top);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.page-head {
    display: grid;
    gap: 8px;
}

.page-head h2 {
    margin: 0;
    font-size: clamp(2rem, 8vw, 2.6rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
}

.page-lede,
.page-body {
    margin: 0;
    color: var(--screen-muted);
    font-size: 0.98rem;
}

.page-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    margin-top: auto;
    padding: 0 20px;
    border: 1px solid var(--screen-card-line);
    border-radius: 18px;
    background: var(--screen-chip);
    color: var(--screen-text);
    font-weight: 700;
    text-align: center;
    transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.page-cta::after {
    content: ">";
    font-size: 1.05rem;
    opacity: 0.6;
}

.page-cta:hover,
.page-cta:focus-visible {
    border-color: var(--line-strong);
    background: var(--screen-active-bg);
    color: #fff;
    transform: translateY(-1px);
}

.stack-groups {
    display: grid;
    gap: 12px;
    align-content: start;
}

.stack-group {
    padding: 16px 18px;
    border: 1px solid var(--screen-card-line);
    border-radius: 22px;
    background: var(--screen-card);
}

.stack-group h3 {
    margin: 0 0 12px;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--screen-muted);
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.chip-list li {
    padding: 7px 13px;
    border: 1px solid var(--screen-card-line);
    border-radius: 999px;
    background: var(--screen-chip);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
}

/*
 * Linea de tiempo de la trayectoria. La linea vertical es un ::before del <ol>
 * y cada hito pone su propio punto encima, asi el trazo queda continuo aunque
 * los textos tengan alturas distintas.
 */
.timeline {
    position: relative;
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 2px 0 2px 28px;
    list-style: none;
    align-content: start;
}

.timeline::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 5px;
    width: 2px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent), var(--screen-card-line));
}

.timeline__item {
    position: relative;
    display: grid;
    gap: 4px;
}

.timeline__item::before {
    content: "";
    position: absolute;
    top: 5px;
    left: -28px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--screen-card-line);
    border-radius: 50%;
    background: var(--screen-card);
}

.timeline__item[data-current="true"]::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(110, 168, 255, 0.18);
}

.timeline__year {
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--screen-muted);
}

.timeline__item[data-current="true"] .timeline__year {
    color: var(--accent);
}

.timeline__role {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.06rem;
    font-weight: 700;
    line-height: 1.2;
}

.timeline__detail {
    color: var(--screen-muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.timeline__stack {
    margin-top: 2px;
    color: var(--screen-muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    opacity: 0.78;
}

.fact-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.fact {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 16px;
    border: 1px solid var(--screen-card-line);
    border-radius: 16px;
    background: var(--screen-card);
}

.fact dt {
    color: var(--screen-muted);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fact dd {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    text-align: right;
}

/* Dock inferior: sustituye a los puntos de paginacion y nombra cada pantalla. */
.screen-nav {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 4px;
    margin: 16px auto 0;
    padding: 5px;
    border: 1px solid var(--screen-card-line);
    border-radius: 999px;
    background: var(--screen-card);
    backdrop-filter: blur(10px);
}

.screen-nav__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--screen-muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 180ms ease, color 180ms ease;
}

.screen-nav__item:focus-visible {
    color: var(--screen-text);
    background: var(--screen-chip);
}

.screen-nav__item[aria-current="page"] {
    background: var(--screen-active-bg);
    color: #fff;
}

.screen-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.screen-nav__icon .lucide {
    width: 19px;
    height: 19px;
}

/*
 * Pantalla de bloqueo de la primera visita. Es un <button> de verdad: el gesto
 * de deslizar es un extra, no el unico camino, asi teclado y lectores de
 * pantalla pueden abrirla igual. No aparece si se pide menos movimiento.
 */
.lock-screen {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    /* El telefono es mas alto que la ventana de un movil, asi que un candado a
       inset:0 dejaria la pista de deslizar bajo el borde inferior. main.js mide
       la parte visible y la escribe en --lock-height; el min() evita pasarse
       cuando el telefono entero si cabe (escritorio). */
    height: min(var(--lock-height, 100%), 100%);
    z-index: 4;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding: 92px 24px 26px;
    border: 0;
    /* Sin radio propio: el borde inferior cae a media pantalla y unas esquinas
       redondeadas ahi dejarian ver el contenido de atras. .iphone-screen ya
       recorta con overflow:hidden, que respeta su propio border-radius. */
    border-radius: 0;
    background: var(--lock-bg);
    color: var(--lock-text);
    font: inherit;
    text-align: center;
    cursor: grab;
    touch-action: none;
    transform: translateY(var(--lock-drag, 0px));
}

.lock-screen:not([hidden]) {
    display: flex;
}

.lock-screen[data-state="dragging"] {
    cursor: grabbing;
}

/* Sin transicion mientras se arrastra: seguiria al dedo con retraso. */
.lock-screen[data-state="idle"],
.lock-screen[data-state="closing"] {
    transition: transform 460ms cubic-bezier(0.32, 0.72, 0, 1), opacity 340ms ease;
}

.lock-screen[data-state="closing"] {
    transform: translateY(-102%);
    opacity: 0;
}

.lock-screen__clock {
    display: grid;
    gap: 4px;
    margin-bottom: auto;
}

.lock-screen__date {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--lock-muted);
}

.lock-screen__time {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(3.6rem, 15vw, 5rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
}

.lock-screen__hint {
    display: grid;
    justify-items: center;
    gap: 6px;
    color: var(--lock-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.lock-screen__chevron {
    display: inline-flex;
    animation: lock-nudge 1900ms ease-in-out infinite;
}

.lock-screen__grip {
    width: 138px;
    height: 5px;
    border-radius: 999px;
    background: var(--lock-grip);
}

@keyframes lock-nudge {
    0%, 100% {
        transform: translateY(3px);
        opacity: 0.55;
    }

    50% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

/*
 * Entrada escalonada. Se dispara con data-entered, que main.js escribe al
 * cargar o al abrir la pantalla de bloqueo, para que la animacion no se gaste
 * detras del candado. Sin JS no hay atributo y todo se ve de inmediato.
 */
@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

html[data-entered="true"] .iphone-header,
html[data-entered="true"] .hero-text,
html[data-entered="true"] .social-list-large li {
    animation: rise-in 560ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

html[data-entered="true"] .hero-text {
    animation-delay: 90ms;
}

html[data-entered="true"] .social-list-large li:nth-child(1) {
    animation-delay: 150ms;
}

html[data-entered="true"] .social-list-large li:nth-child(2) {
    animation-delay: 210ms;
}

html[data-entered="true"] .social-list-large li:nth-child(3) {
    animation-delay: 270ms;
}

html[data-entered="true"] .social-list-large li:nth-child(4) {
    animation-delay: 330ms;
}

html[data-entered="true"] .social-list-large li:nth-child(5) {
    animation-delay: 390ms;
}

html[data-entered="true"] .social-list-large li:nth-child(6) {
    animation-delay: 450ms;
}

/* Parallax: el encabezado se mueve algo mas lento que las tarjetas al pasar
   de pantalla. --parallax lo escribe main.js en cada pagina del deck. */
.iphone-header,
.page-head {
    transform: translateX(calc(var(--parallax, 0) * 24px));
}

/*
 * Caparazon de juegos. Es una capa que toma la pantalla del telefono, hermana
 * del candado y con el mismo orden de apilado. touch-action: none es
 * imprescindible: sin eso el gesto de jugar lo interceptaria el deck y
 * cambiaria de pantalla.
 */
.game {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 100%;
    z-index: 4;
    display: none;
    flex-direction: column;
    padding: 44px 12px 10px;
    background: var(--game-bg);
    color: var(--screen-text);
    touch-action: none;
    user-select: none;
}

.game:not([hidden]) {
    display: flex;
}

.game__hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px 10px;
}

.game__stat {
    display: grid;
    gap: 1px;
    min-width: 62px;
}

.game__stat--right {
    text-align: right;
}

.game__stat em {
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--screen-muted);
}

.game__stat strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.24rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.game__board {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Token propio: con --screen-card-line el borde del tablero no se veia en
       modo claro y el area de juego quedaba sin limite. */
    border: 1px solid var(--game-board-line);
    border-radius: 18px;
    background: var(--game-board);
    overflow: hidden;
}

.game__canvas {
    display: block;
}

.game__canvas[hidden],
.game__grid[hidden] {
    display: none;
}

/* Rejilla para los juegos de cartas: DOM en vez de lienzo, porque cada carta
   es un boton de verdad y asi funciona con teclado y lector de pantalla. */
.game__grid {
    display: grid;
    gap: 8px;
    padding: 10px;
}

.game__message {
    position: absolute;
    /* Anclado abajo: centrado tapaba el contenido del tablero. */
    inset: auto 14px 14px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 14px;
    background: var(--game-overlay);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    color: var(--screen-text);
    font-size: 0.94rem;
    font-weight: 700;
    line-height: 1.45;
    text-align: center;
}

.game__message:empty {
    display: none;
}

.game__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 2px 0;
}

.game__hint {
    flex: 1;
    margin: 0;
    color: var(--screen-muted);
    font-size: 0.76rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

.game__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: none;
    padding: 0;
    border: 1px solid var(--screen-card-line);
    border-radius: 50%;
    background: var(--screen-card);
    color: var(--screen-text);
    cursor: pointer;
}

.game__close:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Cartas del juego de memoria --- */
.memory-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: 1px solid var(--screen-card-line);
    border-radius: 12px;
    background: var(--game-card-back);
    color: transparent;
    font-family: "Space Grotesk", sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
    transition: background 200ms ease, color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.memory-card::after {
    content: "?";
    position: absolute;
    color: var(--screen-muted);
    font-size: 1.1rem;
    opacity: 0.7;
}

.memory-card[data-face="up"],
.memory-card[data-face="match"],
.memory-card[data-face="done"] {
    background: var(--accent);
    border-color: transparent;
    color: #fff;
}

.memory-card[data-face="up"]::after,
.memory-card[data-face="match"]::after,
.memory-card[data-face="done"]::after {
    content: none;
}

/*
 * Pareja acertada: rebote y destello verde antes de apagarse a "done". El
 * verde es oscuro a proposito: con el #34c759 vivo, el texto blanco de la
 * carta quedaba a 2.2:1 de contraste, ilegible. Asi sube a 5.2:1 y el brillo
 * lo aporta el halo del keyframe.
 */
.memory-card[data-face="match"] {
    background: #1a7f3c;
    animation: memory-match 620ms cubic-bezier(0.34, 1.4, 0.64, 1);
    z-index: 1;
}

@keyframes memory-match {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.55);
    }

    35% {
        transform: scale(1.16) rotate(-3deg);
        box-shadow: 0 0 0 10px rgba(52, 199, 89, 0);
    }

    60% {
        transform: scale(0.97) rotate(2deg);
    }

    100% {
        transform: scale(1) rotate(0);
        box-shadow: 0 0 0 0 rgba(52, 199, 89, 0);
    }
}

.memory-card[data-face="done"] {
    background: var(--screen-chip);
    color: var(--screen-muted);
    transform: scale(0.94);
}

.memory-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* --- Menu de juegos --- */
.game-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    align-content: start;
}

.game-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--screen-card-line);
    border-radius: 20px;
    background: var(--screen-card);
    color: var(--screen-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.game-card:hover,
.game-card:focus-visible {
    border-color: var(--line-strong);
    background: var(--screen-chip);
    transform: translateY(-1px);
}

.game-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: none;
    border-radius: 14px;
    background: var(--screen-chip);
    color: var(--accent);
}

.game-card__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.game-card__copy {
    display: grid;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.game-card__copy strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.02rem;
}

.game-card__copy span {
    color: var(--screen-muted);
    font-size: 0.86rem;
    line-height: 1.35;
}

.game-card__best {
    display: grid;
    gap: 1px;
    flex: none;
    text-align: right;
}

.game-card__best em {
    font-style: normal;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--screen-muted);
}

.game-card__best b {
    font-family: "Space Grotesk", sans-serif;
    font-size: 1.02rem;
    font-variant-numeric: tabular-nums;
}

.site-footer p {
    margin: 0;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 6px 0;
    color: var(--muted);
    font-size: 0.95rem;
    text-align: center;
}

/*
 * Modo tablet (dos columnas). Se activa en pantallas anchas y también cuando el
 * teléfono se gira a horizontal, siempre que haya al menos 640px de ancho. Las
 * columnas usan minmax(0, ...fr) para que el mismo bloque sirva entre 640px y
 * 900px sin desbordar.
 */
@media (min-width: 900px),
(min-width: 640px) and (orientation: landscape) {
    .iphone-device {
        width: min(100%, 1100px);
        padding: 18px;
        border-radius: 42px;
        box-shadow: 0 34px 90px rgba(15, 23, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .iphone-notch {
        top: 8px;
        width: 76px;
        height: 10px;
        border-radius: 999px;
        background: rgba(8, 13, 24, 0.92);
    }

    .iphone-screen {
        --deck-height: clamp(280px, calc(100vh - 318px), 640px);
        --deck-height: clamp(280px, calc(100dvh - 318px), 640px);
        padding: 36px;
        border-radius: 28px;
        background:
            radial-gradient(circle at top left, rgba(255, 255, 255, 0.84), transparent 24%),
            linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(236, 241, 248, 0.92) 100%);
        border: 1px solid rgba(255, 255, 255, 0.75);
        box-shadow: 0 24px 60px rgba(82, 101, 139, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.5);
        min-height: auto;
    }

    .screen-page[data-page="social"] {
        display: grid;
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        grid-template-rows: auto auto 1fr;
        gap: 28px 32px;
        align-items: start;
    }

    .iphone-header {
        padding: 0;
        grid-column: 1;
        grid-row: 1;
        align-self: start;
    }

    .iphone-header h1 {
        max-width: 7ch;
        font-size: clamp(2.55rem, 4.4vw, 4rem);
    }

    .status-bar {
        padding: 0;
        margin-bottom: 6px;
        color: rgba(16, 24, 40, 0.72);
    }

    .hero-text {
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        padding: 0;
        max-width: 24ch;
        align-self: start;
    }

    .social-list-large {
        grid-column: 2;
        grid-row: 1 / span 3;
        align-self: start;
    }

    .home-indicator {
        margin-top: 8px;
    }

    .screen-panel {
        gap: 22px;
        padding: 0;
    }

    .game {
        padding: 70px 14px 12px;
    }

    .stack-groups,
    .game-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    /* Misma reja que la pantalla social: encabezado a la izquierda, contenido
       a la derecha. Una linea de tiempo a todo el ancho quedaria desierta. */
    .screen-page[data-page="career"] {
        display: grid;
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
        gap: 28px 32px;
        align-items: start;
    }

    .fact-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-cta {
        align-self: start;
        min-width: 320px;
    }

    .social-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px;
    }

    .social-list a {
        min-height: 150px;
        padding: 24px 24px;
        gap: 18px;
    }

    .social-copy strong {
        font-size: 1.08rem;
    }

    .social-copy span {
        font-size: 0.98rem;
    }
}

/* Modo teléfono: complemento exacto del modo tablet de arriba. */
@media (max-width: 899px) and (orientation: portrait),
(max-width: 639px) {
    /* El footer se queda en fila: apilar en columna era inocuo con un solo
       hijo, pero con la huella al lado duplicaba su alto y le robaba 36px al
       telefono. */
    .hero-copy-minimal {
        grid-template-columns: 1fr;
    }

    .hero-copy {
        padding: 28px;
    }

    .social-list {
        grid-template-columns: 1fr;
    }

    .social-list-large a:hover,
    .social-list-large a:focus-visible {
        transform: translateY(-2px);
    }

    .screen-nav__text {
        display: none;
    }

    .screen-nav__item {
        width: 56px;
        padding: 0;
    }

    h1 {
        font-size: clamp(2.6rem, 16vw, 4rem);
    }

    .iphone-header h1 {
        font-size: clamp(2.5rem, 12vw, 3.6rem);
    }

    .home-indicator {
        width: 124px;
    }
}

@media (max-width: 640px) {
    .page-shell {
        width: min(100% - 24px, 1180px);
    }

    .quick-launcher {
        bottom: 12px;
        right: 12px;
    }

    .quick-drawer {
        bottom: 74px;
        right: 12px;
        width: min(308px, calc(100vw - 24px));
    }

    .hero {
        padding-bottom: 32px;
    }

    .iphone-screen {
        min-height: auto;
        padding: 22px 14px 14px;
    }

    .iphone-device {
        border-radius: 38px;
        padding: 12px;
    }

    .iphone-notch {
        height: 24px;
    }

    .social-list {
        gap: 10px;
    }

    .social-list a {
        min-height: 76px;
    }
}

html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 12% 14%, rgba(64, 100, 176, 0.28), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(82, 114, 195, 0.26), transparent 20%),
        radial-gradient(circle at 78% 74%, rgba(65, 97, 185, 0.18), transparent 22%),
        linear-gradient(145deg, #070b15 0%, #0d1425 42%, #10192d 100%);
}

html[data-theme="dark"] body::before {
    background:
        linear-gradient(115deg, transparent 0 61%, rgba(255, 255, 255, 0.05) 61% 64%, transparent 64% 100%),
        linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.08), transparent 16%),
        radial-gradient(circle at 68% 30%, rgba(255, 255, 255, 0.05), transparent 24%);
    opacity: 0.55;
}

html[data-theme="dark"] body::after {
    background:
        radial-gradient(circle at center, transparent 0 38%, rgba(7, 11, 20, 0.2) 62%, rgba(0, 0, 0, 0.42) 100%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03), transparent 58%);
}

html[data-theme="dark"] .hero-copy {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(15, 21, 37, 0.72), rgba(12, 17, 31, 0.58));
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .iphone-header .eyebrow {
    color: rgba(244, 247, 251, 0.66);
}

html[data-theme="dark"] .iphone-device {
    background: linear-gradient(180deg, #0a1020, #171f31 55%, #0a1020 100%);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: 0 34px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .iphone-notch {
    background: #050914;
}

html[data-theme="dark"] .iphone-screen {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 28%),
        linear-gradient(180deg, #121a2b 0%, #0b1220 100%);
}

html[data-theme="dark"] .iphone-screen::before {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 44%);
}

html[data-theme="dark"] .status-bar {
    color: rgba(244, 247, 251, 0.82);
}

html[data-theme="dark"] .hero-text {
    color: rgba(229, 235, 244, 0.86);
}

html[data-theme="dark"] .social-list a {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .social-list-large a:hover,
html[data-theme="dark"] .social-list-large a:focus-visible {
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

html[data-theme="dark"] .home-indicator {
    background: rgba(255, 255, 255, 0.82);
}

html[data-theme="dark"] .site-footer {
    color: rgba(170, 180, 198, 0.88);
}

html[data-theme="light"] body {
    background:
        radial-gradient(circle at 12% 14%, rgba(86, 154, 255, 0.28), transparent 24%),
        radial-gradient(circle at 82% 18%, rgba(180, 198, 255, 0.32), transparent 20%),
        radial-gradient(circle at 78% 74%, rgba(138, 169, 255, 0.18), transparent 22%),
        linear-gradient(145deg, #f7f9fd 0%, #e7edf7 42%, #dfe7f3 100%);
}

html[data-theme="light"] body::before {
    background:
        linear-gradient(115deg, transparent 0 61%, rgba(255, 255, 255, 0.2) 61% 64%, transparent 64% 100%),
        linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
        radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.72), transparent 16%),
        radial-gradient(circle at 68% 30%, rgba(255, 255, 255, 0.3), transparent 24%);
    opacity: 0.8;
}

html[data-theme="light"] body::after {
    background:
        radial-gradient(circle at center, transparent 0 38%, rgba(255, 255, 255, 0.14) 62%, rgba(185, 198, 220, 0.18) 100%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.06), transparent 58%);
}

html[data-theme="light"] .hero-copy {
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.3));
}

html[data-theme="light"] .eyebrow,
html[data-theme="light"] .iphone-header .eyebrow {
    color: rgba(18, 24, 38, 0.7);
}

html[data-theme="light"] .iphone-header h1,
html[data-theme="light"] .hero-text {
    color: #121826;
}

html[data-theme="light"] .iphone-device {
    background: linear-gradient(180deg, #0f1728, #1b2336 55%, #0f1728 100%);
    box-shadow: 0 34px 70px rgba(15, 23, 40, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="light"] .iphone-notch {
    background: #0a1020;
}

html[data-theme="light"] .iphone-screen {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 28%),
        linear-gradient(180deg, #f7f9fd 0%, #e9eef6 100%);
}

html[data-theme="light"] .iphone-screen::before {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.22), transparent 44%);
}

html[data-theme="light"] .status-bar {
    color: #101828;
}

html[data-theme="light"] .hero-text {
    color: #121826;
}

html[data-theme="light"] .social-list a {
    border-color: rgba(255, 255, 255, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

html[data-theme="light"] .social-list-large a:hover,
html[data-theme="light"] .social-list-large a:focus-visible {
    box-shadow: 0 18px 34px rgba(29, 36, 51, 0.2);
}

html[data-theme="light"] .home-indicator {
    background: rgba(16, 24, 40, 0.85);
}

html[data-theme="light"] .site-footer {
    color: var(--muted);
}

html[data-theme="light"] .quick-launcher {
    border-color: rgba(15, 23, 40, 0.12);
    background: rgba(255, 255, 255, 0.75);
    color: #101828;
}

html[data-theme="light"] .quick-drawer {
    border-color: rgba(15, 23, 40, 0.12);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(243, 246, 251, 0.96));
    color: #121826;
}

html[data-theme="light"] .quick-action,
html[data-theme="light"] .quick-drawer__close {
    color: #121826;
    background: rgba(17, 24, 39, 0.06);
    border-color: rgba(17, 24, 39, 0.08);
}

html[data-theme="light"] .quick-action:hover,
html[data-theme="light"] .quick-action:focus-visible,
html[data-theme="light"] .theme-toggle:hover,
html[data-theme="light"] .theme-toggle:focus-visible {
    background: rgba(17, 24, 39, 0.1);
    border-color: rgba(17, 24, 39, 0.14);
}

html[data-theme="light"] .quick-action__icon,
html[data-theme="light"] .theme-toggle__icon {
    background: rgba(17, 24, 39, 0.08);
}

html[data-theme="dark"] .quick-launcher,
html[data-theme="dark"] .quick-drawer {
    border-color: rgba(255, 255, 255, 0.14);
}

html[data-theme="dark"] .quick-action,
html[data-theme="dark"] .quick-drawer__close {
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    :root {
        --screen-text: rgba(244, 247, 251, 0.92);
        --screen-muted: rgba(229, 235, 244, 0.7);
        --screen-card: rgba(255, 255, 255, 0.05);
        --screen-card-line: rgba(255, 255, 255, 0.1);
        --screen-chip: rgba(255, 255, 255, 0.08);
        --screen-active-bg: rgba(255, 255, 255, 0.14);
        --screen-top: transparent;
        --game-bg: #0d1526;
        --game-board: #08101f;
        --game-grid-line: rgba(255, 255, 255, 0.045);
        --game-overlay: rgba(8, 16, 31, 0.86);
        --game-card-back: rgba(255, 255, 255, 0.07);
        --game-board-line: rgba(255, 255, 255, 0.1);
        --lock-bg: radial-gradient(circle at 22% 12%, rgba(110, 168, 255, 0.28), transparent 42%), radial-gradient(circle at 78% 82%, rgba(64, 100, 176, 0.24), transparent 46%), linear-gradient(170deg, #101a2f 0%, #070b15 100%);
        --lock-text: #f4f7fb;
        --lock-muted: rgba(244, 247, 251, 0.72);
        --lock-grip: rgba(255, 255, 255, 0.82);
        --bg: #0b1020;
        --text: #f4f7fb;
        --muted: #aab4c6;
        --line: rgba(255, 255, 255, 0.1);
        --line-strong: rgba(255, 255, 255, 0.18);
        --accent: #6ea8ff;
        --accent-deep: #8cb8ff;
        --shadow: 0 34px 90px rgba(0, 0, 0, 0.42);
        --card: rgba(14, 20, 35, 0.86);
        --card-strong: rgba(18, 25, 43, 0.96);
    }

    body {
        background:
            radial-gradient(circle at 12% 14%, rgba(64, 100, 176, 0.28), transparent 24%),
            radial-gradient(circle at 82% 18%, rgba(82, 114, 195, 0.26), transparent 20%),
            radial-gradient(circle at 78% 74%, rgba(65, 97, 185, 0.18), transparent 22%),
            linear-gradient(145deg, #070b15 0%, #0d1425 42%, #10192d 100%);
    }

    body::before {
        background:
            linear-gradient(115deg, transparent 0 61%, rgba(255, 255, 255, 0.05) 61% 64%, transparent 64% 100%),
            linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
            linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
            radial-gradient(circle at 24% 12%, rgba(255, 255, 255, 0.08), transparent 16%),
            radial-gradient(circle at 68% 30%, rgba(255, 255, 255, 0.05), transparent 24%);
        opacity: 0.55;
    }

    body::after {
        background:
            radial-gradient(circle at center, transparent 0 38%, rgba(7, 11, 20, 0.2) 62%, rgba(0, 0, 0, 0.42) 100%),
            radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03), transparent 58%);
    }

    .hero-copy {
        border-color: rgba(255, 255, 255, 0.08);
        background: linear-gradient(180deg, rgba(15, 21, 37, 0.72), rgba(12, 17, 31, 0.58));
    }

    .eyebrow,
    .iphone-header .eyebrow {
        color: rgba(244, 247, 251, 0.66);
    }

    .iphone-device {
        background: linear-gradient(180deg, #0a1020, #171f31 55%, #0a1020 100%);
        border: 1px solid rgba(255, 255, 255, 0.22);
        box-shadow: 0 34px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    }

    .iphone-notch {
        background: #050914;
    }

    .iphone-screen {
        background:
            radial-gradient(circle at top left, rgba(255, 255, 255, 0.16), transparent 28%),
            linear-gradient(180deg, #121a2b 0%, #0b1220 100%);
    }

    .iphone-screen::before {
        background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), transparent 44%);
    }

    .status-bar {
        color: rgba(244, 247, 251, 0.82);
    }

    .hero-text {
        color: rgba(229, 235, 244, 0.86);
    }

    .social-list a {
        border-color: rgba(255, 255, 255, 0.14);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .social-list-large a:hover,
    .social-list-large a:focus-visible {
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
    }

    .home-indicator {
        background: rgba(255, 255, 255, 0.82);
    }

    .site-footer {
        color: rgba(170, 180, 198, 0.88);
    }
}

/*
 * Modo zoom: el contenido ocupa toda la pantalla y se retira el marco del
 * dispositivo. Va al final del archivo a propósito: comparte especificidad
 * con las reglas de html[data-theme="..."] y necesita ganarles por orden.
 */
html[data-zoom="on"] .page-shell {
    width: min(1600px, calc(100% - 32px));
    padding: 0 0 20px;
}

/*
 * Sin marco el dock tiene que quedar al fondo de la ventana. No se resuelve
 * estirando la cadena de flex: el deck necesita alto definido para que
 * grid-auto-rows:100% ate la fila. Lo calcula sizeDeck() en main.js, que aqui
 * hace crecer el deck hasta ocupar el hueco disponible.
 */
html[data-zoom="on"] .hero {
    min-height: calc(100vh - 76px);
    min-height: calc(100dvh - 76px);
    align-items: center;
    padding-bottom: 20px;
}

html[data-zoom="on"] .iphone-device {
    transform: none;
    width: 100%;
    max-width: none;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

html[data-zoom="on"] .iphone-screen {
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
}

html[data-zoom="on"] .iphone-screen::before {
    display: none;
}

html[data-zoom="on"] .iphone-notch,
html[data-zoom="on"] .status-bar,
html[data-zoom="on"] .home-indicator,
html[data-zoom="on"] .device-side-button,
html[data-zoom="on"] .device-volume {
    display: none;
}

/* Sin marco no hay notch, pero los avisos siguen haciendo falta: la isla
   reaparece flotando arriba del contenido, como un toast. */
html[data-zoom="on"] .iphone-notch[data-island="active"] {
    display: flex;
    top: 10px;
}

@media (min-width: 900px) {
    html[data-zoom="on"] .screen-page[data-page="social"] {
        gap: 32px 56px;
    }

    html[data-zoom="on"] .iphone-header h1 {
        font-size: clamp(3rem, 5.6vw, 5.4rem);
    }
}

@media (max-width: 899px) and (orientation: portrait),
(max-width: 639px) {
    html[data-zoom="on"] .page-shell {
        width: calc(100% - 20px);
    }

    html[data-zoom="on"] .hero {
        align-items: flex-start;
        padding-top: 12px;
    }

    html[data-zoom="on"] .iphone-header {
        padding: 4px 2px 12px;
    }
}

/*
 * Teléfono en horizontal: conserva las dos columnas del modo tablet pero
 * comprime alturas, tipografía y tarjetas. Cubre dos casos en horizontal:
 * pantallas de menos de 900px (columnas estrechas) y pantallas bajas de hasta
 * 600px de alto (teléfonos grandes que sí superan los 900px). Va al final del
 * archivo porque también debe sobrescribir las reglas de data-zoom.
 */
@media (min-width: 640px) and (max-width: 899px) and (orientation: landscape),
(min-width: 640px) and (orientation: landscape) and (max-height: 600px) {
    .page-shell {
        padding: 4px 0 16px;
    }

    .hero {
        min-height: auto;
        padding-bottom: 20px;
    }

    .iphone-device {
        padding: 12px;
        border-radius: 34px;
    }

    .iphone-notch {
        top: 3px;
        width: 64px;
        height: 6px;
    }

    .screen-page[data-page="social"],
    html[data-zoom="on"] .screen-page[data-page="social"] {
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 14px 22px;
    }

    .iphone-screen {
        /* Horizontal: la ventana es muy baja, el deck necesita un minimo
           menor para que el dock y la barra de inicio sigan cabiendo. */
        --deck-height: clamp(150px, calc(100vh - 240px), 420px);
        --deck-height: clamp(150px, calc(100dvh - 240px), 420px);
        padding: 18px 20px 14px;
        border-radius: 24px;
    }

    .iphone-header {
        gap: 8px;
    }

    .iphone-header .eyebrow {
        font-size: 0.68rem;
        letter-spacing: 0.12em;
    }

    .iphone-header h1,
    html[data-zoom="on"] .iphone-header h1 {
        max-width: none;
        font-size: clamp(1.9rem, 5.2vw, 2.6rem);
    }

    .hero-text {
        max-width: 32ch;
        font-size: 0.92rem;
        line-height: 1.5;
    }

    .social-list {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 10px;
    }

    .social-list a {
        min-height: 0;
        padding: 12px 14px;
        gap: 12px;
        border-radius: 18px;
    }

    .social-list a::after {
        display: none;
    }

    .social-icon {
        width: 40px;
        height: 40px;
        border-radius: 14px;
    }

    .social-icon svg {
        width: 20px;
        height: 20px;
    }

    .social-copy em {
        display: none;
    }

    .social-copy strong {
        font-size: 0.95rem;
    }

    .social-copy span {
        font-size: 0.8rem;
        line-height: 1.3;
    }

    /* Los paneles siguen la misma compresion que la pantalla social. */
    .screen-panel {
        gap: 14px;
    }

    .page-head h2 {
        font-size: clamp(1.7rem, 4.4vw, 2.2rem);
    }

    .page-lede,
    .page-body {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .stack-group {
        padding: 13px 15px;
        border-radius: 18px;
    }

    .timeline {
        gap: 14px;
    }

    .stack-group h3 {
        margin-bottom: 9px;
    }

    .timeline__detail {
        font-size: 0.85rem;
    }

    .page-cta {
        min-height: 44px;
    }

    .screen-nav {
        margin-top: 10px;
    }

    .game {
        padding: 40px 14px 8px;
    }

    .home-indicator {
        width: 110px;
        margin: 10px auto 0;
    }

    .site-footer {
        padding-top: 10px;
        font-size: 0.85rem;
    }
}