/**
 * Estilos Premium para la Landing de Tecnologías - StudioMix
 * Custom CSS para diseño responsivo con rejilla 5x (Desktop) y 2x (Móvil).
 */

.tecnologias-page {
    background: #080808;
    color: #ffffff;
    font-family: 'Raleway', sans-serif;
    /* NO overflow-x: hidden aqui — mata position:sticky en los hijos.
       Usamos overflow: clip en body/html solo cuando se necesite. */
}

/* Forzar que el contenedor principal empiece desde el borde superior de la pantalla.
   NOTA: overflow:hidden/auto en parents rompe position:sticky.
   El override de html/body se inyecta inline via wp_head (functions.php).
   WP genera la body class: page-template-page-tecnologias-php (con el -php al final) */
body.page-template-page-tecnologias-php .site-main,
body.page-template-page-tecnologias .site-main,
.site-main.tecnologias-page {
    margin-top: 0 !important;
    overflow: visible !important;
}


/* ==========================================================================
   Hero Section
   ========================================================================== */
.tech-hero {
    height: 100vh;
    min-height: 650px;
    position: sticky;
    top: 0;
    z-index: 1;
    overflow: hidden;
    display: flex;
    align-items: center;                        /* Centra verticalmente el contenido del Hero */
    justify-content: center;                    /* Centra horizontalmente */
    background: #020202;
}

.tech-hero__bg-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
}

.tech-hero__bg {
    position: absolute;
    inset: -10%; /* Extra margin for smooth parallax movement */
    background-image: linear-gradient(180deg, rgba(0,0,0,0.4) 0%, rgba(8,8,8,0.95) 100%), var(--tech-hero-image, url('../img/hero-tech-fallback.jpg'));
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.tech-hero:after {
    content: "";
    position: absolute;
    inset: -50%;
    background: linear-gradient(108deg, transparent 35%, rgba(159, 123, 78, 0.25) 35.2%, transparent 35.8%),
                linear-gradient(8deg, transparent 50%, rgba(239, 78, 118, 0.2) 50.2%, transparent 51%);
    filter: blur(15px);
    animation: techLight 12s ease-in-out infinite alternate;
    z-index: 2;
    pointer-events: none;
}

.tech-hero__texture {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,8,8,0) 50%, #080808 100%),
                repeating-linear-gradient(160deg, transparent 0 80px, rgba(255,255,255,0.02) 81px 82px);
    z-index: 3;
    pointer-events: none;
}

.tech-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

.tech-hero__orb--one {
    width: 45vw;
    height: 45vw;
    right: -10vw;
    top: 5%;
    background: #5c3554;
}

.tech-hero__orb--two {
    width: 35vw;
    height: 35vw;
    left: -5vw;
    bottom: -10%;
    background: #254261;
}

.tech-hero__content {
    position: relative;
    z-index: 4;
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 24px;
    text-align: left;                          /* Título del Hero alineado a la izquierda */
    color: #ffffff;
}

.tech-hero__eyebrow {
    font-size: 12px;
    letter-spacing: 0.3em;
    font-weight: 700;
    color: var(--brand-accent, #9f7b4e);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.tech-hero__title {
    max-width: 1050px;
    margin: 0;
    font-size: clamp(52px, 7.5vw, 110px);      /* Tamaño más grande para desktop */
    line-height: 0.94;
    letter-spacing: -0.04em;
    font-weight: 300;
    color: var(--tech-hero-text-color, #ffffff);
}

.tech-hero__title span:first-child {
    font-weight: 850;
    display: block;
}

.tech-hero__cursor {
    display: inline-block;
    height: 0.8em;
    width: 3px;
    background: var(--brand-accent, #9f7b4e);
    margin-left: 6px;
    vertical-align: middle;
    animation: techblink 0.9s infinite;
}

.tech-hero__scroll {
    position: absolute;
    right: 24px;
    bottom: 0;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tech-hero__scroll i {
    width: 1px;
    height: 35px;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    display: block;
}

/* ==========================================================================
   Scroll Stacking: Driver + 3 Capas
   ========================================================================== */

/**
 * Driver: contenedor alto que le da espacio al usuario para scrollear.
 * Las 3 capas dentro son sticky, por lo que permanecen fijas mientras el driver "consume" el scroll.
 */
.tech-brand-driver {
    position: relative;
    height: 320vh;          /* Espacio holgado: Capa 1 → Capa 2 → Capa 3 centrada con tiempo de lectura (dwell) → Siguiente marca */
}

/**
 * Capa base: todos los layers comparten estos valores.
 * z-index viene inline desde PHP para garantizar el orden correcto entre marcas.
 */
.tech-layer {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ---- Capa 1: Imagen (Única tarjeta principal con bordes redondeados y sombra sutil) ---- */
.tech-layer--image {
    background: #0a0a0a;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.45);   /* Sombra tenue, sutil y menos prolongada */
    border-top: 1px solid rgba(255, 255, 255, 0.12); /* Borde sutil superior */
}

.tech-layer__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
    transform-origin: center center;
    border-radius: 24px 24px 0 0;
}

/* ---- Capa 2: Overlay de Color (Sigue los bordes redondeados pero SIN sombra extra) ---- */
.tech-layer--overlay {
    background: var(--overlay-color, #9f7b4e);
    opacity: 0;             /* GSAP lo animará de 0 → 0.9 */
    pointer-events: none;
    border-radius: 24px 24px 0 0;
}

/* ---- Capa 3: Información (Contenido perfectamente centrado) ---- */
.tech-layer--info {
    background: transparent;   /* Transparente para mostrar las capas de abajo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;         /* Ajuste fino para centrado perfecto arriba del borde inferior */
    pointer-events: none;       /* Activa con GSAP al aparecer */
}

.tech-layer__info-inner {
    width: min(1240px, calc(100% - 48px));
    padding: 0 24px;
    text-align: center;
    margin: 0 auto;
    will-change: transform;
    pointer-events: auto;
}

.tech-layer__kicker {
    font-size: 11px;
    letter-spacing: 0.28em;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.tech-layer__brand-title {
    font-size: clamp(26px, 3.8vw, 52px);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #ffffff;
    margin: 0 0 36px;
    text-transform: uppercase;
    text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}

.tech-layer__brand-title span {
    font-weight: 850;
    z-index: 2;
    pointer-events: none;
}

.tech-hero__texture {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8,8,8,0) 50%, #080808 100%),
                repeating-linear-gradient(160deg, transparent 0 80px, rgba(255,255,255,0.02) 81px 82px);
    z-index: 3;
    pointer-events: none;
}

.tech-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    z-index: 2;
    pointer-events: none;
}

.tech-hero__orb--one {
    width: 45vw;
    height: 45vw;
    right: -10vw;
    top: 5%;
    background: #5c3554;
}

.tech-hero__orb--two {
    width: 35vw;
    height: 35vw;
    left: -5vw;
    bottom: -10%;
    background: #254261;
}

.tech-hero__content {
    position: relative;
    z-index: 4;
    width: min(1200px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 24px;
    text-align: left;                          /* Título del Hero alineado a la izquierda */
    color: #ffffff;
}

.tech-hero__eyebrow {
    font-size: 12px;
    letter-spacing: 0.3em;
    font-weight: 700;
    color: var(--brand-accent, #9f7b4e);
    text-transform: uppercase;
    margin-bottom: 12px;
}

.tech-hero__title {
    max-width: 1050px;
    margin: 0;
    font-size: clamp(52px, 7.5vw, 110px);      /* Tamaño más grande para desktop */
    line-height: 0.94;
    letter-spacing: -0.04em;
    font-weight: 300;
    color: var(--tech-hero-text-color, #ffffff);
}

.tech-hero__title span:first-child {
    font-weight: 850;
    display: block;
}

.tech-hero__cursor {
    display: inline-block;
    height: 0.8em;
    width: 3px;
    background: var(--brand-accent, #9f7b4e);
    margin-left: 6px;
    vertical-align: middle;
    animation: techblink 0.9s infinite;
}

.tech-hero__scroll {
    position: absolute;
    right: 24px;
    bottom: 0;
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.6);
    writing-mode: vertical-rl;
    display: flex;
    align-items: center;
    gap: 12px;
}

.tech-hero__scroll i {
    width: 1px;
    height: 35px;
    background: linear-gradient(180deg, rgba(255,255,255,0.8), transparent);
    display: block;
}

/* ==========================================================================
   Scroll Stacking: Driver + 3 Capas
   ========================================================================== */

/**
 * Driver: contenedor alto que le da espacio al usuario para scrollear.
 * Las 3 capas dentro son sticky, por lo que permanecen fijas mientras el driver "consume" el scroll.
 */
.tech-brand-driver {
    position: relative;
    height: 320vh;          /* Espacio holgado: Capa 1 → Capa 2 → Capa 3 centrada con tiempo de lectura (dwell) → Siguiente marca */
}

/**
 * Capa base: todos los layers comparten estos valores.
 * z-index viene inline desde PHP para garantizar el orden correcto entre marcas.
 */
.tech-layer {
    position: sticky;
    top: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ---- Capa 1: Imagen (Única tarjeta principal con bordes redondeados y sombra sutil) ---- */
.tech-layer--image {
    background: #0a0a0a;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.45);   /* Sombra tenue, sutil y menos prolongada */
    border-top: 1px solid rgba(255, 255, 255, 0.12); /* Borde sutil superior */
}

.tech-layer__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
    transform-origin: center center;
    border-radius: 24px 24px 0 0;
}

/* ---- Capa 2: Overlay de Color (Sigue los bordes redondeados pero SIN sombra extra) ---- */
.tech-layer--overlay {
    background: var(--overlay-color, #9f7b4e);
    opacity: 0;             /* GSAP lo animará de 0 → 0.9 */
    pointer-events: none;
    border-radius: 24px 24px 0 0;
}

/* ---- Capa 3: Información (Contenido perfectamente centrado) ---- */
.tech-layer--info {
    background: transparent;   /* Transparente para mostrar las capas de abajo */
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 20px;         /* Ajuste fino para centrado perfecto arriba del borde inferior */
    pointer-events: none;       /* Activa con GSAP al aparecer */
}

.tech-layer__info-inner {
    width: min(1240px, calc(100% - 48px));
    padding: 0 24px;
    text-align: center;
    margin: 0 auto;
    will-change: transform;
    pointer-events: auto;
}

.tech-layer__kicker {
    font-size: 11px;
    letter-spacing: 0.28em;
    font-weight: 700;
    color: rgba(255,255,255,0.75);
    text-transform: uppercase;
    margin-bottom: 10px;
}

.tech-layer__brand-title {
    font-size: clamp(26px, 3.8vw, 52px);
    font-weight: 300;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: #ffffff;
    margin: 0 0 36px;
    text-transform: uppercase;
    text-shadow: 0 2px 24px rgba(0,0,0,0.6);
}

.tech-layer__brand-title span {
    font-weight: 850;
    display: block;
}

/* ==========================================================================
   Grid de Tecnologías (dentro de la Capa 3)
   ========================================================================== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    text-align: center;
}

.tech-card {
    min-height: 220px;
    position: relative;
    padding: 20px;
    background: rgba(10,10,10,0.78);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.25,1,0.5,1), border-color 0.4s ease, box-shadow 0.4s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.06);
}

.tech-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 60%, rgba(255,255,255,0.08) 100%);
    opacity: 0.5;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.tech-card::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: rgba(255,255,255,0.9);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s cubic-bezier(0.25,1,0.5,1);
    pointer-events: none;
}

.tech-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,0.25);
    box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
}

.tech-card:hover::after  { transform: scaleX(1); }
.tech-card:hover::before { opacity: 1; }

.tech-card > * { position: relative; z-index: 2; }

.tech-card__icon {
    min-height: 72px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tech-card__icon span {
    width: 8px;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    display: block;
    transition: transform 0.3s ease;
}

.tech-card__icon span:nth-child(1) { height: 32px; }
.tech-card__icon span:nth-child(2) { height: 60px; }
.tech-card__icon span:nth-child(3) { height: 42px; }

.tech-card:hover .tech-card__icon span:nth-child(1) { transform: scaleY(1.3); }
.tech-card:hover .tech-card__icon span:nth-child(2) { transform: scaleY(0.7); }
.tech-card:hover .tech-card__icon span:nth-child(3) { transform: scaleY(1.2); }

.tech-card__icon-img {
    max-height: 76px;
    max-width: 128px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.6));
    transition: transform 0.3s ease;
}

.tech-card:hover .tech-card__icon-img { transform: scale(1.12); }

.tech-card__title {
    font-size: 12px;
    letter-spacing: 0.07em;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.25;
    color: #ffffff;
    text-transform: uppercase;
}

.tech-card__desc {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: rgba(255,255,255,0.72);
    font-weight: 400;
}

@keyframes techblink { 50% { opacity: 0; } }
@keyframes techLight { 0% { transform: rotate(0deg) scale(1); } 100% { transform: rotate(8deg) scale(1.1); } }

@media (max-width: 1100px) {
    .tech-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .tech-layer__brand-title { font-size: clamp(22px, 3.5vw, 40px); margin-bottom: 24px; }
    .tech-card { min-height: 200px; padding: 18px; }
}

@media (max-width: 768px) {
    /* Hero en mobile */
    .tech-hero {
        height: 100svh;
        min-height: 520px;
    }

    .tech-hero__content {
        width: calc(100% - 36px);
        text-align: left;
    }

    .tech-hero__title {
        font-size: clamp(32px, 8vw, 48px);
    }

    .tech-hero__scroll {
        display: none;
    }

    /* Usar Banner Vertical en Mobile si se asignó en metaboxes */
    .tech-layer--image[style*="--layer-bg-mobile"] .tech-layer__bg {
        background-image: var(--layer-bg-mobile) !important;
    }

    /* Layers: Evitar desbordes y recortes arriba/abajo en marcas con >6 tecnologías */
    .tech-layer {
        height: 100svh;
    }

    .tech-layer--info {
        align-items: flex-start;               /* Alinea al inicio superior en móvil */
        padding-top: max(70px, 9vh);           /* Deja espacio libre para el header */
        overflow-y: auto;                      /* Scroll vertical seguro */
        -webkit-overflow-scrolling: touch;
    }

    .tech-layer__info-inner {
        padding: 0 16px 40px;
        max-height: calc(100svh - 80px);
        overflow-y: auto;                      /* Permite ver todas las tarjetas sin cortar títulos */
        scrollbar-width: none;                 /* Ocultar barra de scroll estándar */
        -webkit-overflow-scrolling: touch;
    }

    .tech-layer__info-inner::-webkit-scrollbar {
        display: none;
    }

    .tech-layer__kicker {
        font-size: 10px;
        margin-bottom: 4px;
    }

    .tech-layer__brand-title {
        font-size: clamp(18px, 5.5vw, 26px);
        margin-bottom: 16px;
    }

    /* Grid móvil */
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .tech-card {
        min-height: 150px;
        padding: 12px 10px;
    }

    .tech-card__icon {
        min-height: 50px;
        margin-bottom: 10px;
    }

    .tech-card__icon span:nth-child(1) { height: 22px; width: 6px; }
    .tech-card__icon span:nth-child(2) { height: 40px; width: 6px; }
    .tech-card__icon span:nth-child(3) { height: 28px; width: 6px; }

    .tech-card__icon-img {
        max-height: 50px;
        max-width: 90px;
    }

    .tech-card__title {
        font-size: 11px;
    }

    .tech-card__desc {
        font-size: 10px;
    }
}
