/*
 * Home hero — full-height stage.
 *
 * Design notes:
 * - The hero is always its own dark "stage" (navy/mint), independent of
 *   the site's light/dark toggle. This is deliberate: it reads as a
 *   confident, consistent moment rather than a container that has to
 *   fight for contrast against arbitrary uploaded photos in every theme.
 * - Height is set by JS (initHeroFullHeight in main.js) to exactly fill
 *   the viewport below the floating header, recalculated on resize. The
 *   CSS values below are only the no-JS / first-paint fallback.
 * - A slide's uploaded image is optional and never load-bearing: with
 *   no image the gradient + grid + mouse spotlight already carries the
 *   section. When present, the image is blended in as a dim, desaturated
 *   atmosphere layer rather than a literal photo takeover.
 */

.hero-stage {
    padding: var(--outer-gap, 16px) 0 0;
}

.hero-viewport {
    position: relative;
    overflow-anchor: none;
    width: calc(100% - (var(--outer-gap, 24px) * 2));
    max-width: calc(var(--shell) + (var(--pad) * 2));
    height: calc(100dvh - (var(--outer-gap, 24px) * 3) - 78px);
    min-height: 460px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: var(--box-radius);
    background: #08111e;
    box-shadow: 0 30px 90px rgba(6, 12, 22, 0.32);
    isolation: isolate;
}

.hero-viewport,
.hero-viewport * {
    box-sizing: border-box;
}

/* Base atmosphere: gradient + dot grid + soft mint glows, always present */
.hero-viewport::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -3;
    background:
        radial-gradient(circle at 14% 8%, rgba(119, 229, 191, 0.16), transparent 38%),
        radial-gradient(circle at 88% 82%, rgba(119, 229, 191, 0.1), transparent 42%),
        linear-gradient(160deg, #0c1727 0%, #08111e 55%, #050b15 100%);
}

.hero-viewport::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    opacity: 0.5;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 46px 46px;
    mask-image: radial-gradient(120% 90% at 50% 30%, #000 40%, transparent 92%);
}

.slider-track {
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 100%;
    transition: transform 720ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.slider-track .hero-slide {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    min-width: 100%;
}

.hero-slide {
    position: relative;
    height: 100%;
    overflow: hidden;
}

/* Optional atmospheric image: dim, desaturated, blended — texture, not a photo hero */
.hero-slide-media {
    position: absolute;
    inset: 0;
    z-index: -3;
    background-image: var(--hero-image, none);
    background-size: cover;
    background-position: center;
    opacity: 0.4;
    filter: saturate(0.55) contrast(1.05);
    mix-blend-mode: luminosity;
    transform: scale(1.03);
    transition: transform 1400ms ease;
}

.hero-slide-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(190deg, rgba(5, 11, 21, 0.35) 0%, rgba(5, 11, 21, 0.88) 78%);
}

/*
 * Ambient spotlight: follows the cursor, gently brightening the grid
 * (and the atmosphere image, if present) underneath. JS updates the
 * mask position on pointermove; the values below are the resting
 * position for touch and reduced-motion visitors.
 */
.hero-ambient-spot {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(360px at 68% 30%, rgba(119, 229, 191, 0.14), transparent 72%),
        rgba(5, 11, 21, 0.22);
    -webkit-mask-image: radial-gradient(340px at 68% 30%, transparent 0%, transparent 35%, black 100%);
    mask-image: radial-gradient(340px at 68% 30%, transparent 0%, transparent 35%, black 100%);
}

.hero-slide-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    padding-top: clamp(1.5rem, 3.5vw, 2.75rem);
    padding-bottom: clamp(1.25rem, 3vw, 2.25rem);
}

.hero-slide-copy {
    display: grid;
    gap: clamp(1rem, 2vw, 1.5rem);
    max-width: 900px;
    margin: auto 0;
    padding: clamp(1.5rem, 4vw, 3rem) 0;
}

.hero-slide-copy h1 {
    margin: 0;
    color: #f9f8f4;
    font-size: clamp(2.6rem, 6.4vw, 6.4rem);
    line-height: 0.98;
    letter-spacing: -0.055em;
    text-wrap: balance;
}

.hero-slide-copy p {
    max-width: 620px;
    margin: 0;
    color: rgba(244, 241, 233, 0.68);
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.6;
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    width: fit-content;
    min-height: 48px;
    margin-top: 0.4rem;
    padding: 0.8rem 1.05rem 0.8rem 1.3rem;
    border: 1px solid rgba(119, 229, 191, 0.5);
    border-radius: 999px;
    background: #f9f8f4;
    color: #08111e;
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
    transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.hero-cta i {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    border-radius: 999px;
    background: #77e5bf;
    color: #07111d;
    font-style: normal;
}

.hero-slide-bottom {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.hero-scroll-cue {
    display: none;
    align-items: center;
    gap: 0.55rem;
    color: rgba(244, 241, 233, 0.5);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.hero-scroll-cue em {
    position: relative;
    width: 1px;
    height: 26px;
    background: rgba(244, 241, 233, 0.28);
    overflow: hidden;
}

.hero-scroll-cue em::before {
    content: "";
    position: absolute;
    left: 0;
    top: -100%;
    width: 100%;
    height: 100%;
    background: #77e5bf;
    animation: heroScrollCue 1.8s ease-in-out infinite;
}

@keyframes heroScrollCue {
    0% { top: -100%; }
    60% { top: 100%; }
    100% { top: 100%; }
}

.hero-controls {
    position: absolute;
    left: 0;
    right: 0;
    top: clamp(1.5rem, 3.5vw, 2.75rem);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.9rem;
    padding-inline: var(--pad, clamp(20px, 4vw, 64px));
    pointer-events: none;
}

.hero-dots,
.hero-arrows {
    pointer-events: auto;
}

.hero-dots {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slider-dot {
    display: block;
    width: 24px;
    height: 3px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(244, 241, 233, 0.28);
    cursor: pointer;
    transition: width 220ms ease, background 220ms ease;
}

.slider-dot.is-active {
    width: 46px;
    background: #77e5bf;
}

.hero-arrows {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-arrows button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(244, 241, 233, 0.22);
    border-radius: 999px;
    background: rgba(8, 17, 30, 0.5);
    color: #f4f1e9;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 220ms ease, border-color 220ms ease, background 220ms ease;
}

@media (hover: hover) and (pointer: fine) {
    .hero-cta:hover {
        transform: translateY(-2px);
        border-color: #77e5bf;
        box-shadow: 0 24px 52px rgba(0, 0, 0, 0.36);
    }

    .hero-arrows button:hover {
        transform: translateY(-2px);
        border-color: #77e5bf;
        background: rgba(119, 229, 191, 0.14);
    }

    .slider-dot:hover {
        background: #77e5bf;
        opacity: 0.85;
    }

    .hero-slide.has-image:hover .hero-slide-media {
        transform: scale(1.08);
    }
}

@media (min-width: 861px) {
    .hero-scroll-cue {
        display: inline-flex;
    }
}

@media (max-width: 1100px) {
    .hero-slide-copy h1 {
        font-size: clamp(2.4rem, 7vw, 4.6rem);
    }
}

@media (max-width: 860px) {
    .hero-stage {
        padding-top: 10px;
    }

    .hero-viewport {
        width: calc(100% - 16px);
        height: calc(100dvh - var(--outer-gap, 16px) - 90px);
        min-height: 560px;
        border-radius: 20px;
    }

    .hero-slide-inner {
        padding-top: 1.25rem;
        padding-bottom: 1.1rem;
    }

    .hero-slide-tag {
        display: none;
    }

    .hero-slide-copy h1 {
        font-size: clamp(2.3rem, 9vw, 3.6rem);
    }

    .hero-slide-copy p {
        font-size: 1rem;
    }

    .hero-controls {
        top: 1.1rem;
        gap: 0.5rem;
    }

    .hero-arrows button {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .hero-viewport {
        min-height: 620px;
    }

    .hero-slide-copy h1 {
        font-size: clamp(2.1rem, 10.5vw, 3rem);
        letter-spacing: -0.04em;
    }

    .hero-cta {
        width: 100%;
        justify-content: space-between;
    }
}

@media (prefers-reduced-motion: reduce) {
    .slider-track,
    .hero-cta,
    .hero-arrows button,
    .slider-dot,
    .hero-slide-media {
        transition: none !important;
    }

    .hero-scroll-cue em::before {
        animation: none;
    }

    .hero-ambient-spot {
        display: none;
    }
}

@media not all and (hover: hover) and (pointer: fine) {
    .hero-ambient-spot {
        display: none;
    }
}

/* Admin typography controls */
.hero-slide-copy h1 {
    font-size: clamp(2.2rem, 6vw, var(--font-size-hero));
}

.hero-slide-copy p {
    font-size: clamp(1rem, 1.4vw, calc(var(--font-size-base) * 1.1));
}

.hero-cta {
    font-size: var(--font-size-button);
}

.slider-dot,
.hero-arrows button {
    font-size: var(--font-size-small);
}