/* =========================================
   BASE COMPARTIDA (todas las páginas)
   Variables, reset, intro, header, menú móvil y footer.
   ========================================= */

/* =========================================
   VARIABLES Y RESET
   ========================================= */
:host, html {
    text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

:root {
    /* Paleta Neutral */
    --color-neutral-50: oklch(98.5% 0 0);
    --color-neutral-100: oklch(96% 0 0);
    --color-neutral-200: #e6e6e6;
    --color-neutral-400: oklch(70% 0 0);

    /* Colores Visora: --nc-blue reemplaza al negro en todo el sitio */
    --nc-blue: #051821;
    --nc-blue-soft: color-mix(in srgb, var(--nc-blue) 80%, #ffffff); /* textos secundarios */
    /* Filtro que convierte imágenes (logos PNG de clientes) en el tono exacto de --nc-blue */
    --nc-blue-filter: brightness(0) saturate(100%) invert(8%) sepia(15%) saturate(3218%) hue-rotate(165deg) brightness(84%) contrast(97%);
    --nc-accent: var(--color-neutral-400);

    /* Tipografías */
    --font-sans: 'Outfit', Arial, sans-serif;
    --font-serif: 'Times New Roman', Times, serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #ffffff;
    color: var(--nc-blue);
    font-family: var(--font-sans);
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    color: var(--nc-blue);
}

/* =========================================
   CLASES DE UTILIDAD & ANIMACIÓN (GSAP)
   ========================================= */
.reveal-wrap {
    overflow: hidden;
    display: inline-block;
    vertical-align: top;
}

.reveal-text {
    display: inline-block;
    transform: translateY(100%);
}

.italic-serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.label-accent {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.1em;
    color: var(--nc-blue);
}

.intro-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 500;
    color: var(--nc-blue);
    line-height: 1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
}

.btn-dark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: var(--nc-blue);
    color: var(--color-neutral-50);
    padding: 10px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.btn-dark:hover {
    background-color: var(--nc-blue);
}

/* Filtros de proyectos (inicio y /proyectos/) */
.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 40px;
    position: relative;
    z-index: 10;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--nc-blue);
    color: var(--nc-blue);
    padding: 8px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--nc-blue);
    border-color: var(--nc-blue);
    color: var(--color-neutral-50);
}

/* Botón secundario (contorno) */
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 24px;
    border-radius: 30px;
    color: var(--nc-blue);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: inset 0 0 0 1px var(--nc-blue);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-outline:hover {
    background-color: var(--nc-blue);
    color: var(--color-neutral-50);
}

/* =========================================
   SCREEN SAVER (intro y transición entre páginas)
   ========================================= */
#screen-saver {
    position: fixed;
    top: 0;
    left: 0;
    /* 100vw incluye la zona de la barra de scroll: el centro (y el logo) no se mueve
       cuando main.js bloquea el scroll y la barra desaparece */
    width: 100vw;
    height: 100vh;
    background-color: var(--nc-blue);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

.screen-saver-logo {
    width: 200px;
    height: 57px;
    color: var(--color-neutral-50); /* logo claro sobre el fondo --nc-blue del screen saver */
    /* El fundido de entrada lo hace el CSS para que empiece en cuanto se pinta la página,
       sin esperar a que carguen GSAP y main.js (que luego lo desvanece y levanta el telón) */
    animation: screen-saver-logo-in 0.6s ease-out backwards;
}

@keyframes screen-saver-logo-in {
    from { opacity: 0; }
}

/* Los logos SVG toman el color del texto (color: ...) */
.screen-saver-logo,
.logo-text,
.logo-icon,
.logo-mobile {
    fill: currentColor;
}

/* =========================================
   ANIMACIÓN DE CORTINA (SCROLL REVEAL)
   ========================================= */
.curtain-reveal-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: block;
}

.curtain-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-neutral-100);
    z-index: 2;
    transform-origin: bottom;
}

.curtain-reveal-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    z-index: 1;
}

/* =========================================
   HEADER & NAV
   ========================================= */
header.nc-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    z-index: 100;
    background-color: #ffffff;
    padding: 0 5vw;
    border-bottom: var(--color-neutral-100) 1px solid;
    pointer-events: none;
    transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1),
                background-color 0.5s ease,
                box-shadow 0.5s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    pointer-events: auto;
}

.nav-left, .nav-right {
    display: flex;
    gap: 2rem;
    flex: 1;
}

.nav-left { justify-content: flex-start; }
.nav-right { justify-content: flex-end; }

nav a {
    color: var(--nc-blue);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    opacity: 1 !important;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.sup-number {
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 2px;
}

/* =========================================
   CONTENEDOR DE LOGOS
   ========================================= */
.logo-nav {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 130px;
    height: 35px;
    z-index: 10;
    transition: width 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.logo-text, .logo-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--nc-blue);
    cursor: pointer;
}

.logo-text {
    width: 130px;
    height: 37px;
    opacity: 1;
    margin-top: 0;
    pointer-events: auto;
}

/* Monograma VSR que reemplaza al logo completo al hacer scroll */
.logo-icon {
    width: 65px;
    height: 25px;
    opacity: 0;
    margin-top: 25px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) 0s;
}

.logo-mobile {
    display: none;
}

/* Estado al hacer scroll (escritorio) */
header.nc-header.is-scrolled {
    height: 50px;
}

header.nc-header.is-scrolled .logo-nav {
    width: 65px;
}

header.nc-header.is-scrolled .logo-text {
    opacity: 0 !important;
    margin-top: -20px;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1) 0s;
}

header.nc-header.is-scrolled .logo-icon {
    opacity: 1 !important;
    margin-top: 0;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1) 0.4s;
}

/* =========================================
   MENÚ MÓVIL DESPLEGABLE
   ========================================= */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--nc-blue);
    z-index: 90;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mobile-menu-content {
    padding-top: 130px;
    padding-left: 5vw;
    padding-right: 5vw;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.mobile-link {
    font-size: 40px;
    font-weight: 500;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-decoration: none;
    letter-spacing: -0.02em;
    display: block;
    opacity: 0;
    transform: translateY(20px);
}

.mobile-menu-footer {
    padding: 0 5vw 10vw 5vw;
    font-family: inherit;
    opacity: 0;
    transform: translateY(15px);
}

.mmf-top p {
    color: #ffffff;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.mmf-email {
    color: #ffffff;
    font-size: 13px;
    text-decoration: none;
    text-transform: uppercase;
    border-bottom: 1px solid #ffffff;
    padding-bottom: 4px;
    letter-spacing: 0.02em;
    display: inline-block;
}

.mmf-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.mmf-col p, .mmf-col a {
    font-size: 10px;
    margin: 6px 0;
    display: block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
}

.mmf-col.text-right {
    text-align: right;
}

.mmf-gray-text {
    color: rgba(255, 255, 255, 0.4);
}

.mmf-white-text {
    color: #ffffff;
    font-weight: 500;
}

/* =========================================
   BOTÓN HAMBURGUESA Y ANIMACIÓN A "X"
   ========================================= */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 150;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background-color: var(--nc-blue);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-btn.is-active .hamburger-line:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.hamburger-btn.is-active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.is-active .hamburger-line:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 992px) {
    header.nc-header {
        height: 60px;
        padding: 0 5vw;
    }

    header.nc-header.is-scrolled {
        height: 80px; /* En móvil no se encoge para no romper la estética de la X */
    }

    .nav-container {
        height: 100%;
    }

    .nav-links,
    .logo-nav {
        display: none !important;
    }

    .logo-mobile {
        display: block !important;
        height: 25px;
        width: 65px;
        color: var(--nc-blue);
    }

    .hamburger-btn {
        display: flex !important;
    }
}

/* =========================================
   FOOTER TIPOGRÁFICO (CTA + enlaces)
   ========================================= */
.typographic-links-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
    z-index: 4;
}

.typo-cta-top {
    background-color: var(--nc-blue);
    padding: 12vh 5vw 8vh 5vw;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.cta-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.title-bold {
    font-size: clamp(3.5rem, 8vw, 8rem);
    font-weight: 500;
    color: var(--color-neutral-100);
    line-height: 0.85;
    letter-spacing: -0.04em;
    margin: 0 0 2px 0;
}

.title-italic {
    font-size: clamp(3.5rem, 8vw, 8rem);
    font-weight: 400;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--nc-blue);
    background-color: var(--color-neutral-100);
    padding: 0.05em 0.15em 0.08em 0.15em;
    line-height: 0.95;
    letter-spacing: -0.02em;
}

.cta-get-in-touch {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-neutral-400);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-neutral-400);
    transition: color 0.3s ease, border-color 0.3s ease;
    margin-bottom: 5px;
}

.cta-get-in-touch .arrow-right {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.cta-get-in-touch:hover {
    color: #ffffff;
    border-color: #ffffff;
}

.cta-get-in-touch:hover .arrow-right { transform: translateX(8px); }

.typo-links-bottom {
    background-color: var(--nc-blue);
    padding: 10vh 5vw;
    display: flex;
    justify-content: flex-end;
}

/* Escritorio: 4 columnas de 2 enlaces */
.links-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, auto));
    gap: 12px 40px;
    margin-right: 5vw;
}

.link-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.typo-link {
    font-size: clamp(2rem, 2vw, 2.5rem);
    color: var(--color-neutral-50);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: inline-flex;
    align-items: flex-start;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ext-arrow {
    display: inline-flex;
    margin-left: 6px;
    margin-top: 8px;
}

.ext-arrow svg {
    width: 0.45em;
    height: auto;
    transition: transform 0.3s ease;
}

.typo-link:hover { opacity: 0.6; }
.typo-link:hover .ext-arrow svg { transform: translate(2px, -2px); }

/* =========================================
   FOOTER INFERIOR ("MADE BY" Y "BACK TO TOP")
   ========================================= */
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 5vw;
    background-color: var(--color-neutral-50);
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--color-neutral-400);
    font-weight: 500;
}

.legal-links {
    display: flex;
    gap: 20px;
}

.legal-links a {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-neutral-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

.legal-links a:hover,
.legal-links a[aria-current="page"] {
    color: var(--nc-blue);
}

.made-by-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.made-by-label {
    color: var(--color-neutral-400);
    font-weight: 500;
}

.made-by-mask {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    height: 1.2rem;
    overflow: hidden;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--nc-blue);
}

.guess-text, .visora-text {
    line-height: 1.2rem;
    white-space: nowrap;
}

.visora-text { color: var(--nc-blue); }

.back-to-top {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--nc-blue);
    cursor: pointer;
}

.arrow-mask {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    height: 1.2rem;
    overflow: hidden;
}

.arrow-out, .arrow-in {
    line-height: 1.2rem;
    font-size: 1.1rem;
}

.arrow-in { color: var(--nc-blue); }

@media (max-width: 992px) {
    .typo-cta-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 40px;
    }
    .typo-links-bottom {
        justify-content: flex-start;
    }
    /* Móvil y tablet: 2 columnas de 4 enlaces, llenadas de arriba abajo */
    .links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: repeat(3, auto);
        grid-auto-flow: column;
        gap: 30px 20px;
        margin-right: 0;
        width: 100%;
    }
    .link-col {
        display: contents;
    }
}

@media (max-width: 600px) {
    .typo-cta-top {
        padding: 8vh 5vw 6vh 5vw;
    }
    .title-bold, .title-italic {
        font-size: 11vw;
        line-height: 1;
    }
    .links-grid {
        gap: 25px 10px;
    }
    .typo-link {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }
    .footer-bottom {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}
