/* ══════════════════════════════════════════════════════════════
   Prototipo del Modo Normal (/normal)
   Referencia elegida: tipografía gigante + foto en blanco y negro.
   Identidad compartida con /terminal: Martian Mono (ancho variable)
   + acento lima. Texto largo en Schibsted Grotesk. Sin azul.
   ══════════════════════════════════════════════════════════════ */

:root {
    --bg: #e6e5e1;
    --bg-2: #dcdbd6;
    --ink: #0e0e0d;
    --ink-2: #3b3a37;
    --dim: #76746e;
    --rule: #c9c7c0;
    --lime: #d4ff3a;
    --mono: "Martian Mono", ui-monospace, monospace;
    --sans: "Schibsted Grotesk", system-ui, sans-serif;
    --gut: clamp(16px, 3.2vw, 48px);
    --ease: cubic-bezier(.2, .9, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }

body.nx {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.nx.is-locked { overflow: hidden; }

a { color: inherit; }
::selection { background: var(--lime); color: var(--ink); }
img { max-width: 100%; }

/* ── Piezas comunes ────────────────────────────────────────── */
.nx-pill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 12px;
    font-variation-settings: "wdth" 100;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .4s var(--ease), background .3s, color .3s;
}
.nx-pill--ink { background: var(--ink); color: var(--bg); }
.nx-pill--lime { background: var(--lime); color: var(--ink); }
.nx-pill--line { border: 1px solid var(--ink); }
.nx-pill b { font-weight: 400; color: var(--dim); }
a.nx-pill:hover { transform: translateY(-2px); }
a.nx-pill--ink:hover { background: var(--lime); color: var(--ink); }
a.nx-pill--lime:hover { background: var(--ink); color: var(--lime); }

.nx-idx { font-family: var(--mono); font-size: 12px; color: var(--dim); font-variation-settings: "wdth" 100; }

.nx-dot {
    display: inline-block; width: 8px; height: 8px; margin-right: 10px;
    border-radius: 50%; background: var(--ink);
    box-shadow: 0 0 0 3px var(--lime);
}

/* ── Portada ───────────────────────────────────────────────── */
.nx-hero {
    position: relative;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    padding: 18px var(--gut) 22px;
    overflow: hidden;
}

.nx-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; position: relative; z-index: 3; }
.nx-top__id { font-family: var(--mono); font-size: 12px; font-variation-settings: "wdth" 100; }
.nx-top__id i { font-style: normal; color: var(--dim); }
.nx-top__actions { display: flex; gap: 8px; }

/* Nombre: ancho completo, Martian Mono expandida y ligera; lo ajusta normal.js */
.nx-name {
    position: relative;
    z-index: 1;
    margin: 3vh 0 0;
    font-family: var(--mono);
    font-weight: 300;
    font-variation-settings: "wdth" 112.5, "wght" 300;
    text-transform: uppercase;
    line-height: .88;
    letter-spacing: -.01em;
    font-size: 11vw;                       /* valor inicial; normal.js lo ajusta al ancho exacto */
    white-space: nowrap;
}
.nx-name__row { display: block; }
.nx-name .ch {
    display: inline-block;
    transform: translateY(105%);
    font-variation-settings: "wdth" 75, "wght" 100;
    opacity: 0;
}
.nx-name.is-in .ch {
    animation: nx-ch 1.3s var(--ease) forwards;
    animation-delay: calc(var(--i) * 55ms + 150ms);
}
.nx-name__row { overflow: hidden; padding-top: .16em; margin-top: -.12em; }   /* aire para la tilde de SÁENZ */
@keyframes nx-ch {
    0% { transform: translateY(105%); opacity: 0; font-variation-settings: "wdth" 75, "wght" 100; }
    35% { opacity: 1; }
    100% { transform: none; opacity: 1; font-variation-settings: "wdth" 112.5, "wght" 300; }
}

/* Foto: B/N, se funde con el fondo (multiply + máscara) */
.nx-photo {
    position: relative;
    z-index: 2;
    justify-self: center;
    align-self: end;
    width: min(34vw, 460px);
    margin: -7vw 0 0;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    clip-path: inset(100% 0 0 0);
    animation: nx-wipe 1.4s var(--ease) .7s forwards;
    will-change: transform;
    /* se disuelve hacia abajo, sin bordes duros ni óvalo */
    -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
            mask-image: linear-gradient(to bottom, #000 72%, transparent 100%);
}
.nx-photo img {
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: 48% 50%;
    transform: scale(1.32);
    transform-origin: 48% 62%;          /* acerca a Leonardo y deja fuera casi todo el fondo */
    filter: grayscale(1) contrast(1.15) brightness(1.05);
    mix-blend-mode: multiply;
}
@keyframes nx-wipe { to { clip-path: inset(0 0 0 0); } }

.nx-hero__foot {
    position: relative; z-index: 3;
    display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
    opacity: 0; animation: nx-fade .8s var(--ease) 1.5s forwards;
}
.nx-status { font-family: var(--mono); font-size: 12px; font-variation-settings: "wdth" 100; display: inline-flex; align-items: center; }
@keyframes nx-fade { to { opacity: 1; } }

/* ── Declaración ───────────────────────────────────────────── */
.nx-statement { padding: clamp(80px, 16vh, 180px) var(--gut) clamp(60px, 12vh, 140px); }
.nx-statement__text {
    margin: 0;
    max-width: 22ch;
    font-family: var(--sans);
    font-weight: 500;
    font-size: clamp(30px, 4.6vw, 72px);
    line-height: 1.06;
    letter-spacing: -.025em;
}
.nx-statement__text .w { color: var(--rule); transition: color .25s; }
.nx-statement__text .w.on { color: var(--ink); }
.nx-facts { display: flex; flex-wrap: wrap; gap: 12px 56px; margin: 56px 0 0; }
.nx-facts dt { font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-variation-settings: "wdth" 100; }
.nx-facts dd { margin: 4px 0 0; font-family: var(--mono); font-size: clamp(22px, 2.4vw, 32px); font-variation-settings: "wdth" 112.5, "wght" 300; }

/* ── Secciones ─────────────────────────────────────────────── */
.nx-sec { padding: clamp(60px, 10vh, 120px) var(--gut); border-top: 1px solid var(--rule); }
.nx-sec__head { display: flex; align-items: baseline; gap: 18px; margin-bottom: clamp(28px, 5vh, 56px); flex-wrap: wrap; }
.nx-h2 {
    margin: 0;
    font-family: var(--mono);
    font-weight: 300;
    font-variation-settings: "wdth" 112.5, "wght" 300;
    text-transform: uppercase;
    font-size: clamp(34px, 6.4vw, 104px);
    line-height: .9;
    letter-spacing: -.01em;
}
.nx-sec__note { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); font-variation-settings: "wdth" 100; }

.nx-reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.nx-reveal.is-in { opacity: 1; transform: none; }

/* Proyectos: índice en filas */
.nx-projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.nx-proj {
    position: relative;
    display: grid;
    grid-template-columns: 70px minmax(0, 1.3fr) minmax(0, 1fr) 40px;
    gap: 20px;
    align-items: baseline;
    padding: 22px 0;
    border-bottom: 1px solid var(--ink);
    cursor: pointer;
    isolation: isolate;
}
.nx-proj::before {
    content: ""; position: absolute; inset: 0 calc(var(--gut) * -1); z-index: -1;
    background: var(--lime);
    transform: scaleY(0); transform-origin: bottom;
    transition: transform .45s var(--ease);
}
.nx-proj:hover::before, .nx-proj:focus-visible::before { transform: scaleY(1); }
.nx-proj:focus-visible { outline: none; }
.nx-proj__year { font-family: var(--mono); font-size: 13px; font-variation-settings: "wdth" 100; }
.nx-proj__title {
    font-family: var(--mono);
    font-weight: 300;
    font-variation-settings: "wdth" 100, "wght" 300;
    font-size: clamp(22px, 2.9vw, 44px);
    line-height: 1.05;
    text-transform: uppercase;
    transition: font-variation-settings .5s var(--ease);
}
.nx-proj:hover .nx-proj__title { font-variation-settings: "wdth" 112.5, "wght" 500; }
.nx-proj__desc { font-size: 15px; color: var(--ink-2); line-height: 1.45; }
.nx-proj__go { font-family: var(--mono); font-size: 20px; justify-self: end; transition: transform .4s var(--ease); }
.nx-proj:hover .nx-proj__go { transform: translateX(6px) rotate(-45deg); }
.nx-proj__thumb { display: none; }

/* Vista previa flotante */
.nx-preview {
    position: fixed; left: 0; top: 0; z-index: 30;
    width: 340px; aspect-ratio: 16 / 10;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -50%) scale(.85);
    transition: opacity .3s, transform .35s var(--ease);
    overflow: hidden;
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .45);
}
.nx-preview.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.nx-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }

/* Trayectoria: tabla */
.nx-timeline { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.nx-tl {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 24px;
    padding: 26px 0;
    border-bottom: 1px solid var(--rule);
}
.nx-tl__year { font-family: var(--mono); font-size: 13px; font-variation-settings: "wdth" 100; }
.nx-tl__role { font-family: var(--sans); font-weight: 600; font-size: 21px; line-height: 1.2; }
.nx-tl__co { display: block; margin-top: 6px; font-family: var(--mono); font-size: 12px; color: var(--dim); font-weight: 400; font-variation-settings: "wdth" 100; }
.nx-tl__desc { color: var(--ink-2); font-size: 15.5px; }
.nx-tl__tech { display: block; margin-top: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-variation-settings: "wdth" 88; }
.nx-tl.is-now .nx-tl__year::after { content: " · cerrado"; color: var(--dim); }

/* Habilidades */
.nx-skills { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.nx-skills article { border-top: 1px solid var(--ink); padding-top: 18px; }
.nx-skills h3 { margin: 14px 0 8px; font-size: 22px; font-weight: 600; line-height: 1.2; }
.nx-skills p { margin: 0; color: var(--ink-2); font-size: 15.5px; }

/* Tecnologías */
.nx-stack { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; }
.nx-stack h3 { margin: 0 0 8px; font-family: var(--mono); font-weight: 500; font-size: 12px; font-variation-settings: "wdth" 100; color: var(--dim); }
.nx-stack p { margin: 0; font-size: 18px; line-height: 1.5; }

/* Hackathones */
.nx-hack { padding: 34px 0 44px; border-top: 1px solid var(--ink); }
.nx-hack + .nx-hack { margin-top: 12px; }
.nx-hack__meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.nx-hack__year { font-family: var(--mono); font-size: 13px; font-variation-settings: "wdth" 100; }
.nx-hack__title { margin: 18px 0 12px; font-size: clamp(24px, 3vw, 40px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.nx-hack__text { max-width: 70ch; margin: 0; color: var(--ink-2); }
.nx-hack__text b { color: var(--ink); font-weight: 600; }
.nx-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 26px; }
.nx-strip img {
    width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; cursor: zoom-in;
    filter: grayscale(1) contrast(1.05);
    transition: filter .5s, transform .6s var(--ease);
}
.nx-strip img:hover { filter: none; transform: translateY(-4px); }

/* ── Contacto ──────────────────────────────────────────────── */
.nx-foot { background: var(--ink); color: var(--bg); padding: clamp(70px, 14vh, 160px) var(--gut) 110px; }
.nx-foot .nx-idx { color: #8d8b84; }
.nx-foot__kicker { margin: 18px 0 0; font-size: clamp(18px, 1.8vw, 24px); color: #bdbbb4; }
.nx-foot__big {
    display: inline-block;
    margin-top: 10px;
    font-family: var(--mono);
    font-weight: 300;
    font-variation-settings: "wdth" 112.5, "wght" 300;
    text-transform: uppercase;
    font-size: clamp(48px, 12vw, 190px);
    line-height: .95;
    text-decoration: none;
    transition: color .3s, font-variation-settings .6s var(--ease);
}
.nx-foot__big:hover { color: var(--lime); font-variation-settings: "wdth" 112.5, "wght" 600; }
.nx-foot__row { display: flex; flex-wrap: wrap; gap: 12px 32px; margin-top: 48px; font-family: var(--mono); font-size: 13px; font-variation-settings: "wdth" 100; }
.nx-foot__row a { text-decoration: none; border-bottom: 1px solid #55534e; padding-bottom: 2px; }
.nx-foot__row a:hover { color: var(--lime); border-color: var(--lime); }

/* ── Dock inferior ─────────────────────────────────────────── */
.nx-dock {
    position: fixed; left: 50%; bottom: 18px; z-index: 20;
    display: flex; gap: 2px;
    padding: 5px;
    border-radius: 999px;
    background: var(--ink);
    box-shadow: 0 0 0 1px #3d3c38, 0 12px 30px -12px rgba(0, 0, 0, .5);
    transform: translate(-50%, 140%);
    transition: transform .6s var(--ease);
}
.nx-dock.is-on { transform: translate(-50%, 0); }
.nx-dock a {
    padding: 8px 14px;
    border-radius: 999px;
    font-family: var(--mono);
    font-size: 12px;
    font-variation-settings: "wdth" 100;
    color: #cfcdc6;
    text-decoration: none;
    white-space: nowrap;
    transition: background .3s, color .3s;
}
.nx-dock a:hover { color: var(--lime); }
.nx-dock a.is-active { background: var(--lime); color: var(--ink); }
.nx-dock__links { display: flex; gap: 2px; }
.nx-dock__toggle, .nx-dock__extra { display: none; }

/* Móvil: el dock es UNA píldora (sección actual) que despliega el menú hacia arriba */
@media (max-width: 700px) {
    .nx-dock { padding: 4px; }
    .nx-dock__toggle {
        display: inline-flex; align-items: center; gap: 12px;
        min-height: 44px; padding: 0 20px;
        border: 0; border-radius: 999px;
        background: var(--lime); color: var(--ink);
        font-family: var(--mono); font-size: 13px; font-variation-settings: "wdth" 100;
        cursor: pointer;
    }
    .nx-dock__chev { transition: transform .35s var(--ease); }
    .nx-dock.is-open .nx-dock__chev { transform: rotate(180deg); }
    .nx-dock__links {
        position: absolute; left: 50%; bottom: calc(100% + 10px);
        flex-direction: column; gap: 2px;
        min-width: 220px; padding: 6px;
        background: var(--ink); border-radius: 22px;
        box-shadow: 0 0 0 1px #3d3c38, 0 18px 40px -14px rgba(0, 0, 0, .55);
        opacity: 0; pointer-events: none;
        transform: translate(-50%, 10px) scale(.96); transform-origin: bottom center;
        transition: opacity .25s, transform .35s var(--ease);
    }
    .nx-dock.is-open .nx-dock__links { opacity: 1; pointer-events: auto; transform: translate(-50%, 0) scale(1); }
    .nx-dock__links a { display: block; padding: 13px 18px; font-size: 14px; text-align: left; }
    .nx-dock__extra { display: block; margin-top: 4px; border-top: 1px solid #2b2a27; border-radius: 0 0 16px 16px !important; color: #9a978f !important; }
}

/* ── Modal de proyecto ─────────────────────────────────────── */
.nx-modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
.nx-modal[hidden] { display: none; }
.nx-modal__scrim { position: absolute; inset: 0; background: rgba(14, 14, 13, .55); animation: nx-fade .3s forwards; opacity: 0; }
.nx-modal__panel {
    position: relative;
    width: min(920px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    background: var(--bg);
    padding: 28px clamp(20px, 4vw, 44px) 36px;
    animation: nx-rise .5s var(--ease);
}
@keyframes nx-rise { from { transform: translateY(30px); opacity: 0; } }
.nx-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; border-bottom: 1px solid var(--ink); padding-bottom: 18px; }
.nx-modal__head h3 {
    margin: 6px 0 0;
    font-family: var(--mono); font-weight: 300; text-transform: uppercase;
    font-variation-settings: "wdth" 112.5, "wght" 300;
    font-size: clamp(26px, 4vw, 48px); line-height: 1;
}
.nx-modal__close { font-family: var(--mono); font-size: 12px; background: none; border: 0; cursor: pointer; padding: 6px 0; color: var(--ink); white-space: nowrap; }
.nx-modal__close:hover { text-decoration: underline; }
.nx-modal__stack { margin: 16px 0 6px; font-family: var(--mono); font-size: 11.5px; color: var(--dim); font-variation-settings: "wdth" 88; line-height: 1.8; }
.nx-modal__body .modal-subtitle { margin: 28px 0 8px; font-family: var(--mono); font-size: 12px; font-weight: 500; font-variation-settings: "wdth" 100; color: var(--dim); text-transform: lowercase; }
.nx-modal__body .modal-text { margin: 0 0 12px; color: var(--ink-2); }
.nx-modal__body strong { color: var(--ink); font-weight: 600; }
.nx-modal__body ul { padding-left: 20px; color: var(--ink-2); }
.nx-modal__foot { margin-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }

/* Carrusel del modal (markup de site.js: createCarousel) */
.nx-modal .project-carousel { margin: 18px 0; }
.nx-modal .carousel-container { position: relative; background: var(--bg-2); }
.nx-modal .carousel-slide { display: none; }
.nx-modal .carousel-slide.active { display: block; animation: nx-fade .4s forwards; opacity: 0; }
.nx-modal .carousel-slide img { width: 100%; display: block; }
.nx-modal .carousel-btn {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border-radius: 50%; border: 0;
    background: var(--ink); color: var(--bg); font-size: 22px; line-height: 1; cursor: pointer;
}
.nx-modal .carousel-btn:hover { background: var(--lime); color: var(--ink); }
.nx-modal .carousel-btn.prev { left: 10px; }
.nx-modal .carousel-btn.next { right: 10px; }
.nx-modal .carousel-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.nx-modal .carousel-dot { width: 7px; height: 7px; border-radius: 50%; border: 0; padding: 0; background: var(--rule); cursor: pointer; }
.nx-modal .carousel-dot.active { background: var(--ink); width: 22px; border-radius: 4px; }

/* Lightbox (markup de site.js: openLightbox) */
.lightbox-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(14, 14, 13, .9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox-content { position: relative; }
.lightbox-content img { max-width: 92vw; max-height: 88vh; display: block; }
.lightbox-close { position: absolute; top: -40px; right: 0; background: none; border: 0; color: #fff; font-size: 30px; cursor: pointer; }

/* ── Páginas internas (aviso de privacidad, contacto, errores) ─ */
.nx-page-top {
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 18px var(--gut);
    border-bottom: 1px solid var(--rule);
}
.nx-page-top .nx-top__id { text-decoration: none; }
.nx-page-top .nx-top__id:hover { text-decoration: underline; text-underline-offset: 4px; }

.nx-legal {
    display: grid;
    grid-template-columns: minmax(0, 240px) minmax(0, 68ch);
    gap: 32px clamp(32px, 6vw, 96px);
    padding: clamp(40px, 8vh, 90px) var(--gut) clamp(60px, 10vh, 120px);
}
.nx-legal__head { grid-column: 1 / -1; }
.nx-legal__head .nx-h2 { margin: 14px 0 18px; }
.nx-legal__lede { max-width: 60ch; margin: 0; font-size: clamp(18px, 1.6vw, 22px); color: var(--ink-2); }
.nx-legal__toc {
    position: sticky; top: 24px; align-self: start;
    display: flex; flex-direction: column; gap: 8px;
    font-family: var(--mono); font-size: 12px; font-variation-settings: "wdth" 100;
}
.nx-legal__toc a { text-decoration: none; color: var(--dim); }
.nx-legal__toc a:hover { color: var(--ink); }
.nx-legal section { grid-column: 2; scroll-margin-top: 24px; }
.nx-legal section + section { margin-top: 18px; padding-top: 28px; border-top: 1px solid var(--rule); }
.nx-legal h2 { margin: 0 0 14px; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.nx-legal h2 .nx-idx { margin-right: 8px; font-size: 13px; }
.nx-legal p, .nx-legal li { color: var(--ink-2); }
.nx-legal p { margin: 0 0 12px; }
.nx-legal b { color: var(--ink); font-weight: 600; }
.nx-legal a { text-decoration-color: var(--rule); text-underline-offset: 3px; }
.nx-legal a:hover { text-decoration-color: var(--ink); }
.nx-legal ul { margin: 0 0 12px; padding-left: 20px; }
.nx-legal li { margin-bottom: 6px; }
.nx-legal__list { margin: 0 0 14px; }
.nx-legal__list div { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px dashed var(--rule); }
.nx-legal__list div:last-child { border-bottom: 0; }
.nx-legal__list dt { font-family: var(--mono); font-size: 12px; font-variation-settings: "wdth" 100; color: var(--ink); padding-top: 3px; }
.nx-legal__list dd { margin: 0; color: var(--ink-2); }

/* Contacto */
.nx-contact {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px clamp(40px, 7vw, 120px);
    padding: clamp(40px, 8vh, 90px) var(--gut) clamp(60px, 10vh, 110px);
    align-items: start;
}
.nx-contact__title {
    margin: 12px 0 18px;
    font-family: var(--mono); font-weight: 300;
    font-variation-settings: "wdth" 112.5, "wght" 300;
    text-transform: uppercase;
    font-size: clamp(52px, 8.4vw, 128px); line-height: .9; letter-spacing: -.01em;
}
.nx-contact__lede { margin: 0 0 18px; max-width: 34ch; font-size: clamp(19px, 1.7vw, 24px); color: var(--ink-2); }
.nx-contact .nx-status { margin: 0 0 34px; }
.nx-channels { margin: 0; border-top: 1px solid var(--ink); }
.nx-channels div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.nx-channels dt { font-family: var(--mono); font-size: 12px; font-variation-settings: "wdth" 100; color: var(--dim); padding-top: 2px; }
.nx-channels dd { margin: 0; overflow-wrap: anywhere; }
.nx-channels a { text-decoration: none; }
.nx-channels a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--ink); }
.nx-contact__alt { margin: 26px 0 0; color: var(--ink-2); }
.nx-contact__alt a { color: var(--ink); text-underline-offset: 4px; }

.nx-contact__panel { background: var(--bg-2); padding: clamp(24px, 3.4vw, 44px); }
.nx-form { display: flex; flex-direction: column; gap: 26px; }
.nx-field { position: relative; display: flex; flex-direction: column; gap: 8px; }
.nx-field label { font-family: var(--mono); font-size: 12px; font-variation-settings: "wdth" 100; }
.nx-field label em { font-style: normal; color: var(--dim); }
.nx-field label .nx-idx { margin-right: 6px; }
.nx-field input, .nx-field textarea {
    width: 100%;
    font: inherit; font-size: 18px; color: var(--ink);
    background: transparent;
    border: 0; border-bottom: 1px solid var(--ink-2);
    border-radius: 0;
    padding: 8px 0 10px;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}
.nx-field textarea { resize: vertical; min-height: 130px; line-height: 1.5; }
.nx-field input::placeholder, .nx-field textarea::placeholder { color: #9a978f; }
.nx-field input:focus, .nx-field textarea:focus { border-bottom-color: var(--ink); box-shadow: 0 2px 0 var(--lime); }
.nx-field .is-bad, .nx-field .input-validation-error { border-bottom-color: #b3261e; }
.nx-field__err { font-size: 13.5px; color: #b3261e; min-height: 0; }
.nx-field__err:empty { display: none; }
.nx-field__count { position: absolute; right: 0; top: 0; font-family: var(--mono); font-size: 11px; color: var(--dim); font-variation-settings: "wdth" 100; }
.nx-form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 4px; }
.nx-submit {
    display: inline-flex; align-items: center; gap: 14px;
    padding: 15px 26px;
    border: 0; border-radius: 999px;
    background: var(--ink); color: var(--bg);
    font-family: var(--mono); font-size: 14px; font-variation-settings: "wdth" 100;
    cursor: pointer;
    transition: background .3s, color .3s, transform .4s var(--ease);
}
.nx-submit:hover:not(:disabled) { background: var(--lime); color: var(--ink); transform: translateY(-2px); }
.nx-submit:disabled { opacity: .6; cursor: progress; }
.nx-form__legal { margin: 0; font-size: 13.5px; color: var(--dim); }
.nx-form__legal a { color: var(--ink-2); text-underline-offset: 3px; }
.nx-alert { margin: 0 0 24px; padding: 14px 16px; border-left: 3px solid #b3261e; background: rgba(179, 38, 30, .07); color: #6e1a15; }

.nx-sent { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 0; }
.nx-sent__mark { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--lime); font-size: 26px; animation: nx-rise .6s var(--ease); }
.nx-sent h2 {
    margin: 6px 0 0;
    font-family: var(--mono); font-weight: 300; text-transform: uppercase;
    font-variation-settings: "wdth" 112.5, "wght" 300;
    font-size: clamp(30px, 3.6vw, 48px); line-height: 1;
}
.nx-sent p { margin: 0 0 10px; color: var(--ink-2); max-width: 40ch; }

/* Páginas de estado (404 / 500) */
.nx--status { min-height: 100svh; display: flex; flex-direction: column; }
.nx-status-page { flex: 1; padding: clamp(40px, 8vh, 90px) var(--gut) 80px; }
.nx-status-page__code {
    margin: 4px 0 0;
    font-family: var(--mono); font-weight: 200;
    font-variation-settings: "wdth" 112.5, "wght" 200;
    font-size: clamp(120px, 26vw, 360px); line-height: .82; letter-spacing: -.03em;
}
.nx-status-page__title { margin: 22px 0 10px; font-size: clamp(26px, 3vw, 40px); font-weight: 600; letter-spacing: -.02em; }
.nx-status-page__text { margin: 0 0 30px; max-width: 52ch; color: var(--ink-2); font-size: 18px; }
.nx-status-page__links { display: flex; flex-direction: column; max-width: 560px; border-top: 1px solid var(--ink); }
.nx-status-page__links a {
    display: flex; align-items: baseline; gap: 14px;
    padding: 16px 0; border-bottom: 1px solid var(--rule);
    text-decoration: none; font-size: 20px;
    transition: padding .35s var(--ease), background .3s;
}
.nx-status-page__links a span:last-child { margin-left: auto; transition: transform .35s var(--ease); }
.nx-status-page__links a:hover { background: var(--lime); padding-left: 12px; padding-right: 12px; }
.nx-status-page__links a:hover span:last-child { transform: translateX(4px); }
.nx-status-page__id { margin-top: 28px; font-family: var(--mono); font-size: 12px; color: var(--dim); font-variation-settings: "wdth" 100; }

.nx-foot--slim { padding: 36px var(--gut); }
.nx-foot--slim .nx-foot__row { margin-top: 0; }

/* ── Objetivos táctiles (teléfonos y tabletas) ─────────────── */
@media (max-width: 900px), (pointer: coarse) {
    .nx-top__actions .nx-pill, .nx-page-top .nx-pill { min-height: 40px; padding: 0 16px; }
    .nx-page-top .nx-top__id { display: inline-block; padding: 10px 0; }
    .nx-foot__row { gap: 4px 28px; }
    .nx-foot__row a { display: inline-block; padding: 10px 0; }
    .nx-channels a { display: block; padding: 4px 0; }
    .nx-contact__alt a, .nx-form__legal a { display: inline-block; padding: 8px 0; }
    .nx-legal__toc a { display: block; padding: 10px 0; }
    .nx-legal section a { display: inline-block; padding: 4px 0; }   /* solo enlaces del texto; el índice tiene su propia regla */
    .nx-status-page__links a { min-height: 52px; }
    .nx-modal__close { min-height: 40px; padding: 0 4px; }
    .nx-sent .nx-pill { min-height: 40px; }
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 900px) {
    .nx-top__id i { display: none; }
    .nx-hero { min-height: auto; padding-bottom: 28px; }          /* sin hueco entre nombre y foto */
    .nx-photo { width: min(72vw, 380px); margin-top: 28px; align-self: start; }
    .nx-hero__foot { margin-top: 24px; }

    /* Modal de proyecto: hoja a pantalla completa con encabezado fijo (cerrar siempre visible) */
    .nx-modal { padding: 0; }
    .nx-modal__panel { width: 100%; max-height: 100dvh; height: 100dvh; padding-top: 0; }
    .nx-modal__head { position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: 18px; margin: 0 calc(clamp(20px, 4vw, 44px) * -1); padding-left: clamp(20px, 4vw, 44px); padding-right: clamp(20px, 4vw, 44px); }
    /* puntos del carrusel: área de toque de ~24px sin cambiar su tamaño visual */
    .nx-modal .carousel-dot { box-sizing: content-box; padding: 8px; background-clip: content-box; }
    .nx-modal .carousel-dots { gap: 0; }
    .nx-proj { grid-template-columns: 1fr auto; gap: 8px 12px; }
    .nx-proj__year { grid-column: 1; }
    .nx-proj__title { grid-column: 1 / -1; }
    .nx-proj__desc { grid-column: 1 / -1; }
    .nx-proj__go { grid-row: 1; grid-column: 2; }
    .nx-proj__thumb { display: block; grid-column: 1 / -1; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; object-position: top; margin-top: 6px; }
    .nx-tl { grid-template-columns: 1fr; gap: 8px; }
    .nx-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nx-stack { grid-template-columns: 1fr 1fr; }
    .nx-strip { grid-template-columns: repeat(5, 62%); overflow-x: auto; scroll-snap-type: x mandatory; }
    .nx-strip img { scroll-snap-align: start; }
    .nx-sec__note { display: none; }
    .nx-legal { grid-template-columns: 1fr; }
    .nx-legal__toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px 16px; }
    .nx-legal section { grid-column: 1; }
    .nx-legal__list div { grid-template-columns: 1fr; gap: 4px; }
    .nx-contact { grid-template-columns: minmax(0, 1fr); }
    .nx-contact__title { font-size: clamp(40px, 14vw, 96px); }
    .nx-hack__meta .nx-pill { white-space: normal; line-height: 1.45; }
    .nx-channels div { grid-template-columns: 90px minmax(0, 1fr); }
}
@media (max-width: 420px) {
    .nx-channels div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .nx-legal__toc { flex-direction: column; gap: 0; }
}
@media (max-width: 560px) {
    .nx-top__id { display: none; }
    .nx-top { justify-content: flex-end; }
    .nx-page-top .nx-top__id { display: inline; }      /* en páginas internas el nombre se queda */
    .nx-page-top .nx-top__id i { display: none; }
    .nx-top__actions .nx-pill { padding: 6px 12px; font-size: 11px; }
    .nx-hero__foot .nx-pill { display: inline-block; white-space: normal; line-height: 1.5; }
    .nx-skills, .nx-stack { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .nx-name .ch { transform: none; opacity: 1; font-variation-settings: "wdth" 112.5, "wght" 300; animation: none !important; }
    .nx-photo { clip-path: none; animation: none; }
    .nx-hero__foot, .nx-reveal { opacity: 1; transform: none; animation: none; transition: none; }
    .nx-statement__text .w { color: var(--ink); }
}
