/**
 * PROJECT: VlasLabs
 * FILE: styles.css
 */

@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200&display=swap');

/* ==========================================
   1. VARIABLES & CORE SETTINGS
   ========================================== */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --line-color: color-mix(in srgb, var(--bg-color), var(--text-color) 30%);
    --transition-speed: 0.5s;
}

[data-theme="dark"] {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
}

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

html {
    /* Activa el snapping en el eje vertical */
    scroll-snap-type: y mandatory;
    /* Suaviza el movimiento */
    scroll-behavior: smooth;
}


body {
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    overflow-y: auto;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

/* ==========================================
   2. ESTRUCTURA DE SECCIONES (Layout)
   ========================================== */
section {
    /* Indica que esta sección es un punto de anclaje */
    scroll-snap-align: start;
    /* Opcional: evita que el scroll se pase de largo si el usuario scrollea muy rápido */
    scroll-snap-stop: always;

    /* Tu configuración actual se mantiene */
    width: 100%;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 2rem;
}

/* ==========================================
   3. TOP NAVIGATION (Botones)
   ========================================== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 80px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    pointer-events: none;
}

.nav-btn {
    pointer-events: auto;
    width: 40px;
    height: 40px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: var(--text-color);
    transition: transform 0.3s ease;
}

.btn-menu .outer-ring {
    fill: none;
    stroke: var(--text-color);
    stroke-width: 1.2;
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-menu .inner-dot {
    fill: var(--text-color);
    transform-origin: center;
}

.btn-menu:hover .outer-ring {
    transform: scale(0.45);
}

.btn-theme .theme-circle {
    stroke: var(--text-color);
    stroke-width: 1.5;
    transition: all 0.4s ease;
}

[data-theme="light"] .btn-theme .theme-circle {
    fill: #000000;
    stroke: #000000;
}

[data-theme="dark"] .btn-theme .theme-circle {
    fill: transparent;
    stroke: #ffffff;
}

/* ==========================================
   4. INTRO (VlasLabs Logo)
   ========================================== */
.container {
    animation: intro 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.word-wrapper {
    display: flex;
    transition: letter-spacing 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    letter-spacing: 0.5rem;
}

.word-wrapper.collapsed {
    letter-spacing: -0.5rem;
}

.index-letter {
    display: inline-block;
    /* Mínimo 2.5rem, escala con el ancho, máximo 10vw */
    font-size: clamp(3rem, 8vw, 10vw);
    font-weight: 200;
    color: var(--text-color);
    padding-inline: clamp(2px, 1vw, 8px);
    line-height: .95;
    user-select: none;
    transition: all 0.3s ease;
}

.index-letter:hover {
    font-weight: 800;
    padding-inline: 16px;
    transform: scale(1.1);
    color: #184ddc;
}

/* ==========================================
   5. WELCOME SECTION (Efecto Slot 3rem)
   ========================================== */
.welcome-para {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 6rem;
    margin-top: 1.5rem;
}

.welcome-para .letter-slot {
    display: inline-flex;
    position: relative;
    justify-content: center;
    align-items: center;
    height: 4.5rem;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, width 0.3s ease;
    padding: 0.2rem 0;
}

.welcome-para .letter-slot span {
    font-size: 3rem;
    font-weight: 300;
    line-height: 1;
    white-space: pre;
    color: var(--text-color);
}

/* ==========================================
   6. BOTTOM SCROLL INDICATOR
   ========================================== */
.bottom-nav {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 9999;
    pointer-events: none;
}

.scroll-line {
    width: 40px;
    height: 1px;
    background-color: var(--line-color);
    transition: background-color var(--transition-speed) ease;
}

.scroll-indicator svg {
    width: 24px;
    height: 24px;
    transform: rotate(0deg);
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.scroll-indicator.active svg {
    transform: rotate(180deg);
}

.scroll-indicator circle {
    stroke: var(--line-color);
    stroke-width: 1px;
    fill: url(#splitGradient);
}

#splitGradient .stop-top {
    stop-color: transparent;
}

#splitGradient .stop-bottom {
    stop-color: var(--text-color);
    transition: stop-color var(--transition-speed) ease;
}

/* ==========================================
   7. KEYFRAMES
   ========================================== */
@keyframes intro {
    from {
        opacity: 0;
        transform: translateY(-4rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   8. ABOUT VISIBILITY & LAYOUT (Responsivo)
   ========================================== */
.about-text {
    /* Ajustamos el mínimo a 1.2rem para que en móvil respire mejor */
    font-size: clamp(1.2rem, 2.2vw, 2.5rem);
    font-weight: 300;
    line-height: 1.5;
    max-width: 1100px;
    text-align: left;

    padding: 0 clamp(1rem, 5vw, 3rem);
    margin-bottom: 3rem;

    color: transparent !important;
    user-select: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.2s ease, transform 1.2s ease;
    position: relative;
    display: block;
}

.about-text.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Clases generadas dinámicamente por JS */
.about-word {
    position: relative;
    display: inline-flex;
    white-space: pre;
    color: var(--text-color) !important;
    user-select: text;
}

.about-ghost {
    opacity: 0;
    pointer-events: none;
    user-select: none;
}

.about-slot {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
}

.about-slot span {
    font-size: inherit;
    font-weight: inherit;
    color: var(--text-color);
    font-family: inherit;
    line-height: 1;
}

.about-text {
    cursor: pointer;
    /* Indica que se puede interactuar */
}

/* Mobile (< 767px) */
@media (max-width: 767px) {
    section {
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Centrado base */
        align-items: center;
        min-height: 100dvh;
    }

    /* --- AJUSTE ESPECÍFICO HERO (VlasLabs + Welcome) --- */
    #hero {
        justify-content: center;
    }

    #hero .container {
        /* Subimos un poco el logo para que el conjunto respire */
        transform: translateY(-2rem);
    }

    .welcome-para {
        height: 3rem;
        /* Reducimos la caja del welcome */
        margin-top: 0.5rem;
        /* Pegamos el welcome un poco más al logo */
    }

    .welcome-para .letter-slot span {
        /* Tamaño más elegante para móvil */
        font-size: 1.8rem;
    }

    /* --- AJUSTE ESPECÍFICO ABOUT --- */
    .about-container {
        padding-top: 80px;
        padding-bottom: 80px;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .about-text {
        font-size: 1.2rem;
        /* Un poco más pequeña para que no sature */
        line-height: 1.45;
        margin-top: 0;
        margin-bottom: 1.5rem;
        padding: 0 1.5rem;
    }

    /* --- NAVEGACIÓN --- */
    .top-nav {
        padding: 0 20px;
    }
}

/* --- TABLET (768px a 1024px) --- */
@media (min-width: 768px) and (max-width: 1024px) {
    section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 0;
        /* Limpiamos para centrado real */
        min-height: 100dvh;
    }

    /* --- HERO TABLET (Compactado) --- */
    #hero .container {
        transform: translateY(-1rem);
        /* Subimos levemente el logo */
    }

    .welcome-para {
        height: 2.5rem;
        /* Caja compacta */
        margin-top: 0.8rem;
        /* Pegamos el saludo al logo */
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .welcome-para .letter-slot span {
        font-size: 1.8rem;
        /* Reducido para que sea elegante, no gigante */
    }

    /* --- ABOUT TABLET (Protección de Interacción) --- */
    .about-container {
        width: 100%;
        max-width: 900px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Aseguramos que el contenedor no bloquee clics ajenos */
        pointer-events: none;
    }

    .about-text {
        font-size: 1.5rem;
        line-height: 1.5;
        margin-bottom: 2rem;
        padding: 0 3rem;
        /* Reactivamos los clics solo en el texto */
        pointer-events: auto;
        cursor: pointer;
        z-index: 10;
    }
}

/* --- DESKTOP (> 1025px) --- */
@media (min-width: 1025px) {
    section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 100dvh;
    }

    /* --- HERO DESKTOP (Ajuste de proximidad) --- */
    #hero .container {
        transform: translateY(0);
    }

    .welcome-para {
        height: 3.5rem;
        /* Reducimos el margen de 1.5rem a 0.2rem para pegarlo más al logo */
        margin-top: 0.2rem;
        display: flex;
        align-items: center;
    }

    .welcome-para .letter-slot span {
        font-size: 2.2rem;
        font-weight: 300;
        line-height: 1;
    }

    /* --- ABOUT DESKTOP --- */
    .about-container {
        width: 100%;
        max-width: 1000px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        pointer-events: none;
    }

    .about-text {
        font-size: 1.65rem;
        line-height: 1.6;
        margin-bottom: 2.5rem;
        padding: 0 5%;
        pointer-events: auto;
        cursor: pointer;
        z-index: 10;
        text-align: left;
    }
}

/* --- LARGE SCREENS & TV (> 1440px) --- */
@media (min-width: 1441px) {
    section {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        height: 100vh;
        padding: 0;
    }

    .about-container {
        width: 90vw;
        max-width: 1700px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .about-text {
        /* Subimos 1rem: de 2.2rem a 3.2rem para un impacto total */
        font-size: 2.2rem;
        line-height: 1.6;
        /* Reducimos levemente el interlineado por el tamaño mayor */
        padding: 0 2rem;
        margin-bottom: 4.5rem;
        /* Un poco más de espacio entre párrafos */
        width: 100%;
        text-align: left;
        pointer-events: auto;
    }

    .welcome-para {
        margin-top: 0.5rem;
        height: 5rem;
    }

    .welcome-para .letter-slot span {
        /* El Welcome también escala para no quedarse pequeño tras el logo */
        font-size: 4rem;
    }
}
