/* ==========================================================================
   1. RESET & SYSTEM VARIABLES
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #000000;
    --card-bg: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --text-muted: #555555;
    --border-subtle: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --header-height: 80px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: all 0.2s ease;
}

html {
    /* SCROLL INSTANTÁNEO AL NAVEGAR O CERRAR PROYECTOS */
    scroll-behavior: auto !important;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
    line-height: 1.5;
    scrollbar-gutter: stable;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
    width: 100%;
    position: relative;
    padding: 24px 30px 0 30px;
}

/* PROTECTION RULES */
img, video {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    pointer-events: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

body:has(.project-view-page:target) {
    overflow: hidden !important;
}

/* ==========================================================================
   2. FIXED HEADER & NAVIGATION
   ========================================================================== */
.header-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: grid;
    grid-template-columns: 280px 320px 1fr 40px;
    gap: 30px;
    padding: 24px 30px;
    font-size: 13px;
    line-height: 1.4;
    z-index: 1000;
    background: transparent;
    pointer-events: none;
    transition: color 0.3s ease;
    -webkit-text-size-adjust: 100%;
    color: #ffffff;
}

.header-fixed .col {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.header-fixed .col-2 {
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

body:has(#about:target) .header-fixed .col-2 {
    opacity: 0 !important;
    visibility: hidden !important;
}

/* TEXTOS BASE DEL HEADER EN BLANCO PURO */
.txt-bold,
.txt-white {
    color: #ffffff !important;
    font-weight: 400;
    opacity: 1 !important;
}

.txt-bold {
    font-weight: 500;
}

/* INTERACCIÓN HOVER: DE BLANCO A GRIS PARA LUCIANO, EMAIL Y LN */
.home-link,
.link-white {
    display: inline-block;
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 400;
    transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.home-link:hover,
.link-white:hover {
    color: #888888 !important;
}

/* BOTÓN DE TOGGLE ABOUT Y CAMBIO A NEGRO EN VISTAS CLARAS */
.toggle-about-btn {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
    text-decoration: none;
    color: #ffffff;
    width: 26px;
    height: 26px;
    transition: opacity 0.35s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.toggle-about-btn:hover {
    opacity: 0.55 !important;
}

.toggle-icon-svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
    display: block;
}

.toggle-icon-svg .vert-bar {
    transition: opacity 0.25s ease;
    opacity: 1;
}

body:has(#about:target) .toggle-icon-svg .vert-bar {
    opacity: 0;
}

/* COLOR NEGRO CUANDO SE MUESTRAN VISTAS DE PROYECTO O ABOUT (FONDOS BLANCOS) */
body:has(.project-view-page:target) .header-fixed,
body:has(#about:target) .header-fixed {
    color: #000000 !important;
}

body:has(.project-view-page:target) .header-fixed .txt-bold,
body:has(.project-view-page:target) .header-fixed .txt-white,
body:has(#about:target) .header-fixed .txt-bold,
body:has(#about:target) .header-fixed .txt-white {
    color: #000000 !important;
}

body:has(.project-view-page:target) .header-fixed .home-link,
body:has(.project-view-page:target) .header-fixed .link-white,
body:has(#about:target) .header-fixed .home-link,
body:has(#about:target) .header-fixed .link-white {
    color: #000000 !important;
}

body:has(.project-view-page:target) .header-fixed .home-link:hover,
body:has(.project-view-page:target) .header-fixed .link-white:hover,
body:has(#about:target) .header-fixed .home-link:hover,
body:has(#about:target) .header-fixed .link-white:hover {
    color: #888888 !important;
}

body:has(.project-view-page:target) .header-fixed .toggle-about-btn,
body:has(#about:target) .header-fixed .toggle-about-btn {
    color: #000000 !important;
}

/* ==========================================================================
   3. PORTFOLIO MAIN LAYOUT (HERO & MOSAIC GRID)
   ========================================================================== */
.portfolio-layout {
    margin-top: 105px;
}

.hero-block {
    display: grid;
    grid-template-columns: 1fr 1.85fr;
    gap: 16px;
    margin-bottom: 50px;
    align-items: start;
}

.bio-container {
    grid-column: 1;
    padding-right: 20px;
}

.bio-container p {
    font-size: 22px !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    font-weight: 400 !important;
    letter-spacing: -0.01em !important;
}

.bio-container strong {
    color: #ffffff !important;
    font-weight: 500;
}

.about-hero-text {
    font-size: 22px !important;
    line-height: 1.2 !important;
    letter-spacing: -0.01em !important;
    color: #000000;
    font-weight: 400;
}

.about-hero-text strong {
    color: #000000 !important;
    font-weight: 500;
}

.reel-wrapper {
    grid-column: 2;
    width: 100%;
}

.reel-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* MOSAIC GRID SYSTEM */
.mosaic-tight-grid {
    display: grid;
    grid-template-columns: 1fr 1.85fr;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}

.mosaic-reversed {
    grid-template-columns: 1.85fr 1fr;
    margin-bottom: 60px;
}

.stack-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.project-card {
    display: flex;
    flex-direction: column;
    position: relative;
    width: 100%;
}

.title-container {
    margin-bottom: 12px;
    position: relative;
    z-index: 5;
}

.project-title {
    font-size: 13px;
    color: #ffffff !important;
    font-weight: 400;
    cursor: pointer;
    display: inline-block;
    letter-spacing: -0.01em;
}

.project-title a {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 400;
}

.project-title a:hover {
    opacity: 0.7;
}

.title-description {
    position: absolute;
    top: 28px;
    left: 0;
    width: 100%;
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.title-description p {
    font-size: 22px;
    line-height: 1.2;
    color: #ffffff;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.title-container:hover .title-description {
    opacity: 1;
    visibility: visible;
}

.project-card:has(.title-container:hover) .media-container {
    opacity: 0.05 !important;
    visibility: visible !important;
}

.media-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #111111;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.project-link {
    display: block;
    width: 100%;
    height: 100%;
}

.project-link img,
.project-link video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.4s ease;
}

.img-primary {
    position: relative;
    z-index: 1;
    opacity: 1;
}

.img-secondary {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
    opacity: 0;
}

.media-container:hover .img-primary {
    opacity: 0;
}

.media-container:hover .img-secondary {
    opacity: 1;
}

.lazy-video-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: #0d0d0d;
}

.lazy-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ==========================================================================
   4. FULLSCREEN OVERLAYS (PROJECT DETAILS & ABOUT PAGE)
   ========================================================================== */
.project-view-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff !important;
    color: #000000 !important;
    z-index: 900;
    display: none;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    padding: 130px 30px 0 30px;
}

.project-view-page:target {
    display: flex;
    flex-direction: column;
}

/* BOTÓN FLOTANTE GLASS "BACK" ESTÁTICO */
.close-project-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    color: #000000 !important;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(235, 235, 235, 0.75) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    padding: 10px 22px 10px 18px;
    border-radius: 50px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transform: none !important;
    transition: background 0.25s ease, opacity 0.25s ease;
}

.close-project-btn:hover {
    background: rgba(215, 215, 215, 0.9) !important;
    transform: none !important;
}

.project-detail-container {
    width: 100%;
}

.project-meta-row {
    display: grid;
    grid-template-columns: 280px 320px 1fr 40px;
    gap: 30px;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 50px;
    color: #000000;
}

.meta-title {
    color: inherit;
    font-weight: 500;
}

.meta-sub {
    color: inherit;
    font-weight: 400;
}

.meta-label {
    color: #666666 !important;
    display: block;
    margin-bottom: 4px;
}

.meta-value {
    color: inherit;
    font-weight: 400;
}

.project-description-hero {
    margin-bottom: 50px;
    max-width: 1100px;
}

.project-description-hero p {
    font-size: 32px;
    line-height: 1.22;
    letter-spacing: -0.02em;
    color: inherit;
    font-weight: 400;
}

.project-description-hero strong {
    font-weight: 500;
}

/* ==========================================================================
   5. GALLERIES & LAYOUT MOSAICS WITHIN PROJECTS
   ========================================================================== */
.project-gallery {
    width: 80%;
    margin: 0 auto;
}

.project-gallery img,
.project-gallery video,
.project-gallery .lazy-video-container {
    width: 100%;
    height: auto;
    margin-bottom: 30px;
    display: block;
    overflow: hidden;
}

.project-gallery .lazy-video-container video {
    margin-bottom: 0;
}

.gallery-vertical-mosaic,
.gallery-quad,
.gallery-triptych,
.gallery-diptych,
.gallery-grid-5,
.gallery-grid-4 {
    overflow: hidden !important;
    isolation: isolate;
    gap: 0 !important;
    margin: 0 auto 30px auto;
    width: 80%;
    max-width: 100%;
}

.gallery-vertical-mosaic { display: flex; flex-direction: column; }
.gallery-quad { display: grid; grid-template-columns: repeat(4, 1fr); }
.gallery-triptych { display: grid; grid-template-columns: repeat(3, 1fr); }
.gallery-diptych { display: grid; grid-template-columns: repeat(2, 1fr); }
.gallery-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch; }
.gallery-grid-5 { display: grid; grid-template-columns: repeat(6, 1fr); }

.gallery-vertical-mosaic img, .gallery-vertical-mosaic video, .gallery-vertical-mosaic .lazy-video-container,
.gallery-quad img, .gallery-quad video, .gallery-quad .lazy-video-container,
.gallery-triptych img, .gallery-triptych video, .gallery-triptych .lazy-video-container,
.gallery-diptych img, .gallery-diptych video, .gallery-diptych .lazy-video-container,
.gallery-grid-4 img, .gallery-grid-4 video, .gallery-grid-4 .lazy-video-container,
.gallery-grid-5 img, .gallery-grid-5 video, .gallery-grid-5 .lazy-video-container {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

.gallery-grid-5 img { grid-column: span 2; }
.gallery-grid-5 img.grid-span-bottom { grid-column: span 3; }

.gallery-grid-4 img.img-full-height {
    height: 100%;
    object-fit: cover;
}

.project-credits-block {
    width: 80%;
    margin: 50px auto 0 auto;
    font-size: 13px;
    line-height: 1.35;
    color: #888888;
    text-align: center;
}

.project-credits-block p {
    margin-bottom: 2px;
}

/* ==========================================================================
   6. ABOUT PAGE OVERLAY LAYOUT
   ========================================================================== */
#about {
    background-color: #ffffff;
    color: #000000;
}

.about-layout-grid {
    display: grid;
    grid-template-columns: 630px 280px 1fr;
    gap: 40px;
    align-items: start;
    width: 100%;
}

.about-col-left {
    padding-right: 20px;
}

.about-mobile-contact {
    display: none;
    margin-top: 25px;
    font-size: 13px;
    line-height: 1.6;
}

.about-col-mid {
    width: 100%;
}

.about-section-label {
    font-size: 13px;
    color: #000000;
    margin-bottom: 35px;
    font-weight: 400;
}

.exp-block {
    margin-bottom: 25px;
    font-size: 13px;
    line-height: 1.4;
}

.exp-title {
    font-size: 18px;
    font-weight: 500;
    color: #000000;
    margin-bottom: 4px;
}

.exp-sub {
    color: #000000;
    font-weight: 400;
}

.about-col-right {
    width: 100%;
    padding-left: 0px;
}

.clients-list {
    list-style: none;
    padding: 0;
    margin-top: 0;
}

.clients-list li {
    font-size: 22px;
    line-height: 1.25;
    color: #000000;
    font-weight: 400;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ==========================================================================
   7. FOOTER SYSTEM
   ========================================================================== */
.site-footer {
    text-align: center;
    padding-top: 60px;
    padding-bottom: 60px;
    font-size: 12px;
    line-height: 1.35;
    color: #2b2b2b;
}

.site-footer p {
    margin: 0;
}

.footer-line-1 {
    letter-spacing: -0.035em !important;
    display: inline-block;
    margin-bottom: 2px;
}

.footer-semibold {
    font-weight: 600 !important;
}

.footer-medium {
    font-weight: 500 !important;
}

.footer-line-2 {
    letter-spacing: -0.01em;
    display: inline-block;
    margin-bottom: 0 !important;
}

.about-footer,
.project-footer {
    color: #bfbfbf !important;
}

.about-footer {
    margin-top: auto;
    padding-top: 80px;
    padding-bottom: 60px;
}

.project-footer {
    margin-top: 50px;
    padding-bottom: 60px;
}

/* ==========================================================================
   8. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1100px) {
    .about-layout-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .about-col-left {
        grid-column: span 2;
        padding-right: 0;
    }
}

@media (max-width: 900px) {
    body {
        padding: 20px 20px 0 20px;
    }

    .header-fixed {
        position: fixed !important;
        top: 0;
        left: 0;
        width: 100%;
        padding: 20px;
        display: grid !important;
        grid-template-columns: 1fr 32px !important;
        gap: 12px;
        z-index: 1000;
        align-items: flex-start !important;
    }

    .header-fixed .col-1 {
        display: block !important;
    }

    .header-fixed .col-2,
    .header-fixed .col-3 {
        display: none !important;
    }

    .header-fixed .col-4 {
        display: block !important;
        pointer-events: auto;
    }

    .toggle-about-btn {
        width: 32px;
        height: 32px;
        align-items: flex-start;
        justify-content: flex-end;
    }

    .toggle-icon-svg {
        margin-top: -1px;
    }

    .portfolio-layout {
        margin-top: 80px;
    }

    .hero-block {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .bio-container {
        grid-column: 1;
    }

    .reel-wrapper {
        grid-column: 1;
    }

    .bio-container p {
        font-size: 18px !important;
        line-height: 1.25 !important;
        margin: 0;
    }

    .mosaic-tight-grid, .mosaic-reversed {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .project-view-page {
        padding: 100px 20px 0 20px;
    }

    .about-layout-grid {
        grid-template-columns: 1fr;
        gap: 30px;
        padding-left: 0;
        margin: 0;
    }

    .about-col-left {
        grid-column: span 1;
        padding-right: 0;
    }

    .about-hero-text {
        font-size: 18px !important;
        line-height: 1.25 !important;
        margin: 0;
    }

    .about-mobile-contact {
        display: block !important;
    }

    .about-col-mid,
    .about-col-right {
        padding-left: 0;
    }

    .clients-list {
        padding-left: 0;
    }

    .clients-list li {
        font-size: 18px;
        text-align: left;
    }

    .project-meta-row {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 30px;
    }

    .project-description-hero p {
        font-size: 20px;
    }

    .gallery-quad,
    .gallery-triptych,
    .gallery-diptych,
    .gallery-grid-5,
    .gallery-grid-4,
    .gallery-vertical-mosaic,
    .project-gallery,
    .project-credits-block {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .gallery-quad,
    .gallery-grid-4 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gallery-triptych {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gallery-triptych img:first-child,
    .gallery-triptych video:first-child,
    .gallery-triptych .lazy-video-container:first-child {
        grid-column: span 2 !important;
    }

    .gallery-grid-5 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .gallery-grid-5 img:first-child,
    .gallery-grid-5 video:first-child,
    .gallery-grid-5 .lazy-video-container:first-child {
        grid-column: span 2 !important;
    }

    .gallery-grid-5 img.grid-span-bottom,
    .gallery-grid-5 video.grid-span-bottom,
    .gallery-grid-5 .lazy-video-container.grid-span-bottom {
        grid-column: span 1 !important;
    }

    .gallery-diptych {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================================================
   9. REGLAS ADICIONALES (MOSAICO 2X2 & DIPTYCH INTERNO Y BROWSER BLOCKER)
   ========================================================================== */
.gallery-mosaic-2x2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 80% !important;
    max-width: 100% !important;
    margin: 0 auto 30px auto !important;
    overflow: hidden !important;
    isolation: isolate;
    gap: 0 !important;
}

.gallery-mosaic-2x2 img,
.gallery-mosaic-2x2 video,
.gallery-mosaic-2x2 .lazy-video-container {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    margin: 0 !important;
    object-fit: cover !important;
}

.gallery-mosaic-2x2 .grid-full-width {
    grid-column: span 2 !important;
}

/* DIPTYCH INTERNO PARA MOSAICOS VERTICALES SIN BORDES INTERMEDIOS */
.gallery-vertical-mosaic .diptych-inner {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
}

.gallery-vertical-mosaic .diptych-inner img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

@media (max-width: 900px) {
    .gallery-mosaic-2x2 {
        width: 100% !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .gallery-vertical-mosaic .diptych-inner {
        grid-template-columns: 1fr !important;
    }
}

/* BROWSER EXTENSION OVERLAY BLOCKER */
[class*="search-by-image"],
[class*="image-search"],
[id*="image-search"],
div[style*="camera"],
button[style*="camera"] {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
