/* ==================== 1. CONFIGURACIÓN — FOLIO EDITION ====================
   Rediseño sobre design-ref/PROMPT-REDISENO.md: se toma la estructura,
   tipografía y ritmo de khanhnguyen.design, se conserva la paleta e
   identidad propia (ver tabla de mapeo de colores de la auditoría). */

:root {
    /* PALETA — sin cambios de valor, solo se le suman roles semánticos abajo */
    --negro: #14110d;
    /* No 100% negro — un carbón cálido */
    --hueso: #f3f3e8;
    --gris: #b7b7b7;
    --naranja: #ff7a29;
    /* Acento naranja — reemplaza al verde ácido */

    --c-bg: var(--negro);
    --c-text: var(--hueso);
    --c-text-muted: var(--gris);
    --c-accent: var(--naranja);
    --c-border: rgba(243, 243, 232, 0.15);
    /* Hueso transparente */

    /* Vuelta atrás: se probó Instrument Serif + Inter Tight y no — la
       identidad monospace ya era buena. JetBrains Mono vuelve a ser toda
       la tipografía del sistema, display y texto por igual. */
    --font-main: 'JetBrains Mono', monospace;
    --font-display: 'JetBrains Mono', monospace;
    /* Detalles "de código" (SCROLL, subtítulo): más duro y técnico que JetBrains */
    --font-code: 'IBM Plex Mono', 'JetBrains Mono', monospace;
    --font-text: var(--font-main);

    --container-width: 1400px;

    /* ---- Roles del sistema Folio, mapeados a mi paleta (ver auditoría) ---- */
    --ink-dark: var(--negro);
    --paper: var(--hueso);
    --text-on-dark: var(--hueso);
    --text-on-paper: var(--negro);
    --muted-on-dark: var(--gris);
    /* Derivado, más oscuro que un gris "medio" — con las paletas nuevas
       --paper puede ser un beige/verde-agua bastante claro (vanilla
       custard, pearl aqua) y un gris medio se quedaba corto de 3:1. */
    --muted-on-paper: #403d37;
    --border-on-dark: var(--c-border);
    --border-on-paper: rgba(20, 17, 13, 0.15);

    --rail-width: 32px;
}

/* ==================== DOS TEMAS DE 3 COLORES ====================
   Ya no hay botonera para elegir (se sacó, pedido explícito): el sitio queda
   siempre en "dark". El tema "light" queda definido por si vuelve. Los capítulos siguen alternando "dark"/"light"
   (data-chapter-theme) mapeados a los roles de cada tema.
   data-mode="dark"  → negro grisáceo #17181a (alterna con #232427) + mostaza #ee9b00 + beige #e9d8a6.
   data-mode="light" → beige #e9d8a6 + negro #001219 + rojo #c8321f. Hero beige, "Julián"
                       en negro, "Luchelli Fassa" en rojo. */
:root,
:root[data-mode="dark"] {
    /* Paleta 2026-10-18 (vuelta a la de antes, pedido): gris casi negro +
       amarillo mostaza + texto beige. Misma paleta en todo el sitio. */
    --negro: #17181a;
    --hueso: #e9d8a6;
    --naranja: #ee9b00;
    --terracota: #8f6a1c;
    --gris: rgba(233, 216, 166, 0.56);
    --c-bg: #17181a;
    --c-text: #e9d8a6;
    --c-text-muted: rgba(233, 216, 166, 0.58);
    --c-border: rgba(233, 216, 166, 0.13);
    --c-accent-2: #8f6a1c;
    --ink-dark: #17181a;
    --paper: #1b1c1f;
    --text-on-dark: #e9d8a6;
    --text-on-paper: #e9d8a6;
    --muted-on-dark: rgba(233, 216, 166, 0.58);
    --muted-on-paper: rgba(233, 216, 166, 0.6);
    --border-on-dark: rgba(233, 216, 166, 0.13);
    --border-on-paper: rgba(233, 216, 166, 0.13);
    --font-main: 'Rethink Sans', system-ui, sans-serif;
    --font-display: 'Rethink Sans', system-ui, sans-serif;
    --font-name: 'Rethink Sans', system-ui, sans-serif;   /* nombre de la portada y celda del rol */
    --nav-h: 52px;
    --px-fill: #222326;
}

/* Tema beige/negro/rojo: capítulos "dark" = beige, "light" = negro. */
:root[data-mode="light"] {
    --negro: #001219;
    --hueso: #e9d8a6;
    --naranja: #c8321f;
    --gris: rgba(0, 18, 25, 0.68);
    --c-bg: #e9d8a6;
    --c-text: #001219;
    --c-text-muted: rgba(0, 18, 25, 0.68);
    --c-border: rgba(0, 18, 25, 0.2);
    --ink-dark: #e9d8a6;
    --paper: #001219;
    --text-on-dark: #001219;
    --text-on-paper: #e9d8a6;
    --muted-on-dark: rgba(0, 18, 25, 0.68);
    --muted-on-paper: rgba(233, 216, 166, 0.72);
    --border-on-dark: rgba(0, 18, 25, 0.2);
    --border-on-paper: rgba(233, 216, 166, 0.24);
}

:root[data-mode="light"] .float-contact:hover {
    color: #e9d8a6;
}

/* Antialiasing parejo para la tipografía editorial — pedido explícito del
   brief, se nota más con Instrument Serif que con un monospace. */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ==================== 2. BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--c-bg);
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--c-accent);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

ul {
    list-style: none;
}

img {
    width: 100%;
    display: block;
    object-fit: cover;
}

/* Persistent brand accent — thin line pinned to the very top edge, above the nav */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--c-accent);
    z-index: 101;
    pointer-events: none;
}

/* Subtle film-grain overlay — pure texture, no hue shift. SVG feTurbulence
   tiled as a background, blended over everything via mix-blend-mode. */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0.05;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Loader — two panels ("doors") that slide apart to reveal the hero */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: auto;
}

.loader-panel {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--c-bg);
    transition: transform 0.9s cubic-bezier(0.76, 0, 0.24, 1);
}

.loader-panel-left {
    left: 0;
}

.loader-panel-right {
    right: 0;
}

.loader-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 5px;
    z-index: 1;
    transition: opacity 0.35s ease;
}

body:not(.loading) .loader {
    pointer-events: none;
}

body:not(.loading) .loader-panel-left {
    transform: translateX(-100%);
}

body:not(.loading) .loader-panel-right {
    transform: translateX(100%);
}

body:not(.loading) .loader-text {
    opacity: 0;
}

/* ==================== 3. NAV (full-width bar) ==================== */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
}

/* Terminal-style blinking cursor — used by the loader only now (the old
   hero bracket treatment is gone, see Fase 1 notes) */
.blink-cursor {
    display: inline-block;
    width: 0.5em;
    height: 0.9em;
    background: var(--c-accent);
    margin-left: 0.15em;
    vertical-align: -0.1em;
    animation: cursorBlink 1s step-end infinite;
}

@keyframes cursorBlink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

/* ==================== 3. RIEL LATERAL FIJO ====================
   Columna angosta siempre fija: hamburguesa arriba, mi nombre vertical al
   medio, copyright abajo. Cambia de paleta según el capítulo que tenga
   detrás — por ahora solo existe el Hero (oscuro); el toggle automático
   por scroll (.is-light) se conecta en la Fase 2 cuando existan capítulos
   claros de verdad. */
.side-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--rail-width);
    height: 100vh;
    z-index: 110;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 20px 0;
    box-sizing: border-box;
    border-right: 1px solid var(--border-on-dark);
    background: var(--ink-dark);
    color: var(--text-on-dark);
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

.side-rail.is-light {
    background: var(--paper);
    color: var(--text-on-paper);
    border-right-color: var(--border-on-paper);
}

.rail-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: inherit;
}

.rail-hamburger span {
    display: block;
    width: 16px;
    height: 1px;
    background: currentColor;
    transition: 0.3s ease;
}

.rail-hamburger:hover span {
    background: var(--c-accent);
}

.rail-mid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.rail-brand-label,
.rail-name,
.rail-copyright {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-main);
    white-space: nowrap;
}

.rail-brand-label {
    font-size: 9px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted-on-dark);
}

.rail-name {
    font-size: 12px;
    letter-spacing: 0.08em;
    font-weight: 500;
}

.rail-copyright {
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--muted-on-dark);
}

.side-rail.is-light .rail-brand-label,
.side-rail.is-light .rail-copyright {
    color: var(--muted-on-paper);
}

/* Selector de idioma flotante — no existe en la referencia (sitio
   monolingüe) pero el mío ya es bilingüe; lo dejamos chico y aparte para
   no competir con el riel. */
.lang-switch-float {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 105;
    display: flex;
    gap: 5px;
    font-family: var(--font-main);
    font-size: 12px;
    color: var(--muted-on-dark);
    transition: color 0.4s ease;
}

.lang-switch-float.is-light {
    color: var(--muted-on-paper);
}

.lang-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
}

.lang-btn.active {
    color: var(--c-accent);
}

/* ==================== 4. MENÚ A PANTALLA COMPLETA ====================
   Overlay full-bleed en --ink-dark. El estado de acá abajo es el
   fallback seguro sin JS / reduced-motion; la entrada/salida escalonada
   la agrega GSAP en script.js. Patrón de hover único: el ítem sobre el
   que estoy queda pleno, el resto baja a --muted-on-dark — mismo patrón
   que se reusa en Proyectos y Clientes en las próximas fases. */
.full-menu {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--ink-dark);
    color: var(--text-on-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 clamp(24px, 8vw, 120px);
    box-sizing: border-box;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.full-menu.active {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

.full-menu-close {
    position: absolute;
    top: 28px;
    right: clamp(24px, 8vw, 120px);
    background: none;
    border: none;
    color: var(--text-on-dark);
    font-family: var(--font-main);
    font-size: 13px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    cursor: pointer;
}

.full-menu-close:hover {
    color: var(--c-accent);
}

.full-menu-list {
    display: flex;
    flex-direction: column;
}

.full-menu-list a {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 9vw, 6rem);
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--text-on-dark);
    padding: 0.15em 0;
    transition: color 0.3s ease;
}

.full-menu-index {
    font-family: var(--font-main);
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    color: var(--c-accent);
}

.full-menu-list:hover a {
    color: var(--muted-on-dark);
}

.full-menu-list a:hover {
    color: var(--text-on-dark);
}

.full-menu-list a:hover .full-menu-index {
    color: var(--c-accent);
}

.full-menu-socials {
    position: absolute;
    bottom: 28px;
    right: clamp(24px, 8vw, 120px);
    display: flex;
    gap: 24px;
    font-family: var(--font-main);
    font-size: 13px;
}

.full-menu-socials a {
    color: var(--muted-on-dark);
}

.full-menu-socials a:hover {
    color: var(--c-accent);
}

/* ==================== 5. HERO (capítulo oscuro) ====================
   Nombre gigante en dos líneas ajustado contra el riel, bajada arriba a
   la derecha, reloj/estado abajo a la izquierda y SCROLL abajo a la
   derecha — layout de design-ref/01_hero-reloj-scroll.jpg. */
.hero-section {
    height: 100vh;
    position: relative;
    border-bottom: 1px solid var(--border-on-dark);
    overflow: hidden;
}

/* Nombre + subtítulo van juntos: el bloque es el que se posiciona */
.hero-heading {
    position: absolute;
    left: calc(var(--rail-width) + clamp(16px, 3vw, 40px));
    top: clamp(70px, 10vh, 110px);
}

.hero-name {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.5rem, 7vw, 5.5rem);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.hero-name-line {
    display: block;
}

/* Apellido en el acento naranja — nombre queda en el color de texto normal */
.hero-name-line:last-child {
    color: var(--c-accent);
}

.hero-role {
    margin: clamp(14px, 2.2vh, 24px) 0 0;
    font-family: var(--font-code);
    font-weight: 500;
    font-size: clamp(0.95rem, 1.5vw, 1.25rem);
    letter-spacing: 0.04em;
    color: var(--muted-on-dark);
}


.hero-meta {
    position: absolute;
    bottom: clamp(28px, 6vh, 56px);
    left: calc(var(--rail-width) + clamp(16px, 4vw, 48px));
    /* Más separado del borde que el resto de las esquinas: el botón
       flotante de WhatsApp (.float-contact, siempre visible, ver footer)
       vive en ese mismo rincón — sin este margen extra "SCROLL" queda
       tapado por él en ventanas bajas (bug real, visto en 1280×680). */
    right: clamp(150px, 10vw, 200px);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.hero-meta-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--font-main);
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    color: var(--muted-on-dark);
}

.hero-clock {
    font-variant-numeric: tabular-nums;
}

/* SCROLL — centrado abajo del hero (centrado sobre el área visible,
   descontando el riel), texto + flecha que empuja hacia el costado. */
.hero-scroll {
    position: absolute;
    left: calc(50% + var(--rail-width) / 2);
    bottom: clamp(28px, 6vh, 56px);
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: var(--font-code);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    color: var(--text-on-dark);
    transition: color 0.3s ease;
}

.hero-scroll-arrow {
    width: 1.35em;
    height: 1.35em;
    color: var(--c-accent);
    animation: hero-scroll-nudge 1.8s ease-in-out infinite;
}

@keyframes hero-scroll-nudge {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(6px); }
}

.hero-scroll:hover {
    color: var(--c-accent);
}

@media (prefers-reduced-motion: reduce) {
    .hero-scroll-arrow { animation: none; }
}

/* Placeholder for a future portrait — dashed so it reads as "swap me",
   not as a finished design element. Hidden on tablet/mobile. */


@media (max-width: 1024px) {
}

/* ==================== 5. SECCIONES COMUNES ==================== */
section {
    padding: 8rem 0;
    border-bottom: 1px solid var(--c-border);
}

.highlight {
    color: var(--c-accent);
}

/* ==================== 5. MOTOR DE CAPÍTULOS (scroll horizontal) ====================
   El scroll del mouse/trackpad sigue siendo vertical — .chapters-pin solo
   le da distancia (6 capítulos × 100vh). GSAP (script.js) lee ese
   progreso y traslada .chapters-track en X, así se ve TODO el sitio como
   un scroll lateral continuo sin que el navegador scrollee horizontal de
   verdad (mismo comportamiento que confirmé en khanhnguyen.design). En
   mobile / tablet vertical el motor se desmonta (gsap.matchMedia en
   script.js) y el media query de más abajo lo deja como un stack normal. */
.chapters-pin {
    position: relative;
    height: calc(4 * 100vh);
}

.chapters-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}

.chapters-track {
    display: flex;
    height: 100%;
    will-change: transform;
}

.chapter-panel {
    position: relative;
    flex: 0 0 100vw;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    /* Para que el cambio de paleta (.palette-picker) se sienta como un
       ajuste, no como un flash */
    transition: background-color 0.4s ease, color 0.4s ease;
}

.chapter-dark {
    background: var(--ink-dark);
    color: var(--text-on-dark);
}

.chapter-light {
    background: var(--paper);
    color: var(--text-on-paper);
}

/* "CAPÍTULO N" — arriba a la izquierda de cada capítulo */

.chapter-eyebrow {
    display: block;
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    opacity: 0.7;
}

/* ---- Capítulo I — Intro: por ahora solo la frase grande (sin bio: falta material) ---- */
.chapter-intro-body {
    position: absolute;
    top: 50%;
    left: calc(var(--rail-width) + clamp(24px, 5vw, 64px));
    right: clamp(24px, 5vw, 64px);
    max-width: 1320px;
    transform: translateY(-50%);
    font-family: var(--font-main);
    display: flex;
    flex-direction: column;
    gap: clamp(36px, 7vh, 80px);
}

/* ---- Perfil compacto: texto a la izquierda, herramientas a la derecha ---- */
.chapter-intro-body.about {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(40px, 6vw, 110px);
    align-items: center;
}
.about-copy { display: flex; flex-direction: column; gap: clamp(16px, 2.6vh, 26px); align-items: flex-start; }
.about-head { display: flex; align-items: center; gap: 20px; }
.about-avatar {
    flex: none;
    width: clamp(64px, 7vw, 96px);
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid var(--c-border);
    filter: grayscale(0.2) contrast(1.05);
}
.about-title {
    margin: 0;
    font-size: clamp(1.8rem, 3vw, 3rem);
    font-weight: 500;
    line-height: 1.06;
    letter-spacing: -0.02em;
    text-wrap: balance;
    max-width: 18ch;
}
.about-text {
    margin: 0;
    max-width: 50ch;
    font-size: clamp(0.95rem, 1.1vw, 1.1rem);
    line-height: 1.6;
    color: color-mix(in srgb, currentColor 78%, transparent);
}
.about-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.about-points li {
    padding: 7px 12px;
    border: 1px solid color-mix(in srgb, var(--c-accent-2) 60%, transparent);
    color: var(--c-accent-2);
    font-family: var(--font-code);
    font-size: 0.8rem;
}

/* Herramientas: 4 grupos en filas finas, íconos chicos con nombre */
.about-stack-title {
    margin: 0 0 14px;
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: color-mix(in srgb, currentColor 60%, transparent);
}
.about-tools-group {
    display: grid;
    grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--c-border);
}
.about-tools-group:last-child { border-bottom: 1px solid var(--c-border); }
.about-tools-title {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.about-tools-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    color: color-mix(in srgb, currentColor 75%, transparent);
}
.about-tools-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}
.about-tools-list .tool-icon,
.about-tools-list .tool-icon-svg { width: 20px; height: 20px; }
.about-tools-list li:hover { color: var(--c-text); }
.about-tools-list li:hover .tool-icon { background: var(--brand, var(--c-accent)); }
.about-tools-list li:hover .tool-icon-svg { color: var(--brand, var(--c-accent)); }
@media (hover: none) {
    .about-tools-list .tool-icon { background: var(--brand, currentColor); }
    .about-tools-list .tool-icon-svg { color: var(--brand, currentColor); }
}
.about-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; }
.about-wa {
    padding: 14px 24px;
    background: var(--c-accent);
    color: var(--c-bg);
    font-family: var(--font-code);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.3s ease;
}
.about-wa:hover, .about-wa:focus-visible { filter: brightness(1.12); }

/* Ver CV: botón discreto bajo la frase, mismo idioma que "Scroll" */
.intro-cv {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--c-accent);
    font-family: var(--font-code);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: inherit;
    text-decoration: none;
    background: none;
    border-top: 0;
    border-left: 0;
    border-right: 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.intro-cv svg {
    width: 1.1em;
    height: 1.1em;
    color: var(--c-accent);
    transition: transform 0.3s ease;
}

.intro-cv:hover,
.intro-cv:focus-visible {
    color: var(--c-accent);
}

.intro-cv:hover svg {
    transform: rotate(90deg);
}


/* ---- Ventana del CV (#cv-dialog) ----
   La hoja (.cv-sheet) recibe el HTML de cv/cv.html sin sus estilos de
   impresión: todo lo de acá abajo lo re-viste con el estilo del sitio. */
.cv-dialog {
    width: min(960px, calc(100vw - 48px));
    max-width: none;
    height: min(88vh, 1000px);
    max-height: none;
    margin: auto; /* el reset global de márgenes la descentraba */
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--c-accent) 35%, transparent);
    border-radius: 4px;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--font-main);
    overflow: hidden;
    flex-direction: column;
}

.cv-dialog[open] {
    display: flex;
    animation: cv-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.cv-dialog::backdrop {
    background: rgba(8, 8, 9, 0.82);
}

@keyframes cv-in {
    from { opacity: 0; transform: translateY(40px); clip-path: inset(0 0 100% 0); }
    to { opacity: 1; transform: none; clip-path: inset(0); }
}

.cv-dialog-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px 14px 28px;
    border-bottom: 1px solid var(--c-border);
}

.cv-dialog-title {
    font-family: var(--font-code);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: var(--c-text-muted);
}

.cv-dialog-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cv-dialog-download {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--c-accent);
    color: var(--c-bg);
    font-family: var(--font-code);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: filter 0.3s ease;
}

.cv-dialog-download svg,
.cv-dialog-close svg {
    width: 1.1em;
    height: 1.1em;
}

.cv-dialog-download:hover {
    filter: brightness(1.12);
}

.cv-dialog-close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 1px solid var(--c-border);
    border-radius: 50%;
    background: none;
    color: var(--c-text);
    font-size: 1.1rem;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.cv-dialog-close:hover {
    color: var(--c-accent);
    border-color: var(--c-accent);
    transform: rotate(90deg);
}

.cv-dialog-body {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(24px, 4vw, 48px) clamp(20px, 4vw, 56px) 56px;
    scrollbar-color: color-mix(in srgb, var(--c-accent) 50%, transparent) transparent;
}

/* Hoja: cada bloque entra escalonado al abrir */
.cv-sheet > * {
    animation: cv-item-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(0.15s + var(--i, 0) * 45ms);
}

@keyframes cv-item-in {
    from { opacity: 0; transform: translateY(14px); }
}

@media (prefers-reduced-motion: reduce) {
    .cv-dialog[open],
    .cv-sheet > * { animation: none; }
}

.cv-sheet {
    font-size: 0.92rem;
    line-height: 1.6;
}

.cv-sheet a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--c-accent) 60%, transparent);
    text-underline-offset: 0.2em;
}

.cv-sheet a:hover {
    color: var(--c-accent);
}

.cv-sheet header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding-bottom: 28px;
}

.cv-sheet h1 {
    margin: 0;
    font-size: clamp(1.8rem, 3.6vw, 3rem);
    font-weight: 500;
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.cv-sheet .role {
    margin: 10px 0 0;
    font-family: var(--font-code);
    color: var(--c-accent);
}

.cv-sheet .contact {
    text-align: right;
    font-size: 0.82rem;
    line-height: 1.8;
    color: var(--c-text-muted);
}

/* Títulos de sección con una línea fina que corre hasta el borde */
.cv-sheet h2 {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 40px 0 18px;
    font-family: var(--font-code);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-accent);
}

.cv-sheet h2::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--c-border);
}

.cv-sheet p {
    margin: 0;
    color: color-mix(in srgb, var(--c-text) 82%, transparent);
}

.cv-sheet .item {
    margin-bottom: 18px;
}

.cv-sheet .item-head,
.cv-sheet .certs li,
.cv-sheet .past li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
}

.cv-sheet .item-title {
    font-weight: 500;
}

.cv-sheet .item-sub {
    color: var(--c-text-muted);
    font-weight: 400;
}

.cv-sheet .item-date {
    flex-shrink: 0;
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--c-text-muted);
}

.cv-sheet .tech {
    display: block;
    margin-top: 2px;
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--c-accent);
}

.cv-sheet .grid {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px 24px;
    margin: 0;
}

.cv-sheet .grid dt {
    font-weight: 500;
}

.cv-sheet .grid dd {
    margin: 0;
    color: color-mix(in srgb, var(--c-text) 82%, transparent);
}

.cv-sheet .certs,
.cv-sheet .past {
    margin: 10px 0 0;
    padding: 0 0 0 18px;
    list-style: none;
    border-left: 1px solid color-mix(in srgb, var(--c-accent) 45%, transparent);
}

.cv-sheet .certs li,
.cv-sheet .past li {
    margin-bottom: 8px;
    color: color-mix(in srgb, var(--c-text) 82%, transparent);
}

.cv-sheet .certs b,
.cv-sheet .past b {
    font-weight: 500;
    color: var(--c-text);
}

.cv-sheet .verify {
    font-family: var(--font-code);
    font-size: 0.78rem;
    color: var(--c-accent);
}

/* Celular: la ventana ocupa toda la pantalla y todo va en una columna */
@media (max-width: 700px) {
    .cv-dialog {
        width: 100vw;
        height: 100dvh;
        border: 0;
        border-radius: 0;
    }

    .cv-dialog-bar {
        padding: 10px 12px 10px 20px;
    }

    .cv-dialog-title {
        display: none;
    }

    .cv-dialog-actions {
        flex: 1;
        justify-content: space-between;
    }

    .cv-sheet header,
    .cv-sheet .item-head,
    .cv-sheet .certs li,
    .cv-sheet .past li {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .cv-sheet header {
        gap: 16px;
    }

    .cv-sheet .contact {
        text-align: left;
    }

    .cv-sheet .grid {
        grid-template-columns: 1fr;
        gap: 2px;
    }

    .cv-sheet .grid dd {
        margin-bottom: 10px;
    }
}

.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;
}



/* ---- Transición — mosaico ---- */



/* Mosaico abstracto — nueve tonos mezclados con color-mix() a partir de
   los 3 colores de la paleta activa, en vez de fotos. Cambia solo al
   tocar la botonera de paletas, sin tocar HTML ni JS. */










/* ---- Capítulo II — Proyectos (lista con hover, patrón único) ---- */
.work-list-wrap {
    position: absolute;
    top: clamp(130px, 20vh, 190px);
    left: calc(var(--rail-width) + clamp(24px, 5vw, 64px));
    width: min(46vw, 620px);
}

.work-hover-list {
    display: flex;
    flex-direction: column;
}

.work-hover-item {
    display: block;
    color: inherit;
    border-bottom: 1px solid var(--border-on-paper);
}

.work-hover-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 1.1rem 0;
    color: inherit;
    transition: color 0.3s ease;
}

.work-hover-name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 2.4rem);
    text-transform: uppercase;
    flex: 1;
}

.work-hover-year {
    font-family: var(--font-main);
    font-size: 0.8rem;
    color: var(--muted-on-paper);
}

.work-hover-arrow {
    font-size: 1.2rem;
    opacity: 0;
    transform: translate(-4px, 4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Patrón de hover único (mismo que el menú): paso el mouse por la lista,
   todo baja a --muted-on-paper salvo el ítem sobre el que estoy. */
.work-hover-list.has-open .work-hover-row {
    color: var(--muted-on-paper);
}

.work-hover-item.is-open .work-hover-row {
    color: var(--text-on-paper);
}

.work-hover-item.is-open .work-hover-arrow {
    opacity: 1;
    transform: translate(0, 0);
}

.work-hover-item.is-empty .work-hover-row {
    color: var(--muted-on-paper);
    cursor: default;
}

.work-hover-info {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
}

.work-hover-info > div {
    overflow: hidden;
}

.work-hover-item.is-open .work-hover-info,
.work-hover-item:focus-within .work-hover-info {
    grid-template-rows: 1fr;
}

.work-hover-tech-label {
    display: block;
    font-size: 0.7rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-accent);
}

.work-hover-tech {
    margin: 0.25rem 0 0.7rem;
    font-size: 0.9rem;
}

.work-hover-desc {
    padding-bottom: 1.1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--muted-on-paper);
}

/* Título "PROYECTOS" del capítulo (antes era un capítulo de transición). */
.work-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.5rem);
    text-transform: uppercase;
    margin-bottom: 8px;
}

@media (min-width: 1024px) and (orientation: landscape) {
    .work-title {
        position: absolute;
        top: clamp(56px, 9vh, 72px);
        left: calc(var(--rail-width) + clamp(24px, 5vw, 64px));
        z-index: 2;
    }
}

/* Sin hover (touch / vertical) el detalle queda siempre desplegado. */
@media (hover: none), (max-width: 1023px), (orientation: portrait) {
    .work-hover-info {
        grid-template-rows: 1fr;
    }
}


/* ---- Capítulo III — Herramientas que utilizo ---- */



/* Sin foto real por herramienta todavía — el hover llena con un velo de
   acento en vez de una imagen de fondo (adaptación del patrón original). */





/* ---- Cierre ---- */
.chapter-closing {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Respaldo del motor en mobile / tablet vertical: scroll vertical normal,
   capítulos apilados — sin carteles de "girá la pantalla". */
@media (max-width: 1023px), (orientation: portrait) {

    .chapters-pin,
    .chapters-sticky {
        height: auto;
    }

    .chapters-sticky {
        position: static;
        overflow: visible;
    }

    .chapters-track {
        display: block;
        height: auto;
        transform: none !important;
    }

    .chapter-panel {
        width: 100%;
        height: auto;
        min-height: 100vh;
        padding: 90px 20px 60px calc(var(--rail-width) + 20px);
    }


    .hero-heading,
    .hero-meta,
    .chapter-intro-body,
    .work-list-wrap {
        position: static;
        transform: none;
        width: auto;
        max-width: none;
        left: auto;
        right: auto;
        top: auto;
        bottom: auto;
        margin-top: 20px;
    }



}

/* ==================== 8. FOOTER ==================== */

.footer-title {
    font-family: var(--font-display);
    font-size: clamp(2.4rem, 6vw, 5.5rem);
    margin-bottom: 1.2rem;
    letter-spacing: -2px;
}

.footer-text {
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    color: var(--muted-on-dark);
    margin-bottom: 3rem;
}

/* Botón de contacto del cierre: píldora con el número. Sin pseudo-elementos
   de relleno, así el texto nunca queda tapado al hacer hover. */
.contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 1.4rem;
    padding: 1.3rem 3.2rem;
    border: 1px solid var(--c-text);
    border-radius: 999px;
    color: var(--c-text);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.contact-btn-label {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}


.contact-btn:hover,
.contact-btn:focus-visible {
    background: var(--c-accent);
    border-color: var(--c-accent);
    color: var(--c-bg);
}

/* Línea de borde a borde del cierre (reemplaza a los links sociales y el copyright). */
.footer-line {
    position: absolute;
    left: var(--rail-width);
    right: 0;
    bottom: 5rem;
    border-top: 1px solid var(--c-border);
}

/* Persistent quick-contact — reachable from anywhere, not just the footer */
.float-contact {
    position: fixed;
    right: 2rem;
    bottom: 2rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--negro);
    border: 1px solid var(--c-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--c-accent);
    z-index: 90;
    transition: 0.3s;
}

.float-contact svg {
    width: 1.5rem;
    height: 1.5rem;
}

.float-contact:hover {
    background: var(--c-accent);
    color: var(--negro);
    transform: scale(1.08);
}

/* RESPONSIVE — el riel queda igual (32px, cabe de sobra); el menú
   fullscreen ya es full-bleed por diseño, solo se achican las letras.
   El Hero pasa de layout "por esquinas" (absolute) a flujo normal
   apilado, como pide el brief para celular/tablet vertical. */
@media (max-width: 768px) {
    .rail-brand-label {
        display: none;
    }

    .lang-switch-float {
        top: 14px;
        right: 16px;
        font-size: 11px;
    }

    .full-menu {
        padding: 0 20px;
    }

    .full-menu-close {
        top: 20px;
        right: 20px;
    }

    .full-menu-list a {
        font-size: clamp(2rem, 14vw, 3rem);
        gap: 0.75rem;
    }

    .full-menu-socials {
        bottom: 20px;
        right: 20px;
        gap: 16px;
        font-size: 12px;
    }

    /* El stack/posición general de .hero-section ya lo resuelve la regla
       genérica .chapter-panel del motor (ver más arriba) — acá solo quedan
       los ajustes de tamaño que le siguen haciendo falta en mobile. */
    .hero-name {
        font-size: clamp(2.4rem, 13vw, 3.5rem);
    }


    .hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .float-contact {
        width: 3rem;
        height: 3rem;
        right: 1.25rem;
        bottom: 1.25rem;
    }

    .float-contact svg {
        width: 1.3rem;
        height: 1.3rem;
    }
}

/* Iconos de tecnologías (Devicon vía mask, así toman el color de la paleta) */
.tools-row-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    transition: color 0.2s ease;
}

.tools-row-list li:hover {
    color: var(--text-on-dark);
}

.tool-icon,
.tool-icon-svg {
    flex: none;
    width: 26px;
    height: 26px;
}

.tool-icon {
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    transition: background 0.2s ease;
}

/* Única excepción al sistema de color del sitio: al pasar el mouse, cada
   ícono se ilumina con el color de su marca (--brand, definido por <li>). */
.tools-row-list li:hover .tool-icon {
    background: var(--brand, var(--c-accent));
}

.tools-row-list li:hover .tool-icon-svg {
    color: var(--brand, var(--c-accent));
}

.tools-row-list li:hover .tool-icon,
.tools-row-list li:hover .tool-icon-svg {
    filter: drop-shadow(0 0 8px color-mix(in srgb, var(--brand, var(--c-accent)) 55%, transparent));
}

@media (hover: none) {
    .tools-row-list .tool-icon {
        background: var(--brand, currentColor);
    }

    .tools-row-list .tool-icon-svg {
        color: var(--brand, currentColor);
    }
}


/* ---- Proyectos: panel desplegado con captura del sitio de fondo ---- */
.work-list-wrap {
    top: clamp(132px, 20vh, 170px);
    right: clamp(24px, 5vw, 64px);
    width: auto;
}

/* Toda la tarjeta (.work-hover-item) es un link. Texto a la izquierda y la
   captura COMPLETA a la derecha, sin velo (antes era un fondo finito). */
.work-hover-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 3rem);
    margin-bottom: 1.1rem;
    padding: 1.2rem clamp(1.2rem, 2.4vw, 2.2rem);
    border: 1px solid var(--border-on-paper);
    transition: border-color 0.3s ease;
}

.work-hover-item.is-open .work-hover-panel {
    border-color: var(--text-on-paper);
}

.work-hover-text {
    display: flex;
    flex-direction: column;
}

.work-hover-shot {
    display: block;
    height: clamp(170px, 26vh, 320px);
    aspect-ratio: 16 / 10;
    border: 1px solid var(--border-on-paper);
    background: var(--site-img) center top / cover no-repeat;
}

.work-hover-tech {
    font-size: 1.05rem;
}

.work-hover-desc {
    padding-bottom: 0;
    max-width: 44ch;
    font-size: 0.95rem;
    color: var(--text-on-paper);
}

.work-hover-list .work-hover-row {
    padding: 0.85rem 0;
}


.contact-btn::after {
    content: '\2197';
    font-size: 1.2rem;
}

/* ---- Herramientas que utilizo: una fila por grupo, íconos grandes ---- */
.tools-rows {
    position: absolute;
    left: var(--rail-width);
    right: 0;
    top: clamp(132px, 20vh, 170px);
    bottom: 5.5rem;
    display: flex;
    flex-direction: column;
}

.tools-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0 clamp(24px, 5vw, 64px);
    border-top: 1px solid var(--border-on-dark);
}

.tools-row:last-child {
    border-bottom: 1px solid var(--border-on-dark);
}

.tools-row-title {
    flex: 0 0 clamp(150px, 18vw, 240px);
    font-family: var(--font-display);
    font-size: clamp(0.9rem, 1.3vw, 1.15rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tools-row-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem clamp(0.5rem, 1.5vw, 1.5rem);
    color: var(--muted-on-dark);
}

.tools-row-list li {
    flex-direction: column;
    justify-content: center;
    gap: 0.55rem;
    width: clamp(88px, 9vw, 128px);
    padding: 0.8rem 0.4rem;
    border-radius: 6px;
    font-size: 0.75rem;
    text-align: center;
    transition: background 0.2s ease, color 0.2s ease;
}

.tools-row-list li:hover {
    background: color-mix(in srgb, var(--brand, var(--c-accent)) 12%, transparent);
    color: var(--text-on-dark);
}

.tools-row-list .tool-icon,
.tools-row-list .tool-icon-svg {
    width: clamp(30px, 5.2vh, 44px);
    height: clamp(30px, 5.2vh, 44px);
}

@media (max-width: 1023px), (orientation: portrait) {
    .tools-rows {
        position: static;
        margin-top: 20px;
    }

    .tools-row {
        flex: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 20px 0;
    }

    .tools-row-title {
        flex: none;
    }
}

.work-hover-link {
    align-self: flex-start;
    margin-top: 1rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid var(--c-accent);
    border-radius: 999px;
    font-size: 0.9rem;
    letter-spacing: 0.04em;
    color: var(--c-accent);
    transition: background 0.25s ease, color 0.25s ease;
}

.work-hover-item.is-open .work-hover-link {
    background: var(--c-accent);
    color: var(--paper);
}

.work-hover-note {
    margin-left: 0.5rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--muted-on-paper);
}

@media (max-width: 1023px), (orientation: portrait) {
    .footer-title {
        font-size: clamp(2rem, 9vw, 5rem);
        letter-spacing: 0;
    }
}

/* ==================== CELULAR: sitio normal de arriba hacia abajo ====================
   Simplificado a propósito: barra superior fija (menú · tema · idioma), secciones
   del alto de su contenido, proyectos como tarjetas (captura arriba, texto abajo).
   Va al final del archivo para pisar los estilos de escritorio y los anteriores. */
@media (max-width: 1023px), (orientation: portrait) {
    :root {
        --rail-width: 0px;
    }

    /* Barra superior fija (antes era el riel lateral) */
    .side-rail {
        top: 0;
        left: 0;
        right: 0;
        width: auto;
        height: 56px;
        flex-direction: row;
        padding: 0 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-on-dark);
    }

    .side-rail.is-light {
        border-bottom-color: var(--border-on-paper);
    }

    .rail-mid,
    .rail-copyright {
        display: none;
    }

    .lang-switch-float {
        top: 19px;
        right: 16px;
        z-index: 120; /* arriba de la barra superior, si no queda tapado */
    }

    /* Secciones: del alto de su contenido */
    .chapter-panel {
        min-height: 0;
        padding: 64px 20px;
    }

    .hero-section {
        min-height: 100svh;
        padding-top: 96px;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }


    /* Perfil: foto arriba, texto abajo */
    .chapter-intro-body.about { display: flex; flex-direction: column; align-items: stretch; gap: 40px; }
    .about-title { font-size: clamp(1.6rem, 7vw, 2.2rem); }
    .about-tools-group { grid-template-columns: 1fr; gap: 10px; }

    /* Proyectos: tarjeta simple */
    .work-title {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }

    .work-hover-row {
        padding: 1rem 0 0.75rem;
    }

    .work-hover-name {
        font-size: 1.35rem;
    }

    .work-hover-arrow {
        opacity: 1;
        transform: none;
    }

    .work-hover-panel {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
        padding: 0 0 1rem;
        border: none;
    }

    .work-hover-shot {
        order: -1;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        margin-bottom: 1rem;
    }

    .work-hover-desc {
        max-width: none;
    }

    /* Herramientas: grilla compacta */
    .tools-rows {
        margin-top: 12px;
    }

    .tools-row {
        padding: 18px 0;
    }

    .tools-row-title {
        font-size: 0.95rem;
    }

    .tools-row-list li {
        width: 84px;
        padding: 0.5rem 0.2rem;
    }

    .tools-row-list .tool-icon,
    .tools-row-list .tool-icon-svg {
        width: 34px;
        height: 34px;
    }

    /* Cierre */
    .chapter-closing {
        flex-direction: column;
        min-height: 70svh;
        padding: 72px 20px 110px;
    }

    .footer-title {
        margin-bottom: 2rem;
    }

    .footer-line {
        position: static;
        align-self: stretch;
        margin: 3rem -20px 0;
    }
}

[data-href] {
    cursor: pointer;
}

/* Alternancia real de fondos (claro/oscuro/claro/oscuro/claro): Proyectos toma
   el fondo "dark" y Herramientas el "light". Sus reglas internas se escribieron
   con los roles del fondo contrario, así que se remapean acá. */
#work {
    --text-on-paper: var(--text-on-dark);
    --muted-on-paper: var(--muted-on-dark);
    --border-on-paper: var(--border-on-dark);
    --paper: var(--ink-dark);
}

#skills {
    --text-on-dark: var(--text-on-paper);
    --muted-on-dark: var(--muted-on-paper);
    --border-on-dark: var(--border-on-paper);
}

/* SCROLL del hero en celular / tablet vertical: en el flujo, centrado, flecha hacia abajo */
@media (max-width: 1023px), (orientation: portrait) {
    .hero-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .hero-scroll {
        position: static;
        transform: none;
        align-self: center;
        margin-top: 40px;
    }

    .hero-scroll-arrow {
        rotate: 90deg;
        animation-name: hero-scroll-nudge-down;
    }

    @keyframes hero-scroll-nudge-down {
        0%, 100% { translate: 0 0; transform: none; }
        50% { translate: 0 6px; transform: none; }
    }
}

/* Botón de WhatsApp del cierre: el número nunca se parte en dos líneas */
.contact-btn-label { white-space: nowrap; }
@media (max-width: 600px) {
    .contact-btn { padding: 1.1rem 1.6rem; gap: 0.8rem; }
    .contact-btn-label { letter-spacing: 0.08em; font-size: 0.9rem; }
}

/* Captura del proyecto: tres vistas del sitio que se van fundiendo */
.work-hover-shot { position: relative; overflow: hidden; }
.work-hover-shot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    opacity: 0;
    animation: shot-fade 9s ease-in-out infinite;
}
.work-hover-shot img:nth-child(2) { animation-delay: -6s; }
.work-hover-shot img:nth-child(3) { animation-delay: -3s; }
@keyframes shot-fade {
    0%     { opacity: 1; transform: scale(1); }
    28%    { opacity: 1; }
    36%    { opacity: 0; transform: scale(1.04); }
    92%    { opacity: 0; transform: scale(1); }
    100%   { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .work-hover-shot img { animation: none; }
    .work-hover-shot img:first-child { opacity: 1; }
}

/* Pantallas bajas (ej. 1366x768 con la barra del navegador): filas y captura
   más compactas para que con un proyecto abierto se vean los tres nombres. */
@media (min-width: 1024px) and (orientation: landscape) and (max-height: 780px) {
    .work-list-wrap { top: 132px; }
    .work-hover-list .work-hover-row { padding: 0.55rem 0; }
    .work-hover-name { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
    .work-hover-panel { padding: 0.9rem clamp(1rem, 2vw, 1.8rem); margin-bottom: 0.7rem; }
    .work-hover-shot { height: clamp(130px, 24vh, 200px); }
}

/* Tarjeta de proyecto sin recuadro: captura a la izquierda (alineada con
   el nombre) y el texto al lado, sin hueco en el medio. */
@media (min-width: 1024px) and (orientation: landscape) {
    .work-hover-panel,
    .work-hover-item.is-open .work-hover-panel {
        grid-template-columns: auto minmax(0, 1fr);
        align-items: center;
        gap: clamp(24px, 3vw, 48px);
        margin: 0.2rem 0 1.2rem;
        padding: 0;
        border: none;
    }
    .work-hover-shot {
        order: -1;
        height: clamp(150px, 26vh, 280px);
        border: 1px solid var(--border-on-paper);
        border-radius: 4px;
        box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6);
    }
    .work-hover-desc { max-width: 40ch; }
}
@media (min-width: 1024px) and (orientation: landscape) and (max-height: 780px) {
    .work-hover-shot { height: clamp(130px, 24vh, 190px); }
    .work-hover-panel,
    .work-hover-item.is-open .work-hover-panel { margin: 0.1rem 0 0.8rem; }
}

/* ---- Perfil: pregunta + mosaico de piezas que entran de a una ---- */
.about-mosaic {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: 640px;
}
.about-mosaic li {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: clamp(14px, 2.2vh, 22px) clamp(16px, 1.6vw, 22px);
    background: color-mix(in srgb, var(--c-text) 4.5%, transparent);
    border-radius: 6px;
    font-size: clamp(0.9rem, 1.05vw, 1.02rem);
    line-height: 1.5;
    color: color-mix(in srgb, var(--c-text) 88%, transparent);
}
/* Mosaico: la primera y la última pieza más anchas que las del medio */
.about-mosaic li:nth-child(1) { grid-column: span 2; }
.about-mosaic li:nth-child(4) { grid-column: span 2; }
.about-mosaic-n {
    font-family: var(--font-code);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    color: var(--c-accent);
}
.about-mosaic li:nth-child(even) .about-mosaic-n { color: var(--c-accent-2); }

/* Entrada: desde la izquierda, con un leve desenfoque, una pieza tras otra */
#about .reveal-piece {
    opacity: 0;
    transform: translateX(-28px);
    filter: blur(6px);
    transition:
        opacity 0.7s ease,
        transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1),
        filter 0.7s ease;
    transition-delay: calc(var(--i, 0) * 0.16s + 0.15s);
}
#about.is-in .reveal-piece {
    opacity: 1;
    transform: none;
    filter: none;
}
@media (prefers-reduced-motion: reduce) {
    #about .reveal-piece { opacity: 1; transform: none; filter: none; transition: none; }
}
@media (max-width: 1023px), (orientation: portrait) {
    .about-mosaic { grid-template-columns: 1fr; }
    .about-mosaic li:nth-child(n) { grid-column: auto; }
}

/* ---- Composiciones abstractas que se "pintan" con el scroll (estilo Heron) ----
   Capa de líneas finas arriba; debajo la versión pintada, tapada por una
   máscara con borde de pincelada que JS hace crecer de arriba hacia abajo. */
.pa { margin: 0; color: var(--c-text); pointer-events: none; }
.pa svg { display: block; width: 100%; height: auto; overflow: visible; }
.pa-lines > :not(.pa-guide),
.pa-lines .pa-fins > * {
    stroke: var(--c-text);
    stroke-opacity: 0.6;
    stroke-width: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.pa-lines .pa-sun { stroke: var(--c-accent); stroke-opacity: 0.85; }
.pa-lines .pa-fins > * { stroke-opacity: 0.35; }
.pa.is-drawn .pa-lines > :not(.pa-guide),
.pa.is-drawn .pa-lines .pa-fins > * {
    animation: pa-draw 1.4s cubic-bezier(0.6, 0, 0.2, 1) forwards;
    animation-delay: calc(0.3s + var(--n, 0) * 0.05s);
}
@keyframes pa-draw { to { stroke-dashoffset: 0; } }
.pa-guide {
    stroke: var(--c-text);
    stroke-opacity: 0.14;
    stroke-width: 0.8;
    stroke-dasharray: 3 6;
}
.pa-label {
    font-family: var(--font-code);
    font-size: 10px;
    letter-spacing: 0.16em;
    fill: var(--c-text);
    fill-opacity: 0.55;
    transform: translateY(16px);
}
.pa .f-sun { fill: var(--c-accent); }
.pa .f-sun2 { fill: color-mix(in srgb, var(--c-accent) 82%, var(--c-bg)); }
.pa .f-ink { fill: var(--pa-ink); }
.pa .f-mid { fill: var(--pa-mid); }
.pa .f-dark { fill: var(--pa-dark); }
.pa .f-light { fill: var(--pa-light); }
.pa .f-hatch { color: var(--pa-dark); }
.pa .f-fins line { stroke: var(--c-bg); stroke-width: 3; }
@media (prefers-reduced-motion: reduce) {
    .pa-lines > *, .pa-lines .pa-fins > * { animation: none !important; stroke-dashoffset: 0; }
}

/* Portada: composición abajo a la derecha */
.pa-a {
    position: absolute;
    right: clamp(32px, 5vw, 96px);
    bottom: clamp(40px, 8vh, 80px);
    width: min(36vw, calc(100vh - 230px), 600px);
}
/* Cierre: texto a la izquierda y composición a la derecha */
@media (min-width: 1024px) and (orientation: landscape) {
    .chapter-closing {
        justify-content: space-between;
        gap: 5vw;
        padding: 0 clamp(40px, 7vw, 120px) 0 calc(var(--rail-width) + clamp(40px, 6vw, 110px));
        text-align: left;
    }
    .pa-b { flex: none; width: min(40vw, calc((100vh - 220px) * 1.19), 640px); }
}
@media (max-width: 1023px), (orientation: portrait) {
    .pa-a {
        position: relative;
        right: auto;
        bottom: auto;
        width: 100%;
        max-width: 460px;
        margin: 36px auto 8px;
    }
    .pa-b { width: 100%; max-width: 460px; margin: 40px auto 0; }
}

/* Capturas de proyectos: en blanco y negro hasta que se abre el proyecto */
.work-hover-shot img { filter: grayscale(1) contrast(1.05); transition: filter 1.1s ease 0.15s; }
.work-hover-item.is-open .work-hover-shot img { filter: none; }
@media (hover: none), (max-width: 1023px), (orientation: portrait) {
    .work-hover-shot img { filter: none; }
}


/* =====================================================================
   REDISEÑO 2026-10-15 (noche): barra de navegación visible, líneas que
   separan las secciones, etiquetas tipo ficha y composiciones que se pintan.
   ===================================================================== */
body::before { display: none; }            /* la barra de arriba reemplaza a la línea */
.side-rail, .lang-switch-float { display: none !important; }
:root { --rail-width: 24px; }

/* ---- Barra de navegación ---- */
.topnav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 120;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: clamp(16px, 3vw, 48px);
    padding: 0 clamp(16px, 3vw, 40px);
    background: color-mix(in srgb, var(--c-bg) 92%, transparent);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--c-border);
    font-family: var(--font-code);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--c-text);
}
.topnav-brand { font-weight: 600; letter-spacing: 0.2em; }
.topnav-links { display: flex; gap: clamp(14px, 2.6vw, 40px); margin-left: auto; }
.topnav-links a {
    position: relative;
    display: inline-flex;
    gap: 8px;
    padding: 6px 0;
    color: var(--c-text-muted);
    transition: color 0.3s ease;
}
.topnav-n { color: color-mix(in srgb, var(--c-text) 35%, transparent); }
.topnav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--c-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.topnav-links a:hover,
.topnav-links a.is-active { color: var(--c-text); }
.topnav-links a.is-active .topnav-n { color: var(--c-accent); }
.topnav-links a.is-active::after { transform: scaleX(1); }
.topnav-lang { display: flex; gap: 4px; align-items: center; color: var(--c-text-muted); padding-left: clamp(12px, 2vw, 28px); border-left: 1px solid var(--c-border); }
.topnav-lang .lang-btn { font-size: 11px; letter-spacing: 0.12em; }
.topnav-progress {
    position: absolute;
    left: 0;
    bottom: -1px;
    height: 1px;
    width: 100%;
    background: var(--c-accent);
    transform: scaleX(0);
    transform-origin: left;
}

/* ---- Escritorio: el visor horizontal arranca debajo de la barra ---- */
@media (min-width: 1024px) and (orientation: landscape) {
    .chapters-sticky { top: var(--nav-h); height: calc(100vh - var(--nav-h)); }
    .hero-section { height: 100%; border-bottom: none; }
    .hero-heading { top: clamp(48px, 9vh, 96px); }
    .work-title { top: clamp(36px, 6vh, 56px); }
    .work-list-wrap { top: clamp(104px, 18vh, 150px); }
    .pa-a { width: min(36vw, calc(100vh - 300px), 580px); bottom: clamp(48px, 9vh, 88px); }
    .pa-b { width: min(38vw, calc((100vh - 280px) * 1.19), 600px); }
}
@media (min-width: 1024px) and (orientation: landscape) and (max-height: 780px) {
    .work-title { font-size: clamp(1.6rem, 3vw, 2.4rem); top: 30px; }
    .work-list-wrap { top: 92px; }
}

/* ---- Tipografía: títulos grotesk, ajustados ---- */
.hero-name, .about-title, .work-title, .work-hover-name, .footer-title {
    font-family: var(--font-display);
    letter-spacing: -0.025em;
}
.hero-name { font-weight: 600; line-height: 0.98; }
.work-title, .work-hover-name { font-weight: 500; }
.hero-role, .about-mosaic-n, .about-stack-title, .about-tools-title, .work-hover-year, .contact-btn-label, .pa-label {
    font-family: var(--font-code);
}

/* ---- Líneas que separan las secciones (se trazan al aparecer) ---- */
.panel-tag {
    position: absolute;
    top: 16px;
    left: calc(var(--rail-width) + clamp(16px, 3vw, 40px));
    z-index: 3;
    display: flex;
    gap: 8px;
    font-family: var(--font-code);
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.panel-tag span:first-child { color: var(--c-accent); }
.pl, .pb, .pm { position: absolute; pointer-events: none; z-index: 2; }
.pl {                                    /* línea vertical que separa paneles */
    top: 0; bottom: 0; left: 0;
    width: 1px;
    background: var(--c-border);
    transform: scaleY(0);
    transform-origin: top;
    transition: transform 1.2s cubic-bezier(0.6, 0, 0.2, 1);
}
.pb {                                    /* línea de base, abajo */
    left: 0; right: 0; bottom: 40px;
    height: 1px;
    background: var(--c-border);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.4s cubic-bezier(0.6, 0, 0.2, 1) 0.2s;
}
.pm {                                    /* cruces en las esquinas */
    width: 9px; height: 9px;
    opacity: 0;
    transition: opacity 0.6s ease 0.9s;
}
.pm::before, .pm::after { content: ''; position: absolute; background: var(--c-text-muted); }
.pm::before { left: 4px; top: 0; width: 1px; height: 9px; }
.pm::after { top: 4px; left: 0; height: 1px; width: 9px; }
.pm-t { top: -4px; left: -4px; }
.pm-b { bottom: 36px; left: -4px; }
.pm-r { bottom: 36px; right: 20px; }
.chapter-panel.is-seen .pl { transform: scaleY(1); }
.chapter-panel.is-seen .pb { transform: scaleX(1); }
.chapter-panel.is-seen .pm { opacity: 1; }
.footer-line { display: none; }

/* ---- Composiciones: colores mate ---- */
.pa-lines [pathLength] {
    stroke: var(--c-text);
    stroke-opacity: 0.5;
    stroke-width: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.pa-lines .pa-acc { stroke: var(--c-accent); stroke-opacity: 0.9; }
.pa.is-drawn .pa-lines [pathLength] {
    animation: pa-draw 1.4s cubic-bezier(0.6, 0, 0.2, 1) forwards;
    animation-delay: calc(0.3s + var(--n, 0) * 0.04s);
}
.pa .f-brass { fill: var(--pa-brass); }
.pa .f-slate { fill: var(--pa-slate); }
.pa .f-bone { fill: var(--pa-bone); }
.pa .f-graph { fill: var(--pa-graph); }
.pa .f-bg { fill: var(--c-bg); }
.pa .f-hatch { color: var(--pa-bone); opacity: 0.35; }
@media (prefers-reduced-motion: reduce) {
    .pa-lines [pathLength] { animation: none !important; stroke-dashoffset: 0; }
    .pl, .pb { transition: none; }
}

/* ---- Celular ---- */
@media (max-width: 1023px), (orientation: portrait) {
    .topnav-brand { display: none; }
    .topnav-links { margin-left: 0; gap: 14px; }
    .topnav-n { display: none; }
    .topnav-lang { margin-left: auto; }
    .topnav { font-size: 10px; letter-spacing: 0.1em; }
    .panel-tag { top: 70px; left: 20px; }
    .chapter-panel { padding-top: 104px; }
    .hero-section { padding-top: 120px; }
    .pl { top: 0; left: 0; right: 0; bottom: auto; width: auto; height: 1px; transform: scaleX(0); transform-origin: left; }
    .chapter-panel.is-seen .pl { transform: scaleX(1); }
    .pb, .pm-b, .pm-r { display: none; }
    .pm-t { top: -4px; left: 16px; }
}
.footer-title { line-height: 1.02; letter-spacing: -0.03em; font-weight: 600; }
.about-title { font-weight: 600; }

/* ---- Portada: marcos de "selección" (caen de arriba; adentro baja un telón) ---- */
.sel {
    --line: color-mix(in srgb, var(--c-text) 22%, transparent);
    position: absolute;
    right: clamp(40px, 6vw, 110px);
    bottom: clamp(64px, 12vh, 110px);
    width: min(34vw, 520px);
    height: min(56%, 400px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    pointer-events: none;
}
.sel-row {
    position: relative;
    flex: 1;
    display: flex;
    gap: clamp(8px, 1vw, 14px);
    align-items: flex-start;
    padding-top: 10px;
}
.sel-row::before {                        /* riel superior del que "cuelgan" */
    content: '';
    position: absolute;
    top: 0; left: -12px; right: -12px;
    height: 1px;
    background: var(--line);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1s cubic-bezier(0.6, 0, 0.2, 1) 0.1s;
}
.sel.is-drawn .sel-row::before { transform: scaleX(1); }
.sel-fr {
    --fp: clamp(0, calc(var(--p, 0) * 7 - var(--i)), 1);
    position: relative;
    flex: 1;
    height: var(--h);
    border: 1px solid var(--line);
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.1s cubic-bezier(0.7, 0, 0.2, 1);
    transition-delay: calc(0.35s + var(--i) * 0.1s);
}
.sel.is-drawn .sel-fr { clip-path: inset(0 0 0 0); }
.sel-cur {                                /* el telón que baja con el scroll */
    position: absolute;
    inset: 3px;
    background:
        repeating-linear-gradient(to bottom, transparent 0 9px, color-mix(in srgb, var(--c-text) 7%, transparent) 9px 10px),
        linear-gradient(to bottom, color-mix(in srgb, var(--c-text) 9%, transparent), color-mix(in srgb, var(--c-text) 3%, transparent));
    transform: scaleY(var(--fp));
    transform-origin: top;
}
.sel-n {
    position: absolute;
    left: 6px;
    bottom: 6px;
    font-family: var(--font-code);
    font-size: 9px;
    letter-spacing: 0.12em;
    color: var(--c-text-muted);
}
.sel-fr.is-pick { border-color: color-mix(in srgb, var(--c-accent) 70%, transparent); }
.sel-fr.is-pick .sel-cur {
    background:
        repeating-linear-gradient(to bottom, transparent 0 9px, color-mix(in srgb, var(--c-accent) 22%, transparent) 9px 10px),
        linear-gradient(to bottom, color-mix(in srgb, var(--c-accent) 26%, transparent), color-mix(in srgb, var(--c-accent) 6%, transparent));
}
.sel-fr.is-pick .sel-n { color: var(--c-accent); }
.sel-tag {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-code);
    font-size: 9px;
    letter-spacing: 0.16em;
    color: var(--c-accent);
}
.sel-cap, .portal-cap {
    font-family: var(--font-code);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    color: var(--c-text-muted);
    opacity: 0;
    transition: opacity 0.8s ease 1.3s;
}
.sel.is-drawn .sel-cap, .portal.is-drawn .portal-cap { opacity: 1; }

/* ---- Cierre: portal con dos telones que se abren desde el centro ---- */
.portal {
    --line: color-mix(in srgb, var(--c-text) 22%, transparent);
    --q: clamp(0, calc(var(--p, 0) * 1.25 - 0.15), 1);
    position: relative;
    flex: none;
    width: min(26vw, calc((100vh - 300px) * 0.72), 360px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    pointer-events: none;
}
.portal-lintel, .portal-floor {
    display: block;
    height: 1px;
    width: 130%;
    background: var(--line);
    transform: scaleX(0);
    transition: transform 1.1s cubic-bezier(0.6, 0, 0.2, 1) 0.1s;
}
.portal-floor { width: 160%; transition-delay: 0.3s; }
.portal.is-drawn .portal-lintel, .portal.is-drawn .portal-floor { transform: scaleX(1); }
.portal-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    margin: 12px 0;
    border: 1px solid var(--line);
    overflow: hidden;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.2s cubic-bezier(0.7, 0, 0.2, 1) 0.4s;
}
.portal.is-drawn .portal-frame { clip-path: inset(0 0 0 0); }
.portal-light {                           /* la luz que aparece al abrirse */
    position: absolute;
    top: 8%; bottom: 8%;
    left: 50%;
    width: 1px;
    background: var(--c-accent);
    box-shadow: 0 0 24px 2px color-mix(in srgb, var(--c-accent) 35%, transparent);
    transform: scaleY(var(--q));
}
.portal-cur {
    position: absolute;
    top: 0; bottom: 0;
    width: 50%;
    background:
        repeating-linear-gradient(to right, transparent 0 7px, color-mix(in srgb, var(--c-text) 7%, transparent) 7px 8px),
        color-mix(in srgb, var(--c-text) 6%, var(--c-bg));
    transition: transform 0.15s linear;
}
.portal-l { left: 0; transform-origin: left; transform: scaleX(calc(1 - var(--q))); border-right: 1px solid var(--line); }
.portal-r { right: 0; transform-origin: right; transform: scaleX(calc(1 - var(--q))); border-left: 1px solid var(--line); }
.portal-cap { margin-top: 12px; align-self: flex-start; }

@media (max-width: 1023px), (orientation: portrait) {
    .sel { position: relative; right: auto; bottom: auto; width: 100%; height: 240px; margin: 40px 0 8px; }
    .portal { width: min(62vw, 260px); margin: 48px auto 0; }
}
@media (prefers-reduced-motion: reduce) {
    .sel-fr, .portal-frame { clip-path: none !important; transition: none; }
}

/* ---- Herramientas: grilla tipo "selección de personaje" ---- */
.tools-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
.tile {
    position: relative;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid var(--c-border);
    color: color-mix(in srgb, var(--c-text) 72%, transparent);
    cursor: default;
    outline: none;
    opacity: 0;
    transform: translateY(-16px);
    clip-path: inset(0 0 100% 0);
    transition: opacity 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), clip-path 0.7s cubic-bezier(0.7, 0, 0.2, 1), background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
#about.is-in .tile {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 0 0);
    transition-delay: calc(0.6s + var(--i) * 0.045s), calc(0.6s + var(--i) * 0.045s), calc(0.6s + var(--i) * 0.045s), 0s, 0s, 0s;
}
.tile .tool-icon, .tile .tool-icon-svg { width: 26px; height: 26px; }
.tile .tool-icon { background: currentColor; }
.tile-name {
    font-family: var(--font-code);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.2;
}
.tile-cat {
    position: absolute;
    top: 6px;
    left: 7px;
    font-family: var(--font-code);
    font-size: 8px;
    letter-spacing: 0.12em;
    color: var(--c-text-muted);
}
.tile::before, .tile::after {             /* esquinas de "seleccionado" */
    content: '';
    position: absolute;
    width: 10px; height: 10px;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tile::before { top: -4px; left: -4px; border-top: 1px solid var(--c-accent); border-left: 1px solid var(--c-accent); transform: translate(4px, 4px); }
.tile::after { bottom: -4px; right: -4px; border-bottom: 1px solid var(--c-accent); border-right: 1px solid var(--c-accent); transform: translate(-4px, -4px); }
.tile:not(.is-empty):hover, .tile:not(.is-empty):focus-visible {
    background: color-mix(in srgb, var(--brand, var(--c-accent)) 9%, transparent);
    border-color: color-mix(in srgb, var(--c-text) 22%, transparent);
    color: var(--c-text);
}
.tile:not(.is-empty):hover::before, .tile:not(.is-empty):hover::after,
.tile:not(.is-empty):focus-visible::before, .tile:not(.is-empty):focus-visible::after { opacity: 1; transform: none; }
.tile:hover .tool-icon, .tile:focus-visible .tool-icon { background: var(--brand, var(--c-accent)); }
.tile:hover .tool-icon-svg, .tile:focus-visible .tool-icon-svg { color: var(--brand, var(--c-accent)); }
.tile.is-empty { border-style: dashed; color: var(--c-text-muted); }
.tile-plus { font-family: var(--font-code); font-size: 14px; opacity: 0.5; }
.tools-readout {
    margin: 14px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--c-border);
    display: flex;
    gap: 14px;
    align-items: baseline;
    font-family: var(--font-code);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.tools-readout-k { color: var(--c-accent); }
.tools-readout-v.is-on { color: var(--c-text); }
.tools-readout-v em { font-style: normal; color: var(--c-text-muted); }
@media (hover: none) {
    .tile .tool-icon { background: var(--brand, currentColor); }
    .tile .tool-icon-svg { color: var(--brand, currentColor); }
}
@media (max-width: 1023px), (orientation: portrait) {
    .tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .tile.is-empty { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tile { opacity: 1; transform: none; clip-path: none; }
}
.sel-tag { top: 6px; left: auto; right: 6px; transform: none; }
@media (hover: none) { .tools-readout { display: none; } }

/* ---- Cierre: nombre gigante en contorno; la tinta se derrama al pasar el mouse ---- */
@media (min-width: 1024px) and (orientation: landscape) {
    .chapter-closing {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: clamp(64px, 12vh, 120px) clamp(32px, 4vw, 64px) 56px calc(var(--rail-width) + clamp(24px, 4vw, 64px));
        gap: 0;
    }
    .chapter-closing .footer-content { flex: 1; }
    .footer-title { margin-bottom: 0.8rem; }
    .footer-text { margin-bottom: 1.8rem; }
}
.ink-word { width: 100%; cursor: crosshair; }
.ink-word svg { display: block; width: 100%; height: auto; overflow: visible; }
.ink-word text {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 205px;
    letter-spacing: -0.02em;
}
.ink-line {
    fill: none;
    stroke: var(--c-text);
    stroke-opacity: 0.55;
    stroke-width: 1;
    vector-effect: non-scaling-stroke;
}
.ink-fill { fill: var(--c-text); }
.ink-halo { fill: color-mix(in srgb, var(--c-text) 38%, var(--c-bg)); }
.ink-guides line {
    stroke: var(--c-text);
    stroke-opacity: 0.12;
    stroke-width: 1;
    stroke-dasharray: 2 6;
    vector-effect: non-scaling-stroke;
}
#ink-spots circle, #ink-halo-spots circle {
    fill: #fff;
    transition: r 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 1.4s ease;
}
@media (max-width: 1023px), (orientation: portrait) {
    .ink-word { margin-top: 48px; }
}

/* ---- Hover de píxeles (botones y barra): se llena con cuadraditos al azar ---- */
.px { position: relative; overflow: hidden; isolation: isolate; }
.px-grid {
    position: absolute;
    inset: 0;
    z-index: -1;
    display: grid;
    pointer-events: none;
}
.px-grid i {
    opacity: 0;
    background: var(--c-text);
    transition: opacity 0s linear var(--d), background-color 0s linear calc(var(--d) + 90ms);
}
.px-grid i.a { background: var(--c-accent); }
.px-grid i.g { background: color-mix(in srgb, var(--c-text) 45%, var(--c-bg)); }
.px.is-px .px-grid i { opacity: 1; background: var(--c-text); }
.px.is-px { color: var(--c-bg) !important; transition: color 0s linear 0.12s; }
.px.is-px .topnav-n { color: var(--c-bg); }
.topnav-links a.px { padding: 6px 10px; }
.topnav-brand.px { padding: 6px 10px; margin-left: -10px; }
.contact-btn.px:hover { background: transparent; border-color: var(--c-text); }
.px.about-wa.is-px { filter: none; }
@media (prefers-reduced-motion: reduce) {
    .px-grid i { transition: none; }
}

/* =====================================================================
   CELDAS SEPARADAS POR LÍNEAS: el hover de píxeles llena TODO el rectángulo,
   de línea a línea (barra, portada y botones), como en la referencia.
   ===================================================================== */
.topnav { padding: 0; gap: 0; }
.topnav-brand,
.topnav-brand.px {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 clamp(18px, 2vw, 28px);
    margin: 0;
    border-right: 1px solid var(--c-border);
}
.topnav-links { gap: 0; height: 100%; margin-left: auto; }
.topnav-links a,
.topnav-links a.px {
    height: 100%;
    width: clamp(108px, 10vw, 160px);
    padding: 0 16px;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--c-border);
}
.topnav-links a::after { bottom: -1px; }
.topnav-lang {
    height: 100%;
    padding: 0 clamp(16px, 1.6vw, 24px);
    margin-left: 0;
    border-left: 1px solid var(--c-border);
}
.topnav-lang.is-px .lang-btn, .topnav-lang.is-px { color: var(--c-bg); }

/* Portada: dos celdas, nombre grande y la columna con el rol y la flecha */
.hero-grid {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 40px;                         /* hasta la línea de base del panel */
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 28%);
}
.hero-cell { position: relative; }
.hero-cell-name {
    display: flex;
    align-items: flex-end;
    padding: 0 clamp(24px, 3vw, 48px) clamp(24px, 5vh, 48px) calc(var(--rail-width) + clamp(16px, 3vw, 40px));
    border-right: 1px solid var(--c-border);
}
.hero-cell-name .hero-name { font-size: clamp(3rem, 8.4vw, 8rem); }
.hero-cell-side {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(20px, 3vh, 32px) clamp(20px, 2vw, 32px);
}
.hero-cell-side .hero-role { margin: 0; }
.hero-cell-side .hero-scroll {
    position: static;
    align-self: flex-end;
    transform: none;
    margin: 0;
}
.hero-cell.is-px .hero-name-line,
.hero-cell.is-px .hero-role,
.hero-cell.is-px .hero-scroll { color: var(--c-bg); }

/* Botones: rectángulos con borde, sin píldoras */
.contact-btn, .work-hover-link { border-radius: 0; }
.intro-cv.px { padding: 12px 18px; border: 1px solid var(--c-border); border-bottom-color: var(--c-border); }
.intro-cv.px.is-px { color: var(--c-bg); }

@media (max-width: 1023px), (orientation: portrait) {
    .topnav-links a, .topnav-links a.px { width: auto; padding: 0 10px; }
    .topnav-links a:first-child { border-left: none; }
    .topnav-lang { margin-left: auto; }
    .hero-grid { position: static; grid-template-columns: 1fr; border-top: 1px solid var(--c-border); border-bottom: 1px solid var(--c-border); }
    .hero-cell-name { padding: 32px 0; border-right: none; border-bottom: 1px solid var(--c-border); }
    .hero-cell-name .hero-name { font-size: clamp(2.8rem, 13vw, 4.5rem); }
    .hero-cell-side { padding: 20px 0; flex-direction: row; align-items: center; }
}
@media (max-width: 1023px), (orientation: portrait) {
    .topnav-brand, .topnav-brand.px { display: none; }
    .topnav-links a, .topnav-links a.px { padding: 0 9px; font-size: 10px; }
    .topnav-lang { padding: 0 12px; }
}


/* =====================================================================
   SISTEMA ÚNICO (2026-10-15): mismos colores, mismas celdas con líneas y el
   mismo hover sutil de píxeles en todo el sitio.
   ===================================================================== */
/* Hover de píxeles, sutil: titilan naranja y oliva, la celda queda apenas
   más clara y el texto pasa a naranja. */
.px-grid i { background: var(--c-accent); }
.px-grid i.a { background: color-mix(in srgb, var(--c-accent) 70%, var(--c-bg)); }
.px-grid i.g { background: var(--c-accent-2); }
.px.is-px .px-grid i { opacity: 1; background: var(--px-fill); }
.px.is-px,
.px.is-px .lang-btn,
.topnav-lang.is-px,
.intro-cv.px.is-px { color: var(--c-accent) !important; }
.px.about-wa.is-px { color: var(--c-accent) !important; }
.topnav-links a.is-active { background: color-mix(in srgb, var(--c-text) 3%, transparent); }

/* Perfil en dos celdas separadas por una línea, de arriba a la línea de base */
@media (min-width: 1024px) and (orientation: landscape) {
    #about .chapter-intro-body.about {
        top: 0;
        bottom: 40px;
        left: 0;
        right: 0;
        max-width: none;
        transform: none;
        display: grid;
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
        gap: 0;
        align-items: stretch;
    }
    #about .about-copy {
        justify-content: center;
        padding: 24px clamp(28px, 4vw, 64px) 24px calc(var(--rail-width) + clamp(16px, 3vw, 40px));
        border-right: 1px solid var(--c-border);
    }
    #about .about-stack {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 24px clamp(28px, 4vw, 64px);
    }
    /* Proyectos: línea de punta a punta debajo del título */
    .chapter-work { --work-top: clamp(104px, 18vh, 150px); }
    .work-list-wrap { top: var(--work-top); }
    .chapter-work::before {
        content: '';
        position: absolute;
        left: 0; right: 0;
        top: calc(var(--work-top) - 14px);
        height: 1px;
        background: var(--c-border);
    }
}
@media (min-width: 1024px) and (orientation: landscape) and (max-height: 780px) {
    .chapter-work { --work-top: 92px; }
}
/* Cierre: línea de punta a punta entre el texto y el nombre gigante */
.ink-word { position: relative; }
.ink-word::before {
    content: '';
    position: absolute;
    top: -22px;
    left: -100vw; right: -100vw;
    height: 1px;
    background: var(--c-border);
}
/* Tinta en la paleta: naranja con halo oliva */
.ink-fill { fill: var(--c-accent); }
.ink-halo { fill: color-mix(in srgb, var(--c-accent-2) 70%, var(--c-bg)); }
/* Celular: las celdas se apilan con líneas entre medio */
@media (max-width: 1023px), (orientation: portrait) {
    #about .about-copy { padding-bottom: 32px; border-bottom: 1px solid var(--c-border); }
    #about .about-stack { padding-top: 32px; }
}
@media (min-width: 1024px) and (orientation: landscape) {
    .chapter-closing .footer-content { flex: none; }
    .ink-word {
        margin-top: auto;
        width: max(420px, min(100%, calc((100vh - 470px) * 5.2)));
    }
}
@media (min-width: 1024px) and (orientation: landscape) and (max-height: 780px) {
    .work-title { top: 22px; }
    .chapter-work { --work-top: 96px; }
    .footer-title { font-size: clamp(2.2rem, 5vw, 3.6rem); }
    .chapter-closing { padding-top: 48px; }
}

/* ---- Rendimiento: fuera lo que se recalculaba en cada cuadro del scroll ---- */
body::after { display: none; }                       /* grano de película */
.topnav { backdrop-filter: none; background: var(--c-bg); }
.work-hover-shot img { animation-play-state: paused; }
.work-hover-item.is-open .work-hover-shot img { animation-play-state: running; }
@media (hover: none), (max-width: 1023px), (orientation: portrait) {
    .work-hover-shot img { animation-play-state: running; }
}

/* ---- Perfil: textos que suben uno por uno (tramo vertical del scroll) ---- */
.about-slides { position: relative; }
.slide { display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.slide-title {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.9rem, 3.2vw, 3.2rem);
    line-height: 1.04;
    letter-spacing: -0.025em;
    max-width: 16ch;
    text-wrap: balance;
}
.slide-text {
    margin: 0;
    max-width: 40ch;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    line-height: 1.55;
    color: var(--c-text-muted);
}
.slide .about-actions { margin-top: 10px; }
@media (min-width: 1024px) and (orientation: landscape) {
    #about .about-copy { position: relative; padding-top: 0; padding-bottom: 0; justify-content: stretch; }
    .about-slides {
        flex: 1;
        overflow: hidden;
        -webkit-mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
        mask-image: linear-gradient(to bottom, transparent, #000 14%, #000 86%, transparent);
    }
    .about-slides-track { height: 100%; display: flex; flex-direction: column; will-change: transform; }
    .slide { flex: 0 0 100%; opacity: 0.18; transition: opacity 0.5s ease; }
    .slide.is-active { opacity: 1; }
    .slides-bar {                         /* avance de los textos, línea fina a la izquierda */
        position: absolute;
        left: calc(var(--rail-width) - 1px);
        top: 22%;
        bottom: 22%;
        width: 1px;
        background: var(--c-border);
    }
    .slides-bar i {
        position: absolute;
        left: 0; top: 0;
        width: 1px;
        height: 100%;
        background: var(--c-accent);
        transform: scaleY(var(--sp, 0));
        transform-origin: top;
    }
}
@media (max-width: 1023px), (orientation: portrait) {
    .slide { padding: 28px 0; border-bottom: 1px solid var(--c-border); }
    .slide:last-child { border-bottom: none; }
    .slides-bar { display: none; }
}

/* ---- Herramientas: solo íconos, cada uno con su color; al pasar el mouse
   se ilumina la caja con el color de esa tecnología y aparece el nombre ---- */
.tile, #about.is-in .tile { gap: 0; }
.tile .tool-icon { background: var(--brand, currentColor); width: 30px; height: 30px; }
.tile .tool-icon-svg { color: var(--brand, currentColor); width: 30px; height: 30px; }
.tile::before, .tile::after { display: none; }
.tile-name {
    position: absolute;
    left: 0; right: 0; bottom: 8px;
    font-size: 9px;
    color: var(--c-text);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.tile:hover, .tile:focus-visible {
    background: color-mix(in srgb, var(--brand, var(--c-accent)) 12%, transparent);
    border-color: color-mix(in srgb, var(--brand, var(--c-accent)) 55%, transparent);
    box-shadow: 0 0 28px -8px color-mix(in srgb, var(--brand, var(--c-accent)) 55%, transparent), inset 0 0 18px -10px color-mix(in srgb, var(--brand, var(--c-accent)) 60%, transparent);
}
.tile:hover .tile-name, .tile:focus-visible .tile-name { opacity: 1; transform: none; }
@media (hover: none) {
    .tile-name { opacity: 0.7; transform: none; }
}
@media (min-width: 1024px) and (orientation: landscape) {
    .tools-wrap { max-width: min(100%, calc((100vh - 330px) * 5 / 3)); }
}
@media (min-width: 1024px) and (orientation: landscape) {
    #about .chapter-intro-body.about { grid-template-rows: minmax(0, 1fr); }
    #about .about-copy, #about .about-stack, .about-slides { min-height: 0; }
}

/* ---- Portada: nombre arriba a la izquierda; celda "Programación y Desarrollo
   Web" abajo a la derecha que se llena de tinta al pasar el mouse ---- */
.hx-stage, .hx-frame, .hx-corner { display: none; }
@media (min-width: 1024px) and (orientation: landscape) {
    .hero-cell-name { align-items: flex-start; padding-top: clamp(28px, 6vh, 56px); }
    .hx { overflow: hidden; isolation: isolate; padding: 0; cursor: crosshair; }
    .hx.is-ready .hx-role {                 /* el texto lo dibuja el SVG; este queda para lectores */
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
    .hx.is-ready .hx-stage { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
    .hx.is-ready .hx-frame { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; overflow: visible; }
    .hx.is-ready .hx-corner { display: block; }
    .hx-stage text { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.025em; }
    .hx-base .t1 { fill: var(--c-text); }
    .hx-base .t2 { fill: var(--c-text-muted); }
    .hx-ink-bg { fill: var(--c-accent); }
    .hx-ink-halo { fill: color-mix(in srgb, var(--c-accent-2) 75%, var(--c-bg)); }
    .hx-ink-text text {
        fill: var(--c-bg);
        transition: transform 1.1s cubic-bezier(0.2, 0.7, 0.2, 1), letter-spacing 1.1s cubic-bezier(0.2, 0.7, 0.2, 1);
        transition-delay: calc(var(--i) * 120ms);
    }
    /* dentro de la tinta las líneas se corren en escalera: el borde de la mancha corta el texto */
    .hx.on .hx-ink-text text {
        transform: translateX(calc(var(--i) * 22px + 8px));
        letter-spacing: 0.01em;
        transition-delay: calc(0.35s + var(--i) * 120ms);
    }
    .hx-stage circle { fill: #fff; }
    .hx-stage .grow { transition: r 2.4s cubic-bezier(0.35, 0.1, 0.25, 1); }
    .hx-stage .dry  { transition: r 1.2s cubic-bezier(0.4, 0, 0.3, 1); }

    .hx .hero-scroll {
        position: absolute;
        left: auto;
        right: clamp(20px, 2vw, 32px);
        bottom: clamp(20px, 3vh, 32px);
        z-index: 3;
        transform: none;
        transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
    }
    .hx.on .hero-scroll { transform: translateX(8px); }
    .hx.on .hero-scroll-arrow { color: var(--c-bg); transition: color 0.2s ease 0.25s; }

    /* bordes: una línea fina recorre el contorno y las esquinas giran */
    .hx-frame rect {
        fill: none;
        stroke: var(--c-text);
        stroke-opacity: 0.55;
        stroke-width: 1;
        stroke-dasharray: 1;
        stroke-dashoffset: 1;
        transition: stroke-dashoffset 1.1s cubic-bezier(0.6, 0, 0.2, 1);
    }
    .hx.on .hx-frame rect { stroke-dashoffset: 0; }
    .hx-corner {
        position: absolute;
        z-index: 3;
        width: 13px; height: 13px;
        margin: -6px 0 0 -6px;
        pointer-events: none;
        color: var(--c-text-muted);
        transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.3s ease;
    }
    .hx-corner::before, .hx-corner::after { content: ''; position: absolute; background: currentColor; }
    .hx-corner::before { left: 6px; top: 0; width: 1px; height: 13px; }
    .hx-corner::after { top: 6px; left: 0; height: 1px; width: 13px; }
    .hx-corner.tl { left: 0; top: 0; }
    .hx-corner.tr { left: 100%; top: 0; margin-left: -7px; }
    .hx-corner.bl { left: 0; top: 100%; margin-top: -7px; }
    .hx-corner.br { left: 100%; top: 100%; margin: -7px 0 0 -7px; }
    .hx.on .hx-corner { transform: rotate(90deg); color: var(--c-bg); }
}
@media (prefers-reduced-motion: reduce) {
    .hx-stage .grow, .hx-stage .dry, .hx-frame rect, .hx-corner, .hx-ink-text text { transition: none; }
}

/* ---- Letra del nombre y de "Programación y Desarrollo Web": Rethink Sans ---- */
.hero-name { font-family: var(--font-name); font-weight: 600; letter-spacing: -0.03em; }
.hx-role, .hx-stage text { font-family: var(--font-name); }
@media (max-width: 1023px), (orientation: portrait) {
    .hx-role { font-weight: 600; font-size: 1.15rem; letter-spacing: -0.01em; color: var(--c-text); }
}

/* ---- Entrada: aparecen J, L y F, después el resto de cada palabra letra por
   letra, y el nombre viaja a su lugar en la portada (solo 1.ª vez por sesión) ---- */
html.intro-pending body > *:not(.intro) { visibility: hidden; }
body.intro-on .hero-name { visibility: hidden; }
.intro {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    background: var(--c-bg);
    transition: background-color .7s ease;
}
.intro.is-moving { background-color: transparent; pointer-events: none; }
.intro-name { margin: 0; color: var(--c-text); white-space: nowrap; transition: transform .9s cubic-bezier(.7, 0, .2, 1); }
.intro-name .ln { display: block; }
.intro-name .ln + .ln { color: var(--c-accent); }
.intro-name .c {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(0.18em);
    transition: opacity .7s ease, filter .7s ease, transform .9s cubic-bezier(.2, .7, .2, 1);
    transition-delay: var(--t);
}
.intro.s1 .intro-name .c.ini, .intro.s2 .intro-name .c { opacity: 1; filter: none; transform: none; }
.intro-skip {
    position: absolute;
    right: 24px;
    bottom: 20px;
    background: none;
    border: 1px solid var(--c-border);
    color: var(--c-text-muted);
    font: 500 11px/1 var(--font-code);
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 10px 14px;
    cursor: pointer;
}
.intro.is-moving .intro-skip { opacity: 0; }

/* ---- Barra (2026-10-17): sin píxeles, misma letra que la portada y más
   gruesa; al pasar el mouse el texto se aclara y crece la línea naranja ---- */
.topnav { font-family: var(--font-name); font-weight: 600; font-size: 12.5px; letter-spacing: 0.08em; }
.topnav-lang .lang-btn { font-family: var(--font-name); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; }
.topnav-links a { transition: color 0.3s ease, background-color 0.3s ease; }
.topnav-links a:hover::after { transform: scaleX(1); }
.topnav-links a:hover { background: color-mix(in srgb, var(--c-text) 3%, transparent); }
.topnav-lang .lang-btn:hover { color: var(--c-text); }
@media (max-width: 1023px), (orientation: portrait) {
    .topnav-links a { font-size: 11px; }
}

/* ---- Perfil (2026-10-17): mismo lenguaje que la portada. Títulos en la
   letra del nombre, con las palabras clave en naranja (como "Luchelli
   Fassa"); entran letra por letra de desenfocadas a nítidas, igual que la
   entrada del nombre. Etiqueta con la letra de la barra y la cruz de las
   esquinas de la celda de la portada, que gira al aparecer. ---- */
.slide { gap: 20px; }
.slide-kicker {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.slide-kicker::before {                   /* cruz como las esquinas de la portada */
    content: '';
    width: 13px;
    height: 13px;
    flex: none;
    background:
        linear-gradient(var(--c-accent), var(--c-accent)) 6px 0 / 1px 13px no-repeat,
        linear-gradient(var(--c-accent), var(--c-accent)) 0 6px / 13px 1px no-repeat;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.slide-title {
    font-family: var(--font-name);
    font-size: clamp(2.1rem, 3.9vw, 3.9rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    max-width: 15ch;
}
.slide-title em { font-style: normal; color: var(--c-accent); }
.slide-title .w { display: inline-block; white-space: nowrap; }
.slide-title .c {
    display: inline-block;
    opacity: 0;
    filter: blur(10px);
    transform: translateY(0.18em);
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}
.slide-text { max-width: 44ch; font-size: clamp(1.02rem, 1.2vw, 1.22rem); }
.slide-kicker, .slide-text, .slide .about-actions {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
    transition: opacity 0.4s ease, transform 0.4s ease, filter 0.4s ease;
}
.slide.is-on .slide-kicker::before { transform: rotate(90deg); }
.slide.is-on .slide-title .c {
    opacity: 1;
    filter: none;
    transform: none;
    transition: opacity 0.7s ease, filter 0.7s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
    transition-delay: calc(0.12s + var(--t) * 0.022s);
}
.slide.is-on .slide-kicker,
.slide.is-on .slide-text,
.slide.is-on .about-actions {
    opacity: 1;
    transform: none;
    filter: none;
    transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s ease;
}
.slide.is-on .slide-kicker { transition-delay: 0s; }
.slide.is-on .slide-text { transition-delay: 0.65s; }
.slide.is-on .about-actions { transition-delay: 0.85s; }
@media (min-width: 1024px) and (orientation: landscape) {
    .slide, .slide.is-active { opacity: 1; }   /* ya no se atenúan: la entrada los muestra y los esconde */
}
@media (prefers-reduced-motion: reduce) {
    .slide-title .c, .slide-kicker, .slide-text, .slide .about-actions { opacity: 1; transform: none; filter: none; transition: none; }
}
/* "Herramientas que utilizo" con el mismo estilo que las etiquetas del Perfil */
.about-stack-title {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.about-stack-title::before {
    content: '';
    width: 13px;
    height: 13px;
    flex: none;
    background:
        linear-gradient(var(--c-accent), var(--c-accent)) 6px 0 / 1px 13px no-repeat,
        linear-gradient(var(--c-accent), var(--c-accent)) 0 6px / 13px 1px no-repeat;
}

/* Brief: botón en "Cómo trabajo" (mismo estilo que Ver CV) */
.brief-btn { display: inline-flex; align-items: center; gap: 10px; }
.brief-btn > svg:not(.btn-ink) { width: 14px; height: 14px; }

/* ---- Herramientas (2026-10-17): grilla pareja de 5 x 3 casilleros separados
   por líneas finas (como la barra y la portada); el título ocupa el casillero
   doble del final. Al pasar el mouse, tinta del color de cada tecnología que
   contagia a las vecinas (JS: .tools-ink). ---- */
.tools-wrap { position: relative; }
.tools-grid,
#about .tools-grid {
    gap: 0;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-top: 1px solid var(--c-border);
    border-left: 1px solid var(--c-border);
}
.tools-grid > li {
    border: 0;
    border-right: 1px solid var(--c-border);
    border-bottom: 1px solid var(--c-border);
}
.tile, .tile:hover, .tile:focus-visible { background: transparent; box-shadow: none; }
.tile:hover, .tile:focus-visible { border-color: var(--c-border); }
.tile-name { display: none; }
.tile .tool-icon, .tile .tool-icon-svg {
    position: relative;
    z-index: 2;
    transition: background-color 0.35s ease, color 0.35s ease, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile.is-inked .tool-icon { background: var(--c-bg); transition-delay: 0.2s; }
.tile.is-inked .tool-icon-svg { color: var(--c-bg); transition-delay: 0.2s; }
.tile.is-inked .tool-icon, .tile.is-inked .tool-icon-svg { transform: scale(1.12); }
.tile.is-touched .tool-icon { background: var(--c-text); }
.tile.is-touched .tool-icon-svg { color: var(--c-text); }
.tools-ink {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}
.tools-ink .grow { transition: r 0.95s cubic-bezier(0.3, 0.1, 0.25, 1); }
.tools-ink .ti-smoke .grow { transition: r 1.6s cubic-bezier(0.3, 0.1, 0.25, 1); }
.tools-ink .dry { transition: r 1.1s cubic-bezier(0.4, 0, 0.3, 1); }
.tools-grid .tile { z-index: 2; }
.tools-label {
    grid-column: span 2;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 16px 18px;
}
.tools-label .about-stack-title { margin: 0; }
.tools-now {
    font-family: var(--font-name);
    font-weight: 600;
    font-size: clamp(1.2rem, 1.8vw, 1.7rem);
    letter-spacing: -0.02em;
    line-height: 1;
    opacity: 0;
    transform: translateY(6px);
    filter: blur(6px);
    transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
}
.tools-grid.has-ink .tools-now { opacity: 1; transform: none; filter: none; }
@media (max-width: 1023px), (orientation: portrait) {
    .tools-label { padding: 12px 14px; }
    .tools-now { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .tools-ink .grow, .tools-ink .dry { transition: none; }
}
.tools-label .about-stack-title { font-size: 10.5px; letter-spacing: 0.05em; gap: 9px; }
.tools-label { overflow: hidden; }

/* ---- Ventana del CV (2026-10-17): mismo lenguaje que la portada. Barra con
   la letra de las etiquetas y botones rectangulares; al abrir, una onda de
   tinta cruza la ventana (JS: .cv-ink), el contorno se traza y las cruces
   de las esquinas giran; los bloques entran de desenfocados a nítidos. ---- */
.cv-dialog { position: relative; border: 0; border-radius: 0; overflow: visible; }
.cv-dialog[open] { animation: cv-pop 0.45s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes cv-pop { from { opacity: 0; transform: scale(0.985); } }
.cv-dialog-body { position: relative; }
.cv-dialog-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.cv-dialog-title::before {
    content: '';
    width: 13px; height: 13px; flex: none;
    background:
        linear-gradient(var(--c-accent), var(--c-accent)) 6px 0 / 1px 13px no-repeat,
        linear-gradient(var(--c-accent), var(--c-accent)) 0 6px / 13px 1px no-repeat;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.3s;
}
.cv-dialog.is-drawn .cv-dialog-title::before { transform: rotate(90deg); }
.cv-dialog-download {
    border-radius: 0;
    padding: 10px 16px;
    font-family: var(--font-name);
    font-size: 12px;
    letter-spacing: 0.08em;
}
.cv-dialog-close { border-radius: 0; }
.cv-dialog-close:hover { transform: none; }
.cv-dialog-close:hover svg { transform: rotate(90deg); transition: transform 0.4s ease; }
.cv-sheet h2 { font-family: var(--font-name); font-size: 12.5px; letter-spacing: 0.08em; }

/* contorno que se traza y cruces en las esquinas, como la celda de la portada */
.cv-frame {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; overflow: visible; z-index: 3;
}
.cv-frame rect {
    fill: none;
    stroke: var(--c-border);
    stroke-width: 1;
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
}
.cv-dialog.is-drawn .cv-frame rect { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s cubic-bezier(0.6, 0, 0.2, 1) 0.15s; }
.cv-corner {
    position: absolute; z-index: 4;
    width: 13px; height: 13px;
    pointer-events: none;
    color: var(--c-accent);
    transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.5s;
}
.cv-corner::before, .cv-corner::after { content: ''; position: absolute; background: currentColor; }
.cv-corner::before { left: 6px; top: 0; width: 1px; height: 13px; }
.cv-corner::after { top: 6px; left: 0; height: 1px; width: 13px; }
.cv-corner.tl { left: -7px; top: -7px; }
.cv-corner.tr { right: -7px; top: -7px; }
.cv-corner.bl { left: -7px; bottom: -7px; }
.cv-corner.br { right: -7px; bottom: -7px; }
.cv-dialog.is-drawn .cv-corner { transform: rotate(90deg); }

/* onda de tinta */
.cv-ink {
    position: absolute; inset: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 2;
}
/* el JS lee estos dos colores para pintar la tinta en el canvas */
.cv-ink { color: var(--c-accent); outline: 0 none color-mix(in srgb, var(--c-accent-2) 70%, var(--c-bg)); }

/* bloques del CV: de desenfocados a nítidos, uno tras otro, detrás de la onda */
.cv-sheet > * {
    animation: cv-item-blur 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
    animation-delay: calc(0.45s + var(--i, 0) * 55ms);
}
@keyframes cv-item-blur {
    from { opacity: 0; transform: translateY(12px); }
}
@media (prefers-reduced-motion: reduce) {
    .cv-ink { display: none; }
    .cv-frame rect { stroke-dashoffset: 0; }
    .cv-sheet > * { animation: none; }
}

/* ---- Perfil (2026-10-17, 2): sin etiquetas arriba de los títulos; títulos
   un poco más chicos y párrafos más largos, para que todo entre sin que la
   difuminación de arriba y abajo corte los botones. ---- */
.slide-title { font-size: clamp(2rem, 3.3vw, 3.3rem); max-width: 16ch; }
.slide-text { max-width: 48ch; }
@media (min-width: 1024px) and (orientation: landscape) {
    .about-slides {
        -webkit-mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
        mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
    }
}
/* WhatsApp: mismo idioma que los demás botones (letra de la barra, rectángulo),
   lleno de naranja; al pasar el mouse se aclara y la flecha avanza */
.about-wa {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 20px;
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 12.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--c-accent);
    transition: background-color 0.3s ease, color 0.3s ease;
}
.about-wa::after {
    content: '';
    width: 12px; height: 12px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='square'%3E%3Cpath d='M7 17L17 7M8 7h9v9'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.about-wa:hover, .about-wa:focus-visible { filter: none; background: transparent; color: var(--c-accent); }
.about-wa:hover::after, .about-wa:focus-visible::after { transform: translate(3px, -3px); }
.intro-cv, .intro-cv.px { font-family: var(--font-name); font-weight: 600; font-size: 12.5px; letter-spacing: 0.08em; }

/* ---- Tinta en los botones (2026-10-17): reemplaza a los cuadraditos.
   --ink = color de la mancha; el texto pasa a naranja mientras está entintado. ---- */
.px-grid { display: none; }
.ink-btn { position: relative; overflow: hidden; isolation: isolate; --ink: color-mix(in srgb, var(--c-accent) 14%, var(--c-bg)); }
.btn-ink { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; }
.btn-ink circle { fill: var(--ink); }
.btn-ink .grow { transition: r 0.6s cubic-bezier(0.3, 0.1, 0.25, 1); }
.btn-ink .dry { transition: r 0.45s cubic-bezier(0.4, 0, 0.3, 1); }
.ink-btn.is-inked { color: var(--c-accent) !important; transition: color 0.3s ease 0.08s, border-color 0.3s ease; }
.ink-btn.is-inked:not(.about-wa) { border-color: color-mix(in srgb, var(--c-accent) 55%, transparent) !important; }
.contact-btn.ink-btn:hover { background: transparent; }
/* WhatsApp va lleno de naranja: la tinta es del color del fondo */
.about-wa.ink-btn { --ink: var(--c-bg); }
.about-wa:hover, .about-wa:focus-visible { background: var(--c-accent); }
.cv-dialog-download.ink-btn { --ink: var(--c-bg); }
.cv-dialog-download:hover { filter: none; }
@media (prefers-reduced-motion: reduce) {
    .btn-ink .grow, .btn-ink .dry { transition: none; }
}
.ink-btn > svg.btn-ink { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; transform: none; }

/* ---- Brief en el sitio (2026-10-17): misma ventana que el CV, con el
   formulario en el lenguaje del sitio — renglones con línea abajo, opciones
   como casilleros rectangulares que se marcan en naranja. ---- */
.brief-pdf {
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--c-border);
}
.brief-pdf:hover { color: var(--c-accent); }
.brief-form { max-width: 760px; margin: 0 auto; }
.brief-form > * { animation: cv-item-blur 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.brief-form > :nth-child(3) { animation-delay: 0.45s; }
.brief-form > :nth-child(4) { animation-delay: 0.52s; }
.brief-form > :nth-child(n+5) { animation-delay: 0.6s; }
.brief-h {
    margin: 0;
    font-family: var(--font-name);
    font-weight: 600;
    font-size: clamp(1.9rem, 3.4vw, 3rem);
    line-height: 1.04;
    letter-spacing: -0.03em;
}
.brief-h em { display: block; font-style: normal; color: var(--c-accent); }
.brief-intro { margin: 18px 0 0; max-width: 58ch; color: var(--c-text-muted); line-height: 1.6; }
.bs { margin: 44px 0 0; padding: 0; border: 0; min-width: 0; }
.bs-title {
    width: 100%;
    padding: 0 0 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--c-border);
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    color: var(--c-text);
}
.bs-note { margin: 14px 0 0; font-size: 0.9rem; color: var(--c-text-muted); line-height: 1.55; }
.bq { display: flex; flex-direction: column; gap: 6px; margin-top: 22px; min-width: 0; }
.bq-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.bq-label { font-weight: 600; font-size: 0.95rem; color: var(--c-text); }
.bq-label i { font-style: normal; color: var(--c-accent); }
.bq-hint { font-size: 0.82rem; color: var(--c-text-muted); }
.brief-form input[type=text], .brief-form input[type=tel], .brief-form input[type=email], .brief-form textarea {
    width: 100%;
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--c-border);
    border-radius: 0;
    background: transparent;
    color: var(--c-text);
    font: inherit;
    font-size: 1rem;
    resize: vertical;
    transition: border-color 0.3s ease;
}
.brief-form textarea { padding: 10px 12px; border: 1px solid var(--c-border); line-height: 1.5; }
.brief-form input:focus, .brief-form textarea:focus { outline: none; border-color: var(--c-accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; align-items: center; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--c-border);
    font-size: 0.9rem;
    color: var(--c-text-muted);
    transition: color 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}
.chip span::before {                      /* casillero chico que se cruza al marcar, como las esquinas */
    content: '';
    width: 9px; height: 9px;
    border: 1px solid currentColor;
    transition: background-color 0.25s ease, transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.chip:hover span { color: var(--c-text); border-color: color-mix(in srgb, var(--c-text) 35%, transparent); }
.chip input:checked + span {
    color: var(--c-accent);
    border-color: color-mix(in srgb, var(--c-accent) 60%, transparent);
    background: color-mix(in srgb, var(--c-accent) 10%, transparent);
}
.chip input:checked + span::before { background: var(--c-accent); border-color: var(--c-accent); transform: rotate(45deg) scale(0.8); }
.chip input:focus-visible + span { outline: 1px solid var(--c-accent); outline-offset: 2px; }
.brief-form .chip-other-text { flex: 1 1 160px; width: auto; padding: 8px 0; }
.brief-send {
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--c-border);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}
.brief-error { margin: 0; color: var(--c-accent); font-size: 0.9rem; }
.brief-foot { margin: 0; font-size: 0.82rem; color: var(--c-text-muted); max-width: 52ch; }
@media (max-width: 640px) {
    .bq-pair { grid-template-columns: 1fr; }
}

/* Cierre: el nombre gigante pasa a ser JLF (2026-10-17); misma altura que tenía JLFASSA */
@media (min-width: 1024px) and (orientation: landscape) {
    .ink-word { width: max(190px, min(100%, calc((100vh - 470px) * 1.82))); }
}
@media (max-width: 1023px), (orientation: portrait) {
    .ink-word { width: min(100%, 340px); }
}
.contact-btn-label { font-family: var(--font-name); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; }

/* =====================================================================
   PERFIL — TÍTULOS CON SCROLL (2026-10-17). --d = distancia del texto al
   centro (-1..1), --ad = su valor absoluto (los pone script.js en compu).
   En celular valen 0: todo queda quieto y legible.
   ===================================================================== */
/* La palabra clave se pinta de naranja al acercarse al centro; queda llena
   del todo antes de que el sitio se acomode solo en el texto. */
.slide-layered .slide-title > em {
    color: transparent;
    -webkit-text-stroke: 1px var(--c-accent);
    background: linear-gradient(90deg, var(--c-accent) 50%, transparent 50%) calc(clamp(0, (var(--ad, 0) - 0.12) * 2.6, 1) * 100%) 0 / 200% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
}

@media (prefers-reduced-motion: reduce) {
    .slide-layered .slide-title > em { background-position: 0 0; }
}

/* =====================================================================
   PROYECTOS (2026-10-18) — dos celdas separadas por una línea, como la
   portada y el Perfil. Izquierda: título y lista; derecha: captura grande
   que cambia con tinta (.pj-ink), descripción y botón.
   ===================================================================== */
.chapter-work::before { display: none; }
.pj { position: absolute; inset: 0 0 40px 0; display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); }
.pj-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 24px clamp(28px, 4vw, 64px) 24px calc(var(--rail-width) + clamp(16px, 3vw, 40px));
    border-right: 1px solid var(--c-border);
}
.pj-title {
    margin: 0 0 clamp(20px, 4vh, 40px);
    font-family: var(--font-name);
    font-weight: 600;
    font-size: clamp(2.4rem, 4.2vw, 4.2rem);
    letter-spacing: -0.035em;
    line-height: 1;
    color: var(--c-text);
    text-transform: none;
}
.pj-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--c-border); }
.pj-item { border-bottom: 1px solid var(--c-border); }
.pj-row {
    width: 100%;
    display: grid;
    grid-template-columns: 13px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: clamp(14px, 2.6vh, 22px) 12px;
    background: none;
    border: 0;
    color: var(--c-text-muted);
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: color 0.35s ease;
}
.pj-cross {
    width: 13px; height: 13px;
    background:
        linear-gradient(currentColor, currentColor) 6px 0 / 1px 13px no-repeat,
        linear-gradient(currentColor, currentColor) 0 6px / 13px 1px no-repeat;
    color: color-mix(in srgb, var(--c-text) 35%, transparent);
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), color 0.35s ease;
}
.pj-name {
    font-family: var(--font-name);
    font-weight: 600;
    font-size: clamp(1.3rem, 2vw, 2rem);
    letter-spacing: -0.025em;
    line-height: 1.1;
}
.pj-year {
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.pj-item.is-active .pj-row { color: var(--c-text); }
.pj-item.is-active .pj-name { color: var(--c-accent); }
.pj-item.is-active .pj-cross { color: var(--c-accent); transform: rotate(90deg); }
.pj-row.ink-btn.is-inked { color: var(--c-text) !important; }
.pj-body { display: none; }

.pj-main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(16px, 3vh, 28px);
    padding: 24px clamp(28px, 4vw, 64px);
    min-height: 0;
}
.pj-stage {
    position: relative;
    display: block;
    width: 100%;
    max-height: 62vh;
    aspect-ratio: 16 / 10;
    background: #111214;
    cursor: pointer;
}
.pj-ink, .pj-frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.pj-ink { display: block; }
.pj-fringe { fill: var(--c-accent); }
.pj-ink .grow-a { transition: r 1.1s cubic-bezier(0.4, 0.05, 0.25, 1); }
.pj-ink .grow-b { transition: r 1.2s cubic-bezier(0.4, 0.05, 0.25, 1); }
.pj-frame { pointer-events: none; overflow: visible; z-index: 2; }
.pj-frame rect { fill: none; stroke: var(--c-border); stroke-width: 1; stroke-dasharray: 1; stroke-dashoffset: 1; }
.chapter-work.is-in .pj-frame rect { stroke-dashoffset: 0; transition: stroke-dashoffset 1.2s cubic-bezier(0.6, 0, 0.2, 1) 0.1s; }
.pj-stage .cv-corner { transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) 0.4s; }
.chapter-work.is-in .pj-stage .cv-corner { transform: rotate(90deg); }
.pj-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.pj-info-desc { margin: 0; max-width: 46ch; color: var(--c-text-muted); line-height: 1.6; font-size: clamp(0.98rem, 1.1vw, 1.1rem); }
.pj-go { flex: none; display: inline-flex; align-items: center; gap: 10px; }
.pj-go svg { width: 12px; height: 12px; }
.pj-info.is-swap > * { animation: cv-item-blur 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.pj-info.is-swap > :last-child { animation-delay: 0.08s; }

/* entrada de la sección */
.pj-title, .pj-item, .pj-info {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(6px);
    transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s ease;
}
.chapter-work.is-in .pj-title, .chapter-work.is-in .pj-item, .chapter-work.is-in .pj-info { opacity: 1; transform: none; filter: none; }
.chapter-work.is-in .pj-item { transition-delay: calc(0.2s + var(--i) * 0.1s); }
.chapter-work.is-in .pj-info { transition-delay: 0.6s; }

/* celular: tarjetas apiladas (captura, nombre, descripción y link) */
@media (max-width: 1023px), (orientation: portrait) {
    .pj { position: static; display: block; padding: 0; }
    .pj-side { padding: 0; border-right: 0; }
    .pj-main { display: none; }
    .pj-title, .pj-item, .pj-info { opacity: 1; transform: none; filter: none; }
    .pj-row { padding: 18px 0; cursor: default; }
    .pj-item .pj-name { color: var(--c-text); }
    .pj-item .pj-cross { color: var(--c-accent); }
    .pj-body { display: flex; flex-direction: column; gap: 14px; padding: 0 0 24px; }
    .pj-thumb { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; border: 1px solid var(--c-border); }
    .pj-desc { margin: 0; color: var(--c-text-muted); line-height: 1.6; }
    .pj-link {
        align-self: flex-start;
        padding: 11px 16px;
        border: 1px solid var(--c-border);
        font-family: var(--font-name);
        font-weight: 600;
        font-size: 12.5px;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: var(--c-text);
        text-decoration: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .pj-title, .pj-item, .pj-info { opacity: 1; transform: none; filter: none; transition: none; }
    .pj-frame rect { stroke-dashoffset: 0; }
}

/* ---- Proyectos (2026-10-18, 2): vista previa que baja sola (página completa),
   botones para desplazarla y nombre activo que se pinta de naranja ---- */
.pj-screen { position: absolute; inset: 0; overflow: hidden; }
.pj-shot {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    opacity: 0;
    transition: opacity 0.35s ease;
}
.pj-shot.is-active { opacity: 1; }
.pj-main { gap: 0; }
.pj-scroll {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0 0;
}
.pj-scroll-label {
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 11.5px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
.pj-scroll-track { flex: 1; height: 1px; background: var(--c-border); position: relative; overflow: hidden; }
.pj-scroll-track i { position: absolute; inset: 0; background: var(--c-accent); transform-origin: left; transform: scaleX(0); }
.pj-scroll-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--c-border);
    background: none;
    color: var(--c-text);
    cursor: pointer;
    transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
}
.pj-scroll-btn svg { width: 14px; height: 14px; }
.pj-scroll-btn:hover, .pj-scroll-btn:focus-visible { color: var(--c-accent); border-color: color-mix(in srgb, var(--c-accent) 55%, transparent); background: color-mix(in srgb, var(--c-accent) 8%, transparent); outline: none; }
.pj-info { padding-top: clamp(14px, 2.4vh, 22px); }

/* nombre: se pinta de naranja de izquierda a derecha al quedar activo */
.pj-name {
    background: linear-gradient(90deg, var(--c-accent) 50%, currentColor 50%) 100% 0 / 200% 100% no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: background-position 0.6s cubic-bezier(0.6, 0, 0.2, 1);
}
.pj-item.is-active .pj-name { color: var(--c-text); background-position: 0 0; }
.pj-row:hover .pj-cross { color: var(--c-text); }
@media (max-width: 1023px), (orientation: portrait) {
    .pj-name { background: none; -webkit-text-fill-color: currentColor; }
    .pj-scroll { display: none; }
}

/* =====================================================================
   CIERRE (2026-10-18): igual que la portada — dos celdas separadas por una
   línea. Izquierda: pregunta, texto y WhatsApp (© abajo); derecha: JLF con
   la misma letra y la misma tinta al pasar el mouse que la celda del rol.
   ===================================================================== */
.ink-word, .foot-bar { display: none; }
.foot-copy {
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-text-muted);
}
@media (min-width: 1024px) and (orientation: landscape) {
    .chapter-closing { padding: 0; display: block; text-align: left; }
    .foot-grid {
        position: absolute;
        inset: 0 0 40px 0;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(240px, 28%);
    }
    .foot-cell-main {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: clamp(28px, 6vh, 56px) clamp(24px, 3vw, 48px) clamp(24px, 5vh, 48px) calc(var(--rail-width) + clamp(16px, 3vw, 40px));
        border-right: 1px solid var(--c-border);
    }
    .chapter-closing .footer-content { flex: none; margin: 0; }
    .footer-title { font-family: var(--font-name); font-size: clamp(2.8rem, 6vw, 6rem); margin-bottom: 1rem; }
    .foot-copy { position: absolute; left: calc(var(--rail-width) + clamp(16px, 3vw, 40px)); bottom: clamp(20px, 3vh, 32px); }
    .foot-cell-mark { position: relative; }
}
@media (max-width: 1023px), (orientation: portrait) {
    .foot-grid { width: 100%; }
    .foot-cell-main { display: flex; flex-direction: column; align-items: center; gap: 40px; }
    .foot-cell-mark { margin-top: 40px; padding: 24px 0 0; border-top: 1px solid var(--c-border); text-align: right; }
    .foot-cell-mark .hx-role { margin: 0; font-family: var(--font-name); font-weight: 600; font-size: 3.4rem; letter-spacing: -0.03em; line-height: 1; color: var(--c-text); }
}

/* =====================================================================
   CELULAR (2026-10-18): la mayoría entra desde Instagram. Portada a pantalla
   completa con la misma lógica de celdas de la compu, cierre alineado a la
   izquierda con JLF en su celda, y entradas suaves al bajar (palabra clave
   que se pinta de naranja, bloques de borroso a nítido).
   ===================================================================== */
@media (max-width: 1023px), (orientation: portrait) {
    /* Portada: nombre grande arriba, celda del rol abajo con borde */
    .hero-section {
        min-height: 100svh;
        padding: 72px 20px 24px;
        display: flex;
        flex-direction: column;
        justify-content: stretch;
    }
    .hero-grid { flex: 1; display: flex; flex-direction: column; border: 0; }
    .hero-cell-name { flex: 1; align-items: flex-start; padding: 24px 0 32px; border-bottom: 0; }
    .hero-cell-name .hero-name { font-size: clamp(3.4rem, 17vw, 5.4rem); line-height: 0.98; }
    .hero-cell-side {
        position: relative;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        padding: 18px 18px 18px 18px;
        min-height: 150px;
        border: 1px solid var(--c-border);
    }
    .hero-cell-side .hx-role { font-size: clamp(1.6rem, 8vw, 2.2rem); line-height: 1.02; letter-spacing: -0.025em; max-width: 9ch; }
    .hero-cell-side .hx-corner { display: block; color: var(--c-accent); }

    /* Cierre: alineado a la izquierda como el resto; JLF grande en su celda */
    .chapter-closing { text-align: left; align-items: stretch; padding-left: 20px; padding-right: 20px; }
    .foot-cell-main { align-items: flex-start; gap: 28px; }
    .chapter-closing .footer-content { text-align: left; }
    .footer-title { font-family: var(--font-name); font-weight: 600; letter-spacing: -0.03em; font-size: clamp(2.6rem, 12vw, 3.6rem); }
    .foot-cell-mark {
        position: relative;
        margin-top: 44px;
        padding: 18px;
        min-height: 150px;
        display: flex;
        align-items: flex-end;
        border: 1px solid var(--c-border);
        text-align: left;
    }
    .foot-cell-mark .hx-role { font-size: clamp(4rem, 22vw, 6rem); }
    .foot-cell-mark .hx-corner { display: block; color: var(--c-accent); }
    .foot-copy { order: 3; }

    /* Entradas al bajar */
    .slide-layered .slide-title > em { background-position: 100% 0; transition: background-position 0.9s cubic-bezier(0.6, 0, 0.2, 1) 0.2s; }
    .slide-layered.is-on .slide-title > em { background-position: 0 0; }
    .m-reveal { opacity: 0; transform: translateY(18px); filter: blur(6px); transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s ease; }
    .m-reveal.is-seen { opacity: 1; transform: none; filter: none; }
}
@media (max-width: 1023px) and (prefers-reduced-motion: reduce), (orientation: portrait) and (prefers-reduced-motion: reduce) {
    .m-reveal { opacity: 1; transform: none; filter: none; transition: none; }
    .slide-layered .slide-title > em { background-position: 0 0; transition: none; }
}

/* Proyectos con 8 entradas: renglones y título más compactos para que entren en pantallas bajas */
@media (min-width: 1024px) and (orientation: landscape) {
    .pj-title { font-size: clamp(2rem, 3.4vw, 3.4rem); margin-bottom: clamp(14px, 2.6vh, 28px); }
    .pj-row { padding-block: clamp(8px, 1.45vh, 16px); }
    .pj-name { font-size: clamp(1.1rem, 1.6vw, 1.65rem); }
    .pj-side { padding-block: 16px; }
}

/* ---- Ventana de proyectos propios (2026-10-18): misma ventana que el CV,
   con el sitio adentro y la aclaración "Plantilla de prototipo" ---- */
.demo-dialog { width: min(1280px, calc(100vw - 48px)); height: min(92vh, 1000px); }
.demo-head { display: flex; align-items: center; gap: 14px; min-width: 0; }
.demo-tag {
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--c-accent) 55%, transparent);
    font-family: var(--font-name);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--c-accent);
    white-space: nowrap;
}
.demo-body { position: relative; flex: 1; min-height: 0; background: var(--c-bg); }
.demo-frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; opacity: 0; transition: opacity 0.5s ease 0.15s; background: #fff; }
.demo-dialog.is-loaded .demo-frame { opacity: 1; }
.demo-loading { position: absolute; inset: 0; display: grid; place-items: center; }
.demo-loading span { width: 80px; height: 1px; background: var(--c-accent); transform-origin: left; animation: demoLine 1.2s ease-in-out infinite; }
@keyframes demoLine { 0% { transform: scaleX(0); } 50% { transform: scaleX(1); } 100% { transform: scaleX(0); transform-origin: right; } }
.demo-dialog.is-loaded .demo-loading { display: none; }
@media (max-width: 1023px), (orientation: portrait) {
    .demo-dialog { width: 100vw; height: 100svh; max-height: none; }
    .demo-out { display: none; }
    .demo-head .cv-dialog-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .demo-dialog .cv-dialog-bar { padding: 10px 12px 10px 16px; }
}

/* Celular (2026-10-18): sin el recuadro alrededor de "Programación y Desarrollo Web" ni de JLF */
@media (max-width: 1023px), (orientation: portrait) {
    .hero-cell-side, .foot-cell-mark { border: 0; padding-left: 0; padding-right: 0; min-height: 0; }
    .hero-cell-side .hx-corner, .foot-cell-mark .hx-corner { display: none; }
}

/* Celular: JLF grande, centrado y desenfocado al fondo del cierre; el © al final */
@media (max-width: 1023px), (orientation: portrait) {
    .chapter-closing { position: relative; overflow: hidden; }
    .foot-grid { position: static; }
    .foot-cell-main { position: relative; z-index: 1; min-height: 72svh; justify-content: center; }
    .foot-copy { margin-top: auto; padding-top: 48px; }
    .foot-cell-mark {
        position: absolute; inset: 0; z-index: 0;
        display: grid; place-items: center;
        margin: 0; padding: 0;
        pointer-events: none;
    }
    .foot-cell-mark .hx-role {
        font-size: clamp(9rem, 52vw, 16rem);
        letter-spacing: -0.04em;
        color: var(--c-text);
        opacity: 0.07;
        filter: blur(3px);
        transform: translateY(-4%);
    }
}

/* Celular (2026-10-18, 2): cierre centrado, sin JLF; el © centrado abajo como pie */
@media (max-width: 1023px), (orientation: portrait) {
    .foot-cell-mark { display: none; }
    .foot-cell-main { align-items: center; text-align: center; min-height: 64svh; }
    .chapter-closing .footer-content { display: flex; flex-direction: column; align-items: center; text-align: center; }
    .foot-copy {
        align-self: stretch;
        margin-top: auto;
        padding-top: 22px;
        border-top: 1px solid var(--c-border);
        text-align: center;
    }
}

/* ---- "Completar el brief" como botón principal (2026-10-18): lleno de mostaza
   como WhatsApp; al pasar el mouse lo cubre tinta oscura ---- */
.intro-cv.brief-btn, .intro-cv.brief-btn.px {
    padding: 14px 22px;
    border: 1px solid var(--c-accent);
    background: var(--c-accent);
    color: var(--c-bg);
    font-family: var(--font-name);
    font-weight: 700;
    font-size: 12.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
}
.brief-btn.ink-btn { --ink: var(--c-bg); }
.brief-btn.ink-btn.is-inked { color: var(--c-accent) !important; border-color: var(--c-accent) !important; }
.brief-btn::after { display: none; }
.brief-btn > svg:not(.btn-ink) { width: 15px; height: 15px; color: currentColor; transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1); }
.brief-btn:hover > svg:not(.btn-ink), .brief-btn:focus-visible > svg:not(.btn-ink) { transform: translateX(4px); }

/* ---- Celular (2026-10-18): todo el sitio centrado ---- */
@media (max-width: 1023px), (orientation: portrait) {
    /* Portada */
    .hero-cell-name { justify-content: center; text-align: center; }
    .hero-cell-name .hero-name { width: 100%; text-align: center; }
    .hero-cell-side { flex-direction: column; align-items: center; justify-content: flex-end; gap: 18px; text-align: center; }
    .hero-cell-side .hx-role { max-width: none; }
    .hero-cell-side .hero-scroll { align-self: center; }

    /* Perfil */
    .slide { align-items: center; text-align: center; }
    .slide-title { margin-inline: auto; }
    .slide-text { margin-inline: auto; }
    .slide .about-actions { justify-content: center; }
    #about .about-copy, #about .about-stack { text-align: center; }
    .tools-wrap { margin-inline: auto; }

    /* Proyectos: nombre centrado con su etiqueta abajo; descripción y botón centrados */
    .pj-title { text-align: center; }
    .pj-row { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
    .pj-cross { display: none; }
    .pj-body { align-items: center; text-align: center; }
    .pj-link { align-self: center; }
}
@media (max-width: 1023px), (orientation: portrait) {
    .hero-grid { justify-content: center; gap: 44px; }
    .hero-cell-name { flex: none; padding: 0; }
    .hero-cell-side { padding: 0; }
}

/* ---- Celulares angostos (2026-10-18): en 320–400 px la barra empujaba el
   EN / ES fuera de la pantalla y el rótulo de herramientas quedaba cortado ---- */
@media (max-width: 400px) {
    .topnav-links a, .topnav-links a.px { padding: 0 6px; font-size: 10px; letter-spacing: 0.03em; }
    .topnav-lang { padding: 0 8px; gap: 2px; }
    .topnav-lang .lang-btn { font-size: 10.5px; letter-spacing: 0.03em; }
    .tools-label { padding: 10px; }
    .tools-label .about-stack-title { font-size: 9px; letter-spacing: 0.02em; gap: 6px; }
}

/* Ventanas en el celular: los botones de la barra en un solo renglón; si no
   entra todo, el título es el que pasa a dos renglones */
@media (max-width: 480px) {
    .cv-dialog-bar { gap: 10px; padding-left: 16px; }
    .cv-dialog-title { font-size: 10.5px; letter-spacing: 0.05em; gap: 8px; line-height: 1.3; }
    .cv-dialog-actions { flex: none; gap: 8px; }
    .cv-dialog-download, .brief-pdf { white-space: nowrap; padding: 9px 10px; font-size: 10.5px; letter-spacing: 0.04em; }
}

/* ---- Pantallas grandes (2026-10-18): de 2200 px de ancho en adelante los
   textos llegaban a su tope y el sitio se veía chico, con mucho vacío. --big
   agranda la letra base (todo lo que está en rem crece solo) y lo que está en
   px fijos. El JS de la celda del rol también lo lee. ---- */
@media (min-width: 2200px) and (orientation: landscape) { :root { --big: 1.3; } }
@media (min-width: 2800px) and (orientation: landscape) { :root { --big: 1.55; } }
@media (min-width: 3400px) and (orientation: landscape) { :root { --big: 2; } }
@media (min-width: 2200px) and (orientation: landscape) {
    html { font-size: calc(16px * var(--big)); }
    :root, :root[data-mode] { --nav-h: calc(52px * var(--big)); }
    :root .topnav { font-size: calc(12.5px * var(--big)); }
    :root .topnav-lang .lang-btn { font-size: calc(12px * var(--big)); }
    :root .topnav-links a, :root .topnav-links a.px { width: calc(160px * var(--big)); padding: 0 calc(16px * var(--big)); }
    :root .topnav-lang { padding: 0 calc(28px * var(--big)); }
    :root .hero-cell-name .hero-name { font-size: clamp(3rem, 8.4vw, 8rem); }
    :root .hero-role { font-size: calc(20px * var(--big)); }
    :root .slide-text { font-size: 1.22rem; }
    :root .about-wa { font-size: calc(12.5px * var(--big)); padding: calc(13px * var(--big)) calc(20px * var(--big)); }
    :root .intro-cv, :root .intro-cv.px { font-size: calc(12.5px * var(--big)); padding: calc(12px * var(--big)) calc(18px * var(--big)); }
    :root .intro-cv.brief-btn, :root .intro-cv.brief-btn.px { padding: calc(14px * var(--big)) calc(22px * var(--big)); }
    :root .intro-cv svg, :root .pj-go svg { width: calc(12px * var(--big)); height: calc(12px * var(--big)); }
    :root .tools-label { padding: calc(16px * var(--big)) calc(18px * var(--big)); }
    :root .tools-label .about-stack-title { font-size: calc(10.5px * var(--big)); }
    :root .tile .tool-icon, :root .tile .tool-icon-svg { width: calc(30px * var(--big)); height: calc(30px * var(--big)); }
    :root .pj-name { font-size: 2rem; }
    :root .pj-year, :root .foot-copy { font-size: calc(12px * var(--big)); }
    :root .pj-info-desc { font-size: 1.1rem; }
    :root .pj-link { font-size: calc(12.5px * var(--big)); }
    :root .contact-btn-label { font-size: calc(13px * var(--big)); }
    :root .footer-title { font-size: clamp(2.8rem, 6vw, 6rem); }
    :root .footer-text { font-size: 1.25rem; }
    :root .cv-dialog { width: min(calc(960px * var(--big)), calc(100vw - 48px)); height: min(88vh, calc(1000px * var(--big))); }
}
