/* ==========================================================================
   DESIGN SYSTEM & GLOBAL RESETS
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

img {
    user-select: none;
    -webkit-user-drag: none;
}

:root {
    --bg-portafolio: #FFFFFF;
    --text-portafolio: #000000;
    --accent-amber: #F7A810;
    
    --bg-galeria: #000000;
    --text-galeria: #F0F0F0;
    --accent-violet: #4B0082;
    
    /* Active theme variables (mutated via body class) */
    --bg: var(--bg-portafolio);
    --text: var(--text-portafolio);
    --accent: var(--accent-amber);
    
    --transition-wipe: 0.8s cubic-bezier(0.85, 0, 0.15, 1);
    --transition-stiff: 0.35s cubic-bezier(0.19, 1, 0.22, 1);
}

html {
    scroll-behavior: smooth;
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Syne', 'Avenir Next Heavy', 'Avenir Next', sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ==========================================================================
   THEME SWITCHING & STATE MANAGEMENT
   ========================================================================== */
body.portafolio {
    --bg: var(--bg-portafolio);
    --text: var(--text-portafolio);
    --accent: var(--accent-amber);
    font-family: 'Syne', 'Avenir Next Heavy', 'Avenir Next', sans-serif;
}

body.galeria {
    --bg: var(--bg-galeria);
    --text: var(--text-galeria);
    --accent: var(--accent-amber);
    font-family: 'Cormorant Garamond', serif;
}

body.portafolio .portafolio-view {
    display: block;
}
body.portafolio .galeria-view {
    display: none;
}

body.galeria .portafolio-view {
    display: none;
}
body.galeria .galeria-view {
    display: flex;
}

/* ==========================================================================
   FILM GRAIN EFFECT
   ========================================================================== */
.grain-overlay {
    position: fixed;
    top: -50%;
    left: -50%;
    right: -50%;
    bottom: -50%;
    width: 200%;
    height: 200%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.05;
    pointer-events: none;
    z-index: 9999;
    animation: grain-animation 8s steps(10) infinite;
}

body.galeria .grain-overlay {
    opacity: 0.09; /* Extra mood in art gallery */
}

@keyframes grain-animation {
    0%, 100% { transform:translate(0, 0); }
    10% { transform:translate(-5%, -10%); }
    20% { transform:translate(-15%, 5%); }
    30% { transform:translate(7%, -25%); }
    40% { transform:translate(-5%, 25%); }
    50% { transform:translate(-15%, 10%); }
    60% { transform:translate(15%, 0%); }
    70% { transform:translate(0%, 15%); }
    85% { transform:translate(3%, 35%); }
    95% { transform:translate(-10%, 10%); }
}

/* ==========================================================================
   SCREEN WIPE TRANSITION
   ========================================================================== */
.screen-wipe {
    position: fixed;
    top: 0;
    left: -100vw;
    width: 100vw;
    height: 100vh;
    background-color: var(--accent-violet);
    z-index: 10000;
    pointer-events: none;
}

.screen-wipe.active {
    animation: wipe-animation var(--transition-wipe) forwards;
}

@keyframes wipe-animation {
    0% {
        left: -100vw;
    }
    50% {
        left: 0;
        width: 100vw;
    }
    100% {
        left: 100vw;
        width: 100vw;
    }
}

/* ==========================================================================
   PERSISTENT NAVIGATION (NAVBAR)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    padding: 0 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    pointer-events: none;
}

.brand {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    pointer-events: auto;
}

body.portafolio .brand {
    color: #000000;
}

body.galeria .brand {
    color: #888888;
}

/* Toggle Switcher Container */
.mode-toggle-container {
    display: flex;
    background-color: rgba(0, 0, 0, 0.05);
    border: 1px solid #000000;
    padding: 2px;
    pointer-events: auto;
}

body.galeria .mode-toggle-container {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid #333333;
}

.toggle-btn {
    background: none;
    border: none;
    padding: 6px 14px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: #666666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-btn.active {
    color: #000000;
    background-color: #FFFFFF;
    font-weight: 700;
}

body.galeria .toggle-btn.active {
    color: #000000;
    background-color: var(--accent-amber);
}

.monogram-fixed {
    font-family: 'Syne', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-amber);
    letter-spacing: -0.05em;
    pointer-events: auto;
    transition: opacity 0.3s ease;
}

body.galeria .monogram-fixed {
    opacity: 0.3; /* Subtle in gallery mode */
}

/* ==========================================================================
   PORTAFOLIO MODE VIEW (SNAP SCROLL)
   ========================================================================== */
body.portafolio {
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
}

.snap-section {
    scroll-snap-align: start;
    scroll-snap-stop: always;
    height: 100vh;
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* --- BLOCK 1: Hero Editorial --- */
.hero-block {
    background-color: var(--bg-portafolio);
}

.scroll-hint {
    position: absolute;
    bottom: 28px;
    left: 4%;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    color: var(--accent-amber);
    opacity: 1;
    transition: opacity 0.4s ease;
    animation: scroll-pulse 2s ease-in-out infinite;
    z-index: 10;
    pointer-events: none;
}
.scroll-hint.hidden {
    opacity: 0;
}
@keyframes scroll-pulse {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}
.galeria .scroll-hint {
    display: none;
}

.hero-split {
    display: flex;
    height: 100%;
    width: 100%;
}

.hero-image-pane {
    width: 50%;
    height: 100%;
    overflow: hidden;
    position: relative;
    border-right: 1px solid #000000;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(1) contrast(1.5) brightness(0.85);
    transition: transform 1.5s var(--transition-stiff);
}

.hero-block:hover .hero-img {
    transform: scale(1.03);
}

.hero-text-pane {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 5%;
    position: relative;
}

.hero-title {
    font-family: 'Syne', 'Avenir Next Heavy', sans-serif;
    font-size: 10vw;
    line-height: 0.8;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.05em;
    position: absolute;
    left: -12vw; /* Massive text overlaps the B&W photo border */
    z-index: 10;
    pointer-events: none;
    text-transform: uppercase;
}

/* Split text blending effect to read beautifully on light and dark */
body.portafolio .hero-title {
    mix-blend-mode: difference;
    color: #FFFFFF; /* Becomes white over black photo, black over white background */
}

.hero-support {
    position: absolute;
    bottom: 50px;
    right: 4%;
}

.mono-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 500;
    color: #000000;
    letter-spacing: 0.05em;
}

/* --- BLOCK 2: El Manifiesto de Autoridad --- */
.manifesto-block {
    background-color: var(--bg-portafolio);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4%;
}

.manifesto-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr;
    width: 100%;
    max-width: 1400px;
    height: 60%;
    position: relative;
}

/* Asymmetric grid lines drawn dynamically */
.manifesto-grid::before,
.manifesto-grid::after,
.manifesto-col::before {
    content: '';
    position: absolute;
    background-color: #000000;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Top Horizontal Grid Line */
.manifesto-grid::before {
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: left;
}

/* Bottom Horizontal Grid Line */
.manifesto-grid::after {
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: right;
}

.manifesto-col {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    position: relative;
}

/* Left grid line for column 2 */
.manifesto-col.col-2::before {
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: top;
}

/* Left grid line for column 3 */
.manifesto-col.col-3::before {
    left: 0;
    top: 0;
    width: 1px;
    height: 100%;
    transform: scaleY(0);
    transform-origin: bottom;
}

/* Active class triggered by IntersectionObserver */
.manifesto-block.grid-active .manifesto-grid::before,
.manifesto-block.grid-active .manifesto-grid::after {
    transform: scaleX(1);
}

.manifesto-block.grid-active .manifesto-col::before {
    transform: scaleY(1);
}

.manifesto-headline {
    font-family: 'Syne', 'Avenir Next Heavy', sans-serif;
    font-size: 3.5rem;
    line-height: 0.95;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease 0.4s, transform 0.5s var(--transition-stiff) 0.4s;
}

.manifesto-block.grid-active .manifesto-headline {
    opacity: 1;
    transform: translateY(0);
}

/* Portrait Image Styles in Manifesto */
.manifesto-portrait-wrapper {
    width: 100%;
    height: 100%;
    border: 1px solid #000000;
    overflow: hidden;
    position: relative;
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease 0.4s, transform 0.6s var(--transition-stiff) 0.4s;
}

.manifesto-block.grid-active .manifesto-portrait-wrapper {
    opacity: 1;
    transform: scale(1);
}

.manifesto-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(1) contrast(1.4) brightness(0.9);
    transition: transform 1.2s var(--transition-stiff);
}

.manifesto-portrait-wrapper:hover .manifesto-portrait {
    transform: scale(1.05);
}

.manifesto-paragraph {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #222222;
    text-align: justify;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease 0.6s, transform 0.5s var(--transition-stiff) 0.6s;
}

.manifesto-block.grid-active .manifesto-paragraph {
    opacity: 1;
    transform: translateY(0);
}

/* --- BLOCK 3: Galería de Campañas (Scroll Snap de Producto) --- */
.campaign-item {
    height: 100vh;
    width: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 80px 4%;
    background-color: #FFFFFF;
    border-bottom: 1px solid #000000;
}

.campaign-item .image-wrapper {
    width: 55vw;
    height: 70vh;
    border: 1px solid #000000;
    overflow: hidden;
    position: relative;
}

.campaign-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: contrast(1.1) brightness(0.95);
    transform: scale(1.05);
    transition: transform 1.2s var(--transition-stiff);
}

.campaign-item.active img {
    transform: scale(1);
}

/* Technical side label details */
.tech-label {
    position: absolute;
    right: 5%;
    top: 50%;
    transform: translateY(-50%) translateX(50px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.6s var(--transition-stiff), opacity 0.6s ease;
}

.tech-label pre {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    background-color: #000000;
    color: #FFFFFF;
    padding: 24px 30px;
    border: 1px solid #000000;
    white-space: pre-wrap;
    box-shadow: 10px 10px 0px var(--accent-amber);
}

.campaign-item.active .tech-label {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

/* --- BLOCK 4: Conversión Ruda (Cierre) --- */
.conversion-block {
    background-color: var(--bg-galeria); /* Pure Black as per design guide */
    display: flex;
    align-items: center;
    justify-content: center;
}

.conversion-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.giant-monogram {
    position: absolute;
    font-family: 'Syne', sans-serif;
    font-size: 40vw;
    font-weight: 800;
    color: #0c0c0c; /* Enormous 50% screen grey monogram */
    letter-spacing: -0.07em;
    line-height: 1;
    z-index: 1;
    pointer-events: none;
    user-select: none;
    animation: monogram-pulsate 10s ease-in-out infinite alternate;
}

@keyframes monogram-pulsate {
    0% { transform: scale(1); }
    100% { transform: scale(1.05); }
}

.brutalist-button {
    position: relative;
    z-index: 5;
    background-color: var(--accent-amber);
    color: #000000;
    border: none;
    padding: 22px 45px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    border-radius: 0 !important; /* Brutalist - strictly rectangular */
    box-shadow: 0px 0px 30px rgba(247, 168, 16, 0.2);
    /* INSTANT switch on hover - transition: none */
    transition: none !important;
}

.brutalist-button:hover {
    background-color: #FFFFFF !important;
    color: #000000 !important;
    box-shadow: 0px 0px 40px rgba(255, 255, 255, 0.4);
}

/* ==========================================================================
   ÁMBAR COLLECTION VIEW (EXPERIMENTAL ART GALLERY)
   ========================================================================== */
.galeria-view {
    min-height: 100vh;
    width: 100vw;
    background-color: var(--bg-galeria);
    flex-direction: column;
    justify-content: flex-start;
    padding-top: 100px;
    padding-bottom: 50px;
    position: relative;
}

.galeria-intro {
    padding: 0 5%;
    margin-bottom: 40px;
    z-index: 5;
}

.galeria-title {
    font-family: 'Syne', sans-serif;
    font-size: 8vw;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--accent-amber);
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin-bottom: 20px;
    text-shadow: 0 0 30px rgba(75, 0, 130, 0.4);
}

.galeria-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    color: #888888;
    max-width: 600px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.scroll-indicator {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent-violet);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Horizontal track scroll setup */
.galeria-horizontal-scroll {
    width: 100%;
    overflow-x: auto;
    padding: 20px 5%;
    display: flex;
    align-items: center;
    cursor: grab;
    scroll-behavior: smooth;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.galeria-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.galeria-horizontal-scroll.active {
    cursor: grabbing;
    scroll-behavior: auto !important;
}

.galeria-horizontal-scroll.active * {
    pointer-events: none; /* Disable all hover states/mouse interactions during dragging for buttery fluid scroll performance */
}

.galeria-track {
    display: flex;
    gap: 60px;
    padding-right: 15vw; /* Breathing room at the end */
}

/* Art Item Container */
.art-item {
    flex-shrink: 0;
    width: 440px; /* Increased for premium high-fidelity display */
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.4s var(--transition-stiff);
}

.art-img-container {
    width: 100%;
    height: 600px; /* Increased for premium high-fidelity display */
    position: relative;
    overflow: hidden;
    border: 1px solid #1a1a1a;
}

.art-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(0.4) contrast(1.1) brightness(0.8);
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1), filter 0.8s ease;
    will-change: transform;
}

/* Soft Violet Ambient Glow behind images */
.art-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150%;
    height: 150%;
    transform: translate(-50%, -50%) scale(0.6);
    background: radial-gradient(circle, rgba(75, 0, 130, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.19, 1, 0.22, 1), transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.art-item:hover .art-glow {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.art-item:hover img {
    transform: scale(1.06);
    filter: grayscale(0) contrast(1.2) brightness(0.95);
    border-color: var(--accent-violet);
}

/* Metadata below the photo */
.art-meta {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.art-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--accent-amber);
    font-weight: 500;
}

.art-desc {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.15rem;
    font-style: italic;
    color: #cccccc;
    transition: color 0.3s ease;
}

.art-item:hover .art-desc {
    color: #ffffff;
}

/* ==========================================================================
   BRUTALIST CONTACT MODAL
   ========================================================================== */
.contact-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--transition-stiff);
}

.contact-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background-color: #FFFFFF;
    color: #000000;
    width: 90%;
    max-width: 600px;
    max-height: 90svh;
    overflow-y: auto;
    border: 2px solid #000000;
    padding: 50px 40px;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 15px 15px 0px var(--accent-amber);
}

.contact-modal.open .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: #000000;
    cursor: pointer;
    font-weight: 600;
}

.modal-close:hover {
    color: var(--accent-amber);
}

.modal-title {
    font-family: 'Syne', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: -0.04em;
}

.modal-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: #555555;
    margin-bottom: 30px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #000000;
}

.form-group input,
.form-group textarea {
    width: 100%;
    border: 1px solid #000000;
    padding: 12px 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    background-color: #FAFAFA;
    outline: none;
    border-radius: 0;
    transition: background-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    background-color: #FFFFFF;
    border: 2px solid #000000;
}

.form-submit-btn {
    background-color: #000000;
    color: #FFFFFF;
    border: none;
    padding: 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 0;
    transition: none !important; /* Instant swap on hover */
    margin-top: 10px;
}

.form-submit-btn:hover {
    background-color: var(--accent-amber);
    color: #000000;
}

.modal-footer-info {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eeeeee;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: #666666;
}

/* ==========================================================================
   ALBUM HINT (hover indicator over campaign images)
   ========================================================================== */
.campaign-item .image-wrapper {
    cursor: pointer;
}

.album-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
    color: #FFFFFF;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    padding: 36px 20px 18px;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s var(--transition-stiff), opacity 0.35s ease;
    pointer-events: none;
    z-index: 5;
}

.campaign-item .image-wrapper:hover .album-hint {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   ALBUM LIGHTBOX OVERLAY
   ========================================================================== */
.album-lightbox {
    position: fixed;
    inset: 0;
    background-color: rgba(4, 4, 4, 0.97);
    z-index: 3000;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s var(--transition-stiff);
}

.album-lightbox.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* --- Lightbox Header --- */
.lightbox-header {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 4%;
    border-bottom: 1px solid #1e1e1e;
    flex-shrink: 0;
    height: 56px;
}

.lightbox-project-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-amber);
    letter-spacing: 0.1em;
    flex-shrink: 0;
}

.lightbox-project-name {
    font-family: 'Syne', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #e0e0e0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-close {
    margin-left: auto;
    background: none;
    border: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: #555555;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s ease;
    padding: 4px 0;
}

.lightbox-close:hover {
    color: var(--accent-amber);
}

/* --- Lightbox Main Stage --- */
.lightbox-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    position: relative;
}

.lightbox-nav {
    background: none;
    border: none;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.95rem;
    font-weight: 600;
    color: #3a3a3a;
    cursor: pointer;
    padding: 0 3.5%;
    height: 100%;
    flex-shrink: 0;
    transition: color 0.2s ease;
    letter-spacing: 0.05em;
}

.lightbox-nav:hover {
    color: var(--accent-amber);
}

.lightbox-img-container {
    flex: 1;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 16px 0;
    position: relative;
}

/* Skeleton loader mientras carga la imagen (P1-01) */
.lightbox-img-container::after {
    content: '[ CARGANDO... ]';
    position: absolute;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.1em;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-img-container.loading::after {
    opacity: 1;
}

.lightbox-img-container.loading .lightbox-main-img {
    opacity: 0;
}

.lightbox-main-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}

/* --- Film Strip --- */
.filmstrip-wrapper {
    flex-shrink: 0;
    background-color: #080808;
    border-top: 1px solid #1a1a1a;
    display: flex;
    flex-direction: column;
}

/* Sprocket holes rail using repeating gradient */
.filmstrip-rail {
    height: 13px;
    flex-shrink: 0;
    background-color: #080808;
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 8px,
        rgba(255, 255, 255, 0.055) 8px,
        rgba(255, 255, 255, 0.055) 18px,
        transparent 18px,
        transparent 26px
    );
}

.filmstrip-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
    cursor: grab;
    padding: 7px 0;
}

.filmstrip-scroll::-webkit-scrollbar {
    display: none;
}

.filmstrip-scroll.dragging {
    cursor: grabbing;
    scroll-behavior: auto !important;
}

.filmstrip-scroll.dragging * {
    pointer-events: none;
}

.filmstrip-track {
    display: flex;
    gap: 3px;
    padding: 0 4%;
    min-width: max-content;
}

.filmstrip-frame {
    flex-shrink: 0;
    width: 68px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: pointer;
    opacity: 0.38;
    border: 1px solid transparent;
    transition: opacity 0.3s ease, border-color 0.3s ease;
}

.filmstrip-frame:hover {
    opacity: 0.7;
}

.filmstrip-frame.active {
    opacity: 1;
    border-color: var(--accent-amber);
}

.filmstrip-frame img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: grayscale(0.5);
    transition: filter 0.3s ease;
}

.filmstrip-frame.active img {
    filter: grayscale(0);
}

.frame-number {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.52rem;
    color: #444;
    text-align: center;
    font-weight: 500;
    line-height: 1;
    padding-bottom: 2px;
    transition: color 0.3s ease;
}

.filmstrip-frame.active .frame-number {
    color: var(--accent-amber);
}

/* --- Lightbox Footer --- */
.lightbox-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 4%;
    border-top: 1px solid #1a1a1a;
    flex-shrink: 0;
}

.lightbox-counter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-amber);
    letter-spacing: 0.06em;
}

.lightbox-specs {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: #444444;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ==========================================================================
   PERSISTENT BRUTALIST FOOTER
   ========================================================================== */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 4%;
    border-top: 1px solid var(--text);
    background-color: var(--bg);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    position: relative;
    z-index: 10;
    transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease;
}

body.portafolio .site-footer {
    border-top-color: #000000;
}

body.galeria .site-footer {
    border-top-color: #333333;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.footer-logo {
    font-family: 'Syne', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.03em;
}

.footer-copyright {
    color: #666666;
    font-size: 0.65rem;
}

.footer-right {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE — TABLET  (≤ 1024px)
   ========================================================================== */
@media (max-width: 1024px) {

    /* Hero */
    .hero-split          { flex-direction: column; }
    .hero-image-pane     { width: 100%; height: 52vh; border-right: none; border-bottom: 1px solid #000; }
    .hero-text-pane      { width: 100%; height: 48vh; padding-left: 5%; justify-content: flex-start; padding-top: 36px; }
    .hero-title          { position: relative; left: 0; font-size: 14vw; color: #000 !important; mix-blend-mode: normal; }

    /* Manifesto */
    .manifesto-grid      { grid-template-columns: 1fr; height: auto; gap: 24px; }
    .manifesto-grid::before,
    .manifesto-grid::after { display: none; }
    .manifesto-col       { padding: 12px 0; }
    .manifesto-col.col-2::before,
    .manifesto-col.col-3::before { display: none; }
    .manifesto-headline  { font-size: 2.5rem; }

    /* Campaign items */
    .campaign-item       { flex-direction: column; height: auto; padding: 100px 5% 50px; }
    .campaign-item .image-wrapper { width: 90vw; height: 58vh; }
    .tech-label          { position: relative; right: auto; top: auto; transform: none !important; opacity: 1 !important; pointer-events: auto; margin-top: 22px; width: 90vw; }
    .tech-label pre      { box-shadow: 6px 6px 0px var(--accent-amber); }

    /* Galería */
    .galeria-title       { font-size: 12vw; margin-bottom: 15px; }
    .art-item            { width: 280px; }
    .art-img-container   { height: 380px; }

    /* Lightbox */
    .lightbox-nav        { padding: 0 2%; font-size: 0.8rem; }
    .lightbox-project-name { font-size: 0.75rem; }
    .filmstrip-frame     { width: 54px; }
    .filmstrip-frame img { height: 72px; }
}

/* ==========================================================================
   RESPONSIVE — MOBILE  (≤ 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* --- Disable snap scroll: natural scroll is better on mobile --- */
    body.portafolio {
        scroll-snap-type: none;
        overflow-y: auto;
    }

    /* Sections: auto height, no clip, content-driven */
    .snap-section {
        height: auto;
        min-height: auto;
        overflow: visible;
        scroll-snap-align: none;
    }

    /* Hero keeps true full-screen feel */
    .hero-block {
        height: 100vh;
        height: 100svh;
        overflow: hidden;
    }

    /* --- Navbar --- */
    .navbar {
        height: 56px;
        padding: 0 5%;
    }

    .brand {
        display: none; /* Save space: brand is in the toggle active state */
    }

    .monogram-fixed {
        font-size: 1.25rem;
    }

    .mode-toggle-container {
        border-color: #000;
        flex-shrink: 0;
    }

    .toggle-btn {
        padding: 5px 8px;
        font-size: 0.58rem;
        letter-spacing: 0;
        white-space: nowrap;
    }

    /* --- Hero --- */
    .hero-image-pane {
        height: 55svh;
    }

    .hero-text-pane {
        height: 45svh;
        padding: 5% 5% 0;
        justify-content: flex-start;
    }

    .hero-title {
        font-size: 17vw;
        mix-blend-mode: normal !important;
        color: #000000 !important;
        line-height: 0.88;
        position: relative;
        left: 0;
    }

    .hero-support {
        bottom: 20px;
        right: 5%;
    }

    /* --- Manifesto --- */
    .manifesto-block {
        padding: 64px 6% 32px;
        align-items: flex-start;
        overflow: visible;
    }

    .manifesto-portrait-wrapper {
        height: 52vw;
        max-height: 260px;
    }

    .manifesto-headline {
        font-size: 2.2rem;
    }

    .manifesto-paragraph {
        font-size: 0.85rem;
    }

    /* --- Campaign items --- */
    .campaign-item {
        padding: 64px 5% 24px;
        gap: 0;
        height: auto;
        min-height: auto;
        justify-content: flex-start;
    }

    /* Conversion block necesita altura mínima — el monograma es absolute y no empuja el contenedor */
    .conversion-block {
        min-height: 60svh;
    }

    .conversion-content {
        min-height: 60svh;
    }

    .campaign-item .image-wrapper {
        width: 90vw;
        height: 52svh;
    }

    /* Album hint: always visible on mobile (no hover event) */
    .album-hint {
        transform: translateY(0);
        opacity: 1;
        font-size: 0.72rem;
        padding: 28px 16px 14px;
    }

    /* Tech label: tighter on mobile */
    .tech-label {
        margin-top: 18px;
        width: 90vw;
    }

    .tech-label pre {
        font-size: 0.72rem;
        padding: 16px 20px;
        line-height: 1.6;
    }

    /* --- Conversion block --- */
    .brutalist-button {
        padding: 18px 28px;
        font-size: 0.85rem;
        text-align: center;
        line-height: 1.4;
    }

    /* --- Galería Ámbar --- */
    .galeria-view {
        padding-top: 80px;
    }

    .galeria-title {
        font-size: 12vw;
        line-height: 1.0;
    }

    .art-item  { width: 240px; }
    .art-img-container { height: 320px; }

    /* --- Lightbox mobile --- */
    /* Swipe handles nav: hide text buttons, save image space */
    .lightbox-nav {
        display: none;
    }

    .lightbox-img-container {
        padding: 10px;
    }

    .lightbox-header {
        height: 48px;
        padding: 10px 5%;
        gap: 12px;
    }

    .lightbox-project-name {
        display: none;
    }

    .lightbox-footer {
        padding: 8px 5%;
    }

    /* Filmstrip slightly smaller on mobile */
    .filmstrip-frame     { width: 52px; }
    .filmstrip-frame img { height: 68px; }
    .filmstrip-rail      { height: 10px; }

    /* --- Footer --- */
    .site-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        padding: 40px 6%;
    }

    .footer-right {
        flex-direction: column;
        gap: 12px;
    }

    .footer-link {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 88vw;
    }

    /* --- Modal de contacto en mobile --- */
    .modal-content {
        padding: 40px 24px;
        width: 92%;
    }

    .modal-title {
        font-size: 1.8rem;
    }

    /* --- Safe area insets para dispositivos con notch (iPhone 14+) --- */
    .site-footer {
        padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    }

    .galeria-view {
        padding-top: calc(80px + env(safe-area-inset-top, 0px));
    }

    .contact-modal {
        padding-top: env(safe-area-inset-top, 0px);
    }
}

/* ==========================================================================
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
   ========================================================================== */
@media (max-width: 480px) {

    .toggle-btn {
        padding: 4px 6px;
        font-size: 0.52rem;
        letter-spacing: 0;
        white-space: nowrap;
    }

    .hero-title {
        font-size: 19vw;
    }

    .manifesto-headline {
        font-size: 1.9rem;
    }

    .campaign-item {
        padding: 60px 5% 20px;
    }

    .campaign-item .image-wrapper {
        height: 48svh;
    }

    .lightbox-specs {
        display: none;
    }

    .filmstrip-frame     { width: 52px; }
    .filmstrip-frame img { height: 66px; }

    .brutalist-button {
        font-size: 0.78rem;
        padding: 16px 20px;
        max-width: 88vw;
        word-break: break-word;
    }

    .galeria-title {
        font-size: 13vw;
        line-height: 1.0;
    }

    .art-item          { width: 200px; }
    .art-img-container { height: 270px; }
}

/* ==========================================================================
   TOUCH DEVICES — album hint always visible (no hover state)
   ========================================================================== */
@media (hover: none) {
    .album-hint {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ==========================================================================
   LIGHTBOX SWIPE HINT (visible solo en touch)
   ========================================================================== */
.lightbox-swipe-hint {
    display: none;
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.6rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.12em;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.6s ease;
    z-index: 5;
}

.lightbox-swipe-hint.fade-out {
    opacity: 0;
}

@media (hover: none) {
    .lightbox-swipe-hint {
        display: block;
    }
}


/* ==========================================================================
   FOCUS VISIBLE — accesibilidad para navegación por teclado (P1-03)
   ========================================================================== */
:focus-visible {
    outline: 2px solid var(--accent-amber);
    outline-offset: 3px;
}

.toggle-btn:focus-visible,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible,
.modal-close:focus-visible,
.brutalist-button:focus-visible,
.footer-link:focus-visible {
    outline: 2px solid var(--accent-amber);
    outline-offset: 3px;
}

.image-wrapper:focus-visible {
    outline: 2px solid var(--accent-amber);
    outline-offset: 4px;
}

/* Suprimir outline nativo en elementos que ya tienen estilos de hover claros */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible),
[role="button"]:focus:not(:focus-visible) {
    outline: none;
}
