@import url("https://fonts.googleapis.com/css2?family=Google+Sans+Flex:wght@400..700&family=Space+Grotesk:wght@300;400;500;700&display=swap");

/* =========================================
           1. RESET Y VARIABLES GLOBALES
           ========================================= */
:root {
    --header-height: 10vh;
    --card-width: 98%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Google Sans Flex", system-ui, -apple-system, sans-serif;
}

body {
    background-color: #0b0b0b;
    color: #fff;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
    /* Animación de scroll nativa */
}

/* =========================================
   CURSOR PERSONALIZADO (DOM)
   ========================================= */
/* 1. Ocultamos el cursor del sistema en toda la página */
body,
a,
button,
.btn,
.card-logo {
    cursor: none !important;
}

/* 2. Estilos de nuestro nuevo cursor */
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 25px;
    height: 25px;
    pointer-events: none;
    /* FUNDAMENTAL: Evita que el cursor bloquee los clics */
    z-index: 99999;
    /* Siempre por encima de todo */

    /* Centramos el elemento exactamente en la punta del ratón */
    transform: translate3d(-50%, -50%, 0);

    /* Transición suave para las micro-interacciones (hover) */
    transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
    will-change: transform;
    /* Optimización de rendimiento a 60fps */
}

#custom-cursor img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 3. Micro-interacción: Cuando pasa sobre un botón o enlace */
#custom-cursor.is-hovering {
    width: 18px;
    /* Se encoge sutilmente (o puedes hacerlo crecer) */
    height: 18px;
    opacity: 0.8;
}


/* =========================================
           2. CABECERA (Header)
           ========================================= */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
    z-index: 1000;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}


header.scrolled {
    background-color: rgba(11, 11, 11, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: 1px;
    transition: opacity 0.2s ease;
}

.logo:hover {
    opacity: 0.8;
}

.header-logo-img {
    height: 35px;
    width: auto;
    object-fit: contain;
}

nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px;
    font-weight: 500;
}

/* =========================================
           3. SECCIÓN HERO
           ========================================= */
.hero {
    position: relative;
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translateX(-50%) translateY(-50%);
    z-index: 1;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(11, 11, 11, 1));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ESTILO DEL LOGO PRINCIPAL */
.hero-main-logo {
    width: 100%;
    max-width: 1000px;
    /* Tamaño ideal para escritorio */
    height: auto;
    margin-bottom: 36rem;
    /* Sombra sutil para que no se pierda si el video tiene partes blancas */
    filter: drop-shadow(0px 4px 15px rgba(0, 0, 0, 0.5));
}

/* ESTILO DE LA FRASE EN DOS RENGLONES */
.hero-phrase {
    font-size: clamp(1.5rem, 4vw, 4rem);
    /* Responsive fluido */
    font-weight: 800;
    line-height: 1.1;
    /* Texto más junto y premium */
    margin-bottom: 20px;
    letter-spacing: -1px;
    /* Toque editorial moderno */
    text-align: center;
}

/* ESTILO DE LA PALABRA DEGRADADA */
.text-gradient {
    /* Cambia estos colores por los de tu marca (Ejemplo: Azul a Violeta) */
    background: linear-gradient(115deg, #ffd740 0%, #f9ae00 34%, #ec6907 64%, #ab2814 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}


.hero-content p {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    opacity: 0.7;
    margin-top: 10px;
}

/* =========================================
           4. SECCIÓN DE TARJETAS (Stacking Cards)
           ========================================= */
.cards-container {
    padding-bottom: 40vh;
    margin-top: 5vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.card {
    position: sticky;
    width: var(--card-width);
    height: 80vh;
    border-radius: 40px;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    transform-origin: top center;
    background-color: transparent;
}

.card:nth-child(even) {
    flex-direction: row-reverse;
}

.card:nth-child(1) {
    top: calc(var(--header-height) + 2vh);
}

.card:nth-child(2) {
    top: calc(var(--header-height) + 5vh);
}

.card:nth-child(3) {
    top: calc(var(--header-height) + 8vh);
}

/* =========================================
           5. INTERIOR DE LA TARJETA
           ========================================= */
.card-left {
    position: relative;
    width: 50%;
    height: 100%;
    background-color: #000;
}

.card-left video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 35%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), transparent);
    z-index: 2;
}

.card-right {
    position: relative;
    /* FUNDAMENTAL: Para que el logo se posicione absoluto respecto al área derecha */
    width: 50%;
    padding: 5% 8%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.card-logo {
    position: absolute;
    top: 8%;
    right: 8%;
    width: 25%;
    max-width: 120px;
    object-fit: contain;
    z-index: 3;
    filter: drop-shadow(0px 0px 8px rgba(255, 255, 255, 0.85)) drop-shadow(0px 0px 25px rgba(255, 255, 255, 0.5));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
    cursor: pointer;
}

.card-logo:hover {
    transform: scale(1.08);
    filter: drop-shadow(0px 0px 12px rgba(255, 255, 255, 1)) drop-shadow(0px 0px 35px rgba(255, 255, 255, 0.7));
}

.card:nth-child(odd) .card-logo {
    right: 8%;
    object-position: right;
}

.card:nth-child(even) .card-logo {
    right: 8%;
    object-position: right;
}

.card-right {
    width: 50%;
    padding: 5% 8%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.card-right h2 {
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    margin-bottom: 20px;
    font-weight: 800;
    line-height: 1.1;
    background: var(--title-grad, linear-gradient(90deg, #111, #555));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    padding-bottom: 5px;
}

.card-right p {
    font-size: clamp(1.1rem, 1.5vw, 1.3rem);
    line-height: 1.6;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* MAGIA UX: Botón que hereda el degradado del contenedor padre */
.btn {
    display: inline-block;
    padding: 16px 32px;
    /* Se alimenta directamente de la misma variable del título */
    background: var(--title-grad, #1a1a1a);
    color: #fff !important;
    /* Texto blanco en negrita para asegurar legibilidad */
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    /* Añadimos 'filter' a las transiciones para el efecto de brillo al hacer hover */
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    /* En lugar de cambiar a un color sólido, aumentamos el brillo del degradado */
    filter: brightness(1.2);
}

/* (Se eliminaron las reglas estáticas .card:nth-child(1) .btn para que fluya de forma dinámica) */

/* =========================================
           6. RESPONSIVE (Móvil)
           ========================================= */

/* =========================================
           7. SECCIÓN DE CONTACTO
           ========================================= */
.contact-section {
    width: 100%;
    padding: 10vh 5%;
    display: flex;
    justify-content: center;
    align-items: center;

    scroll-margin-top: var(--header-height);
}

.contact-card {
    width: 100%;
    max-width: 600px;
    background: rgba(25, 25, 25, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.contact-card h2 {
    font-size: clamp(2rem, 3vw, 2.5rem);
    margin-bottom: 10px;
    text-align: center;
}

.contact-subtitle {
    text-align: center;
    opacity: 0.7;
    margin-bottom: 40px;
    font-size: 1.1rem;
}

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

/* Magia UX: Floating Labels */
.input-group {
    position: relative;
    width: 100%;
}

.input-group input,
.input-group textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.input-group textarea {
    resize: vertical;
    min-height: 120px;
}

.input-group label {
    position: absolute;
    left: 16px;
    top: 16px;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: 0.2s ease all;
    background: transparent;
}

/* Cuando el input tiene el foco o tiene texto escrito, el label flota */
.input-group input:focus,
.input-group textarea:focus {
    border-color: #ffd740;
    /* Amarillo brillante al escribir */
    box-shadow: 0 0 0 4px rgba(255, 214, 64, 0.1);
}

.input-group input:focus~label,
.input-group input:not(:placeholder-shown)~label,
.input-group textarea:focus~label,
.input-group textarea:not(:placeholder-shown)~label {
    top: -10px;
    left: 12px;
    font-size: 0.85rem;
    background: #151515;
    /* Simula fondo para cortar la línea del borde */
    padding: 0 5px;
    color: #ffd740;
}

.contact-btn {
    width: 100%;
    text-align: center;
    cursor: pointer;
    margin-top: 10px;
    background: linear-gradient(115deg, #ffd740 0%, #f9ae00 34%, #ec6907 64%, #ab2814 100%);
}

/* Estado deshabilitado (Cargando) */
.contact-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Mensajes de feedback */
.form-status {
    text-align: center;
    font-weight: 500;
    margin-top: 15px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-status.success {
    color: #4ade80;
    /* Verde éxito */
    opacity: 1;
}

.form-status.error {
    color: #ef4444;
    /* Rojo error */
    opacity: 1;
}

@media (max-width: 768px) {
    :root {
        --header-height: 8vh;
    }

    nav {
        display: flex;
        align-items: center;
    }

    .header-logo-img {
        height: 28px;
    }

    /* 2. Magia UX: Convertimos el enlace de Contacto en un Botón Call-to-Action (CTA) */
    .mobile-cta {
        background: linear-gradient(115deg, #ffd740 0%, #f9ae00 34%, #ec6907 64%, #ab2814 100%);
        /* Amarillo brillante */
        color: #ffffff !important;
        padding: 8px 20px;
        border-radius: 50px;
        font-weight: 600;
        font-size: 0.9rem;
        margin-left: 0;
        box-shadow: 0 4px 15px rgba(255, 214, 64, 0.4);
        transition: transform 0.2s ease;
    }

    .mobile-cta:active {
        transform: scale(0.95);
        /* Micro-interacción al tocar la pantalla */
    }

    .logo {
        font-size: 1.2rem;
    }

    .hero-main-logo {
        max-width: 250px;
        /* Más pequeño en celular */
        margin-bottom: 15rem;
    }

    .hero-phrase {
        font-size: clamp(1.5rem, 5vw, 2.5rem);
        line-height: 1.2;
    }

    .card,
    .card:nth-child(even) {
        width: 96%;
        height: 85vh;
        flex-direction: column !important;
        border-radius: 30px;
    }

    .card-left {
        width: 100%;
        height: 45%;
    }

    .card-logo,
    .card:nth-child(even) .card-logo {
        width: 30%;
        top: 20px;
        right: 20px;
        left: auto;
        object-position: right;
    }

    .card-logo,
    .card:nth-child(odd) .card-logo {
        width: 30%;
        top: 20px;
        right: 20px;
        left: auto;
        object-position: right;
    }

    .card-right {
        width: 100%;
        height: 55%;
        padding: 30px 20px;
    }

    .card-right h2 {
        margin-bottom: 15px;
    }

    .card-right p {
        margin-bottom: 25px;
    }

    .card-logo {
        width: 20%;
        /* Un poco más pequeño en móvil */
        max-width: 80px;
        top: 20px;
        right: 20px;
    }

    /* Reducimos el padding en móvil porque el logo es más pequeño */
    .card-right h2 {
        margin-bottom: 15px;
        padding-right: 90px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .card:nth-child(1) {
        top: calc(var(--header-height) + 2vh);
    }

    .card:nth-child(2) {
        top: calc(var(--header-height) + 4vh);
    }

    .card:nth-child(3) {
        top: calc(var(--header-height) + 6vh);
    }

    #custom-cursor {
        display: none !important;
    }

    /* 2. Restauramos el comportamiento normal del sistema 
                  (importante por si usan un iPad con ratón físico) */
    *,
    *::before,
    *::after,
    html,
    body {
        cursor: auto !important;
    }

    a,
    button,
    .btn,
    .card-logo {
        cursor: pointer !important;
    }

    .contact-card {
        padding: 30px 20px;
    }
}