/* =============================================
   VARS & RESET
   ============================================= */
:root {
    --bg:     #1e1e1e;
    --fg:     #f0ede8;
    --accent: #c8ff00;
    --muted:  rgba(240,237,232,0.38);
    --border: rgba(240,237,232,0.12);
    --font:   'Space Mono', monospace;
    --marquee-h: 34px;
    --nav-h:     52px;
    --chrome-h:  calc(var(--marquee-h) + var(--nav-h));
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); color: var(--fg); font-size: 15px; overflow: hidden; height: 100%; }
body { height: 100%; overflow: hidden; cursor: crosshair; font-family: var(--font); }

/* =============================================
   SKIP LINK
   ============================================= */
.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--accent); color: var(--bg);
    padding: 6px 12px; font-family: var(--font); font-size: 0.7rem;
    text-decoration: none; z-index: 9999;
}
.skip-link:focus { top: 0; }

/* .scramble-word â€” inline spans that get the reveal animation */
.scramble-word {
    display: inline;
    color: inherit;
}

/* =============================================
   CUSTOM CURSOR (Trailer)
   ============================================= */
#custom-cursor {
    position: fixed; top: 0; left: 0;
    pointer-events: none; z-index: 99999;
    font-size: 1.2rem; color: var(--accent);
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    transition: font-size 0.2s ease, opacity 0.2s ease;
    white-space: nowrap; font-weight: bold;
    will-change: left, top, transform;
}
#custom-cursor.is-hovering {
    font-size: 2rem;
    color: var(--fg);
}
#custom-cursor.is-hidden { opacity: 0; }
a, button, .js-modal-trigger, .cta-link { cursor: crosshair; }

/* Hide custom cursor on touch-only devices */
@media (hover: none) {
    #custom-cursor { display: none !important; }
    body, a, button, .js-modal-trigger, .cta-link { cursor: auto; }
}

/* =============================================
   TYPOGRAPHY â€” ALL SPACE MONO
   ============================================= */
* { font-family: var(--font); }
h1, h2, h3, h4 { font-weight: 400; line-height: 1.2; }
p { line-height: 1.8; }
em { font-style: italic; }

a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

.cta-link {
    font-size: 0.65rem; letter-spacing: 0.08em; text-transform: lowercase;
    display: inline-block; margin-top: 0.8rem; color: var(--fg);
    border-bottom: 1px solid var(--border); padding-bottom: 1px;
    transition: color 0.3s, border-color 0.3s;
}
.cta-link:hover { color: var(--accent); border-color: var(--accent); }

/* =============================================
   COLLAGE FLOATS
   Absolute-positioned images scattered per section
   --cx / --cy / --cr / --cw set per element via inline style
   ============================================= */
.collage-float {
    position: absolute;
    left: var(--cx, 60%);
    top:  var(--cy, 20%);
    width: var(--cw, 140px);
    height: auto;
    transform: rotate(var(--cr, 0deg));
    pointer-events: none;
    user-select: none;
    z-index: 1;
    opacity: 0.38;
    mix-blend-mode: luminosity;
    filter: grayscale(20%) contrast(0.85) brightness(0.9);
    transition: opacity 0.6s, transform 0.6s;
}
.section-panel:hover .collage-float { opacity: 0.52; }

/* inline variant used inside flex/grid containers */
.collage-float--inline {
    position: absolute;
}

/* Mundos floats sit above the track */
.collage-float--mundos { z-index: 3; }

/* AnimaciÃ³n de rotaciÃ³n lenta */
.collage-float--rotate {
    animation: rotateSlow 40s linear infinite;
}

@keyframes rotateSlow {
    from { transform: rotate(var(--cr, 0deg)); }
    to { transform: rotate(calc(var(--cr, 0deg) + 360deg)); }
}

/* =============================================
   DECORATIVE LAYERS
   ============================================= */
#noise-layer {
    position: fixed; inset: 0; pointer-events: none; z-index: 9000; opacity: 0.035;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="n"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23n)"/%3E%3C/svg%3E');
}
#interactive-canvas {
    position: fixed; inset: 0; width: 100vw; height: 100dvh;
    pointer-events: none; z-index: 0; opacity: 0.5;
}
#bg-video {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: cover;
    z-index: -10;
    pointer-events: none;
    user-select: none;
    mix-blend-mode: luminosity;
    filter: contrast(0.9) brightness(0.8);
}

/* =============================================
   MARQUEE BAR
   ============================================= */
.marquee-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--marquee-h); background: var(--accent); z-index: 600;
    overflow: hidden; display: flex; align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.15);
}
.marquee-track {
    display: flex; gap: 3rem; white-space: nowrap;
    animation: marquee-scroll 28s linear infinite;
    font-family: var(--font); font-size: 0.58rem;
    letter-spacing: 0.14em; text-transform: uppercase;
    color: var(--bg); padding-left: 100%;
}
.marquee-track span { flex-shrink: 0; margin-right: 3rem; }
@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* =============================================
   NAV
   ============================================= */
.site-nav {
    position: fixed; top: var(--marquee-h); left: 0; right: 0;
    height: var(--nav-h); z-index: 500;
    display: flex; align-items: center; padding: 0 2.5rem; gap: 2.5rem;
    background: rgba(30,30,30,0.92); backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}
.nav-logo a {
    font-size: 0.75rem; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--fg); opacity: 0.55; transition: opacity 0.2s;
}
.nav-logo a:hover { opacity: 1; }

.lang-toggle {
    display: flex; gap: 0.5rem; align-items: center;
    margin-right: 1.5rem;
}
.lang-btn {
    background: none; border: none; font-family: var(--font);
    font-size: 0.55rem; color: var(--fg); opacity: 0.35;
    cursor: pointer; letter-spacing: 0.15em; transition: opacity 0.2s, color 0.2s;
}
.lang-btn:hover { opacity: 0.8; }
.lang-btn.is-active { opacity: 1; color: var(--accent); }
.lang-sep { font-size: 0.55rem; color: var(--fg); opacity: 0.2; }
.site-nav ul { list-style: none; display: flex; gap: 2rem; flex: 1; }
.site-nav ul a {
    font-size: 0.6rem; letter-spacing: 0.18em; text-transform: lowercase;
    color: var(--fg); opacity: 0.35; transition: opacity 0.25s, color 0.25s;
    padding-bottom: 2px; border-bottom: 1px solid transparent;
}
.site-nav ul a:hover, .site-nav ul a.is-active {
    opacity: 1; color: var(--accent); border-bottom-color: var(--accent);
}
.nav-counter {
    opacity: 0.3; font-size: 0.6rem;
    display: flex; gap: 0.2em; letter-spacing: 0.1em;
}
.counter-sep { color: var(--muted); }

/* =============================================
   PROGRESS / ARROWS
   ============================================= */
.scroll-progress {
    position: fixed; top: var(--chrome-h); left: 0; right: 0;
    height: 1px; background: transparent; z-index: 499;
}
.scroll-progress-bar { height: 100%; width: 0%; background: var(--accent); transition: width 0.12s linear; }

@keyframes pulseGlowNav {
    0%   { box-shadow: 0 0 8px rgba(200, 255, 0, 0.3); }
    50%  { box-shadow: 0 0 20px rgba(200, 255, 0, 0.7); }
    100% { box-shadow: 0 0 8px rgba(200, 255, 0, 0.3); }
}

.nav-arrow {
    position: fixed; bottom: 1.8rem; z-index: 9999;
    background: var(--accent); border: none;
    color: var(--bg); cursor: pointer;
    padding: 0.45rem 0.9rem; font-family: var(--font); font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.95;
    border-radius: 0;
    animation: pulseGlowNav 2.5s infinite ease-in-out;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease, opacity 0.3s ease;
}
.nav-arrow:hover { 
    transform: scale(1.06) translateY(-1px); 
    filter: brightness(1.2);
    opacity: 1; 
}
.nav-arrow:focus-visible { outline: 1px dashed var(--accent); opacity: 1; }
.nav-arrow--prev { right: calc(2.5rem + 4rem); }
.nav-arrow--next { right: 2.5rem; }
.nav-arrow.is-hidden { opacity: 0 !important; pointer-events: none; animation: none; }

/* =============================================
   HORIZONTAL TRACK
   ============================================= */
#main-content {
    position: fixed; top: var(--chrome-h); left: 0; right: 0; bottom: 0;
    overflow: hidden; z-index: 2;
}
#h-track {
    display: flex; flex-direction: row; height: 100%;
    will-change: transform;
    transition: transform 0.72s cubic-bezier(0.77, 0, 0.175, 1);
}

/* =============================================
   SECTION PANELS
   ============================================= */
.section-panel {
    flex: 0 0 100vw; width: 100vw; height: 100%;
    overflow-y: auto; overflow-x: hidden; position: relative; z-index: 2;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.section-panel::-webkit-scrollbar { width: 2px; }
.section-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.section-inner {
    max-width: 1100px; margin: 0 auto; padding: 3rem 2.5rem;
    min-height: 100%; display: flex; flex-direction: column; justify-content: center;
}

.scroll-hint {
    position: absolute; bottom: 2rem; right: 2.5rem;
    font-size: 0.58rem; letter-spacing: 0.18em; text-transform: lowercase;
    color: var(--muted); animation: hint-blink 2.8s ease-in-out infinite;
}
@keyframes hint-blink { 0%,100%{opacity:.15} 50%{opacity:.6} }

/* =============================================
   UMBRAL
   ============================================= */
.section-umbral {
    display: flex; align-items: flex-end; padding: 0; overflow: hidden;
}
.umbral-inner { padding: 3rem 2.5rem; display: flex; flex-direction: column; gap: 1.2rem; z-index: 2; }
.umbral-tag   { font-size: 0.58rem; letter-spacing: 0.15em; text-transform: uppercase; opacity: 0.35; color: var(--accent); }

.statement {
    font-size: clamp(1.6rem, 4.5vw, 3.8rem);
    line-height: 1.25; font-weight: 400; max-width: 22ch;
    letter-spacing: -0.02em;
}
.statement em { font-style: italic; color: var(--accent); }

.umbral-aside { display: flex; gap: 1rem; margin-top: 0.5rem; }
.glitch-emoji {
    font-size: 1.5rem; display: inline-block;
    animation: emoji-float 4s ease-in-out infinite;
}
.glitch-emoji:nth-child(2) { animation-delay: 0.8s; }
.glitch-emoji:nth-child(3) { animation-delay: 1.6s; }
@keyframes emoji-float {
    0%,100%{ transform: translateY(0) rotate(0deg); }
    50%    { transform: translateY(-5px) rotate(4deg); }
}

/* =============================================
   MUNDOS
   ============================================= */
.section-mundos {
    display: flex; flex-direction: column; padding: 2rem 2.5rem; gap: 1.2rem; overflow: hidden;
}
.mundos-header {
    display: flex; justify-content: space-between; align-items: center;
    padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.mundos-header h2 { font-size: 0.85rem; letter-spacing: 0.1em; text-transform: lowercase; }
.mundos-count { font-size: 0.58rem; letter-spacing: 0.12em; opacity: 0.4; text-transform: uppercase; color: var(--accent); }

#mundos-canvas { display: none; }

.mundos-track {
    display: flex; flex-direction: row; gap: 1.2rem; flex: 1;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem; align-items: stretch;
    scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.mundos-track::-webkit-scrollbar { height: 2px; }
.mundos-track::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); }

.mundo-card {
    flex: 0 0 clamp(180px, 24vw, 310px);
    display: flex; flex-direction: column;
    scroll-snap-align: start; cursor: pointer; outline: none;
    border: 1px solid var(--border); transition: border-color 0.3s;
}
.mundo-card:hover { border-color: rgba(200,255,0,0.4); }
.mundo-card:focus-visible { outline: 1px dashed var(--accent); outline-offset: 3px; }

.mundo-img {
    flex: 1; min-height: 0; position: relative; overflow: hidden;
    filter: grayscale(85%) contrast(0.9); transition: filter 1.2s ease;
    perspective: 1000px;
    transform-style: preserve-3d;
}
.mundo-card:hover .mundo-img { filter: grayscale(0%) contrast(1); }

/* Sello Pasmoso 3D logo animation (Central Main + Ambient Particles) */
.sello-logo {
    position: absolute;
    width: 60%;
    height: auto;
    clip-path: inset(0 0 15px 0);
    opacity: 0;
    pointer-events: none;
    backface-visibility: hidden;
}

/* Central Main Logo: Floating, large, and always sharp/readable */
.logo-1 {
    width: 70%;
    animation: floatCentral 1.8s infinite ease-in-out;
    opacity: 0.95;
}

@keyframes floatCentral {
    0%, 19%, 23%, 68%, 71%, 100% {
        transform: translate3d(0, 0, 60px) scale(0.85);
        clip-path: inset(0 0 15px 0);
    }
    /* Glitch slice 1 */
    20% {
        transform: translate3d(-6px, -2px, 60px) scale(0.88) skewX(8deg);
        clip-path: inset(15% 0 35% 0);
    }
    21% {
        transform: translate3d(8px, 3px, 60px) scale(0.82) skewX(-12deg);
        clip-path: inset(40% 0 10% 0);
    }
    22% {
        transform: translate3d(-2px, -3px, 60px) scale(0.85);
        clip-path: inset(0 0 15px 0);
    }
    /* Glitch slice 2 */
    69% {
        transform: translate3d(5px, 6px, 60px) scale(0.89) skewY(4deg);
        clip-path: inset(55% 0 5% 0);
    }
    70% {
        transform: translate3d(-7px, -4px, 60px) scale(0.83) skewX(-6deg);
        clip-path: inset(2% 0 65% 0);
    }
}



/* Ambient Particles: Very small, flying outward to avoid overlapping the center */
@keyframes tunnelPasmoso {
    0% {
        transform: translate3d(var(--x-offset, 0), var(--y-offset, 0), -200px) scale(var(--scale-start, 0.05));
        opacity: 0;
        filter: blur(8px) grayscale(90%);
    }
    15% {
        opacity: 0.25;
        filter: blur(1px) grayscale(70%);
    }
    /* Glitch jump 1 */
    38% {
        transform: translate3d(calc(var(--x-offset) * 0.9), calc(var(--y-offset) * 0.9), -70px) scale(0.18);
        opacity: 0.3;
    }
    39% {
        transform: translate3d(calc(var(--x-offset) * 1.3), calc(var(--y-offset) * 0.8), -60px) scale(0.15) skewX(20deg);
        opacity: 0.05;
        filter: blur(4px) invert(1);
    }
    40% {
        transform: translate3d(calc(var(--x-offset) * 1.0), calc(var(--y-offset) * 1.0), -50px) scale(0.20);
        opacity: 0.35;
    }
    /* Glitch jump 2 */
    63% {
        transform: translate3d(calc(var(--x-offset) * 1.4), calc(var(--y-offset) * 1.4), 30px) scale(0.26);
        opacity: 0.4;
    }
    64% {
        transform: translate3d(calc(var(--x-offset) * 1.1), calc(var(--y-offset) * 1.6), 40px) scale(0.23) skewY(-15deg);
        opacity: 0.08;
        filter: blur(5px) brightness(2);
    }
    65% {
        transform: translate3d(calc(var(--x-offset) * 1.5), calc(var(--y-offset) * 1.5), 50px) scale(0.28);
        opacity: 0.42;
    }
    80% {
        opacity: 0.4;
        filter: blur(0) grayscale(30%);
    }
    100% {
        transform: translate3d(calc(var(--x-offset, 0) * 2.2), calc(var(--y-offset, 0) * 2.2), 150px) scale(var(--scale-end, 0.32));
        opacity: 0;
        filter: blur(3px) grayscale(50%);
    }
}

.logo-2 { --x-offset: -75px; --y-offset: -50px; --scale-start: 0.08; --scale-end: 0.32; animation: tunnelPasmoso 3.5s infinite linear -1s; }
.logo-3 { --x-offset: 80px;  --y-offset: 45px;  --scale-start: 0.05; --scale-end: 0.26; animation: tunnelPasmoso 5.5s infinite linear -3s; }
.logo-4 { --x-offset: -65px; --y-offset: 60px;  --scale-start: 0.06; --scale-end: 0.28; animation: tunnelPasmoso 2.8s infinite linear -5s; }
.logo-5 { --x-offset: 75px;  --y-offset: -55px; --scale-start: 0.09; --scale-end: 0.34; animation: tunnelPasmoso 4.8s infinite linear -7s; }
.logo-6 { --x-offset: -85px; --y-offset: 15px;  --scale-start: 0.07; --scale-end: 0.30; animation: tunnelPasmoso 2.0s infinite linear -2s; }
.logo-7 { --x-offset: 90px;  --y-offset: -20px; --scale-start: 0.05; --scale-end: 0.24; animation: tunnelPasmoso 6.0s infinite linear -4.5s; }
.logo-8 { --x-offset: -15px; --y-offset: -75px; --scale-start: 0.08; --scale-end: 0.30; animation: tunnelPasmoso 4.0s infinite linear -6.5s; }
.img-overlay-label {
    position: absolute; bottom: 0.6rem; right: 0.6rem;
    font-size: 0.55rem; letter-spacing: 0.1em;
    opacity: 0; transition: opacity 0.3s;
    color: var(--bg); background: var(--accent); padding: 2px 5px;
}
.mundo-card:hover .img-overlay-label { opacity: 1; }

.mundo-meta {
    padding: 0.75rem 0.85rem; border-top: 1px solid var(--border);
    background: rgba(0,0,0,0.2); display: flex; flex-direction: column; gap: 0.2rem;
}

/* Botones de expansion en mobile (ocultos por defecto) */
.mundo-close-btn, .mundo-more-btn {
    display: none;
    position: absolute;
    z-index: 10;
    cursor: pointer;
}
.mundo-close-btn {
    top: 8px; right: 8px;
    background: rgba(0,0,0,0.7); color: #fff;
    border: 1px solid rgba(255,255,255,0.3); border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 1rem; align-items: center; justify-content: center;
}
.mundo-more-btn {
    bottom: 12px; right: 12px;
    background: var(--accent); color: #000;
    border: none; padding: 0.5rem 1rem; font-weight: bold;
    border-radius: 0; text-transform: uppercase; font-size: 0.75rem;
    box-shadow: 0 0 10px rgba(200,255,0,0.3);
}
.obra-year  { font-size: 0.52rem; opacity: 0.4; letter-spacing: 0.1em; }
.obra-title { font-size: clamp(0.75rem, 1.4vw, 1rem); line-height: 1.25; font-weight: 400; margin: 0.2rem 0 0; }
.obra-cat   { font-size: 0.5rem; color: var(--accent); opacity: 0.7; margin-top: 0.15rem; text-transform: uppercase; letter-spacing: 0.08em; }

.tilt-effect {
    transition: transform 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.3s;
    will-change: transform;
    transform: perspective(800px) rotateX(var(--tilt-y, 0deg)) rotateY(var(--tilt-x, 0deg));
    transform-style: preserve-3d;
}

/* =============================================
   SEDIMENTOS
   ============================================= */
.section-sedimentos { background: transparent; }
.sedimentos-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1.8rem;
}
.sedimentos-title-group { display: flex; align-items: flex-end; gap: 1rem; }
.sedimentos-title-group h2 { font-size: 1.1rem; font-weight: 400; margin: 0; }

.btn-ghost {
    background: none; border: none; cursor: pointer; color: var(--muted);
    font-family: var(--font); font-size: 0.58rem; letter-spacing: 0.1em;
    transition: color 0.25s; text-transform: lowercase;
}
.btn-ghost:hover { color: var(--accent); }

.archivo-fluido {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0; overflow-y: auto; max-height: calc(100% - 8rem);
}
.archivo-item {
    padding: 1rem 0.9rem; border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 0.25rem; transition: background 0.3s;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.archivo-item:hover { background: rgba(10, 10, 10, 0.75); }
.archivo-fluido .archivo-item:nth-child(3n) { border-right: none; }

.archivo-year { font-size: 0.52rem; opacity: 0.35; letter-spacing: 0.1em; display: block; }
.archivo-name { font-size: 0.88rem; font-weight: 400; margin: 0.15rem 0 0; }
.archivo-type { font-size: 0.5rem; color: var(--accent); opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; }

.archivo-indice { display: flex; flex-direction: column; overflow-y: auto; max-height: calc(100% - 8rem); }
.archivo-indice .archivo-item {
    display: grid; grid-template-columns: 50px 1fr 1fr;
    align-items: center; border-right: none; padding: 0.8rem 0.5rem; gap: 1rem;
}
.archivo-indice .archivo-type { text-align: right; opacity: 1; }

/* =============================================
   PROCESOS
   ============================================= */
.procesos-header-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.8rem; }
.procesos-title { font-size: 1.1rem; font-weight: 400; border-bottom: 1px solid var(--border); padding-bottom: 1rem; flex: 1; margin-right: 2rem; }

.procesos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
.nota {
    padding: 1.2rem 1rem; border-top: 1px solid var(--border);
    border-right: 1px solid var(--border); position: relative; transition: background 0.3s;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.nota:hover { background: rgba(10, 10, 10, 0.78); }
.nota:nth-child(2n) { border-right: none; }
.nota-year  { font-size: 0.5rem; opacity: 0.35; display: block; margin-bottom: 0.4rem; letter-spacing: 0.1em; }
.nota-text  { font-size: 0.9rem; line-height: 1.5; max-width: 26ch; }
.nota-emoji { position: absolute; top: 0.8rem; right: 0.8rem; font-size: 1rem; opacity: 0.5; }
.nota--highlight { background: rgba(10, 10, 10, 0.68); }

/* =============================================
   COORDENADAS
   ============================================= */
.coordenadas-inner { justify-content: center; gap: 2rem; color: var(--accent); }
.bio-block {
    display: flex; align-items: flex-start; gap: 2rem;
    border-bottom: 1px solid rgba(200,255,0,0.2); padding-bottom: 2rem;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1.5rem 2rem 2rem;
    border-radius: 2px;
}
.bio-text { font-size: clamp(0.82rem, 1.8vw, 1.2rem); line-height: 1.75; max-width: 560px; color: var(--accent); }

.coords-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 4rem; }
.block-label {
    display: block; margin-bottom: 1rem; opacity: 0.5; font-size: 0.55rem;
    text-transform: uppercase; letter-spacing: 0.12em;
    border-bottom: 1px solid rgba(200,255,0,0.25); padding-bottom: 0.4rem;
    color: var(--accent);
}
.agenda-list { list-style: none; font-size: 0.78rem; line-height: 2.2; color: var(--accent); }
.links-vertical { display: flex; flex-direction: column; gap: 0.8rem; }

/* Fondo glass para las columnas de info en coordenadas */
.coords-cols > * {
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1.2rem 1.4rem;
    border-radius: 2px;
}

/* Links en coordenadas heredan amarillo */
.coordenadas-inner .cta-link { color: var(--accent); border-color: rgba(200,255,0,0.4); }
.coordenadas-inner .cta-link:hover { color: var(--accent); border-color: var(--accent); }

/* =============================================
   MODAL
   ============================================= */
.modal {
    position: fixed; top: 0; left: 0; right: 0; height: 100dvh; z-index: 99999;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; pointer-events: none; transition: opacity 0.35s ease;
}
.modal.is-open { opacity: 1; pointer-events: auto; }
.modal-backdrop {
    position: absolute; inset: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); cursor: pointer;
}
.modal-wrapper {
    position: relative; z-index: 2001; width: 90%; max-width: 860px; max-height: 88vh;
    background: #1a1a1a; overflow-y: auto; -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border: 1px solid var(--border);
    transform: translateY(24px); transition: transform 0.45s cubic-bezier(0.16,1,0.3,1);
    display: flex; flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: #1a1a1a transparent;
}
.modal-wrapper::-webkit-scrollbar {
    width: 6px;
}
.modal-wrapper::-webkit-scrollbar-track {
    background: transparent;
}
.modal-wrapper::-webkit-scrollbar-thumb {
    background: #1a1a1a;
    border-radius: 3px;
}
.modal-wrapper--procesos::-webkit-scrollbar-thumb {
    background: var(--fg);
}
.modal-wrapper--fotografia::-webkit-scrollbar-thumb {
    background: #000;
}
.modal-wrapper--pasmoso::-webkit-scrollbar-thumb {
    background: transparent;
}
.modal.is-open .modal-wrapper { transform: translateY(0); }
.modal-header {
    display: flex; justify-content: flex-end; padding: max(1rem, env(safe-area-inset-top)) 1.5rem 1rem;
    position: sticky; top: 0; background: #1a1a1a; z-index: 10;
    border-bottom: 1px solid var(--border);
}
.modal-close {
    background: none; border: none; cursor: pointer;
    color: var(--accent); font-family: var(--font); font-size: 0.6rem;
    letter-spacing: 0.1em; transition: opacity 0.25s;
}
.modal-close:hover { opacity: 0.6; }
.modal-body { padding: 2rem 2.5rem calc(3rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 1.5rem; }
.modal-img-hero { width: 100%; height: 36dvh; max-height: 36dvh; filter: grayscale(30%); object-fit: cover; }
.modal-title { font-size: 1.8rem; font-weight: 400; line-height: 1.15; }
.modal-info  { font-size: 0.82rem; line-height: 1.85; max-width: 58ch; opacity: 0.75; }
.modal-meta-line { font-size: 0.58rem; letter-spacing: 0.1em; opacity: 0.4; text-transform: uppercase; }
.modal-rol-tag {
    display: inline-block; background: var(--accent); color: var(--bg);
    font-size: 0.52rem; letter-spacing: 0.1em; text-transform: uppercase;
    padding: 3px 8px; font-family: var(--font); align-self: flex-start;
}
.modal-desc-block { display: flex; flex-direction: column; gap: 1rem; }
.modal-videos {
    display: flex; flex-direction: column; gap: 0.6rem;
    border-top: 1px solid var(--border); padding-top: 1.2rem; margin-top: 0.5rem;
}
.modal-videos-label {
    font-size: 0.52rem; letter-spacing: 0.12em; text-transform: uppercase;
    opacity: 0.35; display: block; margin-bottom: 0.3rem;
}
.modal-video-link { margin-top: 0 !important; }

/* ---- Clip reel (Guitarra & Dildos) ---- */
.clip-reel {
    border-top: 1px solid var(--border);
    padding-top: 1.4rem;
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.clip-reel-label {
    font-size: 0.52rem; letter-spacing: 0.12em; text-transform: uppercase;
    opacity: 0.35; display: block;
}
.clip-reel-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
    border-radius: 2px;
}
.clip-reel-video {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
    opacity: 1;
    /* Sin transición: corte directo entre clips */
}
.clip-reel-video--hidden {
    opacity: 0;
    pointer-events: none;
}
.clip-reel-counter {
    position: absolute;
    bottom: 0.6rem; right: 0.8rem;
    font-size: 0.48rem;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    font-family: var(--font-mono, monospace);
    pointer-events: none;
}
.clip-reel-bar {
    height: 2px;
    background: var(--border);
    width: 100%;
    overflow: hidden;
    border-radius: 1px;
}
.clip-reel-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.1s linear;
}

/* PosiciÃ³n del vol control dentro del clip reel */
.clip-vol-ctrl {
    position: absolute;
    bottom: 0.6rem;
    left: 0.8rem;
}

/* ---- Tema Invertido para "Procesos" ---- */
.modal-wrapper--procesos {
    background: var(--fg);
    color: var(--bg);
    border: 2px dashed rgba(30, 30, 30, 0.25);
    border-radius: 0;
}
.modal-wrapper--procesos .modal-header {
    background: var(--fg);
    border-bottom: 1px dashed rgba(30, 30, 30, 0.2);
}
.modal-wrapper--procesos .modal-close {
    color: var(--bg);
    opacity: 0.5;
}
.modal-wrapper--procesos .modal-close:hover { opacity: 1; }
.modal-wrapper--procesos .modal-rol-tag {
    background: var(--bg);
    color: var(--fg);
}
.modal-wrapper--procesos .modal-info { opacity: 0.85; }
.modal-wrapper--procesos .modal-meta-line { opacity: 0.5; }
.modal-wrapper--procesos .modal-videos {
    border-top: 1px dashed rgba(30, 30, 30, 0.2);
}
.modal-wrapper--procesos .cta-link {
    color: var(--bg);
    border-color: rgba(30, 30, 30, 0.3);
}
.modal-wrapper--procesos .cta-link:hover {
    color: var(--bg); border-color: var(--bg); font-weight: bold;
}

/* ---- Tema Sello Pasmoso ---- */
.modal-wrapper--pasmoso {
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-wrapper--pasmoso .modal-body {
    background: url('img/fondopasmoso.jpg') center/cover no-repeat;
}
.modal-wrapper--pasmoso .modal-header {
    background: #1a1a1a;
}
/* WCAG Contrast/Accessibility card backings for Sello Pasmoso text content */
.modal-wrapper--pasmoso .modal-desc-block,
.modal-wrapper--pasmoso .modal-videos {
    background: rgba(15, 15, 15, 0.85);
    padding: 1.5rem;
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-wrapper--pasmoso .modal-title,
.modal-wrapper--pasmoso .modal-meta-line {
    background: rgba(15, 15, 15, 0.85);
    padding: 0.5rem 1.2rem;
    border-radius: 0;
    display: inline-block;
    width: fit-content;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.modal-wrapper--pasmoso .modal-title {
    margin-bottom: 0.5rem;
}

@media (max-width: 768px) {
    .modal-wrapper--pasmoso .modal-img-hero {
        background-size: contain !important;
        background-color: #000 !important;
        background-position: center !important;
    }
}

/* ---- Tema Fanzine (Slideshow / Book Reader) ---- */
.modal-wrapper--fanzine {
    /* Uses default dark modal styling, which fits perfectly */
}
.fanzine-book-reader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 2rem 0;
    width: 100%;
}
.fanzine-page-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 680px;
    gap: 1rem;
}
.fanzine-img-frame {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #0d0d0d;
    padding: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 12px 40px rgba(0,0,0,0.8);
    min-height: 450px;
    max-height: 70dvh;
    perspective: 1200px;
    transform-style: preserve-3d;
}
.fanzine-page-img {
    max-width: 100%;
    max-height: 65dvh;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform-origin: left center;
    backface-visibility: hidden;
}
.fanzine-nav-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: all 0.2s ease;
}
.fanzine-nav-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255,255,255,0.02);
}
.fanzine-page-counter {
    font-family: var(--font);
    font-size: 0.58rem;
    color: var(--accent);
    opacity: 0.8;
    letter-spacing: 0.15em;
}

/* Fanzine mobile rules consolidated in the main @media (max-width: 768px) block below */

/* ---- Tema FotografÃ­a (Draggable Canvas) ---- */
.modal-wrapper--fotografia {
    background: #000;
    max-width: 100%; height: 100dvh; max-height: 100dvh;
    border: none; border-radius: 0;
    overflow: hidden;
}
.modal-wrapper--fotografia .modal-header {
    background: transparent; border-bottom: none;
    position: absolute; top: 0; right: 0; z-index: 9999;
}
.modal-wrapper--fotografia .modal-body { padding: 0; height: 100%; display: block; }
.fotografia-canvas {
    position: relative; width: 100%; height: 100%;
    overflow: hidden; touch-action: none; /* Prevent scroll on touch */
}
.draggable-photo {
    position: absolute;
    max-width: 300px; max-height: 400px;
    object-fit: contain;
    cursor: grab;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 8px solid #fff; /* Polaroid effect */
    background: #fff;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.2s;
}
.draggable-photo:active { cursor: grabbing; }
@media (max-width: 768px) {
    .draggable-photo { max-width: 200px; max-height: 300px; border-width: 4px; }
}

/* ---- Photo Zoom Button & Lightbox ---- */
.photo-zoom-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(0,0,0,0.6); color: var(--accent);
    border: none; border-radius: 0;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; opacity: 0.8;
    transition: opacity 0.2s;
    backdrop-filter: blur(4px);
    z-index: 2; /* above image */
}
.photo-zoom-btn:hover { opacity: 1; }
.photo-zoom-btn svg { width: 16px; height: 16px; pointer-events: none; }

@media (max-width: 768px) {
    .photo-zoom-btn { top: 4px; right: 4px; width: 28px; height: 28px; }
    .photo-zoom-btn svg { width: 14px; height: 14px; }
}

#lightbox-overlay {
    position: fixed; inset: 0; z-index: 100000;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
#lightbox-overlay.is-open { opacity: 1; pointer-events: auto; }
.lightbox-bg {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}
.lightbox-content {
    position: relative; z-index: 1;
    width: calc(100vw - 40px); height: calc(100vh - 40px);
    display: flex; align-items: center; justify-content: center;
}
.lightbox-content img {
    max-width: 100%; max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute; top: 0; right: 0;
    background: none; border: none; color: #fff;
    font-size: 2.5rem; cursor: pointer;
    line-height: 1; transition: opacity 0.2s;
    opacity: 0.7; padding: 10px;
}
.lightbox-close:hover { opacity: 1; }

/* ---- Video hero en modal ---- */
.modal-video-hero {
    position: relative;
    width: 100%;
    height: calc(36dvh + 20px);
    overflow: hidden;
    background: #000;
}
.modal-video-hero video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Control de volumen superpuesto */
.modal-vol-ctrl {
    position: absolute;
    bottom: 0.8rem;
    left: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(20,20,20,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 2px;
    padding: 0.35rem 0.6rem;
}

.modal-vol-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    color: var(--fg);
    padding: 0;
    transition: color 0.2s;
}
.modal-vol-btn:hover { color: var(--accent); }
.modal-vol-btn:focus-visible { outline: 1px dashed var(--accent); outline-offset: 2px; }

.vol-icon { width: 16px; height: 16px; display: block; }
.vol-icon--hidden { display: none; }

/* Slider / fader */
.modal-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 2px;
    background: rgba(240,237,232,0.25);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    transition: width 0.3s ease;
}
.modal-vol-slider:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}
.modal-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px; height: 10px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}
.modal-vol-slider::-webkit-slider-thumb:hover { transform: scale(1.3); }
.modal-vol-slider::-moz-range-thumb {
    width: 10px; height: 10px;
    background: var(--accent);
    border: none; border-radius: 50%;
    cursor: pointer;
}

/* ---- Carousel en modales ---- */
.carousel-nav {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    padding: 0 1rem;
    z-index: 5;
}
.carousel-arrow {
    background: rgba(20, 20, 20, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--fg);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.3s, color 0.3s;
}
.carousel-arrow:hover {
    background: rgba(20, 20, 20, 0.8);
    color: var(--accent);
}
.carousel-arrow svg {
    width: 16px;
    height: 16px;
}
.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}
.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
}
.carousel-dot.is-active {
    background: var(--accent);
    transform: scale(1.2);
}

/* bio secondary paragraph */
.bio-sub { font-size: clamp(0.72rem, 1.4vw, 0.95rem); opacity: 0.65; }

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
    #h-track { transition: none !important; }
    .tilt-effect { transition: none !important; transform: none !important; }
    .marquee-track { animation: none; }
    .scroll-hint { animation: none; }
}

/* =============================================
   HAMBURGER BUTTON (hidden on desktop)
   ============================================= */
.nav-hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 15px;
    background: none;
    border: none;
    cursor: crosshair;
    padding: 0;
    margin-left: auto;
    flex-shrink: 0;
    z-index: 10;
}
.nav-hamburger span {
    display: block;
    width: 100%;
    height: 1px;
    background: var(--fg);
    transition: transform 0.25s ease, opacity 0.25s ease;
    transform-origin: center;
}
.nav-hamburger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.is-open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-hamburger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Desktop: nav-menu is always visible, flex row */
.nav-menu {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 2rem;
}
/* site-nav ul rules defined above at L.198 */

/* =============================================
   RECREO (MINI GAME)
   ============================================= */
.section-recreo { background: #080808; }
.recreo-inner {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
}
.recreo-header-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
.recreo-title {
    font-size: 1.1rem;
    font-weight: 400;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
    flex: 1;
}
.game-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    flex: 1;
    justify-content: center;
    min-height: 0;
}
.game-hud {
    display: flex;
    justify-content: space-around;
    width: 100%;
    max-width: 600px;
    font-family: var(--font-mono, monospace);
    font-size: 0.8rem;
    color: var(--accent);
    padding: 0.5rem 1rem;
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid var(--border);
    box-sizing: border-box;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.canvas-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 600/400;
    border: 1px solid var(--border);
    background: #030303;
    overflow: hidden;
    box-sizing: border-box;
}
#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none; /* prevent scroll interference */
}
.game-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    box-sizing: border-box;
    z-index: 10;
    transition: opacity 0.3s ease;
}
.game-overlay.is-hidden { opacity: 0; pointer-events: none; }
.game-title {
    font-size: 1.8rem;
    color: var(--accent);
    font-family: var(--font);
    letter-spacing: 0.25em;
    margin-bottom: 0.8rem;
}
.game-instructions {
    font-size: 0.72rem;
    color: var(--muted);
    max-width: 440px;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-transform: lowercase;
}
.game-btn {
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.5rem 1.6rem;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    transition: all 0.2s ease;
    border-radius: 0;
}
.game-btn:hover {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 10px rgba(200,255,0,0.4);
}

/* Pause button in HUD */
.game-pause-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--accent);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: crosshair;
    transition: background 0.2s, border-color 0.2s, opacity 0.2s;
    padding: 0;
    flex-shrink: 0;
}
.game-pause-btn:hover:not(:disabled) {
    background: rgba(200,255,0,0.1);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(200,255,0,0.25);
}
.game-pause-btn:disabled { opacity: 0.2; cursor: not-allowed; }

/* =============================================
   TABLET (769 â€“ 1100px)
   ============================================= */
@media (min-width: 769px) and (max-width: 1100px) {
    .archivo-fluido { grid-template-columns: repeat(2, 1fr); }
    .archivo-fluido .archivo-item:nth-child(3n) { border-right: 1px solid var(--border); }
    .archivo-fluido .archivo-item:nth-child(2n) { border-right: none; }
    .coords-cols { grid-template-columns: 1fr; }
    .mundo-card { flex: 0 0 clamp(180px, 34vw, 280px); }
    .site-nav { padding: 0 1.5rem; gap: 1.5rem; }
    .site-nav ul { gap: 1.2rem; }
}

/* =============================================
   MOBILE (â‰¤768px) â€” vertical scroll layout
   ============================================= */
@media (max-width: 768px) {
    :root { --marquee-h: 26px; --nav-h: 48px; }

    /* --- Navbar hamburger --- */
    .nav-hamburger { display: flex; }
    .nav-counter, .nav-arrow, .scroll-progress, .ascii-deco { display: none; }

    .site-nav {
        padding: 0 1.2rem;
        gap: 0;
        flex-wrap: nowrap;
        position: fixed;
    }

    .nav-menu {
        /* Hidden by default on mobile */
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        position: fixed;
        top: calc(var(--marquee-h) + var(--nav-h));
        left: 0; right: 0;
        background: rgba(20, 20, 20, 0.98);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding: 1.2rem 1.5rem 1.5rem;
        z-index: 490;
        animation: menuSlide 0.2s ease;
    }
    @keyframes menuSlide {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .nav-menu.is-open { display: flex; }

    .site-nav ul {
        flex-direction: column;
        gap: 0;
        width: 100%;
        flex: none;
    }
    .site-nav ul li {
        border-bottom: 1px solid var(--border);
    }
    .site-nav ul li:last-child { border-bottom: none; }
    .site-nav ul a {
        display: block;
        padding: 0.85rem 0;
        font-size: 0.75rem;
        letter-spacing: 0.15em;
        opacity: 0.7;
    }
    .site-nav ul a:hover,
    .site-nav ul a.is-active { opacity: 1; }

    .lang-toggle {
        margin-right: 0;
        margin-top: 1.2rem;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
        width: 100%;
    }

    /* --- Layout: vertical scroll --- */
    html, body { overflow: hidden; }
    #main-content {
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: y mandatory;
    }
    #h-track {
        flex-direction: column;
        width: 100%;
        transform: none !important;
        transition: none;
    }
    .section-panel {
        flex: none;
        min-height: 100dvh;
        height: auto;
        width: 100%;
        overflow-y: visible;
        scroll-snap-align: start;
        padding-bottom: calc(2.5rem + env(safe-area-inset-bottom));
    }

    /* --- Typography --- */
    .statement { font-size: clamp(1.2rem, 6.5vw, 2rem); }

    /* --- Mundos --- */
    .section-mundos { padding: 1rem; }
    
    .mundos-track { 
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: repeat(4, minmax(160px, 1fr));
        gap: 0.5rem;
        position: relative; 
        width: 100%;
        height: auto;
        min-height: 75dvh;
        overflow: visible; 
        scroll-snap-type: none;
    }
    
    .mundo-card {
        display: flex;
        flex-direction: column;
        position: relative;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        box-shadow: none;
        animation: none !important;
        transform: none !important;
        margin: 0;
        overflow: hidden;
    }
    
    /* Imagen ocupando todo el cuadrante */
    .mundo-card .mundo-img {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        border-bottom: none;
        z-index: 1;
    }

    /* Ocultar etiqueta "ver" en la cuadrÃ­cula normal */
    .mundo-card:not(.is-expanded) .img-overlay-label { display: none; }

    /* TÃ­tulo sÃºper grande por encima de la foto */
    .mundo-card .mundo-meta {
        position: absolute;
        inset: 0;
        z-index: 2;
        background: rgba(0, 0, 0, 0.4);
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 0.5rem;
        border: none;
        transition: background 0.3s ease;
    }

    .mundo-card .obra-title {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        color: #fff;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.9);
        white-space: normal;
        margin: 0;
    }
    
    .mundo-card .obra-cat { display: none; }
    
    /* Ocultar botones en vista normal */
    .mundo-card:not(.is-expanded) .mundo-more-btn { display: none; }
    
    /* ESTADO EXPANDIDO (ZOOM) */
    .mundo-card.is-expanded {
        position: fixed;
        inset: 0;
        z-index: 9999;
        width: 100%;
        height: 100dvh;
        background: var(--bg);
        border: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    
    .mundo-card.is-expanded .mundo-img {
        position: relative;
        height: 50vh;
        border-bottom: 1px solid var(--border);
    }
    
    .mundo-card.is-expanded .img-overlay-label { display: block; }
    
    .mundo-card.is-expanded .mundo-meta {
        position: relative;
        background: none;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        text-align: left;
        padding: 1.5rem;
        padding-bottom: 5rem;
    }
    
    .mundo-card.is-expanded .obra-title {
        color: var(--fg);
        text-shadow: none;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .mundo-card.is-expanded .obra-cat { 
        display: block; 
        color: var(--fg-alt);
    }
    
    .mundo-card.is-expanded .mundo-close-btn { display: flex; }
    .mundo-card.is-expanded .mundo-more-btn { display: block; }

    /* --- Sedimentos --- */
    .archivo-fluido { grid-template-columns: 1fr 1fr; }
    .archivo-item { padding: 0.8rem 0.6rem; }

    /* --- Procesos --- */
    .procesos-grid { grid-template-columns: 1fr; }
    .nota:nth-child(2n) { border-right: 1px solid var(--border); }

    /* --- Coordenadas --- */
    .bio-block { flex-direction: column; gap: 0.8rem; padding: 1rem; }
    .bio-text { font-size: 0.82rem; }
    .coords-cols { grid-template-columns: 1fr; gap: 1.2rem; }
    .coords-cols > * { padding: 1rem; }
    .collage-float { display: none; }

    /* --- Modals --- */
    .modal {
        display: block; /* flex no aplica en mobile — usamos position absolute en el wrapper */
        overflow: hidden;
    }
    .modal-wrapper {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        width: 100%;
        height: 100%;
        max-height: 100dvh;
        max-width: 100%;
        border: none; margin: 0; border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .modal-header {
        padding: calc(0.8rem + env(safe-area-inset-top)) 1.2rem 0.8rem;
        position: sticky;
        top: 0;
        z-index: 10;
    }
    .modal-body {
        padding: 1rem 1rem calc(3rem + env(safe-area-inset-bottom));
        gap: 1rem;
    }
    .modal-title { font-size: 1.2rem; }
    .modal-info { font-size: 0.8rem; line-height: 1.7; max-width: 100%; }
    .modal-img-hero { height: 28dvh; max-height: 28dvh; }

    /* --- Fanzine modal: botones debajo de imagen --- */
    .fanzine-book-reader { gap: 0.6rem; margin: 0.8rem 0 1rem; }
    .fanzine-page-container {
        flex-direction: column;
        gap: 0.6rem;
        align-items: stretch;
        max-width: 100%;
    }
    .fanzine-img-frame {
        min-height: 0;
        max-height: 52dvh;
        padding: 0.5rem;
        order: 1;
        width: 100%;
    }
    .fanzine-page-img { max-height: 48dvh; }
    .fanzine-nav-btn {
        order: 2;
        position: static;
        transform: none;
        flex: 1;
        padding: 0.6rem 0.5rem;
        font-size: 0.56rem;
        letter-spacing: 0.08em;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .fanzine-prev-btn { order: 2; }
    .fanzine-next-btn { order: 3; }
    .fanzine-page-counter {
        order: 2;
        font-size: 0.55rem;
        text-align: center;
        margin: 0;
        padding: 0.3rem 0;
    }

    /* --- Game --- */
    .recreo-inner { padding: 1.2rem 1rem; justify-content: flex-start; }
    .recreo-header-row { margin-bottom: 0.8rem; }
    .game-title { font-size: 1.1rem; letter-spacing: 0.15em; }
    .game-instructions { font-size: 0.62rem; margin-bottom: 1rem; }
    .game-hud { font-size: 0.62rem; padding: 0.35rem 0.6rem; }
    .game-wrapper { gap: 0.5rem; justify-content: flex-start; padding-top: 0.5rem; }

    /* Canvas fills mobile width */
    .canvas-container {
        max-width: 100%;
        width: 100%;
    }

    /* Clip reel in modals */
    .clip-reel-player { aspect-ratio: 4/3; }
}

/* =============================================
   EXTRA SMALL (â‰¤400px)
   ============================================= */
@media (max-width: 400px) {
    :root { --marquee-h: 22px; --nav-h: 44px; }
    .archivo-fluido { grid-template-columns: 1fr; }
    .archivo-fluido .archivo-item:nth-child(3n),
    .archivo-fluido .archivo-item:nth-child(2n) { border-right: none; }
    .modal-title { font-size: 1rem; }
    .statement { font-size: clamp(1rem, 7vw, 1.6rem); }
    .nav-logo a { font-size: 0.65rem; }
}


/* ARTE & TECNOLOGÍA MODAL Y TARJETA */
.arte-tecnologia-card .mundo-img {
    background: #000 !important;
}
.arte-tecnologia-card:hover .mundo-img {
    background-image: url('https://giffiles.alphacoders.com/360/36022.gif') !important;
    background-color: var(--accent) !important;
    background-blend-mode: multiply !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

.modal-wrapper--arte {
    background: #000 !important;
}

.modal-wrapper--arte #modal-body-content {
    background-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 45dvh), 
                      url('https://giffiles.alphacoders.com/360/36022.gif') !important;
    background-color: var(--accent) !important;
    background-blend-mode: normal, multiply !important;
    background-size: 100% 100%, cover !important;
    background-position: top, center top !important;
    background-repeat: no-repeat, no-repeat !important;
}

.modal-wrapper--arte .modal-img-hero {
    background: transparent !important;
}

