/* Mentrix Digital — site styles.
   Quiet near-white and cool-gray surfaces, near-black type, one blue for actions and links.
   Gold appears only as a small marker on human-review steps (and in the logo). */

:root {
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --body: #424245;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --gray: #f5f5f7;
  --white: #fff;
  --blue: #0066cc;
  --action: #0071e3;
  --action-hover: #0077ed;
  --gold: #FFC52F;
  /* Editorial palette (header and home opening sections): off-white paper, ink, hairlines, one muted bronze */
  --paper: #f7f5f0;
  --paper-2: #efece5;
  --ink: #15171c;
  --ink-2: #5d5f66;
  --rule: #dcd8cf;
  --accent-muted: #8a7457;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-wipe: cubic-bezier(.7, 0, .2, 1);
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "IBM Plex Sans Thai", "DM Sans", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-th: "IBM Plex Sans Thai", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --contact-bar-height: 64px;
  --contact-consent-offset: 0px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body { margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6; color: var(--text); background: var(--white); font-synthesis: none; -webkit-font-smoothing: antialiased; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
html:lang(th) body { font-family: var(--font-th); line-height: 1.75; }
h1, h2, h3 { color: var(--text); font-weight: 600; text-wrap: balance; }
h1 { margin: 0 0 16px; font-size: clamp(40px, 6vw, 76px); line-height: 1.06; letter-spacing: -.028em; }
h2 { margin: 0; font-size: clamp(30px, 4.2vw, 52px); line-height: 1.1; letter-spacing: -.022em; }
h3 { margin: 0; font-size: 21px; line-height: 1.3; letter-spacing: -.01em; }
html:lang(th) :is(h1, h2, h3) { letter-spacing: 0; line-height: 1.3; }
p { margin: 0 0 16px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1:focus { outline: none; }
:focus-visible { outline: 2px solid var(--action); outline-offset: 3px; border-radius: 4px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }

.container { width: min(1080px, calc(100% - 44px)); margin-inline: auto; }
.container-wide { width: min(1240px, calc(100% - 32px)); }
.reading { width: min(720px, calc(100% - 44px)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 1100; padding: 10px 16px; border-radius: 10px; background: var(--white); color: var(--text); box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.skip-link:focus { left: 8px; }

/* Text roles */
.eyebrow { margin: 0 0 12px; font-size: 17px; font-weight: 600; color: var(--text-2); }
.lead { max-width: 680px; margin: 0 0 8px; font-size: clamp(19px, 2vw, 24px); line-height: 1.45; color: var(--text-2); }
html:lang(th) .lead { line-height: 1.65; }
.lead-sm { max-width: 680px; margin: 16px 0 0; font-size: 19px; line-height: 1.55; color: var(--text-2); }
.statement { margin: 0; font-size: clamp(21px, 2.3vw, 28px); line-height: 1.45; font-weight: 500; color: var(--text); }
html:lang(th) .statement { line-height: 1.7; }
.body-lg { margin: 0; font-size: 19px; line-height: 1.65; color: var(--body); }
.muted { color: var(--text-2); }
.statement + .body-lg { margin-top: 24px; }
.fine-print { margin: 20px 0 0; font-size: 14px; line-height: 1.6; color: var(--text-2); }
.fine-print a, .more, .text-link { color: var(--blue); }
.fine-print a:hover, .more:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.measure { max-width: 760px; }

/* Actions */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 32px; }
.actions-center { justify-content: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--action); color: #fff; font-size: 17px; font-weight: 500; line-height: 1.2; transition: background-color .2s; }
.button:hover { background: var(--action-hover); }
.button:disabled { opacity: .45; cursor: default; }
.more { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; }
.more span[aria-hidden] { font-size: 1.2em; line-height: 1; }

/* Header — restrained: paper ground, one hairline, letter-spaced labels.
   The ONLY state mark is a 1px ink underline under the current nav section (aria-current "page" or
   "true"); hover draws the same line from the centre. The logo never carries a state mark. */
.site-header { position: sticky; top: 0; z-index: 900; background: rgba(247,245,240,.94); border-bottom: 1px solid var(--rule); -webkit-backdrop-filter: saturate(1.2) blur(10px); backdrop-filter: saturate(1.2) blur(10px); }
.header-inner { display: flex; align-items: center; gap: 32px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; min-height: 44px; }
.brand img { display: block; width: 136px; height: auto; }
.brand:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; border-radius: 0; }
.nav-desktop { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-desktop a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 400; line-height: 1.2; letter-spacing: .02em; color: var(--ink-2); transition: color .3s ease; }
html:lang(en) .nav-desktop a { font-size: 11.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.nav-desktop a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 11px; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .45s var(--ease-out); }
html:lang(en) .nav-desktop a::after { right: calc(12px + .16em); }
.nav-desktop a:hover, .nav-desktop a[aria-current] { color: var(--ink); }
.nav-desktop a:hover::after, .nav-desktop a[aria-current]::after { transform: scaleX(1); }
.nav-desktop a:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; border-radius: 0; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.nav-desktop + .header-actions { padding-left: 16px; border-left: 1px solid var(--rule); }
.nav-mobile { display: none; }
.nav-mobile > summary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 44px; height: 44px; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nav-mobile > summary::-webkit-details-marker { display: none; }
.nav-mobile > summary:focus-visible { outline: 1px solid var(--ink); outline-offset: 0; border-radius: 0; }
.nav-mobile-current { display: none; position: relative; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--ink); white-space: nowrap; }
html:lang(en) .nav-mobile-current { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.nav-mobile-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 1px; background: var(--ink); }
.nav-mobile-bars, .nav-mobile-bars::before, .nav-mobile-bars::after { display: block; width: 20px; height: 1px; background: var(--ink); transition: transform .3s var(--ease-out), background-color .2s; }
.nav-mobile-bars { position: relative; }
.nav-mobile-bars::before, .nav-mobile-bars::after { content: ""; position: absolute; left: 0; }
.nav-mobile-bars::before { top: -5px; }
.nav-mobile-bars::after { top: 5px; }
.nav-mobile[open] .nav-mobile-bars { background: transparent; }
.nav-mobile[open] .nav-mobile-bars::before { transform: translateY(5px) rotate(45deg); }
.nav-mobile[open] .nav-mobile-bars::after { transform: translateY(-5px) rotate(-45deg); }
.nav-mobile nav { position: absolute; left: 0; right: 0; top: 100%; padding: 12px 22px 32px; background: var(--paper); border-bottom: 1px solid var(--rule); max-height: calc(100vh - var(--header-h)); overflow: auto; }
.nav-mobile nav a { display: flex; align-items: center; min-height: 56px; border-bottom: 1px solid var(--rule); font-size: 20px; font-weight: 400; color: var(--ink-2); transition: color .25s ease; }
html:lang(en) .nav-mobile nav a { font-size: 13px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.nav-mobile nav a:hover { color: var(--ink); }
.nav-mobile nav a[aria-current] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 8px; }
.nav-mobile nav a:focus-visible { outline: 1px solid var(--ink); outline-offset: -2px; border-radius: 0; }
@media (max-width: 900px) {
  .header-inner { gap: 12px; }
  .nav-desktop { display: none; }
  .nav-mobile { display: block; }
  .header-actions { margin-left: auto; }
}
/* Collapsed menu shows the current section beside the bars once there is room (logo + TH/EN + label). */
@media (min-width: 420px) and (max-width: 900px) {
  .nav-mobile > summary.has-current { padding: 0 4px 0 12px; }
  .nav-mobile > summary.has-current .nav-mobile-current { display: inline; }
}
@media (max-width: 359px) { .brand img { width: 120px; } }
@media (prefers-reduced-motion: reduce) {
  .nav-desktop a, .nav-desktop a::after, .nav-mobile nav a, .nav-mobile-bars, .nav-mobile-bars::before, .nav-mobile-bars::after { transition: none; }
}
@media (forced-colors: active) {
  .nav-desktop a[aria-current] { text-decoration: underline; text-underline-offset: 6px; }
  .nav-desktop a::after, .nav-mobile-current::after { background: CanvasText; }
  .nav-desktop a:not([aria-current]):not(:hover)::after { display: none; }
}

/* Footer */
.site-footer { background: var(--gray); color: var(--text-2); padding: 56px 0 24px; font-size: 13px; line-height: 1.6; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-grid > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.footer-grid img { display: block; width: 130px; height: auto; margin-bottom: 12px; }
.footer-grid p { max-width: 320px; margin: 0; }
.footer-grid strong { margin-bottom: 6px; color: var(--text); font-weight: 600; }
.footer-grid a { display: inline-flex; align-items: center; min-height: 28px; color: var(--body); }
.footer-grid a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; }
.footer-preferences { min-height: 32px; padding: 0; border: 0; background: none; color: var(--body); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.footer-preferences:hover { color: var(--text); }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; } .footer-grid > div:first-child { grid-column: 1 / -1; } }

/* Breadcrumbs */
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 28px; font-size: 13px; color: var(--text-2); }
.breadcrumbs a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.breadcrumbs span[aria-hidden] { color: var(--text-3); }
.breadcrumbs-center { justify-content: center; }

/* Page intro */
.intro { padding: clamp(64px, 9vw, 112px) 0 clamp(40px, 6vw, 72px); text-align: center; }
.intro h1 { max-width: 16ch; margin-inline: auto; }
html:lang(th) .intro h1 { max-width: 20ch; }
.intro .lead { margin-inline: auto; }
.intro .actions { justify-content: center; }
.intro .fine-print { margin-inline: auto; max-width: 640px; }
.intro-detail { text-align: left; }
.intro-detail > .container:first-child { width: min(880px, calc(100% - 44px)); }
.intro-detail h1 { max-width: none; margin-inline: 0; font-size: clamp(36px, 5vw, 64px); }
.intro-detail .lead, .intro-detail .fine-print { margin-inline: 0; }
.intro-detail .actions { justify-content: flex-start; }

/* Media */
.media { margin: 0; }
.media img { display: block; width: 100%; height: auto; border-radius: 24px; }
.media figcaption { margin-top: 14px; text-align: center; font-size: 14px; color: var(--text-2); }
.media figcaption a { color: var(--blue); }
.media-hero { margin-top: clamp(40px, 6vw, 64px); }
.media-stage { display: grid; justify-items: center; padding: clamp(28px, 5vw, 64px); border-radius: 28px; background: var(--gray); }
.media-stage img { width: auto; max-width: 100%; max-height: 640px; border-radius: 16px; box-shadow: 0 0 0 1px var(--line-soft), 0 24px 48px -28px rgba(0,0,0,.35); }
.band-gray .media-stage { background: #fff; }
.media-banner { max-width: 1080px; margin: clamp(32px, 5vw, 56px) auto 0; }

/* Home opening + shared-stage project story (ProjectShowcase.razor; spec .artifacts/feature-motion/design.md).
   Base = static flow: intro, then the three project panels stacked on ONE ivory background, all visible.
   .story.is-staged (js/home-motion.js initStory): one bounded track, one sticky stage, the three panels layered in
   the same plane and scrubbed by --t. Layers are transparent; only .story paints the background. */
.story-intro { padding: clamp(40px, 7vh, 88px) 0 clamp(24px, 4vh, 48px); background: var(--paper); color: var(--ink); }
.story-intro > .container { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px 72px; align-items: end; }
.story-intro .hero-eyebrow { grid-column: 1 / -1; }
.story-intro h1 { grid-column: 1; grid-row: 2 / span 2; max-width: 15ch; margin: 0; font-size: clamp(34px, 4.2vw, 60px); font-weight: 500; line-height: 1.06; letter-spacing: -.028em; color: var(--ink); }
html:lang(th) .story-intro h1 { max-width: 16ch; line-height: 1.26; letter-spacing: 0; }
.story-intro .hero-lead { grid-column: 2; grid-row: 2; }
.story-intro .hero-actions { grid-column: 2; grid-row: 3; margin-top: 4px; }
.hero-eyebrow { display: flex; align-items: center; gap: 14px; margin: 0 0 6px; font-size: 11.5px; font-weight: 500; line-height: 1.4; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-2); }
html:lang(th) .hero-eyebrow { font-size: 13px; letter-spacing: .04em; }
.hero-rule { flex: none; width: 40px; height: 1px; background: var(--accent-muted); transform-origin: left; }
.hero-lead { max-width: 32em; margin: 0; font-size: clamp(16px, 1.25vw, 18px); line-height: 1.65; color: var(--ink-2); }
html:lang(th) .hero-lead { line-height: 1.8; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.button-ink { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 26px; border: 1px solid var(--ink); background: var(--ink); color: var(--paper); font-size: 15px; font-weight: 500; line-height: 1.2; letter-spacing: .02em; transition: background-color .35s ease, color .35s ease; }
html:lang(en) .button-ink { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
.button-ink:hover { background: transparent; color: var(--ink); }
.button-ink:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; border-radius: 0; }
.link-quiet { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule); text-underline-offset: 6px; transition: text-decoration-color .3s ease; }
.link-quiet:hover { text-decoration-color: var(--ink); }
.link-quiet:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; border-radius: 0; }

.story { position: relative; overflow-x: clip; background: var(--paper); color: var(--ink); }
.story-stage { padding: clamp(16px, 3vh, 40px) 0 clamp(56px, 9vh, 104px); }
.story-stage:focus { outline: none; }
.story-panels { display: grid; min-width: 0; }
.story-panel { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 28px clamp(40px, 5vw, 88px); align-items: center; min-width: 0; }
.story-panel + .story-panel { margin-top: clamp(48px, 8vh, 96px); padding-top: clamp(48px, 8vh, 96px); border-top: 1px solid var(--rule); }
.panel-copy, .panel-visual { min-width: 0; }
.panel-visual { margin: 0; }

/* Project copy */
.scene-index { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; font-size: 11px; letter-spacing: .16em; color: var(--accent-muted); font-variant-numeric: tabular-nums; }
.scene-rule { flex: none; width: 28px; height: 1px; background: currentColor; }
.scene-name { margin: 0 0 8px; font-size: clamp(28px, 3vw, 44px); font-weight: 500; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
/* Official project mark beside the title: sized from the title font (0.9em ≈ cap height + descender), so it adds no
   line height and scales with the 26–44px title. Decorative (alt="") — the visible name carries the meaning. */
.scene-name { display: flex; align-items: center; gap: .3em; }
.project-logo { flex: none; width: .9em; height: .9em; object-fit: contain; }
.panel-brief { max-width: 30em; margin: 0 0 16px; font-size: 16px; line-height: 1.6; color: var(--ink-2); }
/* Explanation beats: always visible and readable. While staged, the current beat (aria-current="step", set by the
   script) gets the gold dot and ink heading; the others keep readable secondary colour. Colour only — no weight or
   size change, so nothing reflows between beats. */
.beats { margin: 0 0 12px; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.beat { position: relative; display: grid; gap: 2px; padding: 11px 0 11px 22px; border-bottom: 1px solid var(--rule); }
.beat::before { content: ""; position: absolute; left: 1px; top: 18px; width: 7px; height: 7px; border: 1px solid var(--rule); border-radius: 50%; background: var(--paper); transition: background-color .25s ease, border-color .25s ease; }
.beat strong { font-size: 15px; font-weight: 600; line-height: 1.4; color: var(--ink); transition: color .25s ease; }
.beat span { font-size: 14px; line-height: 1.55; color: var(--ink-2); }
html:lang(th) .beat span { line-height: 1.65; }
.story.is-staged .beat strong { color: var(--ink-2); }
.story.is-staged .beat[aria-current="step"] strong { color: var(--ink); }
.story.is-staged .beat[aria-current="step"]::before { border-color: var(--gold); background: var(--gold); }
@media (forced-colors: active) { .story.is-staged .beat[aria-current="step"]::before { background: Highlight; } }
.scene-link { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule); text-underline-offset: 5px; transition: text-decoration-color .3s ease; }
.scene-link:hover { text-decoration-color: var(--ink); }
.scene-link:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; border-radius: 0; }

/* Art. Flow: each visual is bounded by the viewport height so a whole panel fits one screen. Staged/fitting: the
   art fills the column scaled by --vis-w (JS fit factor; text never scales). Whole images, no crop. */
.story-art { width: min(100%, calc((100vh - var(--header-h) - 200px) * 1.6)); width: min(100%, calc((100svh - var(--header-h) - 200px) * 1.6)); margin-inline: auto; }
.story.is-staged .story-art, .story.is-fitting .story-art { width: calc(var(--vis-w, 1) * 100%); }
.story.is-staged .fit1-stage, .story.is-fitting .fit1-stage { width: 100%; }
.illus-note { margin: 10px 0 0; font-size: 14px; line-height: 1.4; color: var(--ink-2); text-align: center; }

/* FIT1 — warehouse 70% wide at the back; tablet and phone overlap its lower half. */
.fit1-stage { position: relative; width: min(100%, calc((100vh - var(--header-h) - 220px) * 2)); width: min(100%, calc((100svh - var(--header-h) - 220px) * 2)); margin-inline: auto; padding-bottom: 8%; container-type: inline-size; }
.shot > img { display: block; width: 100%; height: auto; }
.shot-browser { width: 70%; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 1px var(--line-soft), 0 40px 80px -40px rgba(0,0,0,.35); }
.shot-tablet { position: absolute; right: 0; bottom: 0; width: 46%; padding: 9px; border-radius: 24px; background: var(--text); box-shadow: 0 40px 70px -36px rgba(0,0,0,.5); }
.shot-tablet img { border-radius: 15px; }
/* Phone (same geometry as .phone-frame on the automation page): thin uniform black bezel (.03), screen
   radius .12 = body radius .15 minus bezel. The flat capture gets WHITE top/bottom safe areas (.14/.12,
   both >= the screen radius), so the rounded corners only clip white padding, never capture pixels.
   The camera pill sits inside the top safe area; no home indicator. All sizes scale from --pw. */
.shot-phone { --pw: 17cqw; position: absolute; left: 45%; bottom: 2%; width: var(--pw); padding: calc(var(--pw) * .03); border-radius: calc(var(--pw) * .15); background: #000; box-shadow: inset 0 0 0 1px #3a3a3c, 0 0 0 1px #a1a1a6, 0 30px 60px -30px rgba(0,0,0,.55); }
.shot-phone::before { content: ""; position: absolute; z-index: 2; top: calc(var(--pw) * .065); left: 50%; width: calc(var(--pw) * .24); height: calc(var(--pw) * .06); translate: -50% 0; border-radius: 999px; background: #000; }
.shot-phone > img { padding: calc(var(--pw) * .14) 0 calc(var(--pw) * .12); border-radius: calc(var(--pw) * .12); background: #fff; object-fit: contain; }
/* Per-feature compositions (staged): each device moves from its base place by w1·(x1,y1,s1) + w2·(…) + w3·(…),
   weights from the feature beats (all 0 when static = base composition). Offsets in cqw of .fit1-stage. Feature 1:
   POS central and large; feature 2: warehouse central; feature 3: phone central. */
.shot-tablet { --x1: -27cqw; --y1: -9cqw; --s1: 1.4; --x2: 10cqw; --y2: 3cqw; --s2: .55; --x3: 1cqw; --y3: -4cqw; --s3: .62; }
.shot-browser { --x1: -10cqw; --y1: -5.8cqw; --s1: .7; --x2: 9cqw; --y2: 2.2cqw; --s2: 1.05; --x3: -12cqw; --y3: 1.2cqw; --s3: .62; }
.shot-phone { --x1: 34.5cqw; --y1: 1cqw; --s1: .75; --x2: -48.5cqw; --y2: 4.3cqw; --s2: .55; --x3: -3.5cqw; --y3: -3.7cqw; --s3: 1.15; }
@media (max-width: 760px) {
  .fit1-stage { width: 100%; padding-bottom: 30%; }
  .shot-browser { width: 92%; border-radius: 10px; }
  .shot-tablet { width: 58%; padding: 5px; border-radius: 14px; }
  .shot-tablet img { border-radius: 9px; }
  .shot-phone { --pw: 24cqw; left: 12%; }
  .shot-tablet { --x1: -17cqw; --y1: -20.9cqw; --s1: 1.35; --x2: 11cqw; --y2: 7.1cqw; --s2: .5; --x3: 11cqw; --y3: -2.9cqw; --s3: .5; }
  .shot-browser { --x1: -16cqw; --y1: -10.4cqw; --s1: .6; --x2: 4cqw; --y2: 4.6cqw; --s2: 1.05; --x3: -22cqw; --y3: -7.4cqw; --s3: .5; }
  .shot-phone { --x1: -16cqw; --y1: 11.2cqw; --s1: .6; --x2: -12cqw; --y2: 13.2cqw; --s2: .5; --x3: 26cqw; --y3: -12.4cqw; --s3: 1.35; }
}
.pwa { display: none; }

/* ContentVelo / ChatMai feature illustrations: fixed 16:10 boxes, every position in cqw so the composition scales
   as one unit. Static state (no --t) = final composition via var() fallbacks; staged beats drive the same vars. */
.cv-illus, .cm-illus { position: relative; width: 100%; aspect-ratio: 16 / 10; container-type: inline-size; }
.cv-label { display: block; font-size: max(11px, 1.6cqw); font-weight: 600; line-height: 1.2; letter-spacing: .02em; color: var(--ink); white-space: nowrap; }
.cv-card { position: absolute; display: grid; align-content: start; gap: 1.2cqw; padding: 2.2cqw; border-radius: 1.2cqw; background: #fff; box-shadow: 0 0 0 1px rgba(9,15,29,.08), 0 24px 48px -30px rgba(9,15,29,.35); }
.cv-bar { display: block; width: var(--w, 100%); height: max(4px, .9cqw); border-radius: 99px; background: #d9dce3; transform-origin: left; scale: clamp(0, calc((var(--fill, 1) - var(--i) * .15) / .4), 1) 1; }

/* ContentVelo: voice → creation → schedule. --v1/--v2/--v3 beat weights (static: 0/0/1). */
.cv-site { position: absolute; left: 4cqw; top: 8cqw; width: 58cqw; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgba(9,15,29,.08), 0 30px 60px -36px rgba(9,15,29,.35); transform-origin: 0 0; translate: calc((1 - var(--v1, 0)) * -2cqw) calc((1 - var(--v1, 0)) * -6cqw); scale: calc(1 - (1 - var(--v1, 0)) * .55); }
.cv-site img { display: block; width: 100%; height: auto; }
.cv-scan { position: absolute; left: 0; right: 0; top: calc(var(--cs, 1) * 100%); height: 2px; background: var(--gold); opacity: calc(var(--cs, 1) * (1 - var(--cs, 1)) * 4 * var(--v1, 0)); }
.cv-voice { --fill: var(--cl, 1); left: 60cqw; top: 14cqw; width: 34cqw; opacity: var(--v1, 0); translate: 0 calc((1 - var(--v1, 0)) * 4cqw); }
.cv-tones { display: flex; gap: 1cqw; margin-top: .6cqw; }
.cv-tones i { width: 7cqw; height: max(10px, 2.2cqw); border: 1px solid var(--gold); border-radius: 99px; }
.cv-draft { --fill: var(--cd, 1); left: 6cqw; top: 22cqw; width: 34cqw; opacity: var(--v2, 0); translate: calc(var(--v3, 1) * -4cqw) calc((1 - var(--v2, 0) - var(--v3, 1)) * 4cqw); }
.cv-cal { position: absolute; left: 6cqw; top: 26cqw; width: 88cqw; opacity: var(--v3, 1); translate: 0 calc((1 - var(--v3, 1)) * 4cqw); }
.cv-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .8cqw; margin-top: 1cqw; }
.cv-day { height: 26cqw; padding: .8cqw; border: 1px solid var(--rule); border-radius: .8cqw; background: #fff; opacity: clamp(0, calc((var(--cc, 1) - var(--i) * .1) / .4), 1); }
.cv-day b { display: block; font-size: max(11px, 1.4cqw); font-weight: 600; color: var(--ink-2); }
/* Real sample ads: base place = creation layout (beat 2); beat 3 moves each onto a day cell (Mon/Wed/Fri). */
.cv-ad { position: absolute; width: 16cqw; padding: .6cqw; background: #fff; box-shadow: 0 0 0 1px rgba(9,15,29,.06), 0 18px 32px -20px rgba(9,15,29,.45); transform-origin: 0 0; opacity: calc(1 - var(--v1, 0)); translate: calc(var(--v3, 1) * var(--tx3)) calc(var(--v3, 1) * var(--ty3) + var(--v1, 0) * 4cqw); scale: calc(var(--s2) + var(--v3, 1) * (.55 - var(--s2)) - var(--v1, 0) * .1); }
.cv-ad img { display: block; width: 100%; height: auto; }
.cv-ad::after { content: ""; position: absolute; right: -1.6cqw; bottom: -1.6cqw; width: 3.6cqw; height: 3.6cqw; border: max(1px, .3cqw) solid var(--ink); border-radius: 50%; background: #fff linear-gradient(var(--ink), var(--ink)) 50% 30% / max(1px, .3cqw) 30% no-repeat; opacity: var(--v3, 1); }
.cv-ad-0 { --s2: 1.4; --tx3: -40.45cqw; --ty3: 24cqw; left: 48cqw; top: 12cqw; z-index: 3; }
.cv-ad-1 { --s2: 1.1; --tx3: -31.05cqw; --ty3: 20cqw; left: 64cqw; top: 16cqw; z-index: 2; }
.cv-ad-2 { --s2: .95; --tx3: -17.65cqw; --ty3: 16cqw; left: 76cqw; top: 20cqw; z-index: 1; }

/* ChatMai: team inbox → knowledge via MCP → knowledge-based replies. Generic placeholders and labels only.
   --m1/--m2/--m3 feature weights (static: 0/0/1 = final reply composition); sub-phases default to 1. */
.cm-inbox { position: absolute; left: 34cqw; top: 6cqw; width: 60cqw; height: 52cqw; padding: 2cqw; border-radius: 1.4cqw; background: #fff; box-shadow: 0 0 0 1px rgba(9,15,29,.08), 0 30px 60px -36px rgba(9,15,29,.35); opacity: var(--m1, 0); translate: 0 calc((1 - var(--m1, 0)) * -3cqw); }
.cm-msg { --m: clamp(0, calc((var(--cmt, 1) - var(--k) * .12) / .52), 1); opacity: var(--m1, 0); position: absolute; left: 36cqw; top: calc(14cqw + var(--k) * 7.5cqw); display: flex; align-items: center; gap: 1.2cqw; width: 56cqw; height: 6cqw; padding: 0 1.2cqw; border: 1px solid var(--rule); border-radius: .8cqw; background: #fff; transform-origin: 0 0; translate: calc((1 - var(--m)) * (-33cqw + var(--k) * 1.5cqw)) calc((1 - var(--m)) * (-10cqw - var(--k) * .5cqw)); rotate: calc((1 - var(--m)) * var(--fr, 0deg)); scale: calc(1 - (1 - var(--m)) * .54); }
.cm-msg:nth-of-type(1) { --fr: -4deg; } .cm-msg:nth-of-type(2) { --fr: 3deg; } .cm-msg:nth-of-type(3) { --fr: -2deg; } .cm-msg:nth-of-type(4) { --fr: 4deg; } .cm-msg:nth-of-type(5) { --fr: -3deg; }
.cm-avatar { flex: none; width: 3.4cqw; height: 3.4cqw; border-radius: 50%; background: #e3e6ec; }
.cm-lines { display: grid; flex: 1; gap: .7cqw; }
.cm-lines i { display: block; height: max(3px, .7cqw); border-radius: 99px; background: #d9dce3; }
.cm-lines i:last-child { width: 55%; background: #e8eaef; }
/* Feature 1: the second conversation is assigned (gold edge + teammate avatar) and gets a note mark. */
.cm-msg:nth-of-type(2)::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: .7cqw; border-radius: .8cqw 0 0 .8cqw; background: var(--gold); opacity: var(--hi, 1); }
.cm-person { position: relative; display: block; flex: none; width: 100%; height: 100%; border-radius: 50%; background: #fff; box-shadow: inset 0 0 0 1px var(--rule); overflow: hidden; }
.cm-person::before { content: ""; position: absolute; left: 34%; top: 20%; width: 32%; height: 32%; border-radius: 50%; background: var(--ink-2); }
.cm-person::after { content: ""; position: absolute; left: 18%; top: 58%; width: 64%; height: 60%; border-radius: 50%; background: var(--ink-2); }
.cm-assignee { position: absolute; left: 86cqw; top: 22.5cqw; width: 4cqw; height: 4cqw; border-radius: 50%; box-shadow: 0 0 0 max(1px, .3cqw) var(--gold); opacity: var(--m1, 0); scale: var(--ca, 1); }
.cm-badge { position: absolute; left: 80.5cqw; top: 22.5cqw; width: 4cqw; height: 4cqw; border: max(1px, .25cqw) solid var(--gold); border-radius: .6cqw; background: #fff linear-gradient(#d9dce3, #d9dce3) 50% 40% / 55% max(1px, .3cqw) no-repeat; opacity: var(--m1, 0); scale: var(--cb, 1); }

/* Feature 2: an external AI assistant → MCP → knowledge and reply-tone cards; gold check = owner review. */
.cm-ai, .cm-mcp { position: absolute; display: grid; place-items: center; border: 1px solid var(--ink); background: #fff; font-weight: 700; color: var(--ink); }
.cm-ai { left: 6cqw; top: 22cqw; width: 14cqw; height: 14cqw; border-radius: 50%; font-size: max(11px, 3cqw); opacity: calc(var(--m2, 0) * var(--k1, 1)); scale: calc(.8 + var(--k1, 1) * .2); }
.cm-mcp { left: 30cqw; top: 25cqw; width: 16cqw; height: 8cqw; border-radius: 1cqw; font-size: max(11px, 2.2cqw); letter-spacing: .08em; opacity: calc(var(--m2, 0) * var(--k2, 1)); }
.cm-wires { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.cm-wires path { fill: none; stroke: var(--gold); stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-dasharray: 1; }
.cm-wire-a { stroke-dashoffset: calc(1 - var(--k2, 1)); opacity: var(--m2, 0); }
.cm-wire-b { stroke-dashoffset: calc(1 - var(--k3, 1)); opacity: var(--m2, 0); }
.cm-wire-c { stroke-dashoffset: calc(1 - var(--r4, 1)); opacity: var(--m3, 1); }
.cm-know { --q: clamp(0, calc((var(--k5, 1) - var(--c) * .25) / .5), 1); --fill: var(--q); position: absolute; left: 56cqw; top: calc(8cqw + var(--c) * 14.5cqw); display: grid; align-content: start; gap: 1cqw; width: 36cqw; min-height: 12cqw; padding: 1.6cqw; border-radius: 1cqw; background: #fff; box-shadow: 0 0 0 1px rgba(9,15,29,.08), 0 18px 36px -24px rgba(9,15,29,.35); transform-origin: 0 0; opacity: calc((var(--m2, 0) + var(--m3, 1)) * var(--q)); translate: calc((1 - var(--q)) * 4cqw + var(--m3, 1) * -52cqw) calc(var(--m3, 1) * var(--c) * -4.5cqw); scale: calc(1 - var(--m3, 1) * .3); }
.cm-check { position: absolute; right: 1.4cqw; top: 1.4cqw; width: 3cqw; height: 3cqw; border-radius: 50%; background: var(--gold); scale: var(--k6, 1); }
.cm-check::after { content: ""; position: absolute; left: 34%; top: 22%; width: 26%; height: 44%; border: solid #fff; border-width: 0 max(1px, .35cqw) max(1px, .35cqw) 0; rotate: 45deg; }

/* Feature 3: a reply preview linked to that knowledge, then handoff to a teammate. */
.cm-chat { position: absolute; left: 36cqw; top: 6cqw; width: 58cqw; height: 52cqw; padding: 2cqw; border-radius: 1.4cqw; background: #fff; box-shadow: 0 0 0 1px rgba(9,15,29,.08), 0 30px 60px -36px rgba(9,15,29,.35); opacity: calc(var(--m3, 1) * var(--r1, 1)); translate: 0 calc((1 - var(--r1, 1)) * 3cqw); }
.cm-in, .cm-reply { position: absolute; display: grid; gap: .8cqw; padding: 1.6cqw; border-radius: 2cqw; }
.cm-in i, .cm-reply i { display: block; height: max(3px, .8cqw); border-radius: 99px; background: #d0d4dc; }
.cm-in { left: 40cqw; top: 16cqw; width: 30cqw; background: #eef0f4; opacity: calc(var(--m3, 1) * var(--r2, 1)); }
.cm-in i:last-child { width: 60%; }
.cm-reply { left: 50cqw; top: 28cqw; width: 40cqw; border: 1px solid var(--gold); background: #fff; transform-origin: 100% 0; opacity: calc(var(--m3, 1) * var(--r3, 1)); scale: calc(.6 + var(--r3, 1) * .4); }
.cm-reply b { color: var(--ink-2); }
.cm-reply i:nth-of-type(2) { width: 82%; } .cm-reply i:nth-of-type(3) { width: 58%; }
.cm-handoff { position: absolute; left: 62cqw; top: 46cqw; display: flex; align-items: center; gap: 1.2cqw; opacity: calc(var(--m3, 1) * var(--r5, 1)); translate: 0 calc((1 - var(--r5, 1)) * 2cqw); }
.cm-handoff .cm-person { width: 6cqw; height: 6cqw; box-shadow: inset 0 0 0 1px var(--gold); }

/* Tablet/mobile: intro stacked and compact; each panel shows its visual first, then its copy (same in flow and
   staged). Prints larger and contained; beats tighter but text sizes unchanged. */
@media (max-width: 960px) {
  .story-intro { padding: 20px 0; }
  .story-intro > .container { grid-template-columns: 1fr; gap: 10px; }
  .story-intro h1, .story-intro .hero-lead, .story-intro .hero-actions { grid-column: 1; grid-row: auto; }
  .story-intro .hero-actions { gap: 4px 20px; margin-top: 4px; }
  .button-ink { min-height: 44px; padding: 0 20px; }
  .story-panel { grid-template-columns: 1fr; gap: 16px; }
  .panel-visual { order: -1; }
  .scene-name { margin-bottom: 4px; }
  .scene-index { margin-bottom: 6px; }
  .panel-brief { margin-bottom: 10px; font-size: 15px; }
  .beat { padding: 7px 0 7px 20px; }
  .beat::before { top: 14px; }
  .story-art, .fit1-stage { width: 100%; }
}
/* Small phones: less decorative space (never smaller text) so the staged story fits 320×740. */
@media (max-width: 560px) {
  .story-panel { gap: 12px; }
  .scene-name { font-size: 26px; }
  .scene-index { margin-bottom: 4px; }
  .panel-brief { margin-bottom: 8px; }
  .beats { margin-bottom: 4px; }
  .beat { padding: 5px 0 5px 20px; }
  .beat::before { top: 12px; }
  .illus-note { margin-top: 6px; }
}

/* Staged layout: bounded track (--story-h = stage × 7), sticky stage under the header (and above the mobile
   contact bar), the three panels in one grid cell. All sizes in px from the script's measurement. */
.story.is-staged { height: var(--story-h); }
.story.is-staged .story-stage { position: sticky; top: var(--stage-top); display: flex; align-items: center; height: var(--stage-h); padding: var(--stage-pad) 0; }
.story.is-staged .story-panels { width: min(1240px, calc(100% - 32px)); }
.story.is-staged .story-panel { grid-area: 1 / 1; align-content: center; margin: 0; padding: 0; border: 0; }
@media (max-width: 960px) { .story.is-staged .story-panel { align-content: start; } } /* visual top stays put */
/* Copy swaps atomically at the project midpoints (.385/.705): only the active panel's copy is shown, at full opacity;
   inactive panels (inert + aria-hidden, set by the script) keep their layout but are invisible. Independent of
   reduced-motion preferences, so a staged story can never show two projects' text. */
.story.is-staged .story-panel[aria-hidden="true"] .panel-copy { visibility: hidden; }
/* Fit measurement reads each panel's own intrinsic height, not the shared (stretched) grid row. */
.story.is-fitting .story-panel { align-self: start; }

/* Opening intro: time-based once on load (CSS only), text only. */
@keyframes mx-rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes mx-draw { from { transform: scaleX(0); } }
@keyframes mx-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .hero-rule { animation: mx-draw .9s var(--ease-wipe) .05s both; }
  .hero-eyebrow { animation: mx-fade .8s ease .1s both; }
  .story-intro h1 { animation: mx-rise 1s var(--ease-out) .15s both; }
  .hero-lead { animation: mx-rise .9s var(--ease-out) .3s both; }
  .hero-actions { animation: mx-rise .9s var(--ease-out) .42s both; }
}

/* Story choreography — scrubbed by --t on .story (0→1). r = clamp(0, (t − a)/(b − a), 1); recompositions eased
   with smoothstep r·r·(3 − 2r). Ranges: .artifacts/feature-motion/design.md. One sequence at a time: a project's
   visual recomposes for each feature; between projects only .panel-visual fades (old out, then new in). */
@media (prefers-reduced-motion: no-preference) {
  .story.is-staged {
    /* Project changes (copy swaps at .385 / .705). */
    --oa: clamp(0, calc((var(--t, 0) - .36) / .025), 1);
    --ia: clamp(0, calc((var(--t, 0) - .385) / .025), 1);
    --ob: clamp(0, calc((var(--t, 0) - .68) / .025), 1);
    --ib: clamp(0, calc((var(--t, 0) - .705) / .025), 1);
    /* FIT1 feature weights: POS → warehouse (.075–.105) → phone (.165–.195). */
    --fa-r: clamp(0, calc((var(--t, 0) - .075) / .03), 1);
    --fb-r: clamp(0, calc((var(--t, 0) - .165) / .03), 1);
    --fa: calc(var(--fa-r) * var(--fa-r) * (3 - 2 * var(--fa-r)));
    --fb: calc(var(--fb-r) * var(--fb-r) * (3 - 2 * var(--fb-r)));
    --w1: calc(1 - var(--fa));
    --w2: calc(var(--fa) - var(--fb));
    --w3: var(--fb);
    /* Web-app illustration inside the phone (feature 3). */
    --pa: clamp(0, calc((var(--t, 0) - .20) / .01), 1);
    --ps-up: clamp(0, calc((var(--t, 0) - .215) / .015), 1);
    --pr: clamp(0, calc((var(--t, 0) - .232) / .01), 1);
    --ps-dn: clamp(0, calc((var(--t, 0) - .25) / .01), 1);
    --pi: clamp(0, calc((var(--t, 0) - .26) / .01), 1);
    --pt: clamp(0, calc((var(--t, 0) - .275) / .015), 1);
    --pl: clamp(0, calc((var(--t, 0) - .29) / .015), 1);
    --po: clamp(0, calc((var(--t, 0) - .31) / .01), 1);
    /* ContentVelo: voice → creation (.48–.52) → schedule (.57–.61), plus in-feature phases. */
    --cva-r: clamp(0, calc((var(--t, 0) - .48) / .04), 1);
    --cvb-r: clamp(0, calc((var(--t, 0) - .57) / .04), 1);
    --cva: calc(var(--cva-r) * var(--cva-r) * (3 - 2 * var(--cva-r)));
    --cvb: calc(var(--cvb-r) * var(--cvb-r) * (3 - 2 * var(--cvb-r)));
    --v1: calc(1 - var(--cva));
    --v2: calc(var(--cva) - var(--cvb));
    --v3: var(--cvb);
    --cs: clamp(0, calc((var(--t, 0) - .41) / .06), 1);
    --cl: clamp(0, calc((var(--t, 0) - .42) / .06), 1);
    --cd: clamp(0, calc((var(--t, 0) - .51) / .05), 1);
    --cc: clamp(0, calc((var(--t, 0) - .59) / .04), 1);
    /* ChatMai: team inbox (.73–.82) → knowledge via MCP (.82–.91) → knowledge-based replies (.91–1). */
    --ma-r: clamp(0, calc((var(--t, 0) - .81) / .025), 1);
    --mb-r: clamp(0, calc((var(--t, 0) - .90) / .02), 1);
    --ma: calc(var(--ma-r) * var(--ma-r) * (3 - 2 * var(--ma-r)));
    --mb: calc(var(--mb-r) * var(--mb-r) * (3 - 2 * var(--mb-r)));
    --m1: calc(1 - var(--ma));
    --m2: calc(var(--ma) - var(--mb));
    --m3: var(--mb);
    --cmt: clamp(0, calc((var(--t, 0) - .735) / .045), 1);  /* cards gather into the inbox */
    --hi: clamp(0, calc((var(--t, 0) - .78) / .01), 1);     /* conversation highlighted */
    --ca: clamp(0, calc((var(--t, 0) - .785) / .01), 1);    /* teammate assigned */
    --cb: clamp(0, calc((var(--t, 0) - .795) / .01), 1);    /* note mark */
    --k1: clamp(0, calc((var(--t, 0) - .835) / .015), 1);   /* AI assistant */
    --k2: clamp(0, calc((var(--t, 0) - .85) / .01), 1);     /* wire + MCP */
    --k3: clamp(0, calc((var(--t, 0) - .86) / .012), 1);    /* MCP → cards */
    --k5: clamp(0, calc((var(--t, 0) - .865) / .025), 1);   /* knowledge + tone cards */
    --k6: clamp(0, calc((var(--t, 0) - .89) / .012), 1);    /* owner review checks */
    --r1: clamp(0, calc((var(--t, 0) - .92) / .015), 1);    /* chat */
    --r2: clamp(0, calc((var(--t, 0) - .935) / .01), 1);    /* incoming message */
    --r4: clamp(0, calc((var(--t, 0) - .945) / .013), 1);   /* knowledge → reply link */
    --r3: clamp(0, calc((var(--t, 0) - .952) / .013), 1);   /* reply preview */
    --r5: clamp(0, calc((var(--t, 0) - .97) / .015), 1);    /* team handoff */
  }
  /* Project change: only the visuals fade, sequentially, so at most one .panel-visual has opacity > 0. */
  .story.is-staged .panel-fit1 .panel-visual { opacity: calc(1 - var(--oa)); translate: 0 calc(var(--oa) * -16px); }
  .story.is-staged .panel-cv .panel-visual { opacity: calc(var(--ia) - var(--ob)); translate: 0 calc((1 - var(--ia)) * 16px - var(--ob) * 16px); }
  .story.is-staged .panel-chatmai .panel-visual { opacity: var(--ib); translate: 0 calc((1 - var(--ib)) * 16px); }

  /* FIT1 — each feature recomposes the three devices; the featured one is centred, enlarged and on top. */
  .story.is-staged .shot-browser { position: relative; }
  .story.is-staged :is(.shot-browser, .shot-tablet, .shot-phone) {
    transform-origin: 50% 50%;
    translate: calc(var(--w1) * var(--x1) + var(--w2) * var(--x2) + var(--w3) * var(--x3)) calc(var(--w1) * var(--y1) + var(--w2) * var(--y2) + var(--w3) * var(--y3));
    scale: calc(1 + var(--w1) * (var(--s1) - 1) + var(--w2) * (var(--s2) - 1) + var(--w3) * (var(--s3) - 1));
  }
  .story.is-staged[data-story-beat="0"] .shot-tablet, .story.is-staged[data-story-beat="1"] .shot-browser, .story.is-staged[data-story-beat="2"] .shot-phone { z-index: 4; }

  /* Web-app illustration: confined to the inner screen (below bezel + top safe area with the camera, above the
     bottom safe area), aria-hidden, ends on the unchanged app capture from .32. */
  .story.is-staged .pwa { position: absolute; z-index: 1; top: calc(var(--pw) * .17); right: calc(var(--pw) * .03); bottom: calc(var(--pw) * .15); left: calc(var(--pw) * .03); display: block; overflow: hidden; border-radius: calc(var(--pw) * .02); background: #eef0f4; opacity: calc(var(--pa) - var(--po)); }
  .story.is-staged .pwa-home { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(4, calc(var(--pw) * .15)); justify-content: space-between; align-content: start; row-gap: calc(var(--pw) * .1); padding: calc(var(--pw) * .1) calc(var(--pw) * .065) 0; }
  .story.is-staged .pwa-icon { aspect-ratio: 1; border-radius: 28%; background: #fff; box-shadow: inset 0 0 0 1px #dde1e8; }
  .story.is-staged .pwa-icon-fit1 { display: block; width: 100%; height: auto; border-radius: 50%; background: none; box-shadow: none; opacity: var(--pi); transform: scale(var(--pi)); }
  .story.is-staged .pwa-sheet { position: absolute; left: 0; right: 0; bottom: 0; display: grid; gap: calc(var(--pw) * .03); padding: calc(var(--pw) * .06); border-radius: calc(var(--pw) * .06) calc(var(--pw) * .06) 0 0; background: #fff; box-shadow: 0 -6px 18px rgba(9, 15, 29, .12); transform: translateY(calc((1 - var(--ps-up) + var(--ps-dn)) * 105%)); }
  .story.is-staged .pwa-row { display: flex; align-items: center; gap: calc(var(--pw) * .05); padding: calc(var(--pw) * .03); border-radius: calc(var(--pw) * .03); }
  .story.is-staged .pwa-row-add { background-color: rgb(0 113 227 / calc(var(--pr) * .14)); }
  .story.is-staged :is(.pwa-plus, .pwa-glyph) { position: relative; flex: none; width: calc(var(--pw) * .09); aspect-ratio: 1; border: max(1px, calc(var(--pw) * .012)) solid #090f1d; border-radius: 24%; }
  .story.is-staged .pwa-glyph { border-color: #c4c9d2; }
  .story.is-staged .pwa-plus::before, .story.is-staged .pwa-plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 56%; height: max(1px, calc(var(--pw) * .012)); translate: -50% -50%; background: #090f1d; }
  .story.is-staged .pwa-plus::after { rotate: 90deg; }
  .story.is-staged .pwa-bar { flex: 1; height: calc(var(--pw) * .03); border-radius: 99px; background: #090f1d; opacity: .7; }
  .story.is-staged .pwa-bar-short { flex: 0 0 45%; opacity: .2; }
  .story.is-staged .pwa-tap { position: absolute; left: 38.3%; top: 33.2%; width: calc(var(--pw) * .26); aspect-ratio: 1; margin: calc(var(--pw) * -.13) 0 0 calc(var(--pw) * -.13); border: max(1px, calc(var(--pw) * .012)) solid var(--action); border-radius: 50%; opacity: calc(var(--pt) * (1 - var(--pt)) * 3.6); transform: scale(calc(.4 + var(--pt) * 1.1)); }
  .story.is-staged .pwa-splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--pw) * .05); background: #fff; clip-path: circle(calc(var(--pl) * 150%) at 38.3% 33.2%); }
  .story.is-staged .pwa-splash img { display: block; width: calc(var(--pw) * .34); height: auto; border-radius: 50%; }
  .story.is-staged .pwa-splash span { font-size: calc(var(--pw) * .065); font-weight: 600; letter-spacing: .02em; color: #090f1d; white-space: nowrap; }
}
@media print { .story-panel { break-inside: avoid; } }


/* Bands */
.band { padding: clamp(72px, 10vw, 120px) 0; }
.band-tight { padding: clamp(32px, 5vw, 56px) 0 clamp(72px, 10vw, 112px); }
.band-gray { background: var(--gray); }
.band-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 32px; margin-bottom: clamp(32px, 5vw, 56px); }
.band-head h2 { max-width: 760px; }
.band-head-stack { display: block; }
.band-head-stack .fine-print { margin-top: 14px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 64px; align-items: start; }
.split h2 { font-size: clamp(28px, 3.2vw, 40px); }
.split + .split { margin-top: clamp(56px, 8vw, 96px); padding-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--line-soft); }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.closing { padding: clamp(80px, 11vw, 136px) 0; text-align: center; }
.closing h2 { max-width: 18ch; margin: 0 auto 16px; }
html:lang(th) .closing h2 { max-width: 22ch; }
.closing p { max-width: 560px; margin: 0 auto 28px; font-size: 19px; color: var(--text-2); }
.band:not(.band-gray) + .closing, .closing + .band:not(.band-gray), .band:not(.band-gray) + .band:not(.band-gray) { border-top: 1px solid var(--line-soft); }

/* Lists */
.list-lines { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.list-lines li { padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 19px; line-height: 1.5; }
.list-lines-sm li { padding: 12px 0; font-size: 17px; }
.list-lines a { color: var(--blue); }
.index { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; margin: 0; padding: 0; }
.index-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.index li { border-top: 1px solid var(--line); }
.index a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding: 16px 0; font-size: 19px; }
.index strong { font-weight: 500; }
.index-arrow { color: var(--blue); font-size: 22px; line-height: 1; }
.index a:hover strong { color: var(--blue); }
@media (max-width: 860px) { .index, .index-compact { grid-template-columns: 1fr; } }

/* Fact lists */
.facts { display: grid; gap: 20px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 14px; font-weight: 600; color: var(--text); }
.facts dd { margin: 4px 0 0; font-size: 17px; line-height: 1.55; color: var(--body); }
.facts dd ul { margin: 0; padding-left: 1.1em; }
.facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin-top: 48px; }
.facts-inline { margin-top: 32px; gap: 14px; }
.facts .flag { color: #b25000; font-weight: 600; }
.is-human > dt, .steps .is-human .steps-role { display: inline-flex; align-items: center; gap: 8px; }
.is-human > dt::before, .steps .is-human .steps-role::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); flex: none; }
@media (max-width: 860px) { .facts-3 { grid-template-columns: 1fr; gap: 20px; } }
.columns-3, .columns-4 { display: grid; gap: 40px; margin: 0; }
.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.columns-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.columns-3 dt, .columns-4 dt { font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.columns-3 dd, .columns-4 dd { margin: 10px 0 0; font-size: 17px; line-height: 1.55; color: var(--text-2); }
.columns-3 > div, .columns-4 > div { padding-top: 20px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .columns-3, .columns-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .columns-3, .columns-4 { grid-template-columns: 1fr; gap: 28px; } }

/* Disclosures (native details) */
.disclosures { border-top: 1px solid var(--line); }
.disclosure { border-bottom: 1px solid var(--line); }
.disclosure > summary { position: relative; display: block; padding: 24px 56px 24px 0; list-style: none; cursor: pointer; }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::after { content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); font-size: 28px; font-weight: 300; line-height: 1; color: var(--blue); }
.disclosure[open] > summary::after { content: "\2212"; }
.disclosure-title { display: block; margin: 0; font-size: 21px; font-weight: 600; line-height: 1.35; color: var(--text); }
.disclosure > summary:hover .disclosure-title { color: var(--blue); }
.disclosure-hint { display: block; margin-top: 4px; font-size: 16px; color: var(--text-2); }
.disclosure-body { max-width: 760px; padding: 0 0 32px; }
.disclosure-body p { color: var(--body); }
.disclosure-body .facts { margin-bottom: 20px; }

/* Home use cases — editorial ledger: sticky heading column, operating-model flow line, numbered rows on hairlines */
.use-cases-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px 88px; align-items: start; }
.use-cases-head { position: sticky; top: calc(var(--header-h) + 40px); }
.use-cases-head h2 { font-size: clamp(30px, 3.6vw, 48px); font-weight: 500; letter-spacing: -.025em; color: var(--ink); }
html:lang(th) .use-cases-head h2 { letter-spacing: 0; line-height: 1.3; }
.use-cases .statement { max-width: 30em; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--rule); font-size: 17px; font-weight: 400; line-height: 1.7; color: var(--ink-2); }
html:lang(th) .use-cases .statement { line-height: 1.85; }
.flow { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 6px 0 48px; padding: 0; list-style: none; }
.flow::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: var(--ink); transform-origin: left; }
.flow-step { position: relative; padding: 24px 16px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink); }
html:lang(en) .flow-step { font-size: 11.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.flow-mark { position: absolute; left: 0; top: 0; width: 9px; height: 9px; border: 1px solid var(--ink); border-radius: 50%; background: #fff; }
.flow-step.is-human .flow-mark { border-color: var(--gold); background: var(--gold); }
.use-cases .disclosures { border-top: 0; border-bottom: 1px solid var(--rule); }
.use-cases .disclosure { position: relative; border-bottom: 0; }
.use-cases .disclosure::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--rule); transform-origin: left; }
.use-cases .disclosure > summary { display: grid; grid-template-columns: 52px minmax(0, 1fr); padding: 26px 56px 26px 0; }
.use-cases .disclosure > summary::after { color: var(--ink); font-size: 24px; font-weight: 200; }
.disclosure-num { grid-row: 1 / span 2; padding-top: .7em; font-size: 11px; letter-spacing: .12em; color: var(--accent-muted); font-variant-numeric: tabular-nums; }
.use-cases .disclosure-title { grid-column: 2; font-size: clamp(19px, 1.8vw, 22px); font-weight: 500; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: transparent; text-underline-offset: 6px; transition: text-decoration-color .3s ease; }
.use-cases .disclosure > summary:hover .disclosure-title { color: var(--ink); text-decoration-color: var(--ink); }
.use-cases .disclosure-hint { grid-column: 2; font-size: 15px; color: var(--ink-2); }
.use-cases .disclosure > summary:focus-visible { outline: 1px solid var(--ink); outline-offset: -1px; border-radius: 0; }
.use-cases .disclosure-body { padding-left: 52px; }
.use-cases .disclosure-body .more { font-size: 15px; color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--rule); text-underline-offset: 5px; }
.use-cases .disclosure-body .more:hover { text-decoration-color: var(--ink); }
@media (max-width: 960px) {
  .use-cases-grid { grid-template-columns: 1fr; }
  .use-cases-head { position: static; }
}
@media (max-width: 560px) {
  .flow { grid-template-columns: 1fr; gap: 18px; margin-bottom: 40px; padding-left: 28px; }
  .flow::before { left: 4px; right: auto; top: 4px; bottom: 6px; width: 1px; height: auto; transform-origin: top; }
  .flow-step { padding: 0; }
  .flow-mark { left: -28px; top: .35em; }
  .use-cases .disclosure > summary { grid-template-columns: 40px minmax(0, 1fr); }
  .use-cases .disclosure-body { padding-left: 0; }
}

/* Reveal tied to the content: js/home-motion.js marks [data-reveal] items that start below the fold as
   .reveal-pending, then .is-revealed when they scroll in. The flow line draws across its three stages,
   then each row's rule draws and its title rises, staggered by --i. Nothing is hidden without that JS. */
@keyframes mx-body-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: no-preference) {
  .flow.reveal-pending::before { transform: scaleX(0); }
  .flow.reveal-pending .flow-step { opacity: 0; transform: translateY(10px); }
  .flow.is-revealed::before { transition: transform 1.2s var(--ease-wipe) .1s; }
  .flow.is-revealed .flow-step { transition: opacity .7s ease, transform .8s var(--ease-out); }
  .flow.is-revealed .flow-step:nth-child(1) { transition-delay: .15s; }
  .flow.is-revealed .flow-step:nth-child(2) { transition-delay: .55s; }
  .flow.is-revealed .flow-step:nth-child(3) { transition-delay: .95s; }
  .use-cases .disclosure.reveal-pending::before { transform: scaleX(0); }
  .use-cases .disclosure.reveal-pending > summary { opacity: 0; transform: translateY(14px); }
  .use-cases .disclosure.is-revealed::before { transition: transform 1s var(--ease-wipe) calc(var(--i, 0) * 90ms + .3s); }
  .use-cases .disclosure.is-revealed > summary { transition: opacity .8s ease calc(var(--i, 0) * 90ms + .45s), transform .9s var(--ease-out) calc(var(--i, 0) * 90ms + .45s); }
  .use-cases .disclosure[open] > .disclosure-body { animation: mx-body-in .5s var(--ease-out) both; }
}
@media (max-width: 560px) and (prefers-reduced-motion: no-preference) {
  .flow.reveal-pending::before { transform: scaleY(0); }
}
@media print { .reveal-pending, .reveal-pending > summary, .reveal-pending .flow-step { opacity: 1 !important; transform: none !important; } }

/* Numbered steps */
.numbered { list-style: none; display: grid; grid-template-columns: repeat(var(--count, 3), minmax(0, 1fr)); gap: 40px; margin: 0; padding: 0; }
.numbered li { min-width: 0; }
.numbered-index { display: block; margin-bottom: 12px; font-size: 56px; font-weight: 600; line-height: 1; letter-spacing: -.03em; color: var(--line); }
.numbered strong { display: block; margin-bottom: 8px; font-size: 21px; font-weight: 600; }
.numbered p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-2); }
@media (max-width: 860px) { .numbered { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .numbered { grid-template-columns: 1fr; gap: 28px; } .numbered-index { font-size: 40px; } }

/* Service workflow steps */
.steps-title { margin-bottom: clamp(32px, 5vw, 48px); font-size: clamp(28px, 3.4vw, 44px); }
.steps { list-style: none; display: grid; grid-template-columns: repeat(var(--count, 4), minmax(0, 1fr)); gap: 0 24px; margin: 0; padding: 0; }
.steps li { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 20px; border-top: 1px solid var(--line); }
.steps li.is-human { border-top: 3px solid var(--gold); padding-top: 18px; }
.steps-role { font-size: 13px; font-weight: 600; color: var(--text-2); }
.steps li strong { font-size: 19px; font-weight: 600; line-height: 1.35; }
.steps-detail { font-size: 15px; line-height: 1.55; color: var(--text-2); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; gap: 0; } .steps li { padding-bottom: 20px; } }

/* Outcome */
.outcome .fine-print { margin: 0 0 20px; }
.outcome-title { margin-bottom: 20px; }
.outcome-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.outcome-before, .outcome-after { padding: clamp(24px, 4vw, 40px); border-radius: 24px; background: #fff; }
.outcome-after { background: var(--text); }
.outcome-label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.outcome-after .outcome-label { color: #a1a1a6; }
.outcome-pair p { margin: 0; font-size: clamp(19px, 2vw, 24px); line-height: 1.45; font-weight: 500; }
.outcome-after p { color: #f5f5f7; }
@media (max-width: 760px) { .outcome-pair { grid-template-columns: 1fr; } }

/* Tiles (portfolio) */
.tiles { display: grid; gap: clamp(32px, 4vw, 48px) 28px; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tiles-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; min-width: 0; }
.tile-media { display: block; overflow: hidden; aspect-ratio: 3 / 2; border-radius: 20px; background: var(--gray); }
.band-gray .tile-media { background: #fff; }
.tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile:hover .tile-media img { transform: scale(1.02); }
.tile-meta { display: block; margin: 18px 0 4px; font-size: 13px; color: var(--text-2); }
.tile strong { font-size: 21px; font-weight: 600; line-height: 1.3; }
.tile:hover strong { color: var(--blue); }
.tile-note { margin-top: 6px; font-size: 14px; color: var(--text-3); }
@media (max-width: 900px) { .tiles-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tiles-2, .tiles-3 { grid-template-columns: 1fr; } }
.feature { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: center; margin-bottom: clamp(40px, 5vw, 56px); overflow: hidden; border-radius: 28px; background: #fff; }
.feature-media img { display: block; width: 100%; height: auto; }
.feature-copy { display: flex; flex-direction: column; gap: 6px; padding: 32px 40px; }
.feature-copy .tile-meta { margin: 0; }
.feature-copy strong { font-size: clamp(24px, 2.6vw, 32px); font-weight: 600; letter-spacing: -.015em; }
.feature:hover strong { color: var(--blue); }
.feature-follow { margin: clamp(40px, 6vw, 64px) 0 0; }
.band:not(.band-gray) .feature { background: var(--gray); }
.feature-copy .more { margin-top: 8px; font-size: 16px; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature-copy { padding: 24px; } }

/* Service entries (typographic) */
.service-entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 40px; }
.service-entry { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 28px 0 32px; border-top: 1px solid var(--line); }
.service-entry strong { font-size: 24px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.service-entry-text { font-size: 16px; line-height: 1.6; color: var(--text-2); }
.service-entry .more { margin-top: auto; padding-top: 6px; font-size: 16px; }
.service-entry:hover strong { color: var(--blue); }
@media (max-width: 900px) { .service-entries { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .service-entries { grid-template-columns: 1fr; } }

/* Training plans */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.plan { padding: clamp(28px, 4vw, 40px); border-radius: 24px; background: #fff; }
.plan h3 { margin-bottom: 16px; font-size: 24px; }
.plan p { color: var(--body); }
.plan p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .plans { grid-template-columns: 1fr; } }

/* Buying guide */
.buying-guide h2 { margin-bottom: 20px; font-size: clamp(28px, 3.4vw, 40px); }
.buying-guide > h3 { margin: 40px 0 10px; }
.buying-guide p, .buying-guide li { color: var(--body); line-height: 1.7; }
.buying-guide ul { padding-left: 1.2em; }
.buying-guide li { margin: 8px 0; }
.buying-guide .disclosure:first-of-type { margin-top: 40px; border-top: 1px solid var(--line); }

/* Contact */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 72px); align-items: start; }
.contact-info h2 { margin-bottom: 16px; font-size: clamp(28px, 3vw, 36px); }
.contact-info p { color: var(--body); }
.contact-actions { display: flex; flex-direction: column; margin: 28px 0 0; border-top: 1px solid var(--line); }
.channel { display: flex; align-items: center; gap: 14px; min-height: 60px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 19px; color: var(--text); overflow-wrap: anywhere; }
.channel:hover > span:nth-child(2) { color: var(--blue); }
.channel .contact-icon-tile { width: 28px; height: 28px; }
.channel-arrow { margin-left: auto; color: var(--blue); }
.brief-title { margin: 40px 0 8px; font-size: 17px; }
.contact-form { padding: clamp(24px, 4vw, 40px); border-radius: 28px; background: #fff; }
.contact-form h2 { margin-bottom: 8px; font-size: 28px; }
.contact-form > p { color: var(--text-2); font-size: 15px; }
.contact-form .field { display: flex; flex-direction: column; gap: 6px; margin: 18px 0; }
.contact-form label { font-size: 14px; font-weight: 600; }
.contact-form input, .contact-form textarea { width: 100%; padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 17px; transition: border-color .2s, box-shadow .2s; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 4px rgba(0,113,227,.18); }
.contact-form textarea { min-height: 140px; resize: vertical; }
.contact-form .button { margin-top: 8px; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0 16px; font-size: 14px; line-height: 1.55; color: var(--body); }
.consent input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.consent-note { margin: -8px 0 16px 28px; font-size: 14px; }
.consent-note a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.validation-message { color: #b3261e; font-size: 13px; }
.form-status { margin: 16px 0; padding: 14px 16px; border-radius: 12px; background: var(--gray); }
.form-status.error { background: #fdeceb; color: #8c1d18; }
.honeypot { position: absolute; left: -9999px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* Articles list */
.articles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(40px, 5vw, 64px) 32px; }
.article-card { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.article-card-media img { display: block; width: 100%; height: auto; border-radius: 20px; background: var(--gray); }
.article-card-copy .tile-meta { margin: 0 0 8px; }
.article-card h3 { margin-bottom: 10px; font-size: 24px; }
.article-card h3 a:hover { color: var(--blue); }
.article-card p { margin: 0; color: var(--text-2); }
.article-card-lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 40px; padding-bottom: clamp(40px, 5vw, 64px); border-bottom: 1px solid var(--line-soft); }
.article-card-lead h3 { font-size: clamp(28px, 3vw, 40px); line-height: 1.15; letter-spacing: -.02em; }
html:lang(th) .article-card-lead h3 { line-height: 1.35; }
@media (max-width: 760px) { .articles { grid-template-columns: 1fr; } .article-card-lead { display: flex; } }

/* Article page */
.article-header { padding: clamp(48px, 7vw, 88px) 0 0; }
.article-header h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.1; }
html:lang(th) .article-header h1 { line-height: 1.3; }
.article-header .lead { margin-bottom: 20px; }
.prose { padding: clamp(40px, 6vw, 64px) 0 clamp(56px, 8vw, 96px); font-size: 19px; line-height: 1.7; overflow-wrap: anywhere; }
html:lang(th) .prose { font-size: 18px; line-height: 1.9; }
.prose p, .prose li { color: var(--text); }
.prose section > h2 { margin: clamp(48px, 6vw, 72px) 0 18px; font-size: clamp(26px, 3vw, 34px); line-height: 1.2; }
html:lang(th) .prose section > h2 { line-height: 1.4; }
.prose-num { margin-right: 12px; color: var(--text-3); font-weight: 500; }
.prose ul { padding-left: 1.2em; }
.prose li { margin: 10px 0; }
.prose a.text-link { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.summary { padding: clamp(24px, 4vw, 36px) clamp(24px, 4vw, 40px); border-radius: 24px; background: var(--gray); }
.summary h2 { margin-bottom: 12px; font-size: 21px; }
.summary ul { margin: 0; }
.summary li { font-size: 17px; }
.toc { margin: 32px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.toc > summary { min-height: 52px; padding: 14px 0; list-style: none; cursor: pointer; font-size: 17px; font-weight: 600; color: var(--blue); }
.toc > summary::-webkit-details-marker { display: none; }
.toc > summary::after { content: " +"; }
.toc[open] > summary::after { content: " \2212"; }
.toc ol { margin: 0 0 20px; padding-left: 1.4em; font-size: 17px; }
.toc a:hover { color: var(--blue); }
.article-aside { margin-top: clamp(56px, 7vw, 80px); padding-top: 28px; border-top: 1px solid var(--line); font-size: 17px; }
.article-aside p { color: var(--text-2); }
.article-sources { margin-top: clamp(40px, 5vw, 56px); font-size: 16px; }
.article-sources ol { color: var(--text-2); }
.aside-title { margin: 24px 0 8px; font-size: 17px; }

/* Status pages */
.status { padding: clamp(80px, 12vw, 144px) 0; text-align: center; }
.status-code { margin: 0 0 8px; font-size: clamp(96px, 16vw, 168px); font-weight: 600; line-height: 1; letter-spacing: -.04em; color: var(--line-soft); }
.status h1 { font-size: clamp(32px, 4.4vw, 52px); }
.status .lead { margin-inline: auto; }
.status .actions { justify-content: center; }
.status code { overflow-wrap: anywhere; }
.status-links { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 32px; margin: 48px 0 0; padding: 0; }
.status-links a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 17px; color: var(--blue); }
.status-links a:hover { text-decoration: underline; }

/* AI learning credentials: unboxed gallery of real certificate excerpts and issued badges */
#ai-learning { scroll-margin-top: calc(var(--header-h) + 24px); }
.ai-learning-head { max-width: 640px; margin-bottom: 40px; }
.ai-learning-head h2 { margin-bottom: 12px; font-size: clamp(28px, 3.4vw, 40px); }
.ai-learning-head p { margin: 0; color: var(--text-2); font-size: 19px; }
.ai-learning-certs, .ai-learning-badges { list-style: none; margin: 0; padding: 0; display: grid; }
.ai-learning-certs { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.ai-learning-cert { min-width: 0; }
.ai-learning-cert figure { margin: 0; }
.ai-learning-cert-media { display: block; overflow: hidden; border-radius: 14px; box-shadow: 0 0 0 1px var(--line-soft); }
.ai-learning-cert-media img { display: block; width: 100%; height: auto; aspect-ratio: 1268 / 656; object-fit: contain; background: #fff; }
.ai-learning-cert figcaption { margin-top: 12px; font-size: 15px; font-weight: 600; }
.ai-learning-badges { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 32px 20px; margin-top: 56px; }
.ai-learning-badge { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.ai-learning-badge img { display: block; width: 80px; height: auto; aspect-ratio: 1; object-fit: contain; }
.ai-learning-badge span { font-size: 13px; line-height: 1.45; color: var(--text-2); overflow-wrap: anywhere; }
.ai-learning-compact .ai-learning-badges { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 24px 16px; margin-top: 40px; }
.ai-learning-compact .ai-learning-badge img { width: 56px; }
.ai-learning-compact .ai-learning-badge span { font-size: 12px; }
.ai-learning-more { margin-top: 40px; }
.ai-learning-details { max-width: 640px; margin-top: 40px; border-top: 1px solid var(--line); }
.ai-learning-details summary { min-height: 52px; padding: 14px 0; cursor: pointer; font-size: 15px; font-weight: 600; color: var(--blue); }
.ai-learning-details p { margin: 0 0 16px; font-size: 15px; color: var(--text-2); }
@media (max-width: 860px) { .ai-learning-certs { grid-template-columns: 1fr; max-width: 520px; } }
@media (max-width: 560px) { .ai-learning-badges { grid-template-columns: repeat(2, minmax(0, 1fr)); } .ai-learning-compact .ai-learning-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Contact dock (Components/ContactDock.razor): desktop floating button + popover, mobile bottom bar */
.contact-icon { display: block; width: 100%; height: 100%; }
.contact-icon-tile { display: inline-grid; place-items: center; flex: none; border-radius: 8px; }
.contact-channel-email .contact-icon-tile, .contact-channel-contact_form .contact-icon-tile { color: var(--text); padding: 2px; }
.contact-dock-trigger { position: fixed; z-index: 900; right: max(24px, calc(env(safe-area-inset-right) + 16px)); bottom: calc(max(24px, calc(env(safe-area-inset-bottom) + 16px)) + var(--contact-consent-offset, 0px)); display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 6px; border: 0; border-radius: 999px; background: var(--text); color: #fff; font-size: 15px; font-weight: 500; line-height: 1.2; box-shadow: 0 10px 30px rgba(0,0,0,.18); transition: background-color .2s; }
.contact-dock-trigger:hover { background: #333336; }
.contact-dock-trigger-icon { display: grid; place-items: center; width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: #fff; color: var(--text); }
.contact-dock-trigger-icon .contact-icon-close,
.contact-dock:is(.is-open, :has(.contact-dock-panel:popover-open)) .contact-dock-trigger-icon .contact-icon-chat { display: none; }
.contact-dock:is(.is-open, :has(.contact-dock-panel:popover-open)) .contact-dock-trigger-icon .contact-icon-close { display: block; }
.contact-dock-panel { position: fixed; z-index: 950; inset: auto; right: max(24px, calc(env(safe-area-inset-right) + 16px)); bottom: calc(max(24px, calc(env(safe-area-inset-bottom) + 16px)) + 64px + var(--contact-consent-offset, 0px)); margin: 0; width: min(340px, calc(100vw - 48px)); max-height: calc(100vh - 120px - var(--contact-consent-offset, 0px)); overflow: auto; padding: 20px; border: 1px solid var(--line-soft); border-radius: 20px; background: #fff; color: var(--text); box-shadow: 0 24px 60px rgba(0,0,0,.18); }
@supports not selector(:popover-open) { .contact-dock-panel:not(.is-open) { display: none; } }
.contact-dock-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.contact-dock-title { margin: 0; font-size: 17px; font-weight: 600; }
.contact-dock-close { display: grid; place-items: center; width: 36px; height: 36px; padding: 9px; border: 0; border-radius: 50%; background: var(--gray); color: var(--body); }
.contact-dock-close:hover { color: var(--text); }
.contact-dock-note { margin: 4px 0 14px; font-size: 14px; color: var(--text-2); }
.contact-dock-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.contact-dock-link { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 10px 12px; border-radius: 12px; color: var(--text); transition: background-color .2s; }
.contact-dock-link:hover { background: var(--gray); }
.contact-dock-link .contact-icon-tile { width: 32px; height: 32px; }
.contact-dock-text { display: grid; gap: 2px; min-width: 0; }
.contact-dock-text strong { font-size: 15px; font-weight: 600; }
.contact-dock-text small { font-size: 13px; color: var(--text-2); overflow-wrap: anywhere; }
.contact-dock-arrow { margin-left: auto; color: var(--blue); }
.contact-bar, .contact-bar-spacer { display: none; }
@media (max-width: 650px) {
  .contact-dock { display: none; }
  .contact-bar { position: fixed; z-index: 900; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); border-top: 1px solid var(--line-soft); background: rgba(255,255,255,.98); }
  .contact-bar-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: calc(var(--contact-bar-height) - 12px); padding: 4px 2px; border-radius: 10px; color: var(--body); font-size: 12px; font-weight: 500; line-height: 1.2; text-align: center; -webkit-tap-highlight-color: transparent; }
  .contact-bar-item:active, .contact-bar-item[aria-current="page"] { background: var(--gray); color: var(--text); }
  .contact-bar-item .contact-icon-tile { width: 24px; height: 24px; }
  .contact-bar-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .contact-bar-spacer { display: block; height: calc(var(--contact-bar-height) + env(safe-area-inset-bottom)); background: var(--gray); }
  .analytics-consent { bottom: calc(var(--contact-bar-height) + env(safe-area-inset-bottom) + 12px); max-height: calc(100vh - var(--contact-bar-height) - 40px); overflow: auto; }
  /* Hide the bar while a text field is focused (the on-screen keyboard is likely open). */
  body:has(input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="hidden"]):focus, textarea:focus, [contenteditable="true"]:focus) .contact-bar { display: none; }
}
@media print { .contact-dock, .contact-bar, .contact-bar-spacer, .site-header { display: none !important; } }

/* Analytics consent */
.analytics-consent[hidden] { display: none; }
.analytics-consent { position: fixed; z-index: 1000; left: 16px; right: 16px; bottom: 16px; max-width: 620px; margin: auto; padding: 20px 24px; border-radius: 20px; background: #fff; color: var(--text); box-shadow: 0 20px 50px rgba(0,0,0,.2); }
.analytics-consent p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; }
.analytics-consent-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.analytics-consent-actions button { min-height: 40px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--gray); color: var(--text); font-size: 15px; }
.analytics-consent-actions button[data-analytics-choice=allow] { background: var(--action); color: #fff; }

.blazor-error-boundary { padding: 1rem; background: #fdeceb; color: #8c1d18; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* Calm motion only; none when the user asks for reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
  .tile:hover .tile-media img { transform: none; }
}
