/* === HERO SECTION (isolated) === */

.hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
    background: radial-gradient(ellipse at 24% 100%,
            var(--color-hero-grad-start) 0%,
            var(--color-hero-grad-mid) 50%,
            var(--color-hero-grad-end) 100%);
}

/* ── Video background ── */
.hero__video-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    mix-blend-mode: hard-light;
}


/* ── Content ── */
.hero__content {
    position: relative;
    z-index: 4;
    text-align: center;
    max-width: 1022px;
    width: 100%;
    padding: 0 var(--content-padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    animation: hero-reveal 1.2s var(--ease-out) 0.3s both;
}

/* ── Animated title ── */
.hero__title {
    position: relative;
    width: 100%;
    /* Height for 2 lines of ~40px expanded text × 1.15 line-height */
    min-height: 100px;
}

.hero__title-line {
    font-family: "SF Pro", "SF Pro Display", var(--font-heading);
    font-weight: 900;
    font-stretch: expanded;
    font-size: clamp(28px, 2.8vw, 40px);
    color: var(--color-text-white);
    text-transform: uppercase;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.2);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.hero__title-line--active {
    opacity: 1;
    pointer-events: auto;
}

/* Word-by-word stagger animation */
.hero__word {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 0.5s var(--ease-out),
        transform 0.5s var(--ease-out);
    /* transition-delay is set per-word by JS */
}

/* When line is active → words animate in with stagger */
.hero__title-line--active .hero__word {
    opacity: 1;
    transform: translateY(0);
}

/* When line deactivates → reset instantly (no stagger on exit) */
.hero__title-line:not(.hero__title-line--active) .hero__word {
    transition-delay: 0s !important;
    transition-duration: 0.2s;
}

.hero__title-accent {
    font-style: italic;
    opacity: 0.5;
}

/* ── Glitch effect on active title line ── */
.hero__title-line--active {
    opacity: 1;
    pointer-events: auto;
    animation: hero-glitch 4s infinite ease-in-out;
}

@keyframes hero-glitch {

    0%,
    14%,
    26%,
    49%,
    61%,
    79%,
    91%,
    100% {
        transform: translate(0);
        text-shadow: 0 2px 40px rgba(0, 0, 0, 0.2);
    }

    15% {
        transform: translate(-1px, 1px);
        text-shadow: 3px 0 rgba(255, 120, 50, 0.4), -3px 0 rgba(100, 130, 255, 0.4);
    }

    18% {
        transform: translate(1px, -1px);
        text-shadow: -2px 0 rgba(255, 120, 50, 0.3), 2px 0 rgba(100, 130, 255, 0.3);
    }

    22% {
        transform: translate(-1px, 0);
        text-shadow: 4px 0 rgba(255, 120, 50, 0.35), -4px 0 rgba(100, 130, 255, 0.35);
    }

    50% {
        transform: translate(1px, -1px);
        text-shadow: -3px 0 rgba(255, 120, 50, 0.4), 3px 0 rgba(100, 130, 255, 0.4);
    }

    53% {
        transform: translate(-2px, 1px);
        text-shadow: 2px 0 rgba(255, 120, 50, 0.35), -2px 0 rgba(100, 130, 255, 0.35);
    }

    57% {
        transform: translate(1px, 0);
        text-shadow: -3px 0 rgba(255, 120, 50, 0.3), 3px 0 rgba(100, 130, 255, 0.3);
    }

    80% {
        transform: translate(-1px, 1px);
        text-shadow: 4px 0 rgba(255, 120, 50, 0.35), -4px 0 rgba(100, 130, 255, 0.35);
    }

    84% {
        transform: translate(1px, -1px);
        text-shadow: -2px 0 rgba(255, 120, 50, 0.4), 2px 0 rgba(100, 130, 255, 0.4);
    }

    88% {
        transform: translate(-1px, 0);
        text-shadow: 3px 0 rgba(255, 120, 50, 0.3), -3px 0 rgba(100, 130, 255, 0.3);
    }
}

/* ── Glitch clone overlays (cut through text) ── */
.hero__glitch {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    mix-blend-mode: screen;
    overflow: hidden;
}

.hero__title-line--active .hero__glitch {
    opacity: 1;
}

.hero__glitch--cyan {
    color: rgba(255, 120, 50, 0.6);
    animation: glitch-slice-1 4s infinite ease-in-out;
}

.hero__glitch--magenta {
    color: rgba(100, 130, 255, 0.6);
    animation: glitch-slice-2 3.5s infinite ease-in-out;
}

@keyframes glitch-slice-1 {

    0%,
    14%,
    26%,
    49%,
    61%,
    100% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }

    15% {
        clip-path: inset(20% 0 50% 0);
        transform: translateX(-3px);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translateX(2px);
    }

    25% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }

    50% {
        clip-path: inset(40% 0 30% 0);
        transform: translateX(-4px);
    }

    55% {
        clip-path: inset(10% 0 70% 0);
        transform: translateX(3px);
    }

    60% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }
}

@keyframes glitch-slice-2 {

    0%,
    18%,
    32%,
    54%,
    68%,
    100% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }

    19% {
        clip-path: inset(50% 0 20% 0);
        transform: translateX(3px);
    }

    25% {
        clip-path: inset(10% 0 60% 0);
        transform: translateX(-2px);
    }

    31% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }

    55% {
        clip-path: inset(30% 0 40% 0);
        transform: translateX(4px);
    }

    62% {
        clip-path: inset(70% 0 5% 0);
        transform: translateX(-3px);
    }

    67% {
        clip-path: inset(0 0 100% 0);
        transform: translate(0);
    }
}

/* ── Scroll indicator ── */
.hero__scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: hero-scroll-bounce 2s var(--ease-smooth) infinite;
}

.hero__scroll-text {
    font-family: var(--font-body);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255, 255, 255, 0.5);
}

.hero__scroll-line {
    width: 1px;
    height: 32px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
}

@keyframes hero-reveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.98);
    }

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

@keyframes hero-scroll-bounce {

    0%,
    100% {
        transform: translateX(-50%) translateY(0);
    }

    50% {
        transform: translateX(-50%) translateY(8px);
    }
}

/* ── Noise overlay ── */
.hero__noise {
    position: absolute;
    inset: 0;
    z-index: 2;
    opacity: 0.04;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
}