/* ==========================================================================
   CMU Student Compass — Immersive design system · HERO + GLOBAL CHROME
   Act I "ก่อนรุ่งสาง": a pinned sunrise over Doi Suthep.

   Sections
     1. chrome — progress line
     2. chrome — floating navigation capsule
     3. chrome — overlay menu (phones)
     4. hero — section, timeline variables, stage
     5. hero — scene: sky, stars, sun, parallax layers, mist, foliage, grade, veil
     6. hero — beat 1: brand lock-up
     7. hero — beat 2: headline + four-step trail
     8. hero — scroll cue
     9. hero — responsive variants
    10. hero — static composition (reduced motion / no JS)
    11. accessibility: high contrast, forced colours, print

   All scroll-linked visuals are transform / opacity / clip-path values computed from the engine's
   --imm-pin (through --hp) and --imm-mx / --imm-my. Nothing here listens to scroll.
   will-change is set only on layers whose transform / opacity / filter changes with scroll or loops: without it the
   full-screen gradient layers would be repainted on every scroll frame (measured: stale tiles at 3840×2160).
   ========================================================================== */

/* ============================================================ 1. progress line */
.imm-progress {
  position: fixed; inset: 0 0 auto 0; z-index: var(--imm-z-progress);
  height: 2px; pointer-events: none;
}
.imm-progress__bar {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--imm-gold-500), var(--imm-gold-300) 60%, #fff3cf);
  box-shadow: 0 0 14px rgba(250, 172, 30, 0.75);
  transform: scaleX(0); transform-origin: 0 50%;
}
.imm-symbols { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ============================================================ 2. navigation capsule */
.imm-nav {
  position: fixed; inset: 0 0 auto 0; z-index: var(--imm-z-nav);
  padding: calc(var(--imm-safe-t) + 10px) max(var(--imm-gutter), var(--imm-safe-r)) 0 max(var(--imm-gutter), var(--imm-safe-l));
  pointer-events: none; /* only the capsule is interactive: the scene below stays scrollable / hoverable */
  transition: transform 0.7s var(--imm-ease-out), opacity 0.4s ease, visibility 0s, z-index 0s linear 0.7s;
}
.imm-nav.is-away { transform: translate3d(0, -140%, 0); }
.imm-nav:focus-within { transform: none; } /* never hide the bar from keyboard users */

.imm-nav__bar {
  position: relative; isolation: isolate;
  display: flex; align-items: center; gap: clamp(6px, 1vw, 14px);
  width: 100%; max-width: var(--imm-max-wide); height: var(--imm-nav-h); margin-inline: auto;
  padding: 0 8px 0 10px; border-radius: var(--imm-r-pill);
  color: #fff; pointer-events: auto;
}
/* dark glass skin: fades in once the page has scrolled (opacity only — no layout animation).
   Deeper than the generic dark-glass token: over the cream journey a 56% tint reads as muddy grey, so the capsule
   keeps a rich night-indigo body with a faint gold rim. */
.imm-nav__bar::before {
  content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: linear-gradient(180deg, rgba(34, 28, 84, 0.86) 0%, rgba(14, 12, 40, 0.84) 100%);
  border: 1px solid rgba(255, 223, 148, 0.22);
  box-shadow: 0 18px 46px rgba(27, 24, 56, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  -webkit-backdrop-filter: blur(var(--imm-blur)) saturate(1.4); backdrop-filter: blur(var(--imm-blur)) saturate(1.4);
  opacity: 0; transition: opacity 0.6s ease;
}
html.imm-scrolled .imm-nav__bar::before { opacity: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .imm-nav__bar::before { background: rgba(19, 16, 52, 0.94); }
}

.imm-nav__brand {
  display: inline-flex; align-items: center; gap: 0.7em; min-height: 44px; margin-right: auto; padding-right: 0.6em;
  color: inherit; text-decoration: none; border-radius: var(--imm-r-pill);
}
.imm-nav__mark {
  flex: none; display: grid; place-items: center;
  width: calc(var(--imm-nav-h) - 16px); height: calc(var(--imm-nav-h) - 16px); border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0%, var(--imm-cream) 70%);
  box-shadow: 0 0 0 1px rgba(250, 172, 30, 0.55), 0 6px 18px rgba(5, 4, 20, 0.35);
  transition: transform 0.9s var(--imm-ease-spring);
}
.imm-nav__mark img { display: block; width: 72%; height: 72%; }
.imm-nav__name { font-size: var(--imm-fs-md); font-weight: 300; line-height: 1; letter-spacing: 0.01em; white-space: nowrap; text-shadow: 0 1px 12px rgba(10, 9, 32, 0.55); }
.imm-nav__name b { font-weight: 600; }
@media (hover: hover) {
  .imm-nav__brand:hover .imm-nav__mark { transform: rotate(90deg); }
}

.imm-nav__links { display: flex; align-items: center; gap: clamp(2px, 0.6vw, 10px); }
.imm-nav__link {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 clamp(10px, 1.1vw, 18px);
  font-size: var(--imm-fs-sm); font-weight: 400; line-height: 1; color: rgba(255, 255, 255, 0.86); text-decoration: none;
  text-shadow: 0 1px 12px rgba(10, 9, 32, 0.55); border-radius: var(--imm-r-pill);
  transition: color var(--imm-dur-2) ease;
}
.imm-nav__link::after { /* gold hairline that draws from the left */
  content: ''; position: absolute; left: clamp(10px, 1.1vw, 18px); right: clamp(10px, 1.1vw, 18px); bottom: 9px; height: 1.5px;
  background: var(--imm-gold-300); border-radius: 2px;
  transform: scaleX(0); transform-origin: 0 50%; transition: transform 0.6s var(--imm-ease-out);
}
.imm-nav__link.is-current { color: #fff; }
.imm-nav__link.is-current::after { transform: scaleX(1); }
@media (hover: hover) {
  .imm-nav__link:hover { color: #fff; }
  .imm-nav__link:hover::after { transform: scaleX(1); }
}

.imm-nav__icon, .imm-nav__toggle {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  font: inherit; color: #fff; background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--imm-dur-2) ease, border-color var(--imm-dur-2) ease, color var(--imm-dur-2) ease, transform var(--imm-dur-2) var(--imm-ease-out);
}
.imm-nav__icon svg, .imm-nav__toggle svg { display: block; }
@media (hover: hover) {
  .imm-nav__icon:hover, .imm-nav__toggle:hover { background: rgba(250, 172, 30, 0.18); border-color: var(--imm-gold-300); color: var(--imm-gold-200); }
}
.imm-nav__icon:active, .imm-nav__toggle:active { transform: scale(0.94); }

/* language switch (i18n.js): TH | EN in the bar on wide screens; on phones it lives in the Navigate menu */
.imm-nav__lang {
  flex: none; display: inline-flex; gap: 2px; padding: 3px; margin-right: 2px;
  border: 1px solid rgba(255, 255, 255, 0.3); border-radius: var(--imm-r-pill); background: rgba(255, 255, 255, 0.08);
}
.imm-nav__lang button, .imm-menu__lang button {
  min-width: 36px; min-height: 36px; padding: 0 0.7em; border: 0; border-radius: var(--imm-r-pill); background: transparent;
  font: inherit; font-size: var(--imm-fs-xs); font-weight: 500; letter-spacing: 0.06em; color: rgba(255, 255, 255, 0.78);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background-color var(--imm-dur-2) ease, color var(--imm-dur-2) ease;
}
.imm-nav__lang button[aria-pressed='true'], .imm-menu__lang button[aria-pressed='true'] { color: var(--imm-night); background: var(--imm-gold-300); }
@media (hover: hover) {
  .imm-nav__lang button:not([aria-pressed='true']):hover, .imm-menu__lang button:not([aria-pressed='true']):hover { color: #fff; background: rgba(255, 255, 255, 0.12); }
}
.imm-nav__lang button:focus-visible, .imm-menu__lang button:focus-visible { outline: 2px solid var(--imm-gold-300); outline-offset: 2px; }
.imm-menu__lang { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: clamp(16px, 3vh, 28px); }
.imm-menu__lang-label { font-size: var(--imm-fs-xs); font-weight: 400; letter-spacing: 0.04em; color: rgba(246, 243, 255, 0.62); }
.imm-menu__lang-pill { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--imm-r-pill); background: rgba(255, 255, 255, 0.06); }
.imm-menu__lang button { min-height: 40px; padding: 0 1.1em; font-size: var(--imm-fs-sm); letter-spacing: 0; }
html.a11y-high-contrast :is(.imm-nav__lang, .imm-menu__lang-pill) { border: 2px solid #fff; background: #05050c; }
html.a11y-high-contrast :is(.imm-nav__lang, .imm-menu__lang) button { color: #fff; }
html.a11y-high-contrast :is(.imm-nav__lang, .imm-menu__lang) button[aria-pressed='true'] { color: #05050c; background: #ffe29a; }

/* compass-rose toggle (phones) */
.imm-nav__toggle { display: none; width: 46px; height: 46px; }
.imm-rose { overflow: visible; }
.imm-rose__ring, .imm-rose__ticks { opacity: 0.6; transform-origin: 24px 24px; transition: opacity 0.5s ease, transform 0.9s var(--imm-ease-out); }
.imm-rose__star { transform-origin: 24px 24px; transition: transform 0.9s var(--imm-ease-spring); }
.imm-rose__ns { fill: var(--imm-gold-300); transition: fill 0.5s ease; }
html.imm-menu-open .imm-rose__star { transform: rotate(135deg) scale(1.12); }
html.imm-menu-open .imm-rose__ring { opacity: 0; transform: scale(1.35); }
html.imm-menu-open .imm-rose__ticks { opacity: 0; transform: rotate(-90deg) scale(0.6); }
html.imm-menu-open .imm-rose__ns { fill: currentColor; }

/* the bar steps aside while a modal owns the screen */
body.no-scroll .imm-nav, body.no-scroll .imm-progress { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.25s ease, visibility 0s linear 0.25s; }
body.no-scroll .imm-nav__bar { pointer-events: none; }

@media (max-width: 767.98px) {
  .imm-nav { padding-left: max(12px, var(--imm-safe-l)); padding-right: max(12px, var(--imm-safe-r)); }
  .imm-nav__links, .imm-nav__icon, .imm-nav__lang { display: none; }
  .imm-nav__toggle { display: grid; }
  .imm-nav__bar { padding: 0 5px 0 7px; }
}
@media (max-width: 339.98px) {
  .imm-nav__name { font-size: var(--imm-fs-sm); }
}
/* without JS the toggle and the accessibility opener cannot work: show plain anchors instead */
html:not(.imm-js) .imm-nav__toggle, html:not(.imm-js) .imm-nav__icon { display: none; }
html:not(.imm-js) .imm-nav__links { display: flex; }
@media (max-width: 479.98px) {
  html:not(.imm-js) .imm-nav__name { display: none; }
}

/* ============================================================ 3. overlay menu (phones) */
.imm-menu {
  --_x: var(--imm-menu-x, calc(100% - 36px)); --_y: var(--imm-menu-y, 44px);
  position: fixed; inset: 0; z-index: calc(var(--imm-z-nav) - 1);
  display: flex; flex-direction: column;
  color: var(--imm-ink-inv);
  background:
    radial-gradient(120% 70% at 78% 108%, rgba(232, 120, 104, 0.34) 0%, rgba(138, 77, 143, 0.2) 38%, transparent 70%),
    linear-gradient(180deg, #0a0920 0%, #17123f 46%, #2e2168 100%);
  overflow: hidden auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  visibility: hidden; pointer-events: none;
  clip-path: circle(0px at var(--_x) var(--_y));
  transition: clip-path 0.6s var(--imm-ease-in-out), visibility 0s linear 0.6s, z-index 0s linear 0.6s;
}
html.imm-menu-open .imm-menu {
  z-index: 10050; visibility: visible; pointer-events: auto;
  clip-path: circle(var(--imm-menu-r, 150vmax) at var(--_x) var(--_y));
  transition: clip-path 1s var(--imm-ease-out), visibility 0s, z-index 0s;
}
/* while the overlay is open the bar stays on top of it (close control) and the page does not scroll.
   10050+ sits above the mascot / help launcher on purpose: the overlay is a full takeover and no modal can be open with it. */
html.imm-menu-open .imm-nav { z-index: 10051; transform: none; transition: transform 0.7s var(--imm-ease-out), z-index 0s; }
html.imm-menu-open .imm-nav__bar::before { opacity: 0; }
html.imm-menu-open body { overflow: hidden; }

.imm-menu__scene { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.imm-menu__scene::before { /* a quiet field of stars */
  content: ''; position: absolute; inset: 0 0 35% 0; opacity: 0.8;
  background-image:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 31% 42%, #ffe2b0 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 54% 12%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 72% 31%, #f3f0ff 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 88% 9%, #fff 50%, transparent 52%), radial-gradient(1px 1px at 8% 58%, #f3f0ff 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 44% 66%, #ffe2b0 50%, transparent 52%), radial-gradient(1px 1px at 64% 54%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 93% 47%, #f3f0ff 50%, transparent 52%), radial-gradient(1.2px 1.2px at 22% 82%, #fff 50%, transparent 52%);
  -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent);
}
.imm-menu__dial {
  position: absolute; right: -34vmin; bottom: -30vmin; width: 118vmin; height: 118vmin;
  color: var(--imm-gold-200); opacity: 0.2;
  transform: rotate(-24deg) scale(0.82); transition: transform 1.6s var(--imm-ease-out), opacity 1s ease;
}
html.imm-menu-open .imm-menu__dial { transform: rotate(0deg) scale(1); opacity: 0.34; }
.imm-menu__ridge {
  position: absolute; left: -12%; bottom: 0; width: 124%; max-width: none; height: auto;
  filter: brightness(0.16) saturate(0.5); opacity: 0.95;
  transform: translate3d(0, 28%, 0); transition: transform 1.3s var(--imm-ease-out) 0.05s;
}
html.imm-menu-open .imm-menu__ridge { transform: translate3d(0, 6%, 0); }

.imm-menu__nav {
  position: relative; flex: 1 0 auto; display: flex; flex-direction: column; justify-content: center;
  width: 100%; max-width: 560px; margin-inline: auto;
  padding: calc(var(--imm-safe-t) + var(--imm-nav-h) + 34px) max(26px, var(--imm-safe-r)) calc(var(--imm-safe-b) + 28px) max(26px, var(--imm-safe-l));
}
.imm-menu__eyebrow { margin-bottom: clamp(10px, 2.4vh, 22px); }
.imm-menu__list { list-style: none; display: grid; counter-reset: imm-menu; }
.imm-menu__item { border-bottom: 1px solid rgba(255, 255, 255, 0.12); counter-increment: imm-menu; }
.imm-menu__num::before { content: counter(imm-menu, decimal-leading-zero); } /* numbering skips hidden items */
/* the trail stays sealed until the menus unlock (journey.js): every link to it waits with it */
html.imm-trail-sealed :is(.imm-nav__link, .imm-menu__link)[href="#imm-trail"],
html.imm-trail-sealed .imm-menu__item:has(> a[href="#imm-trail"]) { display: none !important; }
.imm-menu__item:nth-child(1) { --_i: 0; }
.imm-menu__item:nth-child(2) { --_i: 1; }
.imm-menu__item:nth-child(3) { --_i: 2; }
.imm-menu__item:nth-child(4) { --_i: 3; }
.imm-menu__link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: clamp(14px, 4.5vw, 24px);
  width: 100%; min-height: 64px; padding: clamp(10px, 2.1vh, 20px) 4px;
  font: inherit; text-align: left; color: inherit; text-decoration: none; background: none; border: 0; border-radius: var(--imm-r-sm);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.imm-menu__num { font-size: var(--imm-fs-sm); font-weight: 300; letter-spacing: 0.12em; color: var(--imm-gold-300); font-variant-numeric: tabular-nums; }
.imm-menu__text { display: grid; gap: 0.15em; min-width: 0; }
.imm-menu__text b { font-size: clamp(1.45rem, 1.05rem + 3.2vw, 2.3rem); font-weight: 500; line-height: 1.25; }
.imm-menu__keep { white-space: nowrap; } /* Thai phrases that must not split ("ทุก|คน", "ลดการ|เคลื่อนไหว") */
.imm-menu__text small { font-size: var(--imm-fs-sm); font-weight: 300; line-height: 1.5; color: var(--imm-ink-inv-2); }
.imm-menu__arrow { width: 24px; height: 24px; color: var(--imm-gold-300); opacity: 0.7; transition: transform 0.6s var(--imm-ease-out), opacity 0.3s ease; }
.imm-menu__link:active .imm-menu__arrow, .imm-menu__link:focus-visible .imm-menu__arrow { transform: translate3d(6px, 0, 0); opacity: 1; }
@media (hover: hover) {
  .imm-menu__link:hover .imm-menu__arrow { transform: translate3d(6px, 0, 0); opacity: 1; }
}
.imm-menu__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 18px; margin-top: clamp(16px, 3.4vh, 34px);
  font-size: var(--imm-fs-2xs); font-weight: 400; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(246, 243, 255, 0.55);
}
/* staggered entrance: every row rises out of the blur after the circle has opened a little */
.imm-menu__eyebrow, .imm-menu__item, .imm-menu__lang, .imm-menu__foot {
  opacity: 0; transform: translate3d(0, 38px, 0); filter: blur(8px);
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}
html.imm-menu-open .imm-menu__lang { --_i: 4; }
html.imm-menu-open .imm-menu__eyebrow, html.imm-menu-open .imm-menu__item, html.imm-menu-open .imm-menu__lang, html.imm-menu-open .imm-menu__foot {
  opacity: 1; transform: none; filter: none;
  transition: opacity 0.7s ease calc(0.22s + var(--_i, 0) * 0.075s), transform 1s var(--imm-ease-out) calc(0.22s + var(--_i, 0) * 0.075s), filter 0.7s ease calc(0.22s + var(--_i, 0) * 0.075s);
}
html.imm-menu-open .imm-menu__eyebrow { transition-delay: 0.14s; }
html.imm-menu-open .imm-menu__foot { --_i: 4.4; }

@media (max-height: 520px) and (orientation: landscape) {
  .imm-menu__nav { max-width: 760px; padding-top: calc(var(--imm-safe-t) + var(--imm-nav-h) + 14px); }
  .imm-menu__list { grid-template-columns: 1fr 1fr; column-gap: 28px; }
  .imm-menu__link { min-height: 54px; padding-block: 8px; }
  .imm-menu__text b { font-size: 1.25rem; }
}
html.imm-reduced .imm-menu, html.imm-reduced .imm-menu * { transition-duration: 0.01ms !important; transition-delay: 0s !important; } /* beats the staggered delays above */

/* ============================================================ 4. hero — section, timeline, stage */
.imm-hero {
  /* timeline: --hp is the engine's eased pin progress (0 → 1 through the tall section) */
  --hp: var(--imm-pin);
  /* choreography (presentation stops at 0 · 0.40 · 0.50 · 0.60 · 0.70 · 0.80, see data-imm-snap-at):
     title card (0) → the lock-up sets like the moon while the sun climbs → at 0.40 the sun is up and the product
     line is in place → then, one stop each, the four trail lights come on (hero.js: .is-lit at 0.46/0.56/0.66/0.76)
     → a held beat → cream mist */
  --t-dawn: clamp(0, calc(var(--hp) / 0.36), 1);            /* night grade lifts */
  --t-lock: clamp(0, calc((var(--hp) - 0.02) / 0.15), 1);   /* brand lock-up dissolves */
  --t-sun: clamp(0, calc((var(--hp) - 0.03) / 0.37), 1);    /* sun climbs over the ridge, fully up at 0.40 */
  --t-beat: clamp(0, calc((var(--hp) - 0.25) / 0.13), 1);   /* second beat arrives, settled by 0.38 */
  --t-veil: clamp(0, calc((var(--hp) - 0.86) / 0.14), 1);   /* cream mist rises */

  /* geometry shared by the layers, the sun and the text zones */
  --scene-h: max(var(--imm-vh), 100vh);
  --far-w: max(104vw, 120vh);
  --far-h: calc(var(--far-w) * 0.2213);
  --mid-w: max(106vw, 135vh);
  --mid-h: calc(var(--mid-w) * 0.32476);
  --mid-top: min(var(--mid-h), 41vh);                        /* how high the mountain reaches above the scene bottom */
  /* keep the golden chedi (69.56% of the mid image) inside the viewport on portrait screens */
  --mid-shift: max(calc((106vw - var(--mid-w)) / 2), min(0px, calc(12vw - var(--mid-w) * 0.1956)));
  --near-w: max(110vw, 124vh);
  --near-h: calc(var(--near-w) * 0.26136);
  --near-top: min(var(--near-h), 32vh);
  --far-top: calc(var(--mid-top) * 1.05);                    /* top edge of the far ridges above the scene bottom */
  --sun-x: calc(50% + var(--mid-w) * 0.1956 + var(--mid-shift) - 7vw);
  /* the sun's centre travels from deep behind the mountain to just over the far ridge line, on every aspect ratio */
  --sun-from: calc(var(--mid-top) * 0.6);
  --sun-to: calc(var(--far-top) - var(--far-h) * 0.04);
  --sun-d: clamp(34px, 6.6vmin, 92px);
  --logo: clamp(190px, min(58vw, 33vh), 380px);
  --ui-top: calc(var(--imm-safe-t) + var(--imm-nav-h) + 14px);
  --ui-bottom: calc(var(--mid-top) * 0.86);

  position: relative; z-index: 1;
  /* about 2.7 screens of travel: the sunrise takes its time and every trail light gets a stop of its own */
  height: calc(var(--imm-vh) * 3.67);
  color: var(--imm-ink-inv); background: var(--imm-cream);
  overflow: clip; /* clip (not hidden) keeps position:sticky working */
}
@supports not (overflow: clip) {
  .imm-hero { clip-path: inset(0); }
}
.imm-hero .parallax-bg { display: none; } /* legacy node kept only so compass.js can write its inline transform */

.imm-hero__stage { position: sticky; top: 0; height: var(--imm-vh); }

/* ============================================================ 5. scene */
.imm-hero__scene {
  position: absolute; inset: 0 0 auto 0; height: var(--scene-h);
  overflow: hidden; isolation: isolate;
  /* safety net under the sky photo: continues its dusk → ember gradient, so no dark band can ever show between
     the photograph's lower edge and the ridges on extreme aspect ratios */
  background: #15113a linear-gradient(180deg, #15113a 0%, #3b2a78 42%, #b8607f 72%, #f2994c 100%);
  transform-origin: 50% 62%; animation: imm-hero-settle 2.8s var(--imm-ease-out) both;
}
@keyframes imm-hero-settle { from { transform: scale(1.09); } to { transform: scale(1); } }
.imm-hero__scene img { display: block; max-width: none; -webkit-user-select: none; user-select: none; }

/* sky — sits behind everything; its fiery lower band peeks over the ridge */
.imm-hero__sky {
  position: absolute; left: -4%; top: -3vh; width: 108%; height: calc(100% - var(--mid-top) * 0.72 + 3vh);
  object-fit: cover; object-position: 50% 100%;
  transform: translate3d(calc(var(--imm-mx) * -0.35vw), calc(var(--hp) * 2.2vh), 0); will-change: transform;
}
/* the night sky is a painted gradient laid over the photograph; it thins out as dawn arrives */
.imm-hero__skynight {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #06051a 0%, #0f0c38 26%, #1f1760 calc(100% - var(--mid-top) * 1.55), #4a2f86 calc(100% - var(--mid-top) * 1.12), #8e5596 calc(100% - var(--mid-top) * 0.9), #b0688c calc(100% - var(--mid-top) * 0.7), #b0688c 100%);
  opacity: calc(0.94 - var(--t-dawn) * 0.94); will-change: opacity;
}
.imm-hero__stars {
  position: absolute; inset: 0 0 auto 0; width: 100%; height: calc(100% - var(--mid-top) * 0.8);
  opacity: calc(1 - var(--t-dawn) * 1.7); will-change: opacity;
  -webkit-mask-image: linear-gradient(#000 62%, transparent); mask-image: linear-gradient(#000 62%, transparent);
}
/* shooting stars — the upper sky to the right of the moon, falling toward the lower left. Each streak is one small
   element: hero.js picks a start point, angle, length and pace, then replays one composited animation
   (transform + opacity only). The layer fades with the stars as dawn arrives. */
.imm-hero__meteors {
  position: absolute; inset: 0 0 auto 0; height: calc(100% - var(--far-top)); pointer-events: none; overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 78%, transparent); mask-image: linear-gradient(#000 78%, transparent);
  opacity: calc(1 - var(--t-dawn) * 1.7);
}
.imm-hero__meteors > i {
  /* a plain streak (no round head — owner decision): brightest at its leading tip, thinning into the tail */
  position: absolute; left: var(--mx, 80%); top: var(--my, 12%); width: var(--ml, 180px); height: 2px;
  background: linear-gradient(90deg, #fffdf6 0%, rgba(255, 244, 222, 0.92) 5%, rgba(226, 214, 255, 0.42) 38%, rgba(214, 200, 255, 0) 100%);
  clip-path: polygon(0 0, 100% 40%, 100% 60%, 0 100%);
  transform-origin: 0 50%; rotate: var(--ma, -24deg); opacity: 0; will-change: transform, opacity;
}
.imm-hero__meteors > i.is-flying { animation: imm-hero-meteor var(--md, 0.75s) cubic-bezier(0.25, 0.55, 0.45, 1) both; }
@keyframes imm-hero-meteor {
  0% { opacity: 0; transform: translate3d(0, 0, 0) scaleX(0.15); }
  12% { opacity: var(--mo, 1); }
  60% { opacity: calc(var(--mo, 1) * 0.95); }
  100% { opacity: 0; transform: translate3d(calc(var(--mdist, 30vmin) * -1), 0, 0) scaleX(1); }
}
html.imm-reduced .imm-hero__meteors { display: none; }

/* a handful of brighter "navigation" stars painted on the night gradient (they fade with it) */
.imm-hero__skynight::after {
  content: ''; position: absolute; inset: 0 0 calc(var(--mid-top) * 1.25) 0;
  background-image:
    radial-gradient(circle at 8% 14%, #fff 0, rgba(255, 255, 255, 0.5) 1.2px, transparent 3px), radial-gradient(circle at 19% 44%, #ffe9c4 0, rgba(255, 233, 196, 0.45) 1px, transparent 2.6px),
    radial-gradient(circle at 27% 9%, #fff 0, rgba(255, 255, 255, 0.45) 1px, transparent 2.4px), radial-gradient(circle at 36% 30%, #f3f0ff 0, rgba(243, 240, 255, 0.4) 1px, transparent 2.2px),
    radial-gradient(circle at 63% 12%, #fff 0, rgba(255, 255, 255, 0.5) 1.3px, transparent 3.2px), radial-gradient(circle at 71% 38%, #ffe9c4 0, rgba(255, 233, 196, 0.45) 1px, transparent 2.4px),
    radial-gradient(circle at 80% 20%, #fff 0, rgba(255, 255, 255, 0.45) 1px, transparent 2.6px), radial-gradient(circle at 91% 46%, #f3f0ff 0, rgba(243, 240, 255, 0.45) 1.1px, transparent 2.8px),
    radial-gradient(circle at 94% 8%, #fff 0, rgba(255, 255, 255, 0.4) 1px, transparent 2.2px), radial-gradient(circle at 12% 70%, #f3f0ff 0, rgba(243, 240, 255, 0.35) 1px, transparent 2.2px),
    radial-gradient(circle at 47% 58%, #fff 0, rgba(255, 255, 255, 0.35) 0.9px, transparent 2px), radial-gradient(circle at 86% 72%, #ffe9c4 0, rgba(255, 233, 196, 0.35) 0.9px, transparent 2px);
}

/* sun: predawn glow → rays → disc, rising from behind the ridge beside the chedi */
.imm-hero__sun {
  position: absolute; left: var(--sun-x); bottom: var(--sun-from); width: 0; height: 0;
  transform: translate3d(calc(var(--imm-mx) * -0.45vw), calc(var(--t-sun) * (var(--sun-from) - var(--sun-to))), 0); will-change: transform;
}
.imm-hero__sun > i { position: absolute; left: 0; top: 0; border-radius: 50%; }
.imm-hero__sun-glow {
  width: 170vmin; height: 170vmin; margin: -85vmin 0 0 -85vmin;
  background: radial-gradient(closest-side, rgba(255, 238, 196, 0.95) 0%, rgba(255, 196, 120, 0.62) 12%, rgba(244, 132, 110, 0.32) 30%, rgba(176, 92, 168, 0.14) 52%, rgba(120, 80, 170, 0) 76%);
  opacity: calc(0.72 + var(--t-dawn) * 0.28); will-change: opacity;
}
.imm-hero__sun-rays {
  width: 150vmin; height: 150vmin; margin: -75vmin 0 0 -75vmin;
  background: repeating-conic-gradient(from 8deg, rgba(255, 232, 186, 0) 0deg 9deg, rgba(255, 232, 186, 0.2) 12.5deg 14deg, rgba(255, 232, 186, 0) 17.5deg 30deg);
  -webkit-mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, 0.45) 34%, transparent 72%); mask-image: radial-gradient(closest-side, #000 6%, rgba(0, 0, 0, 0.45) 34%, transparent 72%);
  opacity: calc(var(--t-sun) * 0.85); will-change: transform, opacity;
  animation: imm-spin 240s linear infinite;
}
.imm-hero__sun-disc {
  width: var(--sun-d); height: var(--sun-d); margin: calc(var(--sun-d) / -2) 0 0 calc(var(--sun-d) / -2);
  background: radial-gradient(circle, #fffffb 0 46%, #fff6cf 70%, #ffe08a 100%);
  box-shadow: 0 0 calc(var(--sun-d) * 0.45) calc(var(--sun-d) * 0.2) rgba(255, 240, 190, 0.95), 0 0 calc(var(--sun-d) * 1.6) calc(var(--sun-d) * 0.55) rgba(255, 200, 120, 0.55), 0 0 calc(var(--sun-d) * 4) calc(var(--sun-d) * 1.2) rgba(255, 160, 96, 0.28);
}
/* a thin anamorphic streak through the sun — the cinema-lens signature (kept short on narrow screens, where a
   full-width line would read as a seam rather than a flare) */
.imm-hero__sun-disc::after {
  --_len: min(calc(var(--sun-d) * 11), 56vw);
  content: ''; position: absolute; left: 50%; top: 50%; width: var(--_len); height: 2px; margin: -1px 0 0 calc(var(--_len) / -2);
  background: linear-gradient(90deg, rgba(255, 236, 190, 0) 0%, rgba(255, 240, 200, 0.6) 40%, #fff 50%, rgba(255, 240, 200, 0.6) 60%, rgba(255, 236, 190, 0) 100%);
  opacity: calc(var(--t-sun) * 0.8);
}

/* parallax cut-outs: bottom-anchored, wider than the viewport so pointer drift never shows an edge */
.imm-hero__layer {
  position: absolute; left: 50%; bottom: var(--b, 0px); width: var(--w); margin-left: calc(var(--w) / -2);
  transform-origin: 50% 100%;
  transform:
    translate3d(calc(var(--x, 0px) - var(--imm-mx) * var(--px, 0vw)), calc(var(--hp) * var(--sy, 0vh) + (var(--imm-my) + 1) * var(--py, 0vh)), 0)
    scale(calc(1 + var(--hp) * var(--sz, 0)));
  will-change: transform;
}
.imm-hero__layer > img { width: 100%; height: auto; }
/* far ridges stay fully opaque: their flat bottom edge and the sky's lower edge must never show through */
.imm-hero__layer--far { --w: var(--far-w); --b: calc(var(--far-top) - var(--far-h)); --px: 0.5vw; --py: 0.25vh; --sy: 1.6vh; }
.imm-hero__layer--mid { --w: var(--mid-w); --b: calc(var(--mid-top) - var(--mid-h)); --x: var(--mid-shift); --px: 1.1vw; --py: 0.5vh; --sy: 5vh; --sz: 0.035; aspect-ratio: 1672 / 543; }
.imm-hero__layer--near { --w: var(--near-w); --b: calc(var(--near-top) - var(--near-h)); --px: 2.3vw; --py: 1vh; --sy: 13vh; --sz: 0.16; }

/* warm light spilling over the valley in front of the mountain once the sun is up */
.imm-hero__bloom {
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--sun-x) calc(100% - var(--sun-to)), rgba(255, 226, 170, 0.6) 0%, rgba(255, 184, 120, 0.26) 20%, rgba(255, 160, 120, 0) 52%);
  opacity: calc(var(--t-sun) * 0.95); will-change: opacity;
}

/* drifting mist bands (outer wrapper follows the scroll, the image drifts on its own) */
.imm-hero__mist { position: absolute; left: -22%; width: 144%; pointer-events: none; will-change: transform; }
.imm-hero__mist > img { width: 100%; height: 100%; animation: imm-drift 46s ease-in-out infinite alternate; }
.imm-hero__mist--a {
  bottom: calc(var(--near-top) * 0.42); height: calc(var(--near-top) * 1.25); opacity: 0.46;
  transform: translate3d(calc(var(--imm-mx) * -1.6vw), calc(var(--hp) * 8vh), 0);
}
.imm-hero__mist--b {
  bottom: calc(var(--near-top) * -0.5); height: calc(var(--near-top) * 1.3); opacity: 0.5;
  transform: translate3d(calc(var(--imm-mx) * -3vw), calc(var(--hp) * 16vh), 0);
}
.imm-hero__mist--b > img { animation-duration: 34s; animation-direction: alternate-reverse; }

/* foreground foliage — the camera pushes through it */
.imm-hero__fg {
  position: absolute; left: -4vw; bottom: -3vh; width: 108vw; transform-origin: 50% 100%;
  transform: translate3d(calc(var(--imm-mx) * -2.8vw), calc(var(--hp) * 14vh + (var(--imm-my) + 1) * 1.4vh), 0) scale(calc(1 + var(--hp) * 0.6));
  will-change: transform;
}
.imm-hero__fg > img { width: 100%; height: auto; }
.imm-hero__fg--r { display: none; }

/* night grade: one multiply pass over the land and the foliage (moonlit blue, the mist keeps glowing),
   masked away from the open sky so the stars and the painted night gradient stay clean. */
.imm-hero__night {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, #6a6fd2 0%, #5a60c8 55%, #4a4fb6 78%, #343890 100%);
  -webkit-mask-image: radial-gradient(ellipse 64% calc(100% - var(--mid-top) * 0.9) at 50% 0%, transparent 0%, transparent 62%, #000 100%);
  mask-image: radial-gradient(ellipse 64% calc(100% - var(--mid-top) * 0.9) at 50% 0%, transparent 0%, transparent 62%, #000 100%);
  mix-blend-mode: multiply; opacity: calc(1 - var(--t-dawn)); will-change: opacity;
}
.imm-hero__layer--spark { pointer-events: none; }
.imm-hero__layer--spark > i {
  position: absolute; left: 69.56%; top: 28.6%; width: 6vmin; height: 6vmin; margin: -3vmin 0 0 -3vmin; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 200, 1) 0%, rgba(255, 214, 120, 0.7) 12%, rgba(255, 184, 84, 0.26) 40%, rgba(255, 170, 70, 0) 100%);
  opacity: calc(1 - var(--t-dawn) * 1.2);
  animation: imm-hero-spark 5.5s ease-in-out infinite alternate;
}
@keyframes imm-hero-spark { from { transform: scale(0.78); } to { transform: scale(1.12); } }

.imm-hero__vignette {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 6, 28, 0.45) 0%, rgba(8, 6, 28, 0) 20%),
    radial-gradient(ellipse 115% 90% at 50% 40%, rgba(8, 6, 28, 0) 60%, rgba(8, 6, 28, 0.42) 100%);
  opacity: calc(1 - var(--t-veil) * 0.8);
}

/* cream mist: rises at the end of the pin so the scene dissolves into the paper-coloured journey (seam contract) */
.imm-hero__veil {
  position: absolute; inset: auto 0 0 0; height: 62%; z-index: 3;
  background: linear-gradient(to top, var(--imm-cream) 0%, var(--imm-cream) 24%, rgba(250, 244, 231, 0.9) 34%, rgba(250, 244, 231, 0.6) 48%, rgba(250, 244, 231, 0.26) 64%, rgba(250, 244, 231, 0.07) 82%, rgba(250, 244, 231, 0) 100%);
  transform: translate3d(0, calc((1 - var(--t-veil)) * 101%), 0); will-change: transform;
}
/* two soft banks of real mist ride the leading edge: the peaks stay above a sea of cloud */
.imm-hero__veil > img { position: absolute; width: 160%; height: 58%; opacity: 0.85; animation: imm-drift 30s ease-in-out infinite alternate; }
.imm-hero__veil > img:nth-child(1) { left: -42%; top: 2%; }
.imm-hero__veil > img:nth-child(2) { left: -16%; top: 26%; animation-duration: 38s; animation-direction: alternate-reverse; }

/* ============================================================ 6. beat 1 — brand lock-up */
.imm-hero__lockup, .imm-hero__beat {
  position: absolute; left: 0; right: 0; top: var(--ui-top); bottom: var(--ui-bottom);
  display: flex; flex-direction: column; align-items: center;
  padding-inline: var(--imm-gutter); text-align: center; pointer-events: none;
}
/* "safe" vertical centring: auto margins collapse to 0 when the zone is too short, so the block never slides under the bar */
:is(.imm-hero__lockup, .imm-hero__beat) > :first-child { margin-top: auto; }
:is(.imm-hero__lockup, .imm-hero__beat) > :last-child { margin-bottom: auto; }
/* the lock-up "sets" like the moon: it drifts up, shrinks a touch and dissolves into the haze (blur is small and
   only on this medium-sized block, never on the full-screen layers) */
.imm-hero__lockup {
  gap: clamp(8px, 1.6vh, 18px);
  opacity: calc(1 - var(--t-lock));
  transform: translate3d(calc(var(--imm-mx) * 0.5vw), calc(var(--t-lock) * -9vh), 0) scale(calc(1 - var(--t-lock) * 0.12));
  filter: blur(calc(var(--t-lock) * 7px));
  will-change: transform, opacity, filter;
}
/* touch screens: no scroll-linked blur (a re-blur every frame under the finger costs mobile GPUs a smooth scroll);
   the lock-up still drifts, shrinks and dissolves */
html.imm-touch .imm-hero__lockup { filter: none; will-change: transform, opacity; }
.imm-hero__eyebrow {
  flex-wrap: wrap; justify-content: center; gap: 0.2em 0.9em; color: var(--imm-gold-200);
  text-shadow: 0 1px 14px rgba(10, 9, 32, 0.7);
  animation: imm-hero-rise 1.4s var(--imm-ease-out) 0.25s both;
}
.imm-hero__brand {
  position: relative; flex: none; width: var(--logo); height: var(--logo);
  /* room for the orb (12.5% outside the logo box) and the bezel arc above it, so the eyebrow never touches the ticks */
  margin-block: calc(var(--logo) * 0.3) calc(var(--logo) * 0.17);
  animation: imm-hero-rise 1.6s var(--imm-ease-out) 0.1s both;
}
/* luminous cream orb — the first light the brand sits in (lets the violet / gold / grey marks read on the night sky).
   It doubles as a compass face: crisp rim, soft bloom, tick bezel. */
.imm-hero__brand::before { /* bloom */
  content: ''; position: absolute; inset: -62%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 238, 200, 0.55) 0%, rgba(255, 226, 176, 0.34) 46%, rgba(255, 200, 156, 0.12) 72%, rgba(255, 190, 150, 0) 100%);
}
.imm-hero__brand::after { /* orb */
  content: ''; position: absolute; inset: -12.5%; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #ffffff 0%, #fffcf0 46%, #fff4d9 82%, #ffe9bd 100%);
  box-shadow: 0 0 0 1px rgba(255, 222, 150, 0.9), 0 0 calc(var(--logo) * 0.1) calc(var(--logo) * 0.012) rgba(255, 240, 205, 0.75), inset 0 0 calc(var(--logo) * 0.09) rgba(250, 172, 30, 0.2);
}
/* a faint compass bezel arcs over the orb and dissolves toward the horizon */
.imm-hero__dial {
  position: absolute; inset: -29%; width: 158%; height: 158%; color: var(--imm-gold-200); opacity: 0.62;
  -webkit-mask-image: linear-gradient(#000 34%, transparent 70%); mask-image: linear-gradient(#000 34%, transparent 70%);
}
.imm-hero__dial-spin { transform-origin: 200px 200px; transform: rotate(calc(var(--hp) * 120deg + var(--imm-mx) * 4deg)); }
.imm-hero__logo { position: absolute; inset: 0; z-index: 1; }
.imm-hero__logo-part { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border: 0; pointer-events: none; }
.imm-hero__tagline {
  max-width: 22em; margin-top: clamp(2px, 1vh, 12px);
  font-size: var(--imm-fs-xl); font-weight: 300; line-height: 1.5; color: #fff; text-wrap: balance;
  text-shadow: 0 2px 22px rgba(10, 9, 32, 0.85), 0 0 2px rgba(10, 9, 32, 0.5);
  animation: imm-hero-rise 1.4s var(--imm-ease-out) 0.45s both;
}
.imm-hero__phrase { display: inline-block; } /* lines break between the two phrases first */
@keyframes imm-hero-rise { from { opacity: 0; transform: translate3d(0, 26px, 0); } to { opacity: 1; transform: none; } }

/* first paint (owner decision 2026-11-16): a fresh load — often restored halfway down the sunrise — used to paint the
   copy before the web font, the scene's pictures and the trail lights were ready (a dark band behind the headline,
   half a trail). boot.js marks <html> .imm-hero-pending; hero.js lifts it once all of that is ready (2.5 s at most)
   and the copy fades in whole. The intro animations wait meanwhile, so the choreography starts on the reveal. */
html.imm-hero-pending .imm-hero :is(.imm-hero__lockup, .imm-hero__beat, .imm-hero__cue) {
  visibility: hidden;
  animation: imm-hero-gate-safety 0s linear 3.2s forwards; /* never stays hidden if the script does not run */
}
html.imm-hero-pending .imm-hero :is(.imm-hero__scene, .imm-hero__eyebrow, .imm-hero__brand, .imm-hero__tagline, .imm-hero__node::after) {
  animation-play-state: paused;
}
html.imm-hero-reveal .imm-hero :is(.imm-hero__lockup, .imm-hero__beat) { animation: imm-hero-reveal 0.55s ease backwards; }
@keyframes imm-hero-reveal { from { opacity: 0; } }
@keyframes imm-hero-gate-safety { to { visibility: visible; } }

/* ============================================================ 7. beat 2 — headline + trail */
.imm-hero__beat {
  opacity: var(--t-beat);
  transform: translate3d(0, calc((1 - var(--t-beat)) * 7vh - var(--t-veil) * 2vh), 0);
  will-change: transform, opacity;
}
.imm-hero__beat-inner {
  position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 940px;
  padding: clamp(14px, 3vh, 34px) clamp(8px, 3vw, 44px);
}
.imm-hero__beat-inner::before { /* soft dusk scrim so the type never fights the clouds */
  content: ''; position: absolute; inset: -18% -12%; z-index: -1; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(24, 16, 62, 0.62) 0%, rgba(24, 16, 62, 0.36) 55%, rgba(24, 16, 62, 0) 100%);
}
.imm-hero__headline {
  margin-top: 0.35em; font-size: var(--imm-fs-3xl); font-weight: 600; line-height: 1.22; text-wrap: balance;
  filter: drop-shadow(0 4px 22px rgba(10, 9, 32, 0.55));
}
.imm-hero__headline > span { white-space: nowrap; }
/* English UI: the two phrases stay whole like the Thai ones; only on the narrowest phones may an English phrase wrap
   at a word gap, so it never runs past the screen edge */
@media (max-width: 359.98px) {
  html.imm-lang-en .imm-hero__headline > span { white-space: normal; }
}

.imm-hero__trail {
  --node: clamp(36px, 3.6vw, 50px);
  list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%; max-width: 900px; margin-top: clamp(18px, 4.4vh, 46px);
}
/* Trail lights are discrete events (hero.js toggles .is-lit as the pin passes each threshold), animated by
   time-based transitions on opacity / transform / clip-path only — a fast fling still plays every light at the same
   unhurried pace, and nothing is recomputed per scroll frame. Order inside a step: the path leading into it draws
   (0.44 s), then the node ignites (from 0.33 s), then its label warms up. Going back up, lights go out at once.
   (Owner decision 2026-11-16: this whole part runs 30% quicker — glides, smoothing and these timings.) */
.imm-hero__step {
  --lit-delay: 0s;
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.75em; padding-inline: 6px;
}
.imm-hero__step + .imm-hero__step { --lit-delay: 0.33s; }
.imm-hero__node { position: relative; flex: none; width: var(--node); height: var(--node); color: rgba(255, 255, 255, 0.5); }
.imm-hero__node > svg { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.imm-hero__node > svg + svg {
  color: var(--imm-gold-300); filter: drop-shadow(0 0 7px rgba(250, 172, 30, 0.85));
  opacity: 0; transform: scale(0.72) rotate(-35deg);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
/* a warm halo blooms behind a lit node, and a single ring of light ripples out as it catches */
.imm-hero__node::before, .imm-hero__node::after { content: ''; position: absolute; border-radius: 50%; pointer-events: none; }
.imm-hero__node::before {
  inset: -70%;
  background: radial-gradient(closest-side, rgba(255, 214, 140, 0.5), rgba(250, 172, 30, 0.16) 55%, rgba(250, 172, 30, 0) 100%);
  opacity: 0; transform: scale(0.4); transition: opacity 0.4s ease, transform 0.4s ease;
}
.imm-hero__node::after { inset: -10%; border: 1.5px solid rgba(255, 220, 150, 0.95); opacity: 0; transform: scale(0.6); }
.imm-hero__label {
  display: grid; gap: 0.1em; font-size: var(--imm-fs-lg); font-weight: 400; line-height: 1.35; color: #fff;
  opacity: 0.5; text-shadow: 0 1px 14px rgba(10, 9, 32, 0.85);
  transition: opacity 0.4s ease;
}
.imm-hero__label > small { font-size: var(--imm-fs-xs); font-weight: 300; letter-spacing: 0.18em; color: var(--imm-gold-200); transition: color 0.4s ease, text-shadow 0.4s ease; }
/* dashed gold path between the nodes: quiet base + a bright copy unveiled left → right */
.imm-hero__step + .imm-hero__step::before, .imm-hero__step + .imm-hero__step::after {
  content: ''; position: absolute; top: calc(var(--node) / 2 - 1px); right: calc(50% + var(--node) / 2 + 8px);
  width: calc(100% - var(--node) - 16px); height: 2px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.3) 0 5px, transparent 5px 11px);
}
.imm-hero__step + .imm-hero__step::after {
  background: repeating-linear-gradient(90deg, var(--imm-gold-300) 0 5px, transparent 5px 11px);
  filter: drop-shadow(0 0 4px rgba(250, 172, 30, 0.7));
  clip-path: inset(-6px 100% -6px 0);
  transition: clip-path 0.3s ease;
}

/* lit (also the still composition: reduced motion / no JS shows the whole trail lit) */
:is(.imm-hero__step.is-lit, html.imm-reduced .imm-hero__step, html:not(.imm-js) .imm-hero__step) .imm-hero__node > svg + svg {
  opacity: 1; transform: none;
  transition: opacity 0.42s ease var(--lit-delay), transform 0.63s cubic-bezier(0.34, 1.4, 0.64, 1) var(--lit-delay);
}
:is(.imm-hero__step.is-lit, html.imm-reduced .imm-hero__step, html:not(.imm-js) .imm-hero__step) .imm-hero__node::before {
  opacity: 1; transform: none;
  transition: opacity 0.66s ease calc(var(--lit-delay) + 0.05s), transform 0.84s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--lit-delay) + 0.05s);
}
.imm-hero__step.is-lit .imm-hero__node::after { animation: imm-hero-ignite 0.7s cubic-bezier(0.22, 1, 0.36, 1) calc(var(--lit-delay) + 0.07s) both; }
:is(.imm-hero__step.is-lit, html.imm-reduced .imm-hero__step, html:not(.imm-js) .imm-hero__step) .imm-hero__label {
  opacity: 1; transition: opacity 0.49s ease calc(var(--lit-delay) + 0.12s);
}
:is(.imm-hero__step.is-lit, html.imm-reduced .imm-hero__step, html:not(.imm-js) .imm-hero__step) .imm-hero__label > small {
  color: var(--imm-gold-300); text-shadow: 0 0 10px rgba(250, 172, 30, 0.7), 0 1px 14px rgba(10, 9, 32, 0.85);
  transition: color 0.49s ease calc(var(--lit-delay) + 0.12s), text-shadow 0.49s ease calc(var(--lit-delay) + 0.12s);
}
.imm-hero__step.is-lit::after,
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero__step::after { clip-path: inset(-6px 0 -6px 0); }
.imm-hero__step.is-lit::after { transition: clip-path 0.44s cubic-bezier(0.65, 0, 0.35, 1); }
@keyframes imm-hero-ignite {
  0% { opacity: 0; transform: scale(0.6); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: scale(2.3); }
}

/* ============================================================ 8. scroll cue */
.imm-hero__cue {
  position: absolute; left: 50%; bottom: calc(var(--imm-safe-b) + clamp(10px, 2.6vh, 28px)); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 10px; min-width: 44px; padding: 8px 16px 0;
  font-size: var(--imm-fs-sm); font-weight: 300; line-height: 1.4; color: rgba(255, 255, 255, 0.9); text-decoration: none; white-space: nowrap;
  text-shadow: 0 1px 14px rgba(10, 9, 32, 0.9);
  transform: translate3d(-50%, 0, 0); border-radius: var(--imm-r-sm);
  transition: opacity 0.6s ease, visibility 0s;
  animation: imm-hero-cue-in 1.4s var(--imm-ease-out) 1.1s both;
}
@keyframes imm-hero-cue-in { from { opacity: 0; } to { opacity: 1; } }
.imm-hero__cue-line { position: relative; width: 1px; height: clamp(30px, 5.4vh, 52px); background: rgba(255, 255, 255, 0.26); overflow: hidden; }
.imm-hero__cue-line::after {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 50%;
  background: linear-gradient(180deg, rgba(255, 203, 90, 0), var(--imm-gold-300));
  animation: imm-scroll-cue 2.2s var(--imm-ease-in-out) infinite;
}
html.imm-scrolled .imm-hero__cue { opacity: 0; visibility: hidden; pointer-events: none; animation: none; transition: opacity 0.6s ease, visibility 0s linear 0.6s; }

/* ============================================================ 9. responsive variants */
@media (min-width: 1920px) {
  .imm-hero { --logo: clamp(190px, min(60vw, 36vh), 500px); }
  .imm-hero__beat-inner { max-width: 1120px; }
  .imm-hero__trail { max-width: 1040px; }
}
/* very large canvases at 1× (4K monitors without OS scaling, TVs): the shared type tokens top out around 1440px,
   so the hero scales its own content with one factor --k */
@media (min-width: 2560px) and (min-height: 1300px) {
  .imm-hero { --k: 1.45; --logo: clamp(190px, 33vh, 820px); }
}
@media (min-width: 3200px) and (min-height: 1700px) {
  .imm-hero { --k: 1.85; }
}
@media (min-width: 2560px) and (min-height: 1300px) {
  :is(.imm-hero__eyebrow, .imm-hero__beat-inner > .imm-eyebrow) { font-size: calc(var(--imm-fs-xs) * var(--k)); }
  .imm-hero__tagline { font-size: calc(var(--imm-fs-xl) * var(--k)); }
  .imm-hero__beat-inner { max-width: calc(1120px * var(--k)); }
  .imm-hero__headline { font-size: calc(var(--imm-fs-3xl) * var(--k)); }
  .imm-hero__trail { --node: calc(50px * var(--k)); max-width: calc(1040px * var(--k)); }
  .imm-hero__label { font-size: calc(var(--imm-fs-lg) * var(--k)); }
  .imm-hero__label > small { font-size: calc(var(--imm-fs-xs) * var(--k)); }
  .imm-hero__cue { font-size: calc(var(--imm-fs-sm) * var(--k)); }
}

/* phones and narrow tablets: same five-screen pin (each stop is one relaxed swipe); the rotating rays are skipped */
@media (max-width: 767.98px) {
  .imm-hero__sun-rays { display: none; }
}

/* portrait: the foliage splits into two halves pinned to the screen edges and the trail becomes a vertical path */
@media (max-aspect-ratio: 1/1) {
  .imm-hero { --mid-top: min(var(--mid-h), 45vh); --logo: clamp(180px, min(62vw, 32vh), 400px); }
  .imm-hero__fg { width: 58vw; height: 50vh; bottom: -2vh; }
  .imm-hero__fg > img { height: 100%; object-fit: cover; }
  /* each half fades toward the centre AND toward its cropped top edge (otherwise leaves are cut by a hard line) */
  .imm-hero__fg--l, .imm-hero__fg--r { -webkit-mask-composite: source-in; mask-composite: intersect; }
  .imm-hero__fg--l {
    left: -8vw; transform-origin: 100% 100%;
    -webkit-mask-image: linear-gradient(90deg, #000 62%, transparent), linear-gradient(180deg, transparent 0%, #000 22%);
    mask-image: linear-gradient(90deg, #000 62%, transparent), linear-gradient(180deg, transparent 0%, #000 22%);
  }
  .imm-hero__fg--l > img { object-position: 0% 100%; }
  .imm-hero__fg--r {
    display: block; left: auto; right: -8vw; transform-origin: 0% 100%;
    -webkit-mask-image: linear-gradient(270deg, #000 62%, transparent), linear-gradient(180deg, transparent 0%, #000 22%);
    mask-image: linear-gradient(270deg, #000 62%, transparent), linear-gradient(180deg, transparent 0%, #000 22%);
  }
  .imm-hero__fg--r > img { object-position: 100% 100%; }
}
@media (max-aspect-ratio: 1/1) and (max-width: 767.98px) {
  .imm-hero__trail { --node: 34px; grid-template-columns: minmax(0, auto); justify-content: center; width: auto; margin-top: clamp(14px, 3vh, 26px); }
  .imm-hero__step { flex-direction: row; gap: 14px; padding-inline: 0; text-align: left; }
  .imm-hero__step + .imm-hero__step { padding-top: 20px; }
  .imm-hero__label { grid-auto-flow: column; align-items: baseline; justify-content: start; gap: 0.7em; }
  .imm-hero__step + .imm-hero__step::before, .imm-hero__step + .imm-hero__step::after {
    top: -3px; right: auto; left: calc(var(--node) / 2 - 1px); width: 2px; height: 26px;
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0 4px, transparent 4px 9px);
  }
  .imm-hero__step + .imm-hero__step::after {
    background: repeating-linear-gradient(180deg, var(--imm-gold-300) 0 4px, transparent 4px 9px);
    clip-path: inset(0 -6px 100% -6px);
  }
  .imm-hero__step.is-lit::after,
  :is(html.imm-reduced, html:not(.imm-js)) .imm-hero__step::after { clip-path: inset(0 -6px 0 -6px); }
}
/* short portrait screens (small phones, foldables): a slightly smaller orb so lock-up + tagline clear the scroll
   cue, and the same vertical path packed tighter.
   (A 2 × 2 grid was tried: at 280px its columns split Thai words such as "เป้า|หมาย".) */
@media (max-aspect-ratio: 1/1) and (max-width: 767.98px) and (max-height: 700px) {
  .imm-hero { --logo: clamp(140px, min(56vw, 29vh), 400px); }
  .imm-hero__trail { --node: 28px; margin-top: clamp(10px, 2.4vh, 18px); }
  .imm-hero__step { gap: 12px; }
  .imm-hero__step + .imm-hero__step { padding-top: 10px; }
  .imm-hero__step + .imm-hero__step::before, .imm-hero__step + .imm-hero__step::after { height: 16px; top: -2px; }
  .imm-hero__label { font-size: var(--imm-fs-md); white-space: nowrap; }
}
/* very narrow screens or enlarged text: the eyebrow becomes a two-line title-card stamp (no dangling separator) */
@media (max-width: 359.98px) {
  .imm-hero__eyebrow { flex-direction: column; }
  .imm-hero__eyebrow-dot { display: none; }
  .imm-hero__tagline { font-size: var(--imm-fs-lg); }
}
@media (max-width: 479.98px) {
  html:is(.a11y-font-large, .a11y-font-xlarge) .imm-hero__eyebrow { flex-direction: column; }
  html:is(.a11y-font-large, .a11y-font-xlarge) .imm-hero__eyebrow-dot { display: none; }
}
/* portrait phones and tablets: the cue rises above the mascot / help launcher row that owns the bottom edge */
@media (max-aspect-ratio: 1/1) and (min-height: 521px) {
  .imm-hero__cue { bottom: calc(var(--imm-safe-b) + clamp(92px, 13vh, 116px)); }
  .imm-hero__cue-line { height: clamp(24px, 4vh, 40px); }
}

/* landscape phones: the stage is very short — the orb on the left, eyebrow + tagline beside it, compact trail */
@media (max-height: 520px) and (orientation: landscape) {
  .imm-hero { --logo: clamp(100px, 34vh, 190px); --mid-top: min(var(--mid-h), 44vh); --ui-top: calc(var(--imm-safe-t) + var(--imm-nav-h) + 6px); --ui-bottom: calc(var(--imm-safe-b) + 34px); }
  .imm-hero__lockup {
    display: grid; grid-template-columns: auto minmax(0, 23em); grid-template-areas: 'brand eyebrow' 'brand tagline';
    align-content: center; justify-content: center; column-gap: clamp(30px, 6vw, 72px); row-gap: 10px;
    padding-left: max(var(--imm-gutter), var(--imm-safe-l)); padding-right: max(var(--imm-gutter), var(--imm-safe-r)); text-align: left;
  }
  .imm-hero__lockup > * { margin: 0; } /* (the "safe centring" auto margins still pin eyebrow/tagline to the middle seam) */
  .imm-hero__brand { grid-area: brand; margin: calc(var(--logo) * 0.16); }
  .imm-hero__eyebrow { grid-area: eyebrow; align-self: end; justify-content: flex-start; }
  .imm-hero__tagline { grid-area: tagline; align-self: start; max-width: none; font-size: var(--imm-fs-lg); }
  .imm-hero__headline { font-size: var(--imm-fs-2xl); }
  .imm-hero__beat-inner { padding-block: 6px; }
  .imm-hero__trail { --node: 30px; margin-top: 12px; }
  .imm-hero__label { font-size: var(--imm-fs-sm); }
  .imm-hero__cue-line { display: none; }
  /* the mascot + its bubble own the bottom-left and centre of a landscape phone: the cue moves under the text
     column, just left of the help launcher */
  .imm-hero__cue { left: auto; right: calc(max(var(--imm-gutter), var(--imm-safe-r)) + 64px); bottom: calc(var(--imm-safe-b) + 10px); padding-top: 4px; transform: none; }
}

/* ============================================================ 10. static composition (reduced motion / no JS) */
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero {
  --hp: 0.35; --t-dawn: 0.66; --t-lock: 0; --t-sun: 0.36; --t-beat: 1; --t-veil: 0;
  --imm-mx: 0 !important; --imm-my: 0 !important; /* beats stale inline values written before the setting changed */
  height: auto;
}
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero__stage {
  position: relative; height: auto; min-height: var(--imm-vh);
  display: flex; flex-direction: column; align-items: center; gap: clamp(26px, 6vh, 64px);
  padding: calc(var(--ui-top) + 8px) 0 calc(var(--mid-top) * 0.62);
}
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero__scene { height: 100%; animation: none; }
:is(html.imm-reduced, html:not(.imm-js)) :is(.imm-hero__lockup, .imm-hero__beat) { position: relative; inset: auto; width: 100%; opacity: 1; transform: none; filter: none; }
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero__veil {
  inset: auto 0 0 0; height: 26%; transform: none;
  background: linear-gradient(to top, var(--imm-cream) 0%, rgba(250, 244, 231, 0.82) 22%, rgba(250, 244, 231, 0) 100%);
}
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero__veil > img { display: none; }
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero__cue { display: none; }
:is(html.imm-reduced, html:not(.imm-js)) .imm-hero *, :is(html.imm-reduced, html:not(.imm-js)) .imm-hero *::before { will-change: auto; } /* still frame: no layers to keep warm */
html.imm-reduced .imm-hero :is(.imm-hero__eyebrow, .imm-hero__brand, .imm-hero__tagline, .imm-hero__sun-rays, .imm-hero__mist > img, .imm-hero__layer--spark > i) { animation: none; }

/* ============================================================ 11. accessibility */
html.a11y-high-contrast .imm-nav__bar::before { opacity: 1; background: #05050c; border: 2px solid #fff; box-shadow: none; }
html.a11y-high-contrast .imm-nav__link { color: #fff; text-shadow: none; }
html.a11y-high-contrast .imm-nav__icon, html.a11y-high-contrast .imm-nav__toggle { border: 2px solid #fff; background: #05050c; }
html.a11y-high-contrast .imm-menu { background: #05050c; }
html.a11y-high-contrast .imm-menu__scene { display: none; }
html.a11y-high-contrast .imm-menu__item { border-bottom: 2px solid #fff; }
html.a11y-high-contrast .imm-menu__text small, html.a11y-high-contrast .imm-menu__foot { color: #fff; }
/* text never sits on the photograph without an opaque plate */
html.a11y-high-contrast :is(.imm-hero__eyebrow, .imm-hero__tagline) { padding: 0.3em 0.9em; color: #fff; text-shadow: none; background: #05050c; border: 2px solid #fff; border-radius: var(--imm-r-sm); }
@media (max-width: 1023.98px) { /* the plate adds padding: stack the stamp instead of leaving a dangling "·" */
  html.a11y-high-contrast .imm-hero__eyebrow { flex-direction: column; }
  html.a11y-high-contrast .imm-hero__eyebrow-dot { display: none; }
}
html.a11y-high-contrast .imm-hero__brand::before { inset: -6%; background: #fffef5; border: 2px solid #0b0b12; }
html.a11y-high-contrast .imm-hero__dial { display: none; }
html.a11y-high-contrast .imm-hero__beat-inner { background: #05050c; border: 2px solid #fff; border-radius: var(--imm-r-lg); }
html.a11y-high-contrast .imm-hero__beat-inner::before { display: none; }
html.a11y-high-contrast .imm-hero__headline { filter: none; }
html.a11y-high-contrast :is(.imm-hero__label, .imm-hero__cue) { opacity: 1; text-shadow: none; }
html.a11y-high-contrast .imm-hero__label > small { color: #fff; }
html.a11y-high-contrast .imm-hero__node { color: #fff; }
html.a11y-high-contrast .imm-hero__cue { padding: 6px 14px; color: #fff; background: #05050c; border: 2px solid #fff; }
html.a11y-high-contrast .imm-hero__vignette { display: none; }

@media print {
  .imm-nav, .imm-progress, .imm-menu, .imm-hero__cue { display: none !important; }
  .imm-hero { height: auto; }
  .imm-hero__stage { position: relative; }
}
