/* ==========================================================================
   CMU Student Compass — Immersive design system · FOOTER  "Nightfall · ค่ำคืน"  (Act IV)

   Shared by /compass, /skill and the fallback page (templates/partials/shared/_footer.html).
   Needs only fonts.css + core.css (+ engine.js / footer.js for motion and the fold behaviour).

   ONE pinned shot. .imm-ft-night is the timeline (data-imm-scroll="screens": --imm-scr = screens travelled since
   its top reached the viewport top) in three beats (in screens). None of them is a presentation stop any more (owner
   decisions 2026-11-17): one glide runs from the section above to the footer, easing into a slow drift at 2:

     0  dusk       .imm-ft-dusk (the close shot): the page's cream thins into a sunset over the ridge
     1  nightfall  the sky turns, the Milky Way comes out of it, the ridges go dark by moonlight
     2  the valley (user-confirmed): the tree ridge stretches out to the sides and fades while the far ridges shrink
                   back toward the valley's horizon (receding) and melt into its haze; .imm-ft-scene (the wide shot)
                   settles in behind them — the city lights, the sky lanterns and the closing line arrive
     …  the dark-glass blocks and the bottom bar scroll over the pinned valley.

   The wide shot is laid out like object-fit: cover so its horizon (--_hz) is a known point: it waits slightly
   enlarged and lowered (--_zoom, --_dyb) — its city hidden behind the close shot's ridges — and settles to 1.

   Engine variables (engine.js, on .imm-ft-night): --imm-scr (timeline), --imm-enter (the shot entering the
   viewport), --imm-mx/my (pointer parallax, fine pointers). footer.js adds --imm-ft-dock on .imm-ft (height of the
   fixed avatar zone) so the bottom bar clears พี่ทิศ, and .is-early / .is-late on .imm-ft-night to pause what
   cannot be seen yet / any more.

   Still composition (no JavaScript, the in-app "reduce motion" switch, high contrast): nothing is pinned or zoomed;
   a dusk band sits on top, the valley under the content (see the end of this file).

   Legacy: `.site-footer` rules live in @layer legacy (margin-top, border-top, background, padding, link
   colours); everything they set is re-declared here. The footer keeps z-index 10 of the legacy ladder.
   ========================================================================== */

/* ------------------------------------------------------------------ shell + shot geometry */
.imm-ft {
  /* clip (not hidden: no scroll container, so the pinned shot stays sticky) any decoration that pokes past the
     viewport edge — the brand card's rotated rose added a 1px sideways pan on phones — and the blocks while they
     wait half a screen lower at stop 2 (their overflow would otherwise lengthen the page) */
  overflow: clip;
  --_scene-h: 100vh;                                           /* height of the pinned shot */
  --_dusk-h: clamp(320px, min(72vh, 62vw + 200px), 1600px);    /* height of the dusk band of the still composition */
  --_plinth: clamp(76px, 9.5vw, 170px);                        /* free strip under the bottom bar: wordmark + help launcher */
  /* พี่ทิศ (fixed bottom-left, owned by companions) stands on that strip: footer.js publishes --imm-ft-dock = distance
     from the avatar's head to the viewport bottom; its one-line greeting bubble pokes ~10px above the head */
  --_dock-gap: 30px;
  --_floor: max(var(--_plinth), calc(var(--imm-ft-dock, 0px) + var(--_dock-gap)));
  --_card-pad: clamp(18px, 1.9vw, 30px);
  /* the bottom bar keeps the same gap above it (to the blocks) and below it (to the top of the wordmark's letters) —
     owner decision; the letters reach 0.61em above the bottom edge (measured: Kanit 700 caps, line-height 0.8,
     bottom -0.1em) */
  --_bar-gap: clamp(14px, 1.7vw, 26px);
  --_wm-size: 21vw;
  --_wm-cap: calc(var(--_wm-size) * 0.61);
  --_night-rgb: 10, 9, 32;                                     /* = --imm-night, for alpha gradients */

  /* wide shot — night-valley.webp (1672 × 941) covering the shot at 52% 86%, with a little overscan for the pointer
     drift; its horizon (where the far haze meets the sky, 63.5% of the photo) is the camera's pivot */
  --_bw: calc(max(100vw, var(--_scene-h) * 1.7768) * 1.04);
  --_bh: calc(var(--_bw) * 0.5628);
  --_by: calc((var(--_scene-h) - var(--_bh)) * 0.86);
  --_hz: calc(var(--_by) + var(--_bh) * 0.635);
  /* close shot — the tree ridge (hero-near, 1672 × 437) stands on a dark ground; the far ridges (hero-far,
     1672 × 370) sink behind its notch (the lowest point of its tree line, 32% of its height above its foot) */
  --_dbox: var(--_scene-h);                                    /* height of the close shot's box */
  --_rw: max(108vw, 800px);
  --_rh: calc(var(--_rw) * 0.2614);
  /* a strip of dark ground under the ridge; on very wide screens the ridge sinks instead (never above 56% of the shot) */
  --_rb: min(clamp(18px, calc(var(--_dbox) * 0.035), 64px), calc(var(--_dbox) * 0.56 - var(--_rh)));
  --_notch: calc(var(--_rb) + var(--_rh) * 0.32);              /* the notch, above the bottom of the box */
  --_fw: min(max(120vw, 912px), calc(var(--_dbox) * 2.7));
  --_fh: calc(var(--_fw) * 0.2213);
  --_zoom: 1.15;                                               /* the wide shot's scale while it waits behind the close shot */
  --_dyb: calc(var(--_scene-h) * 0.06);                        /* …and how much lower it sits */

  position: relative;
  z-index: 10;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--imm-night);
  color: var(--imm-ink-inv);
  font-family: 'Kanit', 'Noto Sans Thai', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: var(--imm-lh-body);
  /* "ติดต่อ" (#imm-footer) should land on the contact blocks at the end of the shot, not on the sunset above them */
  scroll-margin-top: -1000vh;
}
@supports (height: 100lvh) {
  .imm-ft { --_scene-h: 100lvh; } /* stable on phones while the URL bar collapses */
}

/* the seam where the page meets the dusk shot (owner request 2026-11-17: no line there, on any device). On screens
   with a fractional pixel ratio (many Android phones: 2.625, 2.8125…) the footer's top edge falls inside a device
   pixel, and that half-covered row blends the shot's composited layers — the dark sky photo under the cream haze —
   into a thin dark line. A cream strip a few pixels tall straddles the edge, above the footer, so that row is only
   ever cream on cream. Zero height in the flow (no layout change); it lives just before the footer because the
   footer clips (overflow: clip) anything drawn outside it. */
.imm-ft-seam { position: relative; z-index: 11; flex: none; height: 0; pointer-events: none; }
.imm-ft-seam::before { content: ''; position: absolute; left: 0; right: 0; top: -4px; height: 8px; background: var(--imm-bg); }
@media print { .imm-ft-seam { display: none; } }
/* the bubble geometry follows companions.css: beside the head on small / short screens, above it when very narrow */
@media (max-width: 768px), (max-height: 520px) {
  .imm-ft { --_dock-gap: 14px; }
}
@media (max-width: 340px) {
  .imm-ft { --_dock-gap: 62px; }
}
.imm-ft a { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.imm-ft img { max-width: none; }
.imm-ft svg { display: block; }

/* ------------------------------------------------------------------ the timeline */
.imm-ft-night {
  --fs: var(--imm-scr, 0);                                     /* screens into the shot */
  --t-night: clamp(0, var(--fs), 1);                           /* 0 → 1: dusk → night            (stop 0 → 1) */
  --c: clamp(0, var(--fs) - 1, 1);                             /* 0 → 1: the camera pulls back   (stop 1 → 2) */
  --t-lan: clamp(0, calc((var(--fs) - 1.35) / 0.6), 1);        /* the lanterns rise from the valley */
  /* after the last stop the blocks arrive: 0 at stop 2 → 1 at the very end (footer.js: --ft-end = screens of travel) */
  /* complete at the last stop (the closing line at the top, ≈0.4 screens on) or at the very end, whichever comes
     first — a hair early for rounding */
  --t-out: clamp(0, calc((var(--fs) - 2) / max(0.2, min(var(--ft-end, 2.6) - 2.02, 0.4))), 1);
  --t-show: clamp(0, calc(var(--t-out) * 2.5), 1);             /* the blocks and the wordmark fade in together */
  --t-wm: var(--t-out);                                        /* the wordmark slides while the blocks travel */
  --_s: calc(var(--_zoom) - (var(--_zoom) - 1) * var(--c));   /* wide-shot scale: --_zoom → 1 */
  position: relative;
  z-index: 1;
  background: var(--imm-night);
}

/* no dusk part (footer_skip_dusk, /skill — owner decision 2026-11-16): the shot opens already at the pulled-back night
   valley with the closing line (the old stop 2), so the timeline starts two screens in and those two screens of
   travel are gone from the body */
.imm-ft-night--nodusk { --fs: calc(var(--imm-scr, 0) + 2); }
.imm-ft-night--nodusk .imm-ft-body { min-height: calc(var(--_scene-h) * 1.35); padding-top: 0; }

/* …and instead of the dusk shot, a short evening-sky band (owner request 2026-11-17): the page's cream blushes,
   turns lavender and violet and deepens into the night, where the first stars come out, so the valley never starts
   on a hard edge. Static (no scroll-linked repaint), in the flow just above the pinned shot. */
/* the band starts see-through, so whatever the page paints just above it (the cream, the last card's soft shadow)
   carries on into it without a cut */
.imm-ft--nodusk { background: transparent; }
.imm-ft-fade {
  --_fade-end: #14132a;                                        /* = the valley photo's zenith (measured), not --imm-night:
                                                                  a darker end would leave a dark seam line above it */
  position: relative;
  height: clamp(240px, 46vh, 520px);
  pointer-events: none;
  background:
    radial-gradient(90% 46% at 50% 30%, rgba(255, 208, 166, 0.32), rgba(255, 208, 166, 0) 70%),
    linear-gradient(180deg,
      rgba(250, 244, 231, 0) 0%,
      #f6e9e1 13%,
      #ecd4d7 24%,
      #cfb7d7 36%,
      #9e88c1 48%,
      #6b57a1 59%,
      #3f3278 70%,
      #261d55 80%,
      #19163d 90%,
      var(--_fade-end) 100%);
}
.imm-ft-fade::after { /* the first stars, only where the sky is already dark */
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 78%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 23% 92%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.2px 1.2px at 41% 84%, rgba(255, 239, 198, 0.85), transparent),
    radial-gradient(1px 1px at 57% 96%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.6px 1.6px at 71% 80%, rgba(255, 255, 255, 0.9), transparent),
    radial-gradient(1px 1px at 88% 90%, rgba(246, 243, 255, 0.7), transparent);
  background-size: 380px 100%;
  background-repeat: repeat-x;
  -webkit-mask-image: linear-gradient(to bottom, transparent 62%, #000 92%);
  mask-image: linear-gradient(to bottom, transparent 62%, #000 92%);
}
/* the valley's sky picks up exactly where the band ends: its zenith starts at the band's last colour. Laid over the
   front layer (above the valley and every lantern, under the text), so a lantern's glow never shows the shot's top
   edge as a cut either — the lanterns rise into it and fade */
.imm-ft-night--nodusk { background: #14132a; }
.imm-ft-night--nodusk .imm-ft-front::after {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: clamp(70px, 13vh, 150px);
  background: linear-gradient(to bottom, #14132a 0%, rgba(20, 19, 42, 0.72) 35%, rgba(20, 19, 42, 0) 100%);
}

/* invisible in-view sentinel: pauses ambient loops while the shot is off-screen */
.imm-ft-gate { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }

.imm-ft-scene,
.imm-ft-dusk,
.imm-ft-front {
  position: sticky;
  top: 0;
  height: var(--_scene-h);
  overflow: hidden;
  pointer-events: none;
}
.imm-ft-scene { z-index: 0; }
.imm-ft-dusk { z-index: 1; margin-top: calc(var(--_scene-h) * -1); }
.imm-ft-front { z-index: 2; margin-top: calc(var(--_scene-h) * -1); }

/* ------------------------------------------------------------------ wide shot · the valley under the Milky Way */
.imm-ft-scene__cam {
  position: absolute;
  inset: 0;
  transform-origin: 50% var(--_hz);
  transform: translate3d(calc(var(--imm-mx) * -12px), calc(var(--_dyb) * (1 - var(--c)) + var(--imm-my) * -7px), 0) scale(var(--_s));
  will-change: transform;
}
.imm-ft-scene__photo {
  position: absolute;
  left: calc((100% - var(--_bw)) * 0.52);
  top: var(--_by);
  width: var(--_bw);
  height: var(--_bh);
}

.imm-ft-scene__stars {
  position: absolute;
  inset: 0 0 auto;
  width: 100%;
  height: 64%;
  opacity: calc(var(--t-night) * var(--t-night) * 0.85);       /* the brightest stars come out last */
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 50%, transparent 100%);
}

.imm-ft-scene__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(var(--_night-rgb), 0.8) 0%, rgba(var(--_night-rgb), 0.32) 15%, rgba(var(--_night-rgb), 0) 34%),
    radial-gradient(130% 100% at 50% 36%, rgba(var(--_night-rgb), 0) 52%, rgba(var(--_night-rgb), 0.5) 100%);
}
/* the valley steps back a little while the blocks travel over it */
.imm-ft-scene__shade::after { content: ''; position: absolute; inset: 0; background: var(--imm-night); opacity: calc(var(--t-out) * 0.36); }

/* ------------------------------------------------------------------ close shot · dusk over the ridge */
.imm-ft-dusk__cam { /* sky, far ridges, mist: they recede — shrink toward the valley's horizon — as the camera leaves */
  position: absolute;
  inset: 0;
  transform-origin: 50% var(--_hz);
  transform: scale(calc(1 - var(--c) * 0.5));
  will-change: transform;
}

/* sky: the sunset photo; night falls from the top of it first, then it gives way to the wide shot's starry sky */
.imm-ft-dusk__sky {
  position: absolute;
  inset: 0 0 auto;
  height: calc(var(--_dbox) - var(--_notch) + var(--_fh) * 0.12);
  overflow: hidden;
  /* fallback sky while the photo loads */
  background: linear-gradient(180deg, var(--imm-bg) 0%, #d9cdea 30%, var(--imm-violet-400) 48%, #a8679f 66%, #ee8b62 84%, var(--imm-gold-300) 100%);
  opacity: calc(1 - clamp(0, calc((var(--t-night) - 0.4) / 0.6), 1));
}
.imm-ft-dusk__sky img {
  position: absolute;
  left: -2%;
  top: -9%;
  width: 104%;
  height: 118%;
  object-fit: cover;
  object-position: 50% 100%;
  transform: translate3d(calc(var(--imm-mx) * -10px), calc((1 - var(--imm-enter)) * -7%), 0);
  will-change: transform;
}
.imm-ft-dusk__sky::after { /* nightfall: the zenith darkens while the horizon still glows */
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, #0b0a2a 0%, rgba(15, 12, 50, 0.9) 34%, rgba(31, 23, 96, 0.5) 62%, rgba(74, 47, 134, 0) 100%);
  opacity: clamp(0, calc(var(--t-night) * 1.8), 1);
}

.imm-ft-dusk__far {
  /* hero-far-pano (4304 × 374): the hero's range (1672 px wide, from x = 1392) with generated wings on both sides.
     --_fw is still the width of the hero's part, so that part sits exactly where the single image used to */
  position: absolute;
  left: 50%;
  bottom: calc(var(--_notch) - var(--_fh) * 0.38);
  width: calc(var(--_fw) * 2.5742);
  height: calc(var(--_fw) * 0.22368);
  margin-left: calc(var(--_fw) * -1.3325);
  transform: translate3d(calc(var(--imm-mx) * -16px), calc((1 - var(--imm-enter)) * -4vh), 0);
  /* during the pull-back the ridges settle onto the valley's horizon and melt into its haze */
  /* they stay while they shrink back, then melt into the valley's far haze */
  opacity: calc(1 - clamp(0, calc((var(--c) - 0.4) / 0.55), 1));
  /* soft sides (off-screen at dusk): a receding range never shows a cut edge */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  will-change: transform;
}
.imm-ft-dusk__far img { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the same ridges by moonlight: graded once (a static filter), only its opacity moves */
.imm-ft-dusk__far .imm-ft-dusk__far-night { filter: grayscale(1) brightness(0.33) sepia(1) hue-rotate(198deg) saturate(1.7); opacity: var(--t-night); }

.imm-ft-dusk__mist {
  position: absolute;
  left: 50%;
  bottom: calc(var(--_notch) - var(--_rw) * 0.12);
  width: calc(var(--_rw) * 1.3);
  height: calc(var(--_rw) * 0.3);
  margin-left: calc(var(--_rw) * -0.65);
  opacity: calc(0.4 - var(--t-night) * 0.14 - var(--c) * 0.26);
  animation: imm-drift 46s ease-in-out infinite alternate;
}

/* the valley's land in front of the receding ridges: the wide shot's own photo, laid out and moved exactly like it
   (.imm-ft-scene__cam) and masked to what lies below its horizon, so the far ridges sink BEHIND the city instead
   of shrinking over it. It only shows while they recede; at the end it is the very picture underneath it. */
.imm-ft-dusk__valley {
  position: absolute;
  inset: 0;
  transform-origin: 50% var(--_hz);
  transform: translate3d(calc(var(--imm-mx) * -12px), calc(var(--_dyb) * (1 - var(--c)) + var(--imm-my) * -7px), 0) scale(var(--_s));
  opacity: calc(clamp(0, calc(var(--c) / 0.35), 1) * (1 - clamp(0, calc((var(--c) - 0.85) / 0.15), 1)));
  will-change: transform, opacity;
}
.imm-ft-dusk__valley img {
  position: absolute;
  left: calc((100% - var(--_bw)) * 0.52);
  top: var(--_by);
  width: var(--_bw);
  height: var(--_bh);
  -webkit-mask-image: linear-gradient(to bottom, transparent 57%, #000 66%);
  mask-image: linear-gradient(to bottom, transparent 57%, #000 66%);
}

/* the tree ridge: a silhouette. For the valley it stretches out to the sides from its notch (wider than it grows
   tall, as if the camera flew through the gap) and fades, and the valley's own forested slopes take its place. */
.imm-ft-dusk__ridge {
  position: absolute;
  left: 50%;
  bottom: var(--_rb);
  width: var(--_rw);
  height: var(--_rh);
  margin-left: calc(var(--_rw) / -2);
  transform-origin: 50% 68%;
  transform: translate3d(calc(var(--imm-mx) * -24px), 0, 0) scale(calc(1 + var(--c) * 1.25), calc(1 + var(--c) * 0.7));
  opacity: calc(1 - clamp(0, calc((var(--c) - 0.12) / 0.6), 1));
  will-change: transform, opacity;
}
.imm-ft-dusk__ridge img { display: block; width: 100%; height: 100%; filter: brightness(0.25) saturate(0.6); }
.imm-ft-dusk__ridge::after { /* the ground the ridge stands on, down to the bottom of the shot */
  content: '';
  position: absolute;
  inset: calc(100% - 2px) -10% auto;
  height: calc(max(var(--_rb), 0px) + 60px);
  background: linear-gradient(to bottom, #0b0e10 0%, #0b0d14 30%, var(--imm-night) 100%);
}

/* cream mist: the section above (always on --imm-bg) thins out over the sky — no seam; it lifts as night falls */
.imm-ft-dusk__haze {
  position: absolute;
  inset: 0 0 auto;
  height: 62%;
  background: var(--imm-bg);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 7%, rgba(0, 0, 0, 0.86) 20%, rgba(0, 0, 0, 0.52) 42%, rgba(0, 0, 0, 0.2) 68%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 7%, rgba(0, 0, 0, 0.86) 20%, rgba(0, 0, 0, 0.52) 42%, rgba(0, 0, 0, 0.2) 68%, transparent 100%);
  /* opaque at its top edge while that edge meets the page above (no seam); it draws up a little as the shot settles
     and then stays, the same over the dusk sky (stop 0) and the Milky Way (stop 1) — owner decision — and lifts
     only while the valley takes over */
  transform-origin: 50% 0;
  transform: scaleY(calc(1 - var(--imm-enter) * 0.3));
  opacity: calc(1 - var(--c) * 1.6);
}

/* nothing left to see of the close shot once the camera has pulled back (footer.js: .is-late) */
.imm-ft-night.is-late .imm-ft-dusk { visibility: hidden; }

/* ------------------------------------------------------------------ sky lanterns (โคมลอย) at three depths */
/* they belong to the wide shot: released once the camera has pulled back to the valley (--t-lan) */
.imm-ft-lanterns { position: absolute; inset: 0; pointer-events: none; }
.imm-ft-lanterns__layer { position: absolute; inset: 0; opacity: var(--t-lan); will-change: transform, opacity; }
.imm-ft-lanterns__layer--far { transform: translate3d(calc(var(--imm-mx) * -8px), calc((1 - var(--t-lan)) * 4vh + var(--imm-my) * -5px), 0); }
.imm-ft-lanterns__layer--mid { transform: translate3d(calc(var(--imm-mx) * -22px), calc((1 - var(--t-lan)) * 12vh + var(--imm-my) * -12px), 0); }
.imm-ft-lanterns__layer--near { transform: translate3d(calc(var(--imm-mx) * -46px), calc((1 - var(--t-lan)) * 28vh + var(--imm-my) * -24px), 0); }

/* each lantern is a full-height track, so translateY(%) is measured against the scene height */
.imm-ft-lantern {
  --x: 50%;        /* horizontal position */
  --w: 48px;       /* width */
  --dur: 38s;      /* one ascent */
  --delay: 0s;     /* negative = already in the sky when the footer arrives, positive = released later */
  --y0: 97%;       /* start / end of the ascent, in scene heights */
  --y1: -12%;
  --drift: 5vw;    /* wind */
  --sway: 9px;
  --sway-dur: 9s;
  --o: 1;
  --ys: 40%;       /* resting height when motion is reduced */
  position: absolute;
  left: var(--x);
  top: 0;
  width: var(--w);
  height: 100%;
  margin-left: calc(var(--w) / -2);
  opacity: 0;
  transform: translate3d(0, var(--y0), 0);
  animation: imm-ft-rise var(--dur) linear var(--delay) infinite;
  will-change: transform, opacity;
}
.imm-ft-lantern__body {
  position: relative;
  display: block;
  width: 100%;
  transform-origin: 50% 18%;
  animation: imm-ft-sway var(--sway-dur) ease-in-out var(--delay) infinite alternate;
}
.imm-ft-lantern__body::before { /* warm halo around the flame */
  content: '';
  position: absolute;
  left: 50%;
  top: 62%;
  width: 340%;
  aspect-ratio: 1;
  margin: -170% 0 0 -170%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 186, 104, 0.42), rgba(255, 160, 80, 0.16) 46%, rgba(255, 150, 70, 0) 100%);
  animation: imm-ft-flicker 3.4s ease-in-out var(--delay) infinite alternate;
}
.imm-ft-lantern img { position: relative; display: block; width: 100%; height: auto; }

/* far — tiny, released from the city */
.imm-ft-lanterns__layer--far .imm-ft-lantern { --y0: 79%; --y1: 26%; --o: 0.82; --sway: 3px; --drift: 2.4vw; }
.imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(1) { --x: 22%; --w: clamp(12px, 1.3vw, 24px); --dur: 64s; --delay: -38s; --sway-dur: 8s; --ys: 46%; }
.imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(2) { --x: 39%; --w: clamp(9px, 1vw, 18px); --dur: 72s; --delay: -14s; --y0: 76%; --y1: 30%; --sway-dur: 11s; --ys: 61%; }
.imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(3) { --x: 57%; --w: clamp(13px, 1.45vw, 27px); --dur: 58s; --delay: -40s; --sway-dur: 9s; --ys: 38%; }
.imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(4) { --x: 69%; --w: clamp(10px, 1.1vw, 20px); --dur: 68s; --delay: 3s; --sway-dur: 10s; --ys: 55%; }
.imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(5) { --x: 81%; --w: clamp(12px, 1.25vw, 23px); --dur: 61s; --delay: 11s; --y0: 77%; --sway-dur: 8.5s; --ys: 66%; }
/* mid — crisp */
.imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(1) { --x: 13%; --w: clamp(34px, 4.1vw, 76px); --dur: 40s; --delay: -12s; --sway-dur: 9s; --ys: 52%; }
.imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(2) { --x: 46%; --w: clamp(26px, 3.1vw, 56px); --dur: 47s; --delay: -30s; --sway-dur: 11s; --ys: 20%; }
.imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(3) { --x: 68%; --w: clamp(38px, 4.6vw, 86px); --dur: 37s; --delay: 1.5s; --sway-dur: 8s; --ys: 64%; }
.imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(4) { --x: 88%; --w: clamp(30px, 3.6vw, 66px); --dur: 43s; --delay: -21s; --sway-dur: 10s; --ys: 34%; }
/* near — large, out of focus. They keep clear of the closing line (left-aligned on wide screens, centred on
   phones) and drift outwards, so they frame the text instead of crossing it. */
.imm-ft-lanterns__layer--near .imm-ft-lantern { --y0: 106%; --y1: -42%; --sway: 16px; --drift: 3vw; --o: 0.92; }
.imm-ft-lanterns__layer--near .imm-ft-lantern img { filter: blur(2.5px); }
.imm-ft-lanterns__layer--near .imm-ft-lantern:nth-child(1) { --x: 83%; --w: clamp(84px, 10.5vw, 200px); --dur: 30s; --delay: -9s; --sway-dur: 10s; --ys: 58%; }
.imm-ft-lanterns__layer--near .imm-ft-lantern:nth-child(2) { --x: 97%; --w: clamp(96px, 12vw, 230px); --dur: 35s; --delay: -24s; --sway-dur: 12s; --drift: 2vw; --ys: 12%; }
.imm-ft-lanterns__layer--near .imm-ft-lantern:nth-child(3) { --x: -2.5%; --w: clamp(70px, 8.4vw, 160px); --dur: 27s; --delay: 7s; --sway-dur: 9s; --drift: -3vw; --ys: 84%; }

/* released when the footer scrolls into view, paused whenever it is off-screen (engine toggles .is-inview) or still
   waiting for the pull-back (footer.js: .is-early); the dusk mist rests once the close shot is gone (.is-late) */
html.imm-js .imm-ft-lanterns:not(.is-inview) .imm-ft-lantern,
html.imm-js .imm-ft-lanterns:not(.is-inview) .imm-ft-lantern__body,
html.imm-js .imm-ft-lanterns:not(.is-inview) .imm-ft-lantern__body::before,
html.imm-js .imm-ft-night.is-early .imm-ft-lantern,
html.imm-js .imm-ft-night.is-early .imm-ft-lantern__body,
html.imm-js .imm-ft-night.is-early .imm-ft-lantern__body::before,
html.imm-js .imm-ft-gate:not(.is-inview) ~ .imm-ft-dusk .imm-ft-dusk__mist,
html.imm-js .imm-ft-night.is-late .imm-ft-dusk__mist { animation-play-state: paused; }

@keyframes imm-ft-rise {
  0% { transform: translate3d(0, var(--y0), 0); opacity: 0; }
  9% { opacity: var(--o); }
  76% { opacity: var(--o); }
  100% { transform: translate3d(var(--drift), var(--y1), 0); opacity: 0; }
}
@keyframes imm-ft-sway {
  from { transform: translate3d(calc(var(--sway) * -1), 0, 0) rotate(-3.5deg); }
  to { transform: translate3d(var(--sway), 0, 0) rotate(4deg); }
}
@keyframes imm-ft-flicker {
  0% { opacity: 0.62; transform: scale(0.94); }
  38% { opacity: 1; transform: scale(1.04); }
  61% { opacity: 0.78; transform: scale(0.98); }
  100% { opacity: 0.95; transform: scale(1.02); }
}

/* ------------------------------------------------------------------ giant outlined wordmark */
.imm-ft-wordmark {
  position: absolute;
  left: 0;
  /* its letters' top sits exactly one --_bar-gap under the bar: when the floor is taller than letters + gap
     (launcher clearance, พี่ทิศ on phones, the safe area) the wordmark rises with it */
  bottom: calc(-0.1em + max(0px, var(--_floor) + var(--imm-safe-b) - var(--_bar-gap) - var(--_wm-cap)));
  width: max-content;
  padding-inline: 0.06em;
  font-size: var(--_wm-size);
  font-weight: 700;
  line-height: 0.8;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
  color: transparent;
  -webkit-text-stroke: 1px rgba(246, 243, 255, 0.2);
  background: linear-gradient(to bottom, rgba(246, 243, 255, 0.09), rgba(246, 243, 255, 0) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  /* phones: slides from STUDENT to COMPASS while the content scrolls over the pinned scene */
  transform: translate3d(calc(var(--t-wm) * (100vw - 100%)), 0, 0);
  opacity: var(--t-show);                                      /* it arrives together with the blocks (owner decision) */
  will-change: transform, opacity;
}

/* ------------------------------------------------------------------ content travelling over the scene */
.imm-ft-body {
  position: relative;
  z-index: 3;
  /* at least a third of a screen of travel after stop 2, so the blocks always finish sliding in (tall screens where
     they fit easily get the room between the closing line and the blocks) */
  display: flex;
  flex-direction: column;
  min-height: calc(var(--_scene-h) * 3.35);
  margin-top: calc(var(--_scene-h) * -1);
  /* two screens of choreography (dusk → night → the valley) pass before the closing line rests at stop 2 */
  padding-top: calc(var(--_scene-h) * 2);
  padding-bottom: calc(var(--_floor) + var(--imm-safe-b));
}
.imm-ft-body > .imm-ft-inner { margin-top: auto; }

/* closing line (placement user-confirmed): it rises over the valley while the camera leaves and rests in the lower
   half of the shot at stop 2 (its top at mid-height); from there it travels up with the blocks and stays right
   above them in the final view — it never dissolves */
.imm-ft-closing {
  position: relative;
  padding: calc(var(--_scene-h) * 0.5) 0 clamp(24px, 4.5vh, 56px);
}
.imm-ft-closing__eyebrow { margin: 0; }
/* the top bar stays on the last stop (owner decision 2026-11-16); where the two lines fit under it but the eyebrow
   would sit beneath it (footer.js: .is-tight), the eyebrow bows out while the blocks arrive */
html.imm-js .imm-ft-closing__inner.is-tight .imm-ft-closing__eyebrow.is-inview { opacity: calc(1 - var(--t-show, 0)); }
.imm-ft-closing__title {
  max-width: 17em;
  margin: 0.55em 0 0;
  font-size: var(--imm-fs-3xl);
  font-weight: 300;
  line-height: 1.34;
  color: var(--imm-ink-inv);
  text-wrap: balance;
}
/* Thai stacks vowels and tone marks: give the masked lines head- and foot-room */
.imm-ft-closing__title .imm-line { padding-block: 0.16em; margin-block: -0.12em; }
.imm-ft-closing__title .imm-line > span { text-shadow: 0 2px 28px rgba(var(--_night-rgb), 0.7); }
.imm-ft-closing__strong { font-weight: 600; }
.imm-ft-closing__title .imm-ft-closing__strong > span {
  text-shadow: none;
  background: var(--imm-grad-text-inv);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ------------------------------------------------------------------ dark-glass blocks */
.imm-ft-inner {
  /* at stop 2 only the closing line shows: the blocks (and the bottom bar) wait half a screen lower, out of sight,
     and slide up into place under the line as the page goes on (owner decision) */
  position: relative;
  transform: translate3d(0, calc((1 - var(--t-out)) * var(--_scene-h) * 0.5), 0);
  opacity: var(--t-show);
  will-change: transform, opacity;
}

.imm-ft-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(14px, 1.7vw, 26px);
  align-items: stretch;
}

.imm-ft-card,
.imm-ft-bottom {
  border: 1px solid var(--imm-glass-dark-border);
  background: var(--imm-glass-dark-bg);
  box-shadow: 0 24px 60px rgba(5, 4, 20, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(var(--imm-blur)) saturate(1.35);
  backdrop-filter: blur(var(--imm-blur)) saturate(1.35);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .imm-ft-card, .imm-ft-bottom { background: rgba(19, 16, 52, 0.9); }
}
/* touch screens: the blocks slide in over a living sky (stars, lanterns); a frosted backdrop re-blurred every frame
   makes phones drop frames there — a near-opaque night glass reads the same */
html.imm-touch :is(.imm-ft-card, .imm-ft-bottom) {
  -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(19, 16, 52, 0.86);
}

.imm-ft-card {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: var(--_card-pad);
  border-radius: var(--imm-r-lg);
  color: var(--imm-ink-inv);
}

/* brand */
.imm-ft-card--brand { display: flex; flex-direction: column; justify-content: space-between; gap: clamp(18px, 2.2vw, 34px); }
.imm-ft-brand { display: flex; align-items: center; gap: clamp(12px, 1.2vw, 18px); }
.imm-ft-brand__logo {
  flex: none;
  display: grid;
  place-items: center;
  width: clamp(56px, 4.6vw, 72px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--imm-white), var(--imm-cream) 72%);
  box-shadow: 0 0 0 1px var(--imm-line-gold), 0 10px 34px rgba(250, 172, 30, 0.24);
}
.imm-ft-brand__logo img { width: 60%; height: auto; }
.imm-ft-brand__text { min-width: 0; }
.imm-ft-brand__title { font-size: var(--imm-fs-xl); font-weight: 600; line-height: 1.25; }
.imm-ft-brand__sub { margin-top: 0.25em; font-size: var(--imm-fs-sm); font-weight: 300; line-height: 1.55; color: var(--imm-ink-inv-2); }
.imm-ft-brand__tagline {
  position: relative;
  max-width: 21em;
  margin: 0;
  padding-left: 1.1em;
  font-size: var(--imm-fs-md);
  font-weight: 300;
  line-height: 1.7;
  color: var(--imm-ink-inv);
}
.imm-ft-brand__tagline > span { display: inline-block; } /* the line breaks between the two phrases, never inside */
.imm-ft-brand__tagline::before { /* gold hairline, like a bearing line on a map */
  content: '';
  position: absolute;
  left: 0;
  top: 0.35em;
  bottom: 0.35em;
  width: 1px;
  background: linear-gradient(to bottom, var(--imm-gold-300), rgba(250, 172, 30, 0));
}

/* night compass rose behind the brand block (decorative, clipped to the card) */
.imm-ft-card__art {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.imm-ft-card--brand > :not(.imm-ft-card__art) { position: relative; z-index: 1; }
.imm-ft-rose {
  /* wide cards: half a rose rises from the right edge, beside the tagline and clear of the chips */
  position: absolute;
  top: 50%;
  right: calc(var(--_rose) * -0.44);
  margin-top: calc(var(--_rose) * -0.42);
  width: var(--_rose);
  height: var(--_rose);
  --_rose: clamp(180px, 16vw, 280px);
  overflow: visible;
  opacity: 0.55;
  /* it turns once the blocks have started to arrive, after a real 400 ms pause (owner decision 2026-11-16: the
     scroll-linked turn started too early), and turns back at once when the page goes back up (footer.js: .is-blocks) */
  transform: rotate(-24deg);
  transition: transform 0.6s var(--imm-ease-out);
  -webkit-mask-image: radial-gradient(closest-side, #000 62%, rgba(0, 0, 0, 0.35) 100%);
  mask-image: radial-gradient(closest-side, #000 62%, rgba(0, 0, 0, 0.35) 100%);
}
html.imm-js .imm-ft-night.is-blocks .imm-ft-rose {
  transform: rotate(16deg);
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}
.imm-ft-rose * { fill: none; stroke: var(--imm-gold-300); vector-effect: non-scaling-stroke; }
.imm-ft-rose__ring { stroke-width: 1; stroke-opacity: 0.45; }
.imm-ft-rose__ring--faint { stroke-opacity: 0.22; stroke-dasharray: 2 5; }
.imm-ft-rose__ticks { stroke-width: 6; stroke-opacity: 0.32; stroke-dasharray: 0.35 4.65; stroke-dashoffset: 0.175; vector-effect: none; }
.imm-ft-rose__ticks--major { stroke-width: 10; stroke-opacity: 0.6; stroke-dasharray: 0.7 44.3; stroke-dashoffset: 0.35; }
.imm-ft-rose__star { stroke-width: 1; stroke-opacity: 0.7; fill: rgba(250, 172, 30, 0.05); }
.imm-ft-rose__star--minor { stroke-opacity: 0.32; fill: none; }
.imm-ft-rose__pivot { fill: var(--imm-gold-300); stroke: none; }
.imm-ft-rose__n {
  fill: var(--imm-gold-200);
  stroke: none;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* version / build / updated chips */
.imm-ft-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.imm-ft-meta__panel { min-width: 0; }
.imm-ft-meta__panel > div { display: flex; flex-wrap: wrap; gap: 8px; }
.imm-ft-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  max-width: 100%;
  min-height: 30px;
  margin: 0;
  padding: 0.25em 0.9em;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--imm-r-pill);
  background: rgba(255, 255, 255, 0.07);
  color: var(--imm-ink-inv-2);
  font: inherit;
  font-size: var(--imm-fs-xs);
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.imm-ft-chip > span:first-child, span.imm-ft-chip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
span.imm-ft-chip { display: inline-block; line-height: calc(30px - 0.5em - 2px); }

/* headings double as the fold toggles on phones */
.imm-ft-heading { margin: 0; padding: 0; font-size: var(--imm-fs-lg); font-weight: 500; line-height: 1.3; }
.imm-ft-fold__toggle {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--imm-r-pill);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.imm-ft-fold__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--imm-line-gold);
  border-radius: 50%;
  background: rgba(250, 172, 30, 0.08);
  color: var(--imm-gold-200);
  transition: transform 0.9s var(--imm-ease-spring), background-color 0.5s ease, color 0.5s ease, box-shadow 0.6s ease;
}
.imm-ft-fold__icon svg,
.imm-ft-link svg,
.imm-ft-contact dt svg,
.imm-ft-top__ring svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.imm-ft-fold__icon svg { width: 20px; height: 20px; }
.imm-ft-fold__title { flex: 1; min-width: 0; }
.imm-ft-fold__chevron { display: none; }
.imm-ft-fold__rule {
  display: block;
  height: 1px;
  margin: clamp(12px, 1.2vw, 18px) 0 clamp(4px, 0.6vw, 10px);
  background: linear-gradient(90deg, var(--imm-gold-400), rgba(250, 172, 30, 0));
  opacity: 0.7;
  transform-origin: 0 50%;
}
/* the engine clips the panel's child (overflow: hidden) — the padding that keeps room for focus rings lives one
   level deeper, so a folded panel collapses to exactly 0px */
.imm-ft-fold__panel > div { margin-inline: -6px; }

/* links */
.imm-ft-links { display: grid; margin: 0; list-style: none; }
.imm-ft-links,
.imm-ft-contact { padding: 4px 6px; }
.imm-ft-links > li { margin: 0; padding: 0; }
.imm-ft-link {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 0.4em 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-size: var(--imm-fs-md);
  font-weight: 300;
  line-height: 1.45;
  transition: color var(--imm-dur-2) ease;
}
.imm-ft-links > li:last-child > .imm-ft-link { border-bottom-color: transparent; }
.imm-ft-link::after { /* gold hairline drawn on hover / focus */
  content: '';
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  background: var(--imm-grad-gold);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.7s var(--imm-ease-out);
}
.imm-ft-link svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.4;
  transform: translate3d(-8px, 0, 0);
  transition: transform 0.6s var(--imm-ease-out), opacity 0.4s ease;
}
.imm-ft-link:focus-visible { color: var(--imm-gold-200); }
.imm-ft-link:focus-visible::after { transform: scaleX(1); }
.imm-ft-link:focus-visible svg { opacity: 1; transform: none; }
@media (hover: hover) {
  .imm-ft-link:hover { color: var(--imm-gold-200); }
  .imm-ft-link:hover::after { transform: scaleX(1); }
  .imm-ft-link:hover svg { opacity: 1; transform: none; }
}

/* contact */
.imm-ft-contact { display: grid; gap: clamp(10px, 1vw, 15px); margin: 0; }
.imm-ft-contact > div { margin: 0; }
.imm-ft-contact dt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: var(--imm-fs-xs);
  font-weight: 400;
  line-height: 1.4;
  color: var(--imm-gold-200);
}
.imm-ft-contact dt svg { flex: none; width: 16px; height: 16px; }
.imm-ft-contact dd {
  margin: 0.15em 0 0 24px;
  font-size: var(--imm-fs-md);
  font-weight: 300;
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.imm-ft-contact a {
  display: inline-block;
  padding-block: 0.2em;
  text-decoration: underline;
  text-decoration-color: var(--imm-line-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  transition: color var(--imm-dur-2) ease, text-decoration-color var(--imm-dur-2) ease;
}
.imm-ft-contact a:focus-visible { color: var(--imm-gold-200); }
@media (hover: hover) {
  .imm-ft-contact a:hover { color: var(--imm-gold-200); text-decoration-color: currentColor; }
}

/* bottom bar */
.imm-ft-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 20px;
  margin-top: var(--_bar-gap);
  padding: 6px clamp(16px, 1.8vw, 26px);
  border-radius: var(--imm-r-pill);
}
.imm-ft-copy { justify-self: start; font-size: var(--imm-fs-xs); line-height: 1.5; letter-spacing: 0.02em; color: var(--imm-ink-inv-2); }
.imm-ft-top {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px 0 4px;
  border-radius: var(--imm-r-pill);
  font-size: var(--imm-fs-sm);
  line-height: 1.3;
  transition: color var(--imm-dur-2) ease;
}
.imm-ft-top__ring {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--imm-line-gold);
  border-radius: 50%;
  color: var(--imm-gold-200);
  transition: background-color var(--imm-dur-2) ease, color var(--imm-dur-2) ease, transform 0.7s var(--imm-ease-spring);
}
.imm-ft-top__ring svg { width: 18px; height: 18px; }
.imm-ft-top:focus-visible .imm-ft-top__ring { background: var(--imm-gold-400); color: var(--imm-violet-950); }
@media (hover: hover) {
  .imm-ft-top:hover { color: var(--imm-gold-200); }
  .imm-ft-top:hover .imm-ft-top__ring { background: var(--imm-gold-400); color: var(--imm-violet-950); transform: translate3d(0, -4px, 0); }
}
.imm-ft-lang { justify-self: end; display: inline-flex; align-items: center; gap: 2px; font-size: var(--imm-fs-xs); color: var(--imm-ink-inv-2); }
.imm-ft-lang > span { opacity: 0.4; }
.imm-ft-lang a {
  display: inline-grid;
  place-items: center;
  min-width: 44px;
  min-height: 36px;
  padding: 0 0.7em;
  border: 1px solid transparent;
  border-radius: var(--imm-r-pill);
  font-weight: 500;
  letter-spacing: 0.12em;
  transition: color var(--imm-dur-2) ease, background-color var(--imm-dur-2) ease, border-color var(--imm-dur-2) ease;
}
.imm-ft-lang a[aria-current='true'] { border-color: var(--imm-line-gold); background: rgba(250, 172, 30, 0.14); color: var(--imm-gold-200); }
@media (hover: hover) {
  .imm-ft-lang a:hover { color: var(--imm-ink-inv); border-color: rgba(255, 255, 255, 0.28); }
}

/* ------------------------------------------------------------------ ≥ 768px: the bottom bar sits low (owner decision)
   Under the bar: one --_bar-gap, then the wordmark's letters (never less than 84px, so the help launcher at the
   bottom right stays clear — the wordmark then rises to keep the gap). พี่ทิศ (bottom left) is cleared sideways:
   footer.js publishes --imm-ft-bar-inset when his figure would reach under the bar's left end. Phones keep the dock
   floor (the avatar spans the stacked bar); there too the wordmark keeps one gap under the bar. */
@media (min-width: 768px) {
  .imm-ft { --_wm-size: min(9.7vw, 32vh); --_floor: max(calc(var(--_wm-cap) + var(--_bar-gap)), 84px); }
  .imm-ft-bottom { margin-left: var(--imm-ft-bar-inset, 0px); }
}
@media (min-width: 768px) {
  .imm-ft-wordmark {
    left: 50%;
    transform: translate3d(calc(-50% + (0.5 - var(--t-wm)) * 4vw), 0, 0);
  }
}
/* the gutters are wide enough to hold the nearest lanterns without crossing a block: they come forward */
@media (min-width: 1920px) {
  .imm-ft-inner, .imm-ft-closing__inner { width: min(100% - 2 * var(--imm-gutter), var(--imm-max-wide)); }
  .imm-ft-front { z-index: 4; }
  .imm-ft-lanterns__layer--near .imm-ft-lantern:nth-child(1) { --x: 3%; --drift: -2vw; }
}

/* ------------------------------------------------------------------ tablets / landscape phones: brand band + two columns */
@media (max-width: 1099.98px) {
  .imm-ft-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .imm-ft-card--brand { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 14px 24px; }
  .imm-ft-brand__tagline { display: none; } /* the band stays one compact row; phones bring it back below */
  /* © on the left, the two actions on the right: the copyright line never has to wrap */
  .imm-ft-bottom { grid-template-columns: minmax(0, 1fr) auto auto; }
  .imm-ft-top { justify-self: end; }
}

/* ------------------------------------------------------------------ phones: one column, groups fold away */
@media (max-width: 767.98px) {
  .imm-ft { --_card-pad: 18px; }
  .imm-ft-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .imm-ft-card--brand { flex-direction: column; align-items: stretch; gap: 16px; }
  .imm-ft-closing__inner { text-align: center; }
  .imm-ft-closing__title { margin-inline: auto; font-size: clamp(1.45rem, 6.6vw, 2.3rem); }
  .imm-ft-closing__eyebrow::before { display: none; }

  /* half the lanterns; the one big lantern peeks in from the right edge, behind the content */
  .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(even),
  .imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(even),
  .imm-ft-lanterns__layer--near .imm-ft-lantern:not(:nth-child(2)) { display: none; }
  .imm-ft-lanterns__layer--near .imm-ft-lantern { --o: 0.7; }

  .imm-ft-card, .imm-ft-bottom { -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); }
  .imm-ft-brand__tagline { display: block; }
  .imm-ft-rose { --_rose: clamp(132px, 34vw, 190px); top: auto; right: calc(var(--_rose) * -0.3); bottom: calc(var(--_rose) * -0.4); margin: 0; opacity: 0.4; }

  /* bottom bar: "back to top" is the big row, © and TH | EN share the line under it */
  .imm-ft-bottom { grid-template-columns: minmax(0, 1fr) auto; padding: 6px 8px 8px; border-radius: var(--imm-r-lg); }
  .imm-ft-top { grid-column: 1 / -1; grid-row: 1; justify-self: stretch; justify-content: center; min-height: 52px; border-bottom: 1px solid rgba(255, 255, 255, 0.1); border-radius: var(--imm-r-md) var(--imm-r-md) 0 0; }
  .imm-ft-copy { padding-left: 10px; }
  .imm-ft-lang a { min-height: 44px; }
}
@media (max-width: 479.98px) {
  .imm-ft-bottom { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .imm-ft-copy { justify-self: center; padding: 6px 8px 0; }
  .imm-ft-lang { justify-self: center; }
}

/* ---- grand fold / unfold (engine adds .is-collapsible below 768px, .is-open while unfolded) ---- */
/* align-self: landscape phones fold inside the two-column grid — a folded pill never stretches to its open neighbour */
.imm-ft-fold.is-collapsible { align-self: start; padding: 8px; border-radius: 30px; }
.imm-ft-fold.is-collapsible::after { /* gold aura of an opened group */
  content: '';
  position: absolute;
  inset: -1px;
  border: 1px solid var(--imm-line-gold);
  border-radius: inherit;
  box-shadow: 0 0 44px rgba(250, 172, 30, 0.16), inset 0 0 30px rgba(250, 172, 30, 0.06);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}
.imm-ft-fold.is-collapsible.is-open::after { opacity: 1; }
.imm-ft-fold.is-collapsible .imm-ft-fold__toggle { min-height: 52px; padding-right: 6px; cursor: pointer; }
.imm-ft-fold.is-collapsible .imm-ft-fold__icon { width: 48px; height: 48px; }
.imm-ft-fold.is-collapsible .imm-ft-fold__chevron {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: var(--imm-gold-200);
  font-size: 0.8rem;
  transition: background-color 0.5s ease, border-color 0.5s ease, color 0.5s ease;
}
.imm-ft-fold.is-open .imm-ft-fold__chevron .imm-chevron { transform: translateY(15%) rotate(225deg); }
.imm-ft-fold.is-collapsible.is-open .imm-ft-fold__icon {
  background: var(--imm-grad-gold);
  color: var(--imm-violet-950);
  box-shadow: 0 0 0 6px rgba(250, 172, 30, 0.12), 0 10px 30px rgba(250, 172, 30, 0.32);
  transform: rotate(360deg);
}
.imm-ft-fold.is-collapsible.is-open .imm-ft-fold__chevron { border-color: var(--imm-line-gold); background: rgba(250, 172, 30, 0.14); }
.imm-ft-fold.is-collapsible .imm-ft-fold__rule { margin: 0 12px; opacity: 0; transform: scaleX(0); transition: transform 0.9s var(--imm-ease-out), opacity 0.4s ease, margin 0.7s var(--imm-ease-out); }
.imm-ft-fold.is-collapsible.is-open .imm-ft-fold__rule { margin: 10px 12px 2px; opacity: 0.8; transform: scaleX(1); transition-delay: 0.08s, 0.08s, 0s; }
.imm-ft-fold.is-collapsible .imm-ft-fold__panel > div { margin-inline: 0; }
.imm-ft-fold.is-collapsible :is(.imm-ft-links, .imm-ft-contact) { padding: 6px 12px 10px; }
/* rows arrive one after another */
.imm-ft-fold.is-collapsible .imm-ft-links > li,
.imm-ft-fold.is-collapsible .imm-ft-contact > div { opacity: 0; transform: translate3d(0, 18px, 0); transition: opacity 0.35s ease, transform 0.5s ease; }
.imm-ft-fold.is-collapsible.is-open .imm-ft-links > li,
.imm-ft-fold.is-collapsible.is-open .imm-ft-contact > div { opacity: 1; transform: none; transition: opacity 0.6s ease calc(140ms + var(--_n, 0) * 70ms), transform 0.9s var(--imm-ease-out) calc(140ms + var(--_n, 0) * 70ms); }
.imm-ft-fold :is(li, .imm-ft-contact > div):nth-child(2) { --_n: 1; }
.imm-ft-fold :is(li, .imm-ft-contact > div):nth-child(3) { --_n: 2; }
.imm-ft-fold :is(li, .imm-ft-contact > div):nth-child(4) { --_n: 3; }
.imm-ft-fold :is(li, .imm-ft-contact > div):nth-child(5) { --_n: 4; }

/* version chip unfolds build + updated */
.imm-ft-meta.is-collapsible { flex-direction: column; align-items: flex-start; gap: 0; }
.imm-ft-meta.is-collapsible .imm-ft-meta__toggle { cursor: pointer; color: var(--imm-ink-inv); }
.imm-ft-meta.is-collapsible .imm-ft-meta__toggle::after { content: ''; position: absolute; inset: -8px -6px; } /* 44px+ touch target */
.imm-ft-meta.is-collapsible .imm-ft-meta__toggle .imm-chevron { color: var(--imm-gold-200); }
.imm-ft-meta.is-collapsible.is-open .imm-ft-meta__toggle { border-color: var(--imm-line-gold); background: rgba(250, 172, 30, 0.14); }
.imm-ft-meta.is-collapsible .imm-ft-meta__panel .imm-ft-chip { margin-top: 8px; } /* margin, not padding: a folded panel collapses to 0px */

/* ------------------------------------------------------------------ landscape phones / very short windows */
@media (max-height: 520px) {
  .imm-ft-brand__tagline { display: none; }
  .imm-ft-closing { padding: calc(var(--_scene-h) * 0.3) 0 20px; } /* short screens: low, but clear of พี่ทิศ at the bottom left */
  .imm-ft-closing__title { font-size: clamp(1.3rem, 5.4vh + 0.3rem, 2rem); }
}

/* ------------------------------------------------------------------ still composition
   No JavaScript, the in-app "reduce motion" switch, high contrast: nothing pinned, nothing zoomed. The close shot
   becomes a dusk band on top (the page's cream still thins into it), the valley sits under the content at its final
   state (--fs: 2), the closing line and the blocks follow in the normal flow. */
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-night {
  --fs: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: var(--_scene-h);
}
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) :is(.imm-ft-scene, .imm-ft-front) { position: absolute; inset: auto 0 0; margin: 0; }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-scene::before { /* the photo's upper edge melts into the night above it */
  content: '';
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 24%;
  background: linear-gradient(to bottom, var(--imm-night), rgba(var(--_night-rgb), 0));
}
/* no dusk part: the valley's upper edge melts into the evening band's last colour instead (the zenith veil over the
   pinned shot has nothing to cover here) */
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-night--nodusk .imm-ft-front::after { display: none; }
:is(html:not(.imm-js), html.imm-reduced) .imm-ft-night--nodusk .imm-ft-scene::before { background: linear-gradient(to bottom, #14132a, rgba(20, 19, 42, 0)); }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-dusk {
  /* the close shot at dusk, as a band (its geometry re-measured against the band) */
  --t-night: 0;
  --c: 0;
  --fs: 0;
  --_dbox: var(--_dusk-h);
  --_rb: min(clamp(18px, calc(var(--_dusk-h) * 0.035), 64px), calc(var(--_dusk-h) * 0.56 - var(--_rh)));
  --_notch: calc(var(--_rb) + var(--_rh) * 0.32);
  position: relative;
  height: var(--_dusk-h);
  margin: 0;
  visibility: visible;
}
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) :is(.imm-ft-dusk__cam, .imm-ft-scene__cam, .imm-ft-dusk__sky img, .imm-ft-dusk__far, .imm-ft-dusk__ridge, .imm-ft-dusk__haze, .imm-ft-lanterns__layer) { transform: none; }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-dusk__haze { opacity: 1; }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-dusk__valley { display: none; }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-body { display: block; min-height: 0; margin-top: 0; padding-top: 0; }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-closing { min-height: 0; padding: clamp(72px, 14vh, 200px) 0 clamp(40px, 9vh, 120px); }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) :is(.imm-ft-closing__inner, .imm-ft-inner) { opacity: 1; transform: none; }
:is(html:not(.imm-js), html.imm-reduced, html.a11y-high-contrast) .imm-ft-wordmark { opacity: 1; }
html.imm-reduced .imm-ft-scene__shade::after { opacity: 0.2; }
html.imm-reduced .imm-ft-dusk__mist,
html.imm-reduced .imm-ft-lantern__body,
html.imm-reduced .imm-ft-lantern__body::before { animation: none; }
/* lanterns hang still, fewer of them, gathered in the open sky beside the closing line (--xs / --ys) */
html.imm-reduced .imm-ft-lantern { left: var(--xs, var(--x)); animation: none; opacity: var(--o); transform: translate3d(0, var(--ys), 0); }
html.imm-reduced .imm-ft-lantern:nth-child(even),
html.imm-reduced .imm-ft-lanterns__layer--near .imm-ft-lantern:nth-child(3) { display: none; }
html.imm-reduced .imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(1) { --xs: 64%; --ys: 14%; }
html.imm-reduced .imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(3) { --xs: 86%; --ys: 4%; }
html.imm-reduced .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(1) { --xs: 73%; --ys: 23%; }
html.imm-reduced .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(3) { --xs: 76%; --ys: 8%; }
html.imm-reduced .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(5) { --xs: 94%; --ys: 19%; }
html.imm-reduced .imm-ft-lanterns__layer--near .imm-ft-lantern:nth-child(1) { --xs: 99%; --ys: 24%; }
@media (max-width: 767.98px) {
  /* phones: the closing line is centred, so the lanterns keep to the edges */
  html.imm-reduced .imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(1) { --xs: 6%; --ys: 9%; }
  html.imm-reduced .imm-ft-lanterns__layer--mid .imm-ft-lantern:nth-child(3) { --xs: 93%; --ys: 3%; }
  html.imm-reduced .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(1) { --xs: 13%; --ys: 21%; }
  html.imm-reduced .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(3) { --xs: 90%; --ys: 16%; }
  html.imm-reduced .imm-ft-lanterns__layer--far .imm-ft-lantern:nth-child(5) { --xs: 79%; --ys: 23%; }
}
html.imm-reduced .imm-ft-wordmark { transform: translate3d(calc(100vw - 100%), 0, 0); }
html.imm-reduced .imm-ft [data-imm-collapse-panel],
html.imm-reduced .imm-ft-fold *,
html.imm-reduced .imm-ft-fold::after { transition: none !important; } /* beats the transition shorthands above and in core.css */
@media (min-width: 768px) {
  html.imm-reduced .imm-ft-wordmark { transform: translate3d(-50%, 0, 0); }
}
/* the OS reduced-motion preference is not followed (owner decision): only the in-app switch (html.imm-reduced) */

/* high contrast: solid plates, strong borders, no imagery behind text */
html.a11y-high-contrast .imm-ft,
html.a11y-high-contrast .imm-ft-night,
html.a11y-high-contrast .imm-ft-scene { background: #05050c; color: #fff; }
html.a11y-high-contrast .imm-ft-fade { background: linear-gradient(180deg, var(--imm-bg), #05050c); }
html.a11y-high-contrast .imm-ft-fade::after,
html.a11y-high-contrast .imm-ft-scene::before { display: none; } /* the plate is solid: no navy melt line over it */
html.a11y-high-contrast .imm-ft-scene > *,
html.a11y-high-contrast .imm-ft-front,
html.a11y-high-contrast .imm-ft-dusk__mist { display: none; }
html.a11y-high-contrast .imm-ft-dusk__ridge::after { background: linear-gradient(to bottom, #0b0e10 0%, #05050c 60%); }
html.a11y-high-contrast .imm-ft-closing__inner { opacity: 1; transform: none; }
html.a11y-high-contrast .imm-ft-closing__title .imm-line > span { text-shadow: none; }
html.a11y-high-contrast .imm-ft-closing__title .imm-ft-closing__strong > span,
html.a11y-high-contrast .imm-ft-brand__title { background: none; -webkit-text-fill-color: currentColor; color: #fff; }
html.a11y-high-contrast .imm-ft-closing__eyebrow,
html.a11y-high-contrast .imm-ft-contact dt { color: #ffe29a; }
html.a11y-high-contrast .imm-ft-card,
html.a11y-high-contrast .imm-ft-bottom { border: 2px solid #fff; background: #05050c; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.a11y-high-contrast .imm-ft-brand__sub,
html.a11y-high-contrast .imm-ft-copy,
html.a11y-high-contrast .imm-ft-lang,
html.a11y-high-contrast .imm-ft-chip { color: #fff; }
html.a11y-high-contrast .imm-ft-chip { border: 2px solid #fff; background: none; }
html.a11y-high-contrast .imm-ft-link,
html.a11y-high-contrast .imm-ft-contact a,
html.a11y-high-contrast .imm-ft-top,
html.a11y-high-contrast .imm-ft-lang a { color: #ffe29a; text-decoration: underline; text-underline-offset: 0.25em; }
html.a11y-high-contrast .imm-ft-link,
html.a11y-high-contrast .imm-ft-top { border-bottom-color: rgba(255, 255, 255, 0.5); }
html.a11y-high-contrast .imm-ft-link svg { opacity: 1; transform: none; }
html.a11y-high-contrast .imm-ft-fold__icon,
html.a11y-high-contrast .imm-ft-fold.is-collapsible .imm-ft-fold__chevron,
html.a11y-high-contrast .imm-ft-top__ring { border: 2px solid #ffe29a; background: none; color: #ffe29a; box-shadow: none; }
html.a11y-high-contrast .imm-ft-fold__rule { height: 2px; background: #fff; opacity: 1; }
html.a11y-high-contrast .imm-ft-fold.is-collapsible.is-open .imm-ft-fold__icon { background: #ffe29a; color: #05050c; transform: none; }
html.a11y-high-contrast .imm-ft-lang a[aria-current='true'] { border: 2px solid #ffe29a; background: none; color: #ffe29a; }
html.a11y-high-contrast .imm-ft-brand__logo { box-shadow: 0 0 0 2px #fff; }
html.a11y-high-contrast .imm-ft-card__art { display: none; }
html.a11y-high-contrast .imm-ft-brand__tagline { color: #fff; }
html.a11y-high-contrast .imm-ft-brand__tagline::before { width: 2px; background: #ffe29a; }

/* ------------------------------------------------------------------ system status (footer.js §7, owner decision 2026-11-18)
   The "สถานะระบบ" link carries a dot of the overall state (after the words, so the list keeps one left edge) and opens a small dialog: a night header with the overall
   state, one row per part of the service, hand-kept notices, and when it was last checked. Centred card on wide
   screens, a bottom sheet on phones. Fades and rises only (no bounce). */
.imm-ft-status-dot {
  --_c: rgba(255, 255, 255, 0.45);
  display: inline-block; width: 8px; height: 8px; margin-left: 0.65em; border-radius: 50%; vertical-align: 0.06em;
  background: var(--_c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--_c) 26%, transparent);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.imm-ft-status-dot:not([data-state]) { display: none; } /* until the first answer arrives */
.imm-ft-status-dot[data-state='operational'] { --_c: #3ccf8e; }
.imm-ft-status-dot[data-state='degraded'] { --_c: var(--imm-gold-400); }
.imm-ft-status-dot[data-state='outage'] { --_c: #ff6b81; }

html.imm-status-open { overflow: hidden; }
.imm-status {
  --_ok: var(--imm-success); --_warn: var(--imm-gold-400); --_bad: var(--imm-danger);
  position: fixed; inset: 0; z-index: 10080; display: grid; place-items: center; padding: 24px;
  font-family: inherit; color: var(--imm-ink);
}
.imm-status[hidden] { display: none; }
.imm-status__scrim {
  position: absolute; inset: 0; background: rgba(10, 9, 32, 0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: imm-status-fade 0.3s ease both;
}
.imm-status__card {
  position: relative; display: flex; flex-direction: column; width: min(100%, 31rem); max-height: min(88vh, 46rem); overflow: hidden;
  border-radius: var(--imm-r-lg); background: var(--imm-surface); outline: none;
  box-shadow: var(--imm-shadow-3), 0 0 0 1px rgba(250, 172, 30, 0.28);
  animation: imm-status-rise 0.45s var(--imm-ease-out) both;
}
@keyframes imm-status-fade { from { opacity: 0; } }
@keyframes imm-status-rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } }

.imm-status__head {
  --_c: rgba(255, 255, 255, 0.5);
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 14px;
  padding: 18px 14px 18px 18px; color: #fff; border-bottom: 1px solid var(--imm-line-gold);
  background:
    radial-gradient(130% 150% at 100% -10%, rgba(250, 172, 30, 0.42) 0%, rgba(240, 163, 180, 0.2) 34%, rgba(240, 163, 180, 0) 62%),
    linear-gradient(118deg, var(--imm-violet-950) 0%, var(--imm-violet-800) 48%, var(--imm-violet-600) 100%);
}
.imm-status[data-state='operational'] .imm-status__head { --_c: #3ccf8e; }
.imm-status[data-state='degraded'] .imm-status__head { --_c: var(--imm-gold-400); }
.imm-status[data-state='outage'] .imm-status__head, .imm-status[data-state='error'] .imm-status__head { --_c: #ff6b81; }
.imm-status__emblem {
  display: grid; place-items: center; width: 46px; height: 46px; margin-top: 2px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.imm-status__emblem::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--_c);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--_c) 30%, transparent), 0 0 18px var(--_c);
  transition: background-color 0.4s ease, box-shadow 0.4s ease;
}
.imm-status[data-state='checking'] .imm-status__emblem::before, .imm-status.is-loading .imm-status__emblem::before { animation: imm-status-pulse 1.4s ease-in-out infinite; }
@keyframes imm-status-pulse { 50% { opacity: 0.35; } }
.imm-status__eyebrow { margin: 0; font-size: var(--imm-fs-xs); font-weight: 500; letter-spacing: 0.04em; color: var(--imm-gold-200); }
.imm-status__title { margin: 2px 0 0; font-size: var(--imm-fs-lg); font-weight: 600; line-height: 1.35; color: #fff; }
.imm-status__lead { margin: 3px 0 0; font-size: var(--imm-fs-sm); line-height: 1.5; color: rgba(255, 255, 255, 0.8); }
.imm-status__lead:empty { display: none; }
.imm-status__close {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer;
  color: #fff; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.26);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.imm-status__close:hover, .imm-status__close:focus-visible { background: rgba(255, 255, 255, 0.24); border-color: var(--imm-gold-300); }
.imm-status__close:focus-visible { outline: 2px solid var(--imm-gold-400); outline-offset: 2px; }

.imm-status__body { padding: 6px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }
.imm-status__list { margin: 0; padding: 0; list-style: none; transition: opacity 0.3s ease; }
.imm-status.is-loading .imm-status__list { opacity: 0.55; }
.imm-status__item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 14px; row-gap: 2px;
  padding: 13px 0; border-bottom: 1px solid var(--imm-line);
}
.imm-status__item[data-state='operational'] { --_c: var(--_ok); --_t: #1d6f4c; }
.imm-status__item[data-state='degraded'] { --_c: var(--_warn); --_t: var(--imm-gold-700); }
.imm-status__item[data-state='down'] { --_c: var(--_bad); --_t: var(--_bad); }
.imm-status__name { grid-column: 1; font-size: var(--imm-fs-md); font-weight: 500; line-height: 1.4; color: var(--imm-ink); }
.imm-status__desc { grid-column: 1; font-size: var(--imm-fs-xs); line-height: 1.5; color: var(--imm-ink-3); }
.imm-status__badge {
  grid-column: 2; grid-row: 1 / span 2; display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--imm-fs-xs); font-weight: 500; line-height: 1.3; white-space: nowrap; color: var(--_t);
}
.imm-status__badge::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--_c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--_c) 22%, transparent); }

.imm-status__notices { display: grid; gap: 10px; padding: 12px 0 4px; }
.imm-status__notices[hidden] { display: none; }
.imm-status__notice {
  --_c: var(--imm-violet-500);
  display: grid; gap: 3px; padding: 11px 14px; border-radius: var(--imm-r-sm);
  background: color-mix(in srgb, var(--_c) 9%, #fff); box-shadow: inset 3px 0 0 var(--_c);
}
.imm-status__notice[data-level='maintenance'] { --_c: var(--imm-gold-500); }
.imm-status__notice[data-level='incident'] { --_c: var(--imm-danger); }
.imm-status__notice-tag { font-size: var(--imm-fs-xs); font-weight: 600; letter-spacing: 0.02em; color: var(--_c); }
.imm-status__notice-title { font-size: var(--imm-fs-sm); font-weight: 600; line-height: 1.45; color: var(--imm-ink); }
.imm-status__notice-detail { font-size: var(--imm-fs-xs); line-height: 1.6; color: var(--imm-ink-2); }
.imm-status__notice-when { font-size: var(--imm-fs-xs); color: var(--imm-ink-3); font-variant-numeric: tabular-nums; }

.imm-status__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding-top: 14px; }
.imm-status__meta { margin: 0; font-size: var(--imm-fs-xs); line-height: 1.5; color: var(--imm-ink-3); font-variant-numeric: tabular-nums; }
.imm-status__refresh {
  min-height: 40px; padding: 0 16px; border-radius: var(--imm-r-pill); cursor: pointer;
  border: 1px solid var(--imm-line-strong); background: rgba(104, 104, 172, 0.07); color: var(--imm-violet-600);
  font: inherit; font-size: var(--imm-fs-xs); font-weight: 500; transition: background-color 0.3s ease, border-color 0.3s ease;
}
.imm-status__refresh:hover, .imm-status__refresh:focus-visible { border-color: var(--imm-gold-400); background: rgba(250, 172, 30, 0.1); }
.imm-status__refresh:disabled { opacity: 0.55; cursor: progress; }

@media (max-width: 600px) { /* phones: a bottom sheet */
  .imm-status { place-items: end stretch; padding: 0; }
  .imm-status__card { width: 100%; max-height: 88vh; border-radius: var(--imm-r-lg) var(--imm-r-lg) 0 0; animation-name: imm-status-sheet; }
  .imm-status__body { padding-bottom: calc(18px + var(--imm-safe-b)); }
  @keyframes imm-status-sheet { from { opacity: 0.6; transform: translate3d(0, 40%, 0); } }
}
html.imm-reduced .imm-status__scrim, html.imm-reduced .imm-status__card, html.imm-reduced .imm-status__emblem::before { animation: none !important; }
html.a11y-high-contrast .imm-status__card { border: 2px solid var(--imm-ink); box-shadow: none; }
html.a11y-high-contrast .imm-status__head { background: #05050c; border-bottom: 2px solid #fff; }
html.a11y-high-contrast .imm-status__item { border-bottom-color: var(--imm-ink); }
html.a11y-high-contrast .imm-status__desc, html.a11y-high-contrast .imm-status__meta { color: var(--imm-ink); }
html.a11y-high-contrast .imm-status__refresh { color: var(--imm-ink); border: 2px solid var(--imm-ink); background: #fff; }

/* ------------------------------------------------------------------ print */
@media print {
  .imm-status { display: none !important; }
  .imm-ft-dusk, .imm-ft-fade, .imm-ft-scene, .imm-ft-front, .imm-ft-top { display: none; }
  .imm-ft, .imm-ft-night { background: none; color: #000; }
  .imm-ft-body { display: block; min-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 0; }
  .imm-ft-closing { min-height: 0; padding: 24px 0; }
  .imm-ft-closing__inner, .imm-ft-inner { opacity: 1; transform: none; }
  .imm-ft-card, .imm-ft-bottom { border-color: #999; background: none; box-shadow: none; color: #000; }
}
