/* Twin Layers hero (revamp/hero-twinlayers-2026-11).
   Native scroll only: the section owns a tall track; the stage is position:sticky.
   After init everything animates via canvas painting + transforms/opacity on the
   overlays (CSS vars set by iotwin-hero.js). Track height is pure CSS keyed on
   html[data-hero3d-mode] (set synchronously in head, pre-paint) - zero CLS. */

/* The sticky .site-header occupies --nav-height (its .nav-inner min-height) PLUS its 1px
   bottom border, so its real height is --nav-height + 1px. The hero reserves that REAL
   height via --hero-nav: the stage then fills exactly to the fold (no 1px overflow past one
   screen) and pins flush under the bar (never hidden under it) at every width, mobile included.
   Hero-scoped and derived from the live token, so other pages and the global token are untouched
   and it tracks any token change (incl. the intended compact mobile bar) automatically. */
.hero3d{position:relative;background:var(--surface);border-bottom:1px solid var(--hairline);--hero-nav:calc(var(--nav-height) + 1px)}
.hero3d-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.hero3d-track{position:relative}
.hero3d-stage{position:relative;min-height:calc(100svh - var(--hero-nav));overflow:clip}

/* --- canvas + SSR fallback -------------------------------------------------- */
.hero3d-canvas{position:absolute;inset:0;width:100%;height:100%;display:none}
.hero3d-static{width:min(76rem,100%);margin:0 auto;padding:0 0 2rem}
.hero3d-static img{display:block;width:100%;height:auto}
html[data-hero3d-mode] .hero3d-canvas{display:block}

/* --- live mode: the scroll track ------------------------------------------- */
html[data-hero3d-mode="live"] .hero3d-track{height:calc(100svh - var(--hero-nav) + 430svh)}
html[data-hero3d-mode="live"] .hero3d-stage{position:sticky;top:var(--hero-nav);height:calc(100svh - var(--hero-nav))}
@media(max-width:700px){
 html[data-hero3d-mode="live"] .hero3d-track{height:calc(100svh - var(--hero-nav) + 360svh)}
}
/* static (reduced-motion) mode: one settled viewport, no track */
html[data-hero3d-mode="static"] .hero3d-stage{height:calc(100svh - var(--hero-nav))}

/* --- opening copy (SSR, LCP). Releases as the camera dives - never docks. ---
   Type is fluid (clamp on vw) so H1, subhead, kicker and CTAs scale together from 360 to 1920 with no
   breakpoint jumps. The H1 is ONE headline: the accent is a colour change on the same flow, not a second block. */
.hero3d{--h3d-h1:clamp(1.65rem,.9rem + 2.2vw,3.25rem);--h3d-sub:clamp(.95rem,.78rem + .45vw,1.2rem);--h3d-kick:clamp(.6875rem,.62rem + .15vw,.8125rem);--h3d-gut:max(2rem,calc((100% - var(--page-width)) / 2))}
.hero3d-copy{position:absolute;z-index:3;left:var(--h3d-gut);top:50%;transform:translateY(-50%);width:min(48vw,46rem);opacity:1;pointer-events:auto}
html[data-hero3d-mode="live"] .hero3d-copy{opacity:var(--h3d-copy,1);transform:translateY(calc(-50% - (1 - var(--h3d-copy,1)) * 5vh))}
html[data-hero3d-mode="live"] .hero3d-copy.is-gone{pointer-events:none;visibility:hidden}
/* live: a soft scrim behind the copy so it stays legible wherever the building sits behind it; it
   rides the copy's own opacity, so it fades out with the text (no separate pop). */
html[data-hero3d-mode="live"] .hero3d-copy::before{content:"";position:absolute;z-index:-1;pointer-events:none;top:-34svh;bottom:-34svh;left:calc(var(--h3d-gut) * -1 - 4vw);right:-14vw;-webkit-mask-image:linear-gradient(to right,transparent 0,#000 9rem);mask-image:linear-gradient(to right,transparent 0,#000 9rem);background:linear-gradient(to right,color-mix(in srgb,var(--surface) 94%,transparent) 0,color-mix(in srgb,var(--surface) 88%,transparent) 62%,transparent 100%)}
.hero3d-copy .eyebrow{margin-bottom:clamp(.75rem,.4rem + 1vw,1.25rem);font-size:var(--eyebrow-size)}
.hero3d-copy h1{margin:0;font-size:var(--h3d-h1);line-height:1.08;letter-spacing:-.035em;text-wrap:balance}
.hero3d-copy h1 span{display:inline;margin:0;font:inherit;letter-spacing:inherit;line-height:inherit;color:var(--blue-light)}
.hero3d-copy .hero-description{max-width:31em;margin-block:clamp(.9rem,.5rem + 1vw,1.5rem) clamp(1.1rem,.6rem + 1.3vw,1.9rem);font-size:var(--h3d-sub);line-height:1.55;text-wrap:pretty}
.hero3d-copy .cta-row{gap:.6rem;flex-wrap:wrap}
.hero3d-copy .hero-cta-note{margin:.85rem 0 0;max-width:34rem;font-size:var(--text-sm);line-height:1.5;color:var(--muted,rgba(255,255,255,.66))}
.hero3d-copy .button{font-size:clamp(.8125rem,.74rem + .22vw,.9375rem);min-height:clamp(44px,2.6rem + .4vw,52px);padding-inline:clamp(.85rem,.5rem + .9vw,1.4rem)}
/* JS-off / static mode: give the copy a quiet scrim so it reads over the art */
html:not([data-hero3d-mode="live"]) .hero3d-copy .hero3d-copy-inner{background:color-mix(in srgb,var(--surface) 72%,transparent);backdrop-filter:blur(6px);border:1px solid var(--hairline);border-radius:var(--radius-lg);padding:1.75rem}
html:not([data-hero3d-mode]) .hero3d-copy{position:relative;top:auto;left:auto;transform:none;width:min(44rem,calc(100% - 3rem));margin:2.5rem auto 0;padding-bottom:1rem}
html:not([data-hero3d-mode]) .hero3d-copy .hero3d-copy-inner{background:none;border:0;padding:0;backdrop-filter:none}
html:not([data-hero3d-mode]) .hero3d-stage{display:flex;flex-direction:column}

/* --- act captions (small narration, bottom left - not an H1 lockup) --------- */
.hero3d-captions{position:absolute;z-index:3;left:max(2rem,calc((100% - var(--page-width)) / 2));bottom:2.6rem;pointer-events:none;display:none}
html[data-hero3d-mode="live"] .hero3d-captions{display:block}
.hero3d-cap{position:absolute;left:0;bottom:0;margin:0;width:max-content;max-width:min(34rem,66vw);display:flex;align-items:baseline;gap:.7rem;color:var(--text);font-size:.9375rem;letter-spacing:.01em;opacity:0;transform:translateY(8px)}
.hero3d-cap span{font:600 .6875rem/1 var(--mono);letter-spacing:.14em;color:var(--blue-light);padding:.3rem .45rem;border:1px solid var(--hairline);border-radius:var(--radius-sm);background:color-mix(in srgb,var(--surface) 55%,transparent);flex:none}
.hero3d-cap[data-cap="1"]{opacity:var(--h3d-c1,0);transform:translateY(calc((1 - var(--h3d-c1,0)) * 8px))}
.hero3d-cap[data-cap="2"]{opacity:var(--h3d-c2,0);transform:translateY(calc((1 - var(--h3d-c2,0)) * 8px))}
.hero3d-cap[data-cap="3"]{opacity:var(--h3d-c3,0);transform:translateY(calc((1 - var(--h3d-c3,0)) * 8px))}
.hero3d-cap[data-cap="4"]{opacity:var(--h3d-c4,0);transform:translateY(calc((1 - var(--h3d-c4,0)) * 8px))}
.hero3d-cap[data-cap="5"]{opacity:var(--h3d-c5,0);transform:translateY(calc((1 - var(--h3d-c5,0)) * 8px))}

/* --- the event rail: five events on one continuous line ------------------------- */
/* A slim glass rail along the foot of the stage. Five icon nodes sit on a single line that fills
   as the story advances (red -> ember -> blue): iotwin-hero.js sets --h3d-rail (0..1) and toggles
   .is-on / .is-now on the steps. No arrows. Static (reduced-motion) and JS-off: the whole rail lit.
   It sits below the building, not over it. */
.hero3d-feed{--ir:1.2rem;position:absolute;z-index:3;right:max(2rem,calc((100% - var(--page-width)) / 2));bottom:2rem;width:min(52rem,calc(100% - 4rem));transform:translateY(calc((1 - var(--h3d-feed,0)) * 12px));opacity:var(--h3d-feed,0);pointer-events:none;background:color-mix(in srgb,#060B13 80%,transparent);backdrop-filter:blur(8px);border:1px solid var(--hairline);border-radius:var(--radius-md);padding:1.5rem 1rem 1.05rem;display:none}
html[data-hero3d-mode="live"] .hero3d-feed,html[data-hero3d-mode="static"] .hero3d-feed{display:block}
.hero3d-feed-h{position:absolute;top:0;left:1.1rem;transform:translateY(-50%);margin:0;display:flex;align-items:center;gap:.5rem;padding:.32rem .7rem .32rem .6rem;background:#060B13;border:1px solid var(--hairline);border-radius:var(--radius-pill);font:600 .625rem/1 var(--mono);letter-spacing:.16em;text-transform:uppercase;color:var(--text)}
.hero3d-feed-h i{width:.4rem;height:.4rem;border-radius:50%;background:#E5484D;box-shadow:0 0 0 0 color-mix(in srgb,#E5484D 55%,transparent);animation:h3d-live 1.8s var(--ease) infinite}
@keyframes h3d-live{0%{box-shadow:0 0 0 0 color-mix(in srgb,#E5484D 55%,transparent)}70%,100%{box-shadow:0 0 0 .45rem transparent}}
.hero3d-feed ol{list-style:none;margin:0;padding:0;position:relative;display:grid;grid-template-columns:repeat(5,minmax(0,1fr))}
/* the rail: a hairline track through the node centres, and a gradient fill clipped to --rail */
.hero3d-feed ol::before,.hero3d-feed ol::after{content:"";position:absolute;left:10%;right:10%;top:calc(var(--ir) - 1px);height:2px;border-radius:2px}
.hero3d-feed ol::before{background:var(--hairline)}
.hero3d-feed ol::after{background:linear-gradient(to right,#E5484D 0,var(--ember) 28%,var(--ember) 40%,var(--blue-line) 70%,var(--blue-light) 100%);clip-path:inset(0 calc((1 - var(--h3d-rail,0)) * 100%) 0 0);transition:clip-path .7s var(--ease)}
.hero3d-feed li{--c:var(--ember);position:relative;z-index:1;display:flex;flex-direction:column;align-items:center;gap:.5rem;padding-inline:.3rem;text-align:center;opacity:.28;transition:opacity .45s var(--ease)}
.hero3d-feed li.is-on{opacity:1}
.hero3d-feed li[data-beat="1"]{--c:#E5484D}
.hero3d-feed li[data-beat="2"]{--c:var(--ember)}
.hero3d-feed li[data-beat="3"]{--c:var(--blue-line)}
.hero3d-feed li[data-beat="4"]{--c:var(--blue-line)}
.hero3d-feed li[data-beat="5"]{--c:var(--blue-light)}
.hero3d-feed-i{width:calc(var(--ir) * 2);height:calc(var(--ir) * 2);border-radius:50%;border:1.5px solid var(--hairline);background:#060B13;display:grid;place-items:center;color:var(--subtle);transition:border-color .45s var(--ease),color .45s var(--ease),background .45s var(--ease),box-shadow .45s var(--ease)}
.hero3d-feed-i svg{width:1.1rem;height:1.1rem}
.hero3d-feed li.is-on .hero3d-feed-i{border-color:var(--c);color:var(--c);background:color-mix(in srgb,var(--c) 15%,#060B13);box-shadow:0 0 0 4px color-mix(in srgb,var(--c) 13%,transparent)}
.hero3d-feed li.is-now .hero3d-feed-i{animation:h3d-now 1.9s var(--ease) infinite}
@keyframes h3d-now{0%,100%{box-shadow:0 0 0 4px color-mix(in srgb,var(--c) 13%,transparent)}50%{box-shadow:0 0 0 9px color-mix(in srgb,var(--c) 4%,transparent)}}
.hero3d-feed strong{display:block;font-size:.875rem;font-weight:600;line-height:1.25;color:var(--text)}
.hero3d-feed-d{display:block;margin-top:-.25rem;font-size:.75rem;line-height:1.3;color:var(--muted)}
/* static (reduced-motion) and JS-off: the whole rail lit, nothing animating */
html[data-hero3d-mode="static"] .hero3d-feed{--h3d-rail:1;opacity:1;transform:none;pointer-events:auto}
html[data-hero3d-mode="static"] .hero3d-feed li,html:not([data-hero3d-mode]) .hero3d-feed li{opacity:1}
html[data-hero3d-mode="static"] .hero3d-feed-i,html:not([data-hero3d-mode]) .hero3d-feed-i{border-color:var(--c);color:var(--c);background:color-mix(in srgb,var(--c) 15%,#060B13);box-shadow:0 0 0 4px color-mix(in srgb,var(--c) 13%,transparent)}
html:not([data-hero3d-mode]) .hero3d-feed{--h3d-rail:1}
html[data-hero3d-mode="static"] .hero3d-feed ol::after,html:not([data-hero3d-mode]) .hero3d-feed ol::after{transition:none}
html[data-hero3d-mode="static"] .hero3d-feed-h i,html:not([data-hero3d-mode]) .hero3d-feed-h i{animation:none}
html:not([data-hero3d-mode]) .hero3d-feed{display:block;position:relative;right:auto;bottom:auto;opacity:1;transform:none;width:min(52rem,calc(100% - 3rem));margin:1.75rem auto 2rem}
@media(prefers-reduced-motion:reduce){.hero3d-feed-h i,.hero3d-feed li.is-now .hero3d-feed-i{animation:none}}
/* tablet: the rail spans the stage foot; the caption lifts above it */
@media(min-width:701px) and (max-width:1100px){
 .hero3d-feed{left:2rem;right:2rem;width:auto;bottom:1.5rem}
 .hero3d-feed strong{font-size:.8125rem}
 .hero3d-feed-d{font-size:.6875rem}
}
/* phone: icons and 2-line titles only (the short lines would crowd the scene) */
@media(max-width:700px){
 .hero3d-feed{--ir:.95rem;left:1.25rem;right:1.25rem;width:auto;bottom:4.9rem;padding:1.35rem .3rem .8rem}
 .hero3d-feed-i svg{width:.95rem;height:.95rem}
 .hero3d-feed strong{font-size:.625rem;line-height:1.2}
 .hero3d-feed-d{display:none}
 .hero3d-feed li{gap:.4rem;padding-inline:.15rem}
 html[data-hero3d-mode="static"] .hero3d-feed{bottom:1rem}
 html:not([data-hero3d-mode]) .hero3d-feed{margin-top:1.25rem}
}

/* --- chips ------------------------------------------------------------------ */
.hero3d-chip{position:absolute;z-index:3;top:1.4rem;right:max(2rem,calc((100% - var(--page-width)) / 2));margin:0;font:500 .6875rem/1 var(--mono);letter-spacing:.1em;color:var(--subtle);border:1px solid var(--hairline);border-radius:var(--radius-pill);padding:.45rem .8rem;background:var(--surface);opacity:var(--h3d-chip,0);pointer-events:none;display:none}
html[data-hero3d-mode="live"] .hero3d-chip{display:block}

/* --- finale: one line, one CTA ---------------------------------------------- */
.hero3d-finale{position:absolute;z-index:4;left:50%;bottom:14svh;transform:translateX(-50%) translateY(calc((1 - var(--h3d-fin,0)) * 14px));display:none;flex-direction:column;align-items:center;gap:1.1rem;text-align:center;opacity:var(--h3d-fin,0);pointer-events:none}
html[data-hero3d-mode="live"] .hero3d-finale{display:flex}
.hero3d.is-fin .hero3d-finale{pointer-events:auto}
.hero3d-finale-line{margin:0;font-size:clamp(1.5rem,2.2vw,2.1rem);font-weight:600;letter-spacing:-.02em;color:var(--text)}

/* --- scroll cue -------------------------------------------------------------- */
.hero3d-cue{position:absolute;z-index:3;left:50%;bottom:1.2rem;transform:translateX(-50%);display:none;align-items:center;gap:.5rem;color:var(--subtle);font-size:.6875rem;letter-spacing:.06em;pointer-events:none;opacity:var(--h3d-cue,1)}
html[data-hero3d-mode="live"] .hero3d-cue{display:flex}
.hero3d-cue svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.5;animation:h3d-cue 1.9s var(--ease) infinite}
@keyframes h3d-cue{0%,100%{transform:translateY(0)}50%{transform:translateY(3px)}}
@media(prefers-reduced-motion:reduce){.hero3d-cue svg{animation:none}}

/* --- viewport tuning ---------------------------------------------------------- */
/* Stacked layout (phones, and tablets / squarish windows): copy on top, the building below it, so the
   copy never runs into the building. Wide windows keep copy left / building centre-right. */
@media(max-width:700px),(max-width:1100px) and (max-aspect-ratio:5/4){
 .hero3d-copy{left:clamp(1.25rem,5vw,2rem);right:clamp(1.25rem,5vw,2rem);width:auto;max-width:40rem;top:clamp(.75rem,5svh,3rem);transform:none}
 html[data-hero3d-mode="live"] .hero3d-copy{transform:translateY(calc((1 - var(--h3d-copy,1)) * -4vh))}
 html[data-hero3d-mode="live"] .hero3d-copy::before{top:-8svh;bottom:-16svh;left:-12vw;right:-12vw;background:linear-gradient(to bottom,color-mix(in srgb,var(--surface) 95%,transparent) 0,color-mix(in srgb,var(--surface) 90%,transparent) 66%,transparent 100%)}
 .hero3d-captions{left:clamp(1.25rem,5vw,2rem)}
}
@media(min-width:701px) and (max-width:1100px) and (max-aspect-ratio:5/4){
 .hero3d-copy .cta-row{flex-wrap:nowrap}
 .hero3d-copy .hero-description{max-width:36em}
}
@media(max-width:700px){
 .hero3d-copy .button{min-height:44px;padding:.6rem .9rem}
 .hero3d-cap{font-size:.8125rem}
 .hero3d-captions{bottom:2.4rem}
 .hero3d-chip{right:1.25rem;top:1rem}
 .hero3d-finale{left:1.25rem;right:1.25rem;transform:translateY(calc((1 - var(--h3d-fin,0)) * 14px));bottom:12svh}
 .hero3d-finale-line{font-size:1.35rem}
 html:not([data-hero3d-mode]) .hero3d-copy{margin-top:1.5rem}
}
}

/* short phones (e.g. 360x640): tighten the enlarged subhead so the card still ends above the fold */
@media(max-width:700px) and (max-height:700px){
 .hero3d-copy .hero-description{font-size:.875rem;margin-block:.7rem .9rem}
}

/* --- QA polish 2026-11 (CSS only) -------------------------------------------- */
/* Desktop finale: the line sat flush on the wireframe base; drop the lockup clear of it. */
@media(min-width:1101px){
 .hero3d-finale{bottom:calc(14svh - 2.5rem)}
}
/* Static (reduced-motion) composition: the settled frame is drawn full-stage by the canvas,
   so the copy card covered the left of the building and its device labels. The live layout
   is untouched - every rule below is keyed on data-hero3d-mode="static".
   Wide: the frame scales toward the right edge so the building and its labels sit clear of
   the card; the mask feathers the scaled frame's edges into the stage background. */
@media(min-width:1101px){
 html[data-hero3d-mode="static"] .hero3d-copy{width:min(44%,36rem)}
 html[data-hero3d-mode="static"] .hero3d-canvas{transform-origin:100% 50%;transform:translateY(-4%) scale(.74);-webkit-mask-image:linear-gradient(to right,transparent,#000 24%),linear-gradient(to bottom,transparent,#000 16%,#000 84%,transparent);-webkit-mask-composite:source-in;mask-image:linear-gradient(to right,transparent,#000 24%),linear-gradient(to bottom,transparent,#000 16%,#000 84%,transparent);mask-composite:intersect}
}
/* Tablet: card across the top, building below it (the stage grows past one viewport on
   landscape tablets so both fit without overlap). */
@media(min-width:701px) and (max-width:1100px){
 html[data-hero3d-mode="static"] .hero3d-stage{height:max(calc(100svh - var(--hero-nav)),calc(120vw + 9rem))}
 html[data-hero3d-mode="static"] .hero3d-copy{top:2rem;left:2rem;right:2rem;width:auto;transform:none}
 html[data-hero3d-mode="static"] .hero3d-canvas{transform:translateY(16%);-webkit-mask-image:linear-gradient(to bottom,transparent,#000 14%);mask-image:linear-gradient(to bottom,transparent,#000 14%)}
}
/* Phone: card to the top of the stage, building below it; short or narrow phones get a
   taller stage (the card grows as the width shrinks) so the card never covers the roof. */
@media(max-width:700px){
 html[data-hero3d-mode="static"] .hero3d-stage{height:max(calc(100svh - var(--hero-nav) + 7rem),calc(101rem - 165vw))}
 html[data-hero3d-mode="static"] .hero3d-canvas{bottom:auto;height:calc(100% - 8.5rem)}   /* the chain panel owns the foot of the stage; the scene is drawn into the part above it */
 html[data-hero3d-mode="static"] .hero3d-copy{top:1.25rem}
}
