/* ==========================================
   DUPLIC — Video-first hero + catalog intro
   Always dark (the film's own environment), independent of theme.
   ========================================== */

:root {
    --xp-bg: #040404;            /* matches the film's left edge (#020202–#040404) */
    --xp-ink: #F4F2EE;           /* ceramic white */
    --xp-mute: rgba(244, 242, 238, 0.62);
    --xp-line: rgba(244, 242, 238, 0.14);
    --xp-pad: clamp(24px, 6vw, 120px);
    --xp-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* main.css gives html AND body overflow-x:hidden, which turns body into a scroll
   container and breaks position:sticky. clip hides overflow without doing that. */
body.xp-home {
    background: var(--xp-bg);
    overflow-x: clip;
    overflow-y: visible;
}

/* ---------- Header over the film ---------- */
body.xp-home .header .container {
    max-width: none;
    padding: 0 var(--xp-pad);
}

body.xp-home .header {
    background: linear-gradient(180deg, rgba(4, 4, 4, 0.6), transparent);
    box-shadow: none;
    border-bottom: 0;
    backdrop-filter: none;
}

/* No backdrop-filter: re-blurring moving video under the header every frame costs real fluidity */
body.xp-home .header.scrolled {
    background: rgba(4, 4, 4, 0.9);
    box-shadow: inset 0 -1px 0 var(--xp-line);
}

@media (min-width: 901px) {
    body.xp-home .nav-link {
        color: var(--xp-mute);
    }

    body.xp-home .nav-link:hover,
    body.xp-home .nav-link.active {
        color: var(--xp-ink);
    }

    body.xp-home .theme-toggle {
        color: var(--xp-ink);
        border-color: var(--xp-line);
        background: transparent;
    }
}

body.xp-home .nav-cta .btn-primary {
    background: transparent;
    color: var(--xp-ink);
    border: 1px solid var(--xp-line);
    border-radius: 999px;
}

body.xp-home .nav-cta .btn-primary:hover {
    border-color: var(--xp-ink);
}

@media (max-width: 900px) {
    /* Off-canvas menu: dark panel; its shadow otherwise leaks a line under the header */
    body.xp-home .nav-menu {
        background: #0B0B0C;
        box-shadow: none;
    }

    body.xp-home .nav-menu .nav-link {
        color: var(--xp-ink);
    }

    body.xp-home .nav-toggle,
    body.xp-home .nav-menu.active ~ .nav-toggle {
        right: 24px;
        background: rgba(4, 4, 4, 0.4);
        color: var(--xp-ink);
        border: 1px solid var(--xp-line);
        border-radius: 999px;
        box-shadow: none;
        backdrop-filter: blur(10px);
    }

    body.xp-home .nav-toggle::before {
        display: none;
    }
}

/* ---------- Hero ---------- */
.xp-hero {
    position: relative;
    background: var(--xp-bg);
    color: var(--xp-ink);
}

.xp-hero__stage {
    position: relative;
    height: 100vh;
    height: 100svh;
    min-height: 560px;
    overflow: hidden;
    isolation: isolate;
}

/* Media: right ~72%, bled into the page via a feathered mask — no visible frame */
.xp-hero__media {
    position: absolute;
    inset: 0 0 0 auto;
    width: 72vw;
    z-index: 0;
    transform-origin: 70% 58%;
    /* Every edge feathered, so scaling during the scroll transition never exposes a frame */
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0%, #000 34%, #000 96%, transparent 100%),
        linear-gradient(180deg, transparent 0%, #000 8%, #000 86%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0%, #000 34%, #000 96%, transparent 100%),
        linear-gradient(180deg, transparent 0%, #000 8%, #000 86%, transparent 100%);
    mask-composite: intersect;
}

.xp-hero__poster,
.xp-hero__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 90% 50%;
}

.xp-hero__video {
    opacity: 0;
    transition: opacity 0.6s linear;
}

.xp-hero__video.is-playing {
    opacity: 1;
}

/* Dark environment that expands on the first scroll */
.xp-hero__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0;
    background: radial-gradient(ellipse 46% 52% at 58% 56%, rgba(4, 4, 4, 0.15) 0%, var(--xp-bg) 100%);
}

.xp-hero__copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    width: min(38vw, 600px);
    padding: 96px 0 72px var(--xp-pad);
}

.xp-eyebrow {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--xp-mute);
}

/* CMYK registration mark — the brand signature, kept small */
.xp-eyebrow::before {
    content: '';
    width: 36px;
    height: 3px;
    background: linear-gradient(90deg, #00A8E1 0 25%, #E6007E 25% 50%, #FFD100 50% 75%, var(--xp-ink) 75%);
}

.xp-hero__title {
    font-size: clamp(2.6rem, 4.6vw, 5rem);
    font-weight: 700;
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin: 0 0 28px;
    color: var(--xp-ink);
}

.xp-hero__title span {
    display: block;
}

.xp-hero__title span + span {
    color: var(--xp-mute);
}

.xp-hero__lead {
    max-width: 30ch;
    margin: 0 0 40px;
    font-size: clamp(1rem, 1.15vw, 1.15rem);
    line-height: 1.6;
    color: var(--xp-mute);
}

.xp-hero__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 32px;
}

.xp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 17px 30px;
    border-radius: 999px;
    background: var(--xp-ink);
    color: #0A0A0A;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.4s var(--xp-ease), background-color 0.3s;
}

.xp-btn:hover {
    background: #FFFFFF;
    color: #0A0A0A;
    transform: translateY(-2px);
}

.xp-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    color: var(--xp-ink);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 1px solid var(--xp-line);
    transition: border-color 0.3s, gap 0.4s var(--xp-ease);
}

.xp-link:hover {
    color: var(--xp-ink);
    border-bottom-color: var(--xp-ink);
    gap: 16px;
}

.xp-btn:focus-visible,
.xp-link:focus-visible {
    outline: 2px solid #00A8E1;
    outline-offset: 4px;
}

/* ---------- Catalog intro (opens the showroom — see experience-showroom.css) ---------- */
.xp-catalog-intro {
    position: relative;
    z-index: 3;
    padding: 18vh var(--xp-pad) 10vh;
    background: var(--xp-bg);
    color: var(--xp-ink);
}

.xp-catalog-intro__title {
    max-width: 14ch;
    margin: 0 0 24px;
    font-size: clamp(2.4rem, 6vw, 6.5rem);
    font-weight: 700;
    line-height: 0.98;
    letter-spacing: -0.04em;
    color: var(--xp-ink);
}

.xp-catalog-intro__lead {
    max-width: 44ch;
    margin: 0 0 56px;
    color: var(--xp-mute);
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ---------- Scroll-driven layout (only when motion is allowed and JS is running) ---------- */
.xp-motion .xp-hero {
    height: 200vh;
    height: 200svh;
}

.xp-motion .xp-hero__stage {
    position: sticky;
    top: 0;
}

/* Catalog intro rises over the dimmed film while the stage is still pinned */
.xp-motion .xp-showroom {
    position: relative;
    z-index: 3;
    margin-top: -55vh;
    margin-top: -55svh;
}

.xp-motion .xp-catalog-intro {
    background: linear-gradient(180deg, transparent 0, var(--xp-bg) 42vh);
}

/* Pre-entrance state (hero-motion.js reveals; head script removes .xp-motion if GSAP never arrives) */
.xp-motion [data-xp-in] {
    opacity: 0;
}

/* ---------- Mobile: separate composition ---------- */
@media (max-width: 900px) {
    .xp-hero__stage {
        min-height: 620px;
    }

    .xp-hero__media {
        inset: 0 0 auto 0;
        width: 100%;
        height: min(112vw, 64svh);
        transform-origin: 50% 60%;
        -webkit-mask-image:
            linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%),
            linear-gradient(180deg, transparent 0%, #000 6%, #000 70%, transparent 100%);
        mask-image:
            linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%),
            linear-gradient(180deg, transparent 0%, #000 6%, #000 70%, transparent 100%);
    }

    .xp-hero__poster,
    .xp-hero__video {
        object-position: 50% 50%;
    }

    .xp-hero__veil {
        background: radial-gradient(ellipse 60% 34% at 50% 34%, rgba(4, 4, 4, 0.15) 0%, var(--xp-bg) 100%);
    }

    .xp-hero__copy {
        justify-content: flex-end;
        width: 100%;
        padding: 0 24px max(40px, env(safe-area-inset-bottom));
    }

    .xp-eyebrow {
        margin-bottom: 16px;
        font-size: 0.66rem;
        letter-spacing: 0.14em;
        white-space: nowrap;
    }

    .xp-hero__title {
        font-size: clamp(2.2rem, 10vw, 3.4rem);
        margin-bottom: 16px;
    }

    .xp-hero__lead {
        margin-bottom: 28px;
        font-size: 0.98rem;
    }

    .xp-hero__actions {
        gap: 14px 24px;
    }

    .xp-btn {
        padding: 15px 26px;
    }

    .xp-catalog-intro {
        padding: 14vh 24px 12vh;
    }

    /* Shorter screens: let the intro arrive sooner so the transition never idles on black */
    .xp-motion .xp-showroom {
        margin-top: -75vh;
        margin-top: -75svh;
    }

    .xp-motion .xp-catalog-intro {
        background: linear-gradient(180deg, transparent 0, var(--xp-bg) 30vh);
    }
}
