html {
    scroll-behavior: smooth;
}

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

:root {
    --bg: #000300;
    --purple: #8655F6;
    --purple-light: #C084FC;
    --text: #F8F9FA;
    --muted: #A1A1AA;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
}

/* ─── SCROLLBAR — sutil gris oscuro ─── */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2e2e2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3d3d3d;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #2e2e2e transparent;
}

/* ─── INTRO OVERLAY ─── */
#intro-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    pointer-events: none;
}

.panel {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    background: #000;
}

#top-panel {
    top: 0;
    transform: translateY(0);
}

#bottom-panel {
    bottom: 0;
    transform: translateY(0);
}

#intro-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Great Vibes', cursive;
    font-size: clamp(4rem, 10vw, 9rem);
    color: var(--text);
    white-space: nowrap;
    z-index: 100000;
    opacity: 0;
}

#intro-text span {
    display: inline-block;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

/* ─── HERO ─── */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 3vh;
    overflow: hidden;
    background: var(--bg);
}

/* Margen superior en móvil */
@media (max-width: 768px) {
    #hero {
        padding-top: 12vh;
    }
}

/* Star canvas */
#star-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* ─── HERO CONTENT ─── */
#hero-content {
    position: relative;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.9s ease, transform 0.9s ease;
    will-change: opacity, transform;
}

#hero-content.visible {
    opacity: 1;
    transform: translateY(0);
}

/* El video también se disuelve al hacer scroll */
#video-container {
    will-change: opacity;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(3.5rem, 10vw, 9.5rem);
    font-weight: 700;
    color: var(--text);
    line-height: 0.95;
    letter-spacing: -0.02em;
    margin-bottom: 1.25rem;
}

.subtitle {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
    font-weight: 300;
    color: var(--muted);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    margin-bottom: 2.5rem;
}

/* ─── CTA BUTTON ─── */
.btn-cta {
    display: inline-block;
    position: relative;
    padding: 1.1rem 3.5rem;
    border-radius: 9999px;
    border: 1px solid rgba(134, 85, 246, 0.7);
    background: rgba(0, 3, 0, 0.4);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(134, 85, 246, 0.25),
        0 0 60px rgba(134, 85, 246, 0.1),
        inset 0 0 20px rgba(134, 85, 246, 0.05);
    transition: box-shadow 0.4s ease, transform 0.25s ease, border-color 0.4s ease;
}

.btn-cta:hover {
    border-color: rgba(134, 85, 246, 1);
    box-shadow:
        0 0 30px rgba(134, 85, 246, 0.5),
        0 0 80px rgba(134, 85, 246, 0.2),
        inset 0 0 30px rgba(134, 85, 246, 0.1);
    transform: scale(1.04);
}

/* ─── VIDEO — 65vh centered ─── */
#video-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 65vh;
    overflow: visible;
    z-index: 10;
    pointer-events: none;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

#hero-video {
    width: auto;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

/* ─── SCROLL INDICATOR ─── */
#scroll-indicator {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    z-index: 30;
    opacity: 1;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

#scroll-indicator.hidden {
    opacity: 0;
}

.scroll-text {
    font-size: 0.65rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 300;
}

.scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0.6), var(--purple), transparent);
    position: relative;
    overflow: hidden;
}

.scroll-line::after {
    content: '';
    position: absolute;
    top: -40%;
    left: 0;
    right: 0;
    height: 40%;
    background: rgba(255, 255, 255, 0.8);
    animation: scrollSlide 1.8s ease-in-out infinite;
}

@keyframes scrollSlide {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    30% {
        opacity: 1;
    }

    100% {
        transform: translateY(200%);
        opacity: 0;
    }
}

/* ─── NEXT SECTION ─── */
#next-section {
    position: relative;
    z-index: 20;
    min-height: 100vh;
    width: 100%;
    background: var(--bg);
}

/* ═══════════════════════════════════════════════════
   HAMBURGER NAVIGATION — global, mobile only
═══════════════════════════════════════════════════ */
#ham-wrap {
    display: none;
}

@media (max-width: 768px) {
    /* Hide all section pill navs — replaced by hamburger */
    .laptop-nav,
    .mobile-nav,
    .auto-nav,
    .fundador-nav,
    .cotizar-nav {
        display: none !important;
    }

    #ham-wrap {
        display: block;
        position: fixed;
        top: 1rem;
        left: 1rem;
        z-index: 9999;
    }

    #ham-btn {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 42px;
        height: 42px;
        align-items: center;
        background: rgba(10, 8, 20, 0.72);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid rgba(134, 85, 246, 0.22);
        border-radius: 13px;
        cursor: pointer;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
        transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
        flex-shrink: 0;
    }

    #ham-btn:hover {
        border-color: rgba(134, 85, 246, 0.4);
        background: rgba(18, 12, 32, 0.85);
    }

    #ham-btn.open {
        border-color: rgba(134, 85, 246, 0.55);
        background: rgba(18, 12, 32, 0.9);
        box-shadow: 0 0 20px rgba(134, 85, 246, 0.18), 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .ham-line {
        display: block;
        width: 18px;
        height: 2px;
        background: rgba(248, 249, 250, 0.82);
        border-radius: 2px;
        transform-origin: center;
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                    opacity 0.2s ease,
                    background 0.25s ease;
    }

    #ham-btn.open .ham-line {
        background: #C084FC;
    }

    #ham-btn.open .ham-line:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    #ham-btn.open .ham-line:nth-child(2) {
        opacity: 0;
        transform: scaleX(0);
    }

    #ham-btn.open .ham-line:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    #ham-menu {
        position: absolute;
        top: calc(100% + 0.6rem);
        left: 0;
        min-width: 210px;
        background: rgba(8, 6, 18, 0.92);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        border: 1px solid rgba(134, 85, 246, 0.16);
        border-radius: 18px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7),
                    0 0 0 0.5px rgba(134, 85, 246, 0.08),
                    inset 0 1px 0 rgba(255, 255, 255, 0.04);
        padding: 0.45rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px) scale(0.97);
        transform-origin: top left;
        transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
        pointer-events: none;
    }

    #ham-menu.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0) scale(1);
        pointer-events: all;
    }

    .ham-item {
        display: flex;
        align-items: center;
        gap: 0.7rem;
        padding: 0.65rem 0.85rem;
        border-radius: 12px;
        cursor: pointer;
        text-decoration: none;
        transition: background 0.18s ease;
    }

    .ham-item:hover,
    .ham-item:active {
        background: rgba(134, 85, 246, 0.1);
    }

    .ham-item.active {
        background: rgba(134, 85, 246, 0.07);
    }

    .ham-dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(160, 160, 160, 0.35);
        flex-shrink: 0;
        transition: background 0.25s ease, box-shadow 0.25s ease;
    }

    .ham-item.active .ham-dot {
        background: #8655F6;
        box-shadow: 0 0 8px rgba(134, 85, 246, 0.8);
    }

    .ham-label {
        font-family: 'Plus Jakarta Sans', sans-serif;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.07em;
        text-transform: uppercase;
        color: rgba(255, 255, 255, 0.58);
        transition: color 0.2s ease;
        white-space: nowrap;
    }

    .ham-item:hover .ham-label {
        color: rgba(255, 255, 255, 0.82);
    }

    .ham-item.active .ham-label {
        color: #C084FC;
    }
}
