/* ==========================================================================
   Hero phone (templates/store/_hero_anim.html + static/js/hero-phone.js): a CSS-built
   tilted iPhone 17 Pro (600x660 stage, scaled by --s into .hero-stage-wrap) running the
   claim journey as a GSAP loop. Home page only (linked from main.html's head block).
   Desktop only: hidden below lg, where the claim card comes first. Every rule is scoped
   under .hero-stage. The only rounded corners on the site are this device's squircles,
   which are part of the drawing.

   Device (iPhone 17 Pro scaled to a 290px body): body 290x605 (150.0x71.9mm), a 7px uniform
   black glass border plus a 1px aluminium lip (display inset 8), display 274x589, corner radii
   50 body / 49 glass / 42 display (concentric), corner-shape: squircle with a border-radius fallback,
   the display clip is a superellipse path() built by hero-phone.js from the same numbers
   (CSS keeps inset(round) until the script runs). Frame: matte aluminium, Deep Blue in the
   dark theme, Silver in the light theme (--ph-* tokens); the unibody is 35px deep (8.75mm), drawn as
   five depth layers 7px apart behind the front face, so the rig's 14deg turn shows a flat side face on
   the left with the buttons at mid-thickness and two 1px antenna bands (9% / 91% of the height).
   Dynamic Island 86x25 capsule, top 8. Status bar 41px (9:41 at 26px; the cellular / Wi-Fi / battery
   cluster ~55px wide, ~20px clear of the island) and the home indicator sit on every screen.
   Screens: S1 Shopee order, S2 Benevolence claim, S3 credentials sheet, S4 tool log in,
   S5 you're in. .hero-stage.static = the final frame (reduced motion, or GSAP missing).
   ========================================================================== */
.hero-visual { display: none; }
@media (min-width: 992px) {
    .hero-visual { display: flex; align-items: center; justify-content: center; align-self: stretch; }
}
.hero-stage-wrap { --s: 1; position: relative; width: 100%; max-width: 600px; aspect-ratio: 600 / 660; }
.hero-stage {
    /* Deep Blue aluminium (dark theme). Satin: one flat colour, a lighter top edge, a darker bottom edge, no shine. */
    --ph-frame: #2c4168; --ph-frame-hi: #4a6494; --ph-frame-lo: #1d2d4c; --ph-side: #31497a; --ph-rim: rgba(255, 255, 255, .14); --ph-btn: #4c6592;
    position: absolute; left: 0; top: 0; width: 600px; height: 660px; transform: scale(var(--s)); transform-origin: 0 0; perspective: 1500px; perspective-origin: 52% 42%; pointer-events: none; user-select: none; font-family: var(--bs-font-sans-serif);
}
/* Silver (light theme): the rim is the darker chamfer line where the glass meets the frame, so the 1px lip stays a hairline and never a bright ring */
[data-bs-theme="light"] .hero-stage { --ph-frame: #d3d6dc; --ph-frame-hi: #eef0f3; --ph-frame-lo: #aeb3bd; --ph-side: #bfc3cb; --ph-rim: rgba(0, 0, 0, .3); --ph-btn: #e3e5ea; }
.hero-stage .rig { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(4deg) rotateY(14deg); will-change: transform; }
.hero-stage .ground { position: absolute; left: 118px; top: 572px; width: 380px; height: 76px; background: radial-gradient(closest-side, var(--hero-ground), transparent); transform: translateZ(-40px); opacity: .75; }

/* Device: flat-sided unibody slab. Depth layers = the aluminium side face, 35px deep in five 7px steps (one colour, the far edge a shade darker),
   with the antenna bands as a background-image on the layers only: nothing on the front. */
.hero-stage .phone-float { position: absolute; left: 163px; top: 0; width: 290px; height: 605px; transform-style: preserve-3d; will-change: transform; }
.hero-stage .phone { position: absolute; inset: 0; transform-style: preserve-3d; }
.hero-stage .phone-depth, .hero-stage .phone-body, .hero-stage .glass, .hero-stage .screen { corner-shape: squircle; }
.hero-stage .phone-depth { position: absolute; inset: 0; border-radius: 50px; background: var(--ph-side); background-image: linear-gradient(180deg, transparent calc(9% - .5px), var(--ph-frame-lo) calc(9% - .5px) calc(9% + .5px), transparent calc(9% + .5px) calc(91% - .5px), var(--ph-frame-lo) calc(91% - .5px) calc(91% + .5px), transparent calc(91% + .5px)); }
.hero-stage .phone-depth.d1 { transform: translateZ(-7px); }
.hero-stage .phone-depth.d2 { transform: translateZ(-14px); }
.hero-stage .phone-depth.d3 { transform: translateZ(-21px); }
.hero-stage .phone-depth.d4 { transform: translateZ(-28px); }
.hero-stage .phone-depth.d5 { transform: translateZ(-35px); background: var(--ph-frame-lo); }
.hero-stage .phone-body { position: absolute; inset: 0; border-radius: 50px; background: linear-gradient(180deg, var(--ph-frame-hi) 0, var(--ph-frame) 5%, var(--ph-frame) 95%, var(--ph-frame-lo) 100%); box-shadow: inset 0 0 0 1px var(--ph-rim), 0 34px 54px -30px rgba(0, 0, 0, .65); }
/* front glass: black border around the display, 1px of frame lip showing outside it, a faint glass edge at the top */
.hero-stage .glass { position: absolute; inset: 1px; border-radius: 49px; background: #000; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07); }
/* buttons on the frame (same metal, slightly lighter face), siblings of the depth layers at mid-thickness (z -17 of the 35px side), 4px proud of it,
   ends shaded so they read as machined parts. Left: Action, volume up, volume down. Right: side button, Camera Control (flush): the rig turns
   that side away, so the body and the front depth layers occlude them. */
.hero-stage .side-btn { position: absolute; width: 4px; transform: translateZ(-17px); background: linear-gradient(180deg, var(--ph-frame-lo), var(--ph-btn) 18% 82%, var(--ph-frame-lo)); }
.hero-stage .side-btn.act { left: -4px; top: 85px; height: 18px; border-radius: 2px 0 0 2px; }
.hero-stage .side-btn.vu { left: -4px; top: 121px; height: 42px; border-radius: 2px 0 0 2px; }
.hero-stage .side-btn.vd { left: -4px; top: 173px; height: 42px; border-radius: 2px 0 0 2px; }
.hero-stage .side-btn.pwr { right: -4px; top: 145px; height: 74px; border-radius: 0 2px 2px 0; }
.hero-stage .side-btn.cam { right: -2px; top: 320px; height: 26px; width: 2px; border-radius: 0 1px 1px 0; }
/* clip-path (not overflow) is what actually clips inside a preserve-3d rig in Chrome; the screen flattens its children and isolates its own stacking context.
   hero-phone.js replaces the inset(round) clip with the matching superellipse path(). */
.hero-stage .screen { position: absolute; inset: 8px; border-radius: 42px; background: #000; overflow: hidden; clip-path: inset(0 round 42px); transform: translateZ(0); transform-style: flat; isolation: isolate; }
.hero-stage .island { position: absolute; top: 8px; left: 50%; width: 86px; height: 25px; margin-left: -43px; background: #000; border-radius: 13px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .04); z-index: 60; }
.hero-stage .tap { position: absolute; left: 0; top: 0; width: 26px; height: 26px; margin: -13px 0 0 -13px; background: rgba(255, 255, 255, .26); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .8); z-index: 40; opacity: 0; }

/* Screens: iOS status bar (41px tall, the time and icons centred on the island's row) + home indicator on every screen */
.hero-stage .scr { position: absolute; inset: 0; font-family: var(--bs-font-sans-serif); font-size: 11px; line-height: 1.35; }
.hero-stage .sb { position: absolute; top: 0; left: 0; right: 0; height: 41px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px 0 26px; font-size: 12.5px; font-weight: 600; letter-spacing: -.01em; z-index: 55; }
.hero-stage .sb .sbr { display: flex; align-items: center; gap: 4.6px; }
.hero-stage .sb .sig { display: inline-flex; align-items: flex-end; gap: 1.2px; height: 9px; }
.hero-stage .sb .sig i { width: 2.4px; background: currentColor; display: block; border-radius: .6px; }
.hero-stage .sb .sig i:nth-child(1) { height: 3px; } .hero-stage .sb .sig i:nth-child(2) { height: 5px; } .hero-stage .sb .sig i:nth-child(3) { height: 7px; } .hero-stage .sb .sig i:nth-child(4) { height: 9px; }
.hero-stage .sb .wifi { display: block; width: 12px; height: 9px; }
.hero-stage .sb .wifi path { stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; }
.hero-stage .sb .wifi circle { fill: currentColor; }
.hero-stage .sb .bat { width: 18.5px; height: 9.5px; border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 40%, transparent); border-radius: 3px; padding: 1.2px; position: relative; margin-right: 2.4px; }
.hero-stage .sb .bat::before { content: ""; display: block; width: 72%; height: 100%; background: currentColor; border-radius: 1.2px; }
.hero-stage .sb .bat::after { content: ""; position: absolute; right: -3px; top: 2px; width: 1.2px; height: 3.5px; background: currentColor; opacity: .4; border-radius: 0 1px 1px 0; }
.hero-stage .hi { position: absolute; left: 50%; bottom: 6px; width: 90px; height: 4px; margin-left: -45px; border-radius: 2px; background: currentColor; opacity: .85; z-index: 50; }
.hero-stage .mg { width: 30px; height: 30px; background: #15181f; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.hero-stage .swap { display: inline-grid; }
.hero-stage .swap > span { grid-area: 1 / 1; white-space: nowrap; }
.hero-stage .swap .l2 { opacity: 0; }

/* S1 Shopee (Shopee's own colours, the same in both themes). The orange header carries the status bar (41px) + its own 43px title row. */
.hero-stage .scr-shopee { background: #f3f3f3; color: #222; z-index: 1; }
.hero-stage .scr-shopee .sb { color: #fff; }
.hero-stage .sp-top { background: #ee4d2d; height: 84px; color: #fff; }
.hero-stage .sp-head { position: absolute; top: 41px; left: 0; right: 0; height: 43px; display: flex; align-items: center; gap: 10px; padding: 0 14px; font-size: 13px; font-weight: 600; color: #fff; }
.hero-stage .sp-head .chev { font-size: 18px; line-height: 1; font-weight: 400; margin-top: -2px; }
.hero-stage .sp-card { background: #fff; margin: 8px 10px 0; padding: 9px 12px; }
.hero-stage .sp-st { font-size: 12px; font-weight: 700; color: #1f7a3f; }
.hero-stage .sp-st-s { font-size: 10px; color: #777; margin-top: 1px; }
.hero-stage .sp-shop { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 600; padding-bottom: 7px; border-bottom: 1px solid #eee; }
.hero-stage .sp-badge { font-size: 8px; font-weight: 700; color: #ee4d2d; border: 1px solid #ee4d2d; padding: 1px 4px; letter-spacing: .04em; }
.hero-stage .sp-item { display: flex; align-items: center; gap: 9px; padding-top: 8px; }
.hero-stage .sp-name { font-size: 11px; font-weight: 500; }
.hero-stage .sp-var { font-size: 9.5px; color: #888; margin-top: 1px; }
.hero-stage .sp-price { margin-left: auto; font-size: 11px; font-weight: 600; }
.hero-stage .sp-total { display: flex; justify-content: space-between; font-size: 10.5px; color: #555; padding-top: 8px; margin-top: 8px; border-top: 1px solid #eee; }
.hero-stage .sp-total b { color: #ee4d2d; font-size: 12px; }
.hero-stage .sp-row { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: #666; padding: 5px 0; }
.hero-stage .sp-row + .sp-row { border-top: 1px solid #f0f0f0; }
.hero-stage .sp-idrow { padding: 7px 0; }
.hero-stage .sp-id { position: relative; isolation: isolate; margin-left: auto; margin-right: 10px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 11px; font-weight: 600; color: #222; }
/* a highlighter pen, not the brand accent (isolation on .sp-id keeps it under the digits but over the white card) */
.hero-stage .sp-hl { position: absolute; left: -4px; right: -4px; top: -2px; bottom: -2px; background: rgba(255, 228, 92, .7); transform: scaleX(0); transform-origin: 0 50%; z-index: -1; }
.hero-stage .sp-copy { color: #ee4d2d; font-weight: 700; font-size: 9.5px; letter-spacing: .04em; }
.hero-stage .sp-btn { margin: 10px 10px 0; height: 34px; border: 1px solid #ee4d2d; color: #ee4d2d; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; background: #fff; }

/* S2 Benevolence claim (theme tokens; no lime in here: the page's Redeem button is the only lime object). Parked 4px past the 274px display. */
.hero-stage .scr-claim { background: var(--bnv-bg); color: var(--bnv-text); z-index: 2; transform: translateX(278px); visibility: hidden; }
.hero-stage .scr-claim .sb { color: var(--bnv-text); }
.hero-stage .bv-head { position: absolute; top: 41px; left: 0; right: 0; height: 41px; display: flex; align-items: center; gap: 7px; padding: 0 18px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--bnv-border); }
.hero-stage .bv-head svg { width: 13px; height: 13px; fill: var(--bnv-text); }
.hero-stage .bv-body { position: absolute; top: 82px; left: 0; right: 0; padding: 16px 18px; }
.hero-stage .bv-eyebrow { font-size: 8.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--bnv-muted); display: flex; align-items: center; gap: 6px; }
.hero-stage .bv-eyebrow::before { content: ""; width: 5px; height: 5px; background: var(--bnv-muted); }
.hero-stage .bv-title { font-family: "Instrument Serif", Georgia, serif; font-size: 24px; line-height: 1.05; margin: 9px 0 10px; letter-spacing: -.01em; }
.hero-stage .bv-label { font-size: 10px; font-weight: 600; margin-bottom: 5px; }
.hero-stage .bv-input { position: relative; height: 40px; border: 1px solid var(--bnv-border); background: var(--bnv-surface-2); padding: 0 11px; display: flex; align-items: center; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 13px; font-weight: 500; }
.hero-stage .bv-input .ph { position: absolute; left: 11px; top: 0; line-height: 40px; color: var(--bnv-muted); opacity: .6; font-weight: 400; }
.hero-stage .bv-input .typed span { opacity: 0; }
.hero-stage .caret-wrap { position: absolute; left: 11px; top: 11px; height: 18px; }
.hero-stage .caret { display: block; width: 1.5px; height: 18px; background: var(--bnv-text); }
/* the mini Redeem button is the inverse of the page (text colour on text colour's opposite), labels stacked in one grid cell so both sit centred */
.hero-stage .bv-btn { position: relative; height: 40px; margin-top: 9px; background: var(--bnv-text); color: var(--bnv-bg); display: grid; place-items: center; font-size: 12px; font-weight: 600; }
.hero-stage .bv-btn > span { grid-area: 1 / 1; }
.hero-stage .bv-btn .l2 { display: inline-flex; align-items: center; gap: 7px; }
.hero-stage .vdots { display: inline-flex; gap: 3px; }
.hero-stage .vdots i { width: 4px; height: 4px; background: var(--bnv-bg); opacity: .3; display: block; }
.hero-stage .bv-hint { font-size: 9px; color: var(--bnv-muted); margin-top: 9px; line-height: 1.5; }
.hero-stage .bv-hint b { font-family: "JetBrains Mono", ui-monospace, monospace; color: var(--bnv-text); font-weight: 600; }

/* S3 Credentials sheet (slides up over the claim screen; it carries its own home indicator, like an iOS sheet) */
.hero-stage .sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 372px; background: var(--bnv-surface); border-top: 1px solid var(--bnv-border); z-index: 3; padding: 10px 16px 0; transform: translateY(376px); visibility: hidden; box-shadow: 0 -20px 40px -20px rgba(0, 0, 0, .35); color: var(--bnv-text); font-family: var(--bs-font-sans-serif); font-size: 11px; }
.hero-stage .sh-grab { width: 34px; height: 3px; background: var(--bnv-border); margin: 0 auto 12px; }
.hero-stage .sh-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.hero-stage .sh-title .tk { width: 16px; height: 16px; background: var(--bnv-text); color: var(--bnv-bg); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none; }
.hero-stage .sh-sub { font-size: 9.5px; color: var(--bnv-muted); margin-bottom: 10px; }
.hero-stage .sh-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-top: 1px solid var(--bnv-border); }
.hero-stage .sh-k { width: 52px; font-size: 8.5px; line-height: 1.2; letter-spacing: .1em; text-transform: uppercase; color: var(--bnv-muted); flex: none; }
.hero-stage .sh-v { flex: 1; min-width: 0; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 10.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-stage .sh-copy { flex: none; font-size: 9px; font-weight: 600; padding: 5px 8px; border: 1px solid var(--bnv-border); background: var(--bnv-surface-2); }
.hero-stage .sh-note { font-size: 9px; color: var(--bnv-muted); margin-top: 10px; line-height: 1.5; }

/* S4 Tool log in (the third-party site: white in both themes). Parked 4px past the 274px display. */
.hero-stage .scr-login { background: #fff; color: #15181f; z-index: 4; transform: translateX(278px); visibility: hidden; }
.hero-stage .scr-login .sb { color: #15181f; }
.hero-stage .lg-body { position: absolute; top: 82px; left: 0; right: 0; padding: 10px 22px; }
.hero-stage .lg-logo { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.hero-stage .lg-logo .mg { width: 24px; height: 24px; font-size: 12px; }
.hero-stage .lg-title { font-size: 19px; font-weight: 600; letter-spacing: -.02em; margin: 26px 0 4px; }
.hero-stage .lg-sub { font-size: 10px; color: #6b7280; margin-bottom: 18px; }
.hero-stage .lg-lbl { font-size: 9px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.hero-stage .lg-field { height: 38px; border: 1px solid #d6d9e0; padding: 0 11px; display: flex; align-items: center; font-size: 11.5px; margin-bottom: 12px; font-family: "JetBrains Mono", ui-monospace, monospace; }
.hero-stage .lg-field span span { opacity: 0; }
.hero-stage .lg-dots span { font-size: 14px; letter-spacing: .08em; }
.hero-stage .lg-btn { height: 38px; background: #15181f; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; margin-top: 4px; }
.hero-stage .lg-foot { font-size: 9px; color: #6b7280; text-align: center; margin-top: 14px; }

/* S5 You're in (also the static fallback frame, see .hero-stage.static) */
.hero-stage .scr-in { background: #fff; color: #15181f; z-index: 5; opacity: 0; }
.hero-stage .scr-in .sb { color: #15181f; }
.hero-stage .in-bar { position: absolute; top: 41px; left: 0; right: 0; height: 41px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid #eceef1; font-size: 12px; font-weight: 700; }
.hero-stage .in-bar .mg { width: 22px; height: 22px; font-size: 11px; }
.hero-stage .in-bar .av { margin-left: auto; width: 20px; height: 20px; background: #e6e8ee; }
.hero-stage .in-skel { position: absolute; top: 96px; left: 16px; right: 16px; opacity: .55; }
.hero-stage .in-skel .banner { height: 48px; background: #e8eaef; margin-bottom: 12px; }
.hero-stage .in-skel .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.hero-stage .in-skel .tile { height: 32px; background: #e8eaef; }
.hero-stage .in-skel .ln { height: 7px; background: #e8eaef; margin-bottom: 7px; }
.hero-stage .in-skel .ln.s { width: 55%; } .hero-stage .in-skel .ln.m { width: 78%; }
.hero-stage .in-hero { position: absolute; left: 0; right: 0; top: 250px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-stage .in-circle { width: 68px; height: 68px; background: #15181f; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.hero-stage .tick { position: relative; width: 30px; height: 30px; }
.hero-stage .tick-a { position: absolute; left: 5px; top: 14px; width: 10px; height: 3.2px; background: #fff; transform-origin: 0 50%; transform: rotate(45deg); }
.hero-stage .tick-b { position: absolute; left: 11.6px; top: 20.6px; width: 18px; height: 3.2px; background: #fff; transform-origin: 0 50%; transform: rotate(-45deg); }
.hero-stage .in-title { font-family: "Instrument Serif", Georgia, serif; font-size: 26px; line-height: 1; margin-top: 16px; letter-spacing: -.01em; }
.hero-stage .in-sub { font-size: 10px; color: #6b7280; margin-top: 6px; }

/* Prop: the brass key with its kraft tag, mid-right, in front of the phone ("key arrives").
   left >= 448px keeps the projected tag edge clear of the phone body's right bezel (rig rotationY 14deg + translateZ 30px). */
.hero-stage .prop { position: absolute; opacity: 0; }
.hero-stage .prop .fl { position: relative; }
.hero-stage .prop-key { left: 448px; top: 150px; width: 126px; transform: translateZ(30px); transform-origin: 18% 15%; }
.hero-stage .keyprop { filter: drop-shadow(0 16px 14px var(--hero-shadow)); }
.hero-stage .keyprop svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Static fallback: reduced motion, or GSAP failed to load. Pure CSS, the final "you're in" frame. */
.hero-stage.static .scr-in { opacity: 1; }
.hero-stage.static .prop { opacity: 1; }
.hero-stage.static .prop-key { transform: translateZ(30px) rotate(8deg); }
.hero-stage.static .tap { display: none; }
