/*
Theme Name: The Digital Gap
Theme URI: https://thedigitalgap.com
Author: The Digital Gap
Description: A minimal, high-end teaser page for AI-powered systems.
Version: 2.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-digital-gap
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700&display=swap');

html {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: inherit;
}

body {
    background-color: #020814;
    color: #e7e5e4;
    font-family: 'Inter', sans-serif;
    margin: 0;
    min-height: 100dvh;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    width: 100%;
    max-width: 100%;
    overscroll-behavior-x: none;
}

.bg-noise {
    position: fixed;
    inset: 0;
    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.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.012;
    pointer-events: none;
    z-index: 20;
}

.main-container {
    position: relative;
    min-height: 100dvh;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0));
    overflow-x: clip;
}

.background-image {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.background-image::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(30% 12% at 24% 79%, rgba(255, 184, 96, 0.38) 0%, rgba(0, 0, 0, 0) 70%),
        radial-gradient(26% 11% at 52% 82%, rgba(255, 174, 84, 0.34) 0%, rgba(0, 0, 0, 0) 72%),
        radial-gradient(22% 10% at 78% 81%, rgba(255, 162, 70, 0.3) 0%, rgba(0, 0, 0, 0) 74%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 2200 1200'%3E%3Cg opacity='0.92'%3E%3Cg fill='%23ffae4f'%3E%3Crect x='170' y='874' width='4' height='4'/%3E%3Crect x='242' y='896' width='4' height='4'/%3E%3Crect x='310' y='888' width='4' height='4'/%3E%3Crect x='384' y='916' width='4' height='4'/%3E%3Crect x='460' y='898' width='4' height='4'/%3E%3Crect x='540' y='928' width='4' height='4'/%3E%3Crect x='624' y='903' width='4' height='4'/%3E%3Crect x='710' y='934' width='4' height='4'/%3E%3Crect x='798' y='908' width='4' height='4'/%3E%3Crect x='890' y='940' width='4' height='4'/%3E%3Crect x='980' y='914' width='4' height='4'/%3E%3Crect x='1072' y='946' width='4' height='4'/%3E%3Crect x='1166' y='918' width='4' height='4'/%3E%3Crect x='1260' y='950' width='4' height='4'/%3E%3Crect x='1352' y='922' width='4' height='4'/%3E%3Crect x='1444' y='948' width='4' height='4'/%3E%3Crect x='1538' y='924' width='4' height='4'/%3E%3Crect x='1630' y='946' width='4' height='4'/%3E%3Crect x='1722' y='922' width='4' height='4'/%3E%3Crect x='1814' y='942' width='4' height='4'/%3E%3Crect x='1906' y='918' width='4' height='4'/%3E%3Crect x='1996' y='936' width='4' height='4'/%3E%3C/g%3E%3Cg fill='%23ffd9a7' opacity='0.94'%3E%3Crect x='286' y='950' width='3' height='3'/%3E%3Crect x='516' y='974' width='3' height='3'/%3E%3Crect x='756' y='983' width='3' height='3'/%3E%3Crect x='998' y='990' width='3' height='3'/%3E%3Crect x='1238' y='984' width='3' height='3'/%3E%3Crect x='1476' y='976' width='3' height='3'/%3E%3Crect x='1718' y='966' width='3' height='3'/%3E%3Crect x='1946' y='953' width='3' height='3'/%3E%3C/g%3E%3C/g%3E%3Cg fill='%23ffd8aa' opacity='0.56'%3E%3Crect x='540' y='906' width='28' height='7'/%3E%3Crect x='1008' y='924' width='34' height='8'/%3E%3Crect x='1448' y='918' width='26' height='7'/%3E%3Crect x='1810' y='910' width='22' height='6'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, cover, cover, cover;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: screen;
    opacity: 0.08;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.background-image::after {
    content: "";
    position: absolute;
    inset: 0;
    /* Un solo acento azul perla (evita “doble azul” por capas con matiz distinto) */
    background: radial-gradient(
        128% 96% at 50% 88%,
        rgba(198, 234, 255, 0.48) 0%,
        rgba(120, 198, 255, 0.3) 34%,
        rgba(52, 132, 220, 0.12) 52%,
        rgba(0, 0, 0, 0) 74%
    );
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: screen;
    opacity: 1;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.background-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 38%;
    filter: grayscale(52%) contrast(1.5) brightness(1.24) saturate(1.22) hue-rotate(-8deg);
    opacity: 0.7;
    transition: filter 0.4s ease, opacity 0.4s ease;
}

/* Softer top / mids reveal planet limb; darker footer band for type */
.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(2, 12, 28, 0.52) 0%,
        rgba(2, 10, 24, 0.64) 35%,
        rgba(1, 7, 18, 0.78) 70%,
        rgba(1, 4, 10, 0.88) 100%
    );
    z-index: 10;
    transition: background 0.4s ease;
}

.content {
    position: relative;
    z-index: 30;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 100%;
    padding: max(1.25rem, env(safe-area-inset-top, 0))
        clamp(1.25rem, 6vw, 2.5rem)
        clamp(1.5rem, 4vw, 2.5rem);
}

.brand-label {
    font-size: clamp(9px, 2.4vw, 10px);
    letter-spacing: 0.5em;
    text-transform: uppercase;
    color: #acabaa;
    font-weight: 300;
    margin-bottom: clamp(1.5rem, 5vw, 2.75rem);
    opacity: 0.6;
    width: 100%;
    max-width: min(42rem, 100%);
    margin-left: auto;
    margin-right: auto;
}

.hero-copy {
    width: 100%;
    max-width: min(52rem, 100%);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    /* Title + subtitle slightly lower in the viewport */
    transform: translateY(clamp(1.25rem, 5.5vh, 3.75rem));
}

.headline {
    font-size: clamp(2.35rem, 9.5vw, 5.75rem);
    font-weight: 200;
    letter-spacing: -0.045em;
    line-height: 1.06;
    color: #fafaf9;
    margin: 0 0 clamp(1rem, 3.5vw, 1.75rem);
    max-width: 100%;
    padding: 0 clamp(0.25rem, 2vw, 0.5rem);
    text-wrap: balance;
}

.subtext {
    font-size: clamp(14px, 3.8vw, 1.125rem);
    letter-spacing: 0.08em;
    color: #a8a6a3;
    font-weight: 300;
    opacity: 0.72;
    max-width: min(38rem, 100%);
    margin: 0 auto;
    margin-bottom: 0;
    line-height: 1.65;
    padding: 0 clamp(0.5rem, 3vw, 1rem);
    text-wrap: balance;
    transition: none;
    position: relative;
}

@supports selector(.main-container:has(.contact-btn:hover)) {
    @media (hover: hover) and (pointer: fine) and (not (prefers-reduced-motion: reduce)) {
        .main-container:has(.contact-btn:hover) .background-image::before,
        .main-container:has(.contact-btn:focus-visible) .background-image::before {
            opacity: 0.54;
        }

        .main-container:has(.contact-btn:hover) .background-image::after,
        .main-container:has(.contact-btn:focus-visible) .background-image::after {
            opacity: 0.24;
        }

        .main-container:has(.contact-btn:hover) .background-image img,
        .main-container:has(.contact-btn:focus-visible) .background-image img {
            filter: grayscale(68%) contrast(1.66) brightness(1.14) saturate(0.92);
            opacity: 0.66;
        }

        .main-container:has(.contact-btn:hover) .overlay,
        .main-container:has(.contact-btn:focus-visible) .overlay {
            background: linear-gradient(
                180deg,
                rgba(0, 0, 0, 0.42) 0%,
                rgba(0, 0, 0, 0.56) 35%,
                rgba(0, 0, 0, 0.72) 70%,
                rgba(0, 0, 0, 0.84) 100%
            );
        }
    }
}

/* CTA con separación equilibrada en desktop y móvil. */
.cta-wrap {
    width: 100%;
    max-width: min(52rem, 100%);
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: clamp(1.1rem, 3.5vw, 1.85rem);
    padding-top: clamp(1.25rem, 4.8vw, 2.5rem);
    padding-bottom: 0.4rem;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
    box-sizing: border-box;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 0.95rem clamp(1.35rem, 6vw, 2.85rem);
    min-height: 48px;
    max-width: min(22rem, calc(100vw - 2.5rem));
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-decoration: none;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: rgba(245, 245, 244, 0.88);
    transition: border-color 0.4s ease, background 0.4s ease, color 0.4s ease, box-shadow 0.4s ease;
}

.contact-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.22);
    color: #fafaf9;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.contact-btn:active {
    background: rgba(255, 255, 255, 0.06);
}

.contact-btn:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.45);
    outline-offset: 4px;
}

.departments {
    position: relative;
    z-index: 30;
    width: 100%;
    max-width: 68rem;
    padding: 0 clamp(1rem, 4vw, 3rem) clamp(0.75rem, 3vw, 1.25rem);
    margin-top: auto;
    flex-shrink: 0;
}

.dept-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: stretch;
    gap: clamp(0.75rem, 3vw, 2rem);
    border-top: 1px solid rgba(72, 72, 72, 0.12);
    padding-top: clamp(1.25rem, 3vw, 2rem);
}

.dept-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 auto;
    min-width: min(100%, 5.5rem);
    min-height: 52px;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.dept-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: opacity 0.32s ease, transform 0.32s ease, filter 0.32s ease;
}

.dept-id {
    font-size: 9px;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(206, 210, 216, 0.62);
}

.dept-name {
    font-size: 10px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-weight: 400;
    color: rgba(226, 230, 236, 0.88);
    margin: 0;
    text-shadow: 0 0 12px rgba(170, 194, 230, 0.1);
}

.dept-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: rgba(240, 238, 236, 0.95);
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.38);
    opacity: 0;
    transform: scale(0.35);
    transition: opacity 0.28s ease, transform 0.38s cubic-bezier(0.34, 1.45, 0.64, 1);
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .dept-item:hover .dept-name,
    .dept-item:focus-visible .dept-name {
        color: rgba(242, 246, 252, 0.96);
    }
}

@media (hover: hover) and (pointer: fine) and (not (prefers-reduced-motion: reduce)) {
    .dept-item:hover .dept-inner,
    .dept-item:focus-visible .dept-inner {
        opacity: 0;
        transform: scale(0.9);
        filter: blur(2px);
    }

    .dept-item:hover .dept-dot,
    .dept-item:focus-visible .dept-dot {
        opacity: 1;
        transform: scale(1);
    }
}

.dept-item:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 4px;
    border-radius: 9999px;
}

@media (prefers-reduced-motion: reduce) {
    .dept-inner,
    .dept-dot,
    .contact-btn,
    .subtext,
    .footer-links a {
        transition: none;
    }

    .subtext { animation: none; }
}

@media (max-width: 768px) {
    /* Mobile queda azul por defecto y no activa "night city lights" por hover. */
    .background-image::before {
        opacity: 0.1;
    }

    .background-image::after {
        opacity: 1;
    }

    .background-image img {
        filter: grayscale(54%) contrast(1.46) brightness(1.22) saturate(1.16) hue-rotate(-8deg);
        opacity: 0.7;
        object-position: center 42%;
    }

    .overlay {
        background: linear-gradient(
            180deg,
            rgba(2, 12, 28, 0.52) 0%,
            rgba(2, 10, 24, 0.64) 35%,
            rgba(1, 7, 18, 0.78) 70%,
            rgba(1, 4, 10, 0.88) 100%
        );
    }

    .headline {
        color: #ffffff;
    }

    .subtext {
        color: #c5c9cf;
        opacity: 0.9;
        text-shadow: 0 0 18px rgba(255, 255, 255, 0.08);
    }

    .dept-name {
        color: rgba(205, 209, 215, 0.88);
    }

    .dept-id {
        color: rgba(185, 190, 198, 0.62);
    }

    .footer-text,
    .footer-links a {
        color: rgba(205, 210, 218, 0.65);
    }
}

/* iOS/Safari touch: evita "desliz" por fondos fixed y micro overflow lateral */
@media (max-width: 1024px) and (hover: none) and (pointer: coarse) {
    .background-image {
        position: absolute;
    }

    .bg-noise {
        position: absolute;
    }

    .content,
    .hero-copy,
    .cta-wrap,
    .departments,
    .footer {
        width: 100%;
        max-width: 100%;
        overflow-x: clip;
    }

    .dept-grid {
        overflow-x: clip;
    }
}

.footer {
    position: relative;
    z-index: 30;
    width: 100%;
    max-width: 68rem;
    padding: clamp(0.75rem, 3vw, 1.25rem) clamp(1rem, 4vw, 3rem) max(0.75rem, env(safe-area-inset-bottom));
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    flex-shrink: 0;
}

.footer-text,
.footer-links a {
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(172, 171, 170, 0.35);
    text-decoration: none;
    margin: 0;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    justify-content: center;
}

.footer-links a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0 0.35rem;
    transition: color 0.35s ease, text-shadow 0.35s ease, opacity 0.35s ease;
}

.footer-links a:hover {
    color: #c4c2be;
    text-shadow:
        0 0 18px rgba(255, 255, 255, 0.12),
        0 0 36px rgba(255, 255, 255, 0.06);
}

.footer-links a:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.45);
    outline-offset: 3px;
    border-radius: 9999px;
}

@media (max-width: 540px) {
    .cta-wrap {
        margin-top: clamp(1.65rem, 8vw, 2.35rem);
        padding-top: clamp(2rem, 10vw, 3rem);
    }

    .footer {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .dept-grid {
        gap: 0.35rem 0.85rem;
    }
}
