/* ==========================================================================
   Home hero stage: layered field / wordmark / player with a 1.2s intro beat.
   Motion uses transform + opacity only. Static composition under reduced motion.

   Intro timeline (ms)
     0     field visible immediately
     0–750 player slides in from the right
   150–700 wordmark diagonal reveal (skewed mask window, follows the brush slant)
   200–800 blue glow rises behind the player
   620–940 yellow splat hits behind the wordmark
   850–1170 visor glint
   920–1200 Book a Game button rises in
   ========================================================================== */

.hero-stage {
    /* Exactly one screen tall below the 67px header (with a floor so the layout always fits) */
    --stage-h: max(520px, calc(100vh - 67px));
    position: relative;
    height: var(--stage-h);              /* reserved space: no layout shift */
    overflow: hidden;
    isolation: isolate;
    background: #23324d;                 /* sky-tone placeholder before the field paints */
}
/* A mouse drag across the art keeps steering the parallax: no ghost-image drag, no text
   selection highlight (the CTA and call link stay clickable) */
.hero-stage img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; }
.hs-layer, .hs-shade, .hs-edge { user-select: none; -webkit-user-select: none; }
/* Header floats over the art on the home page, so the stage takes the whole screen */
.has-hero .hero-stage { --stage-h: max(560px, 100vh); --header-h: 67px; }
@supports (height: 100svh) {
    .has-hero .hero-stage { --stage-h: max(560px, 100svh); }
}

/* Painted edge into the next (white) section: a yellow stroke under a torn white lip */
.hs-edge {
    position: absolute; left: 0; right: 0; bottom: -1px; z-index: 5;
    width: 100%; height: clamp(26px, 3.6vw, 54px);
    pointer-events: none;
}
@supports (height: 100svh) {
    /* svh = the visible height with mobile browser bars showing, so the CTA is never hidden */
    .hero-stage { --stage-h: max(520px, calc(100svh - 67px)); }
}

/* ---------- Layers ---------- */
.hs-layer { position: absolute; will-change: transform; }

/* ---------- Scene geometry ----------
   Every scenery layer (sky, mountains, trees, grass, props) shares one framing so the
   planes stay registered to each other at every screen size.
     --ar        aspect ratio of the plane art in use (full 3:1, or the 1150px phone crop)
     --px / --py focal point of the cover crop (0 = left/top, 1 = right/bottom)
     --canvas-w  width of the full 2172px canvas relative to the scene; props are placed in
                 full-canvas % so the same numbers work for the phone crop (2172/1150). */
.hero-stage { --ar: 3; --px: 0; --py: .58; --canvas-w: 100%; }

.hs-layer--scene { inset: -24px; z-index: 0; container-type: size; } /* oversized so depth/parallax never shows an edge */

/* .hs-scene reproduces object-fit: cover geometry, so % positions inside it map to art pixels */
.hs-scene {
    position: absolute; left: 0; top: 0; width: 100%; height: 100%;   /* fallback without container units */
    width: max(100cqw, calc(100cqh * var(--ar)));
    height: auto; aspect-ratio: var(--ar);
    left: calc((100cqw - max(100cqw, calc(100cqh * var(--ar)))) * var(--px));
    top: calc((100cqh - max(calc(100cqw / var(--ar)), 100cqh)) * var(--py));
}
.hs-scene picture, .hs-plane { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* Props (tower, bunkers, sky paint) positioned on the full canvas: --x/--y/--w in canvas % */
.hs-canvas { position: absolute; left: 0; top: 0; height: 100%; width: var(--canvas-w); }
.hs-prop {
    position: absolute; left: var(--x); top: var(--y); width: var(--w); height: auto;
    transform: var(--t, none);
}
.hs-prop.is-flip { --t: scaleX(-1); }
.hs-prop--shadow { filter: drop-shadow(10px 14px 16px rgba(0, 0, 0, .35)); }
.hs-prop--far { filter: drop-shadow(4px 5px 6px rgba(0, 0, 0, .28)) saturate(.85) brightness(.94); }
.hs-prop--ground { --t: scaleY(.38); transform-origin: 50% 100%; opacity: .9; } /* paint lying flat on the grass */

/* Gentle shading so the white lettering holds against the bright sky */
.hs-shade {
    position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background:
        radial-gradient(ellipse 55% 60% at 32% 48%, rgba(6, 10, 20, .38), transparent 70%),
        linear-gradient(180deg, rgba(0, 0, 0, .28) 0%, transparent 28%, transparent 72%, rgba(0, 0, 0, .5) 100%);
}

/* Centred art-direction frame for wide screens */
.hs-frame { position: absolute; top: 0; bottom: 0; left: 0; right: 0; max-width: 1680px; margin: 0 auto; }

/* ---------- Wordmark + CTA column ---------- */
/* The wordmark column starts where the tower ends (as in the reference the tower stands
   fully visible to the left of the lettering) and runs to just before the player.
   Tower width on screen ≈ 0.33 × stage height (it is pinned to the scene, which scales
   with height); subtract the frame's left offset on screens wider than the 1680px frame.
   Player width uses the same formula as .hs-layer--player below. */
.hs-copy {
    --player-w: min(44vw, calc(var(--stage-h) * .95), 780px);
    position: absolute; top: 0; bottom: 0;
    left: max(2%, calc(var(--stage-h) * .33 - max(0px, (100vw - 1680px) / 2)));
    right: calc(var(--player-w) * .8);   /* lettering may overlap the hopper slightly, as in the reference */
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: clamp(18px, 2.4vw, 34px);
    padding-top: var(--header-h, 0px);   /* centre the art below the floating header */
    padding-bottom: 3%;
}
.hs-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
/* One line that says what is sold, right under the wordmark */
.hs-lede {
    position: relative; z-index: 4; margin: calc(clamp(18px, 2.4vw, 34px) * -.45) 0 0; max-width: 34ch;
    text-align: center; color: var(--white);
    font-size: clamp(1rem, 1.25vw, 1.2rem); font-weight: 600; line-height: 1.45;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .9), 0 0 3px rgba(0, 0, 0, .8);
    text-wrap: balance;
}
/* "from $20" price tag inside the CTA */
.hs-cta-from {
    margin-left: .55em; padding: .18em .5em .14em; border-radius: 6px;
    background: rgba(0, 0, 0, .35); color: var(--yellow);
    font-size: .72em; letter-spacing: .04em; line-height: 1.1; text-shadow: none;
}
.hs-call {
    position: relative; z-index: 4;
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px;
    color: var(--white); text-decoration: none; font-weight: 800; font-size: 1rem; letter-spacing: .01em;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .9);
}
.hs-call .icon { color: var(--yellow); filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .8)); }
.hs-call strong { color: var(--yellow); }
.hs-call:hover { color: var(--yellow); }
.hs-brand { position: relative; z-index: 2; width: 100%; isolation: isolate; will-change: transform; }
.hs-title { margin: 0; line-height: 0; }

/* Skewed clipping window. The image counter-skews inside it, so the final state is
   pixel-identical to the artwork while the window edge stays diagonal. */
.hs-reveal {
    display: block; width: 116%; margin-inline: -8%;
    overflow: hidden;
    transform: skewX(-14deg);
}
.hs-wordmark {
    display: block; width: 100%; height: auto; box-sizing: border-box;
    padding: 3% 6.9%;
    transform: skewX(14deg);
    filter: drop-shadow(0 8px 22px rgba(0, 0, 0, .55));
}

/* Paint bursting out from behind the lettering (supplied splatter artwork).
   --l/--t/--w are % of the wordmark box, which the lettering fills almost edge to edge. */
.hs-splats { position: absolute; inset: 0; z-index: -1; pointer-events: none; transform-origin: 45% 50%; }
.hs-burst { position: absolute; left: var(--l); top: var(--t); width: var(--w); height: auto; max-width: none; }
.hs-burst.is-ink { opacity: .95; }
.hs-burst.is-flip { transform: rotate(180deg); }

.hs-cta {
    position: relative; z-index: 4;
    min-width: 260px;
    filter: drop-shadow(0 10px 22px rgba(0, 0, 0, .55));
}

/* ---------- Player ---------- */
/* Sized by width (like the reference banner, ~44% of the frame) so the barrel stops at
   the wordmark's edge instead of crossing the lettering */
.hs-layer--player {
    z-index: 3;
    right: 0; bottom: -4%;
    width: min(44vw, calc(var(--stage-h) * .95), 780px); height: auto;
    aspect-ratio: 1343 / 1083;
}
.hs-player { position: relative; width: 100%; height: 100%; }
.hs-player-img {
    display: block; width: 100%; height: auto;
    filter: drop-shadow(-14px 12px 28px rgba(0, 0, 0, .45));
}
/* Cool blue paint glow behind the player: separates the dark gear from the warm sky */
.hs-glow {
    position: absolute; z-index: -1; left: 56%; top: 36%; width: 118%; height: auto;
    transform: translate(-50%, -50%);
    opacity: .78;
    pointer-events: none;
}

/* Visor glint: clipped to the lens area, a light band crosses once */
.hs-glint {
    position: absolute; left: 42%; top: 20.5%; width: 25.5%; height: 17%;
    border-radius: 48% 40% 52% 44%;
    overflow: hidden; pointer-events: none;
    transform: rotate(-7deg);
    mix-blend-mode: screen;
    opacity: 0;
}
.hs-glint::before {
    content: ""; position: absolute; top: -30%; bottom: -30%; left: 0; width: 34%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
    transform: translateX(-130%) skewX(-22deg);
}

/* ---------- Tablet ---------- */
@media (max-width: 999.98px) {
    .hs-copy { --player-w: 46vw; right: calc(46vw * .82); }
    .hs-layer--player { width: 46vw; right: -6%; }
    .hs-cta { min-width: 220px; }
}

/* ---------- Phone (and portrait tablet): art-directed separately ---------- */
@media (max-width: 699.98px), (orientation: portrait) and (max-width: 1100px) {
    .hero-stage { --stage-h: max(540px, calc(100vh - 67px)); }
    @supports (height: 100svh) {
        .hero-stage { --stage-h: max(540px, calc(100svh - 67px)); }
    }
    .hero-stage { --px: .08; --py: .5; }
    .hs-brand { max-width: 640px; }
    .hs-shade {
        background:
            radial-gradient(ellipse 90% 34% at 50% 20%, rgba(6, 10, 20, .4), transparent 72%),
            linear-gradient(180deg, rgba(0, 0, 0, .3) 0%, transparent 30%, transparent 70%, rgba(0, 0, 0, .45) 100%);
    }
    /* Wordmark across the top, CTA directly beneath (thumb-reachable, clear of the player) */
    .hs-copy {
        left: 14px; right: 14px; width: auto; top: calc(var(--header-h, 0px) + 3.5%); bottom: auto;
        justify-content: flex-start; gap: 18px; padding-top: 0; padding-bottom: 0;
    }
    .hs-actions { gap: 6px; }
    .hs-cta { min-width: min(100%, 290px); --btn-h: 60px; }
    /* Player bottom-right, visor kept fully on screen */
    .hs-layer--player { width: auto; height: 50%; right: -15%; bottom: -3%; }
}

/* Short phones (e.g. 360×640, iPhone SE): tighter stack so the call link clears the player */
@media (max-width: 699.98px) and (max-height: 740px) {
    .hs-copy { top: calc(var(--header-h, 0px) + 2%); gap: 12px; }
    .hs-brand { max-width: 300px; }
    .hs-lede { font-size: .92rem; }
    .hs-actions { gap: 2px; }
    .hs-layer--player { height: 41%; }
}

/* Phones use the 1150px crop of each plane (the tower side). The full canvas is then
   2172/1150 = 188.87% of the scene, so every prop keeps its canvas position. */
@media (max-width: 699.98px) {
    .hero-stage { --ar: 1.5884; --canvas-w: 188.87%; }
}

/* ==========================================================================
   Intro beat (skipped entirely for reduced motion → static composition)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
    .hs-player { animation: hs-player-in .75s cubic-bezier(.2, .9, .25, 1) both; }
    .hs-reveal { animation: hs-wipe-window .55s cubic-bezier(.75, 0, .2, 1) .15s both; }
    .hs-wordmark { animation: hs-wipe-art .55s cubic-bezier(.75, 0, .2, 1) .15s both; }
    .hs-splats { animation: hs-splat-hit .34s cubic-bezier(.3, 1.6, .5, 1) .62s both; }   /* the whole burst lands as one hit */
    .hs-glow { animation: hs-glow-in .6s cubic-bezier(.2, .9, .3, 1) .2s both; }   /* rises with the player, done by 0.8s */
    .hs-glint { animation: hs-glint-fade .32s ease-out .85s both; }
    .hs-glint::before { animation: hs-glint-sweep .32s cubic-bezier(.4, 0, .2, 1) .85s both; }
    /* "backwards" (not "both") so the button's normal hover lift still works afterwards */
    .hs-cta { animation: hs-cta-in .28s cubic-bezier(.2, .9, .3, 1) .92s backwards; }
    .hs-call { animation: hs-cta-in .28s cubic-bezier(.2, .9, .3, 1) .92s backwards; }
    .hs-lede { animation: hs-cta-in .28s cubic-bezier(.2, .9, .3, 1) .86s backwards; }   /* still done by 1.2s */
}

@keyframes hs-player-in {
    0%   { opacity: 0; transform: translate3d(16%, 0, 0); }
    35%  { opacity: 1; }
    100% { opacity: 1; transform: none; }
}
@keyframes hs-wipe-window {
    from { transform: translateX(-100%) skewX(-14deg); }
    to   { transform: translateX(0) skewX(-14deg); }
}
@keyframes hs-wipe-art {
    from { transform: skewX(14deg) translateX(100%); }
    to   { transform: skewX(14deg) translateX(0); }
}
@keyframes hs-splat-hit {
    0%   { opacity: 0; transform: scale(.55); }
    60%  { opacity: 1; }
    100% { opacity: 1; transform: none; }
}
@keyframes hs-glow-in {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
    to   { opacity: .78; transform: translate(-50%, -50%) scale(1); }
}
@keyframes hs-glint-fade {
    0%   { opacity: 0; }
    30%  { opacity: 1; }
    100% { opacity: 0; }
}
@keyframes hs-glint-sweep {
    from { transform: translateX(-130%) skewX(-22deg); }
    to   { transform: translateX(330%) skewX(-22deg); }
}
@keyframes hs-cta-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}
