/* Typing to Learn: landing site design system + home page.
   ------------------------------------------------------------------------------------------------
   Shared contract for every site page (content pages included):
     Tokens   --bg --bg-2 --surface --surface-2 --ink --ink-2 --ink-3 --line --primary --primary-ink
              --primary-soft --accent --accent-ink --accent-soft --success --danger --radius --radius-lg
              --shadow-sm --shadow --shadow-lg --font-sans --font-mono --font-prose  (light + dark)
     Layout   .container  .section  .section-head(.center)  .grid-2  .grid-3  .stack
     Text     .eyebrow  .title (h2 size)  .lead  .muted  .prose (long legal / guide text)  .sr-only
     UI       .btn .btn-primary .btn-accent .btn-ghost .btn-lg .btn-sm  .card  .chip  .ico (inline SVG icon)
     Language <span data-th>…</span><span data-en>…</span> pairs: the other language is hidden by <html lang>.
     Theme    auto (prefers-color-scheme) or html[data-theme=light|dark] (toggle in the header).
   No inline style attributes anywhere (CSP 'self'). */

/* ---------- Fonts (self-hosted, subsetted by unicode-range) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/display-en.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/noto-thai-400.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/noto-thai-500.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/noto-thai-600.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Noto Sans Thai"; font-style: normal; font-weight: 700 800; font-display: swap; src: url(fonts/display-th.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/mono-500.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 700 800; font-display: swap; src: url(fonts/mono-700.woff2) format("woff2"); }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/sarabun-thai-400.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(fonts/sarabun-thai-600.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/sarabun-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }
@font-face { font-family: "Sarabun"; font-style: normal; font-weight: 600 700; font-display: swap; src: url(fonts/sarabun-latin-600.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --font-sans: "Inter", "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", "Leelawadee UI", Thonburi, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-prose: var(--font-sans);
  --bg: #f7f6fc;
  --bg-2: #efedf9;
  --surface: #ffffff;
  --surface-2: #f6f5fd;
  --surface-3: #ecebf8;
  --ink: #15132e;
  --ink-2: #47446a;
  --ink-3: #636084;
  --line: #e4e1f2;
  --line-2: #d4d0ea;
  --primary: #5b4cf0;
  --primary-2: #7d6dff;
  --primary-ink: #4434d6;
  --primary-soft: #ecebff;
  --on-primary: #ffffff;
  --accent: #f59e0b;
  --accent-ink: #92400e;
  --accent-soft: #fff3da;
  --success: #16a34a;
  --success-ink: #137a3a;
  --success-soft: #e5f8ec;
  --danger: #dc2626;
  --danger-ink: #b91c1c;
  --danger-soft: #fdeceb;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(21, 19, 46, .06), 0 1px 1px rgba(21, 19, 46, .04);
  --shadow: 0 1px 2px rgba(21, 19, 46, .05), 0 8px 24px -8px rgba(37, 28, 120, .14);
  --shadow-lg: 0 2px 6px rgba(21, 19, 46, .06), 0 30px 60px -20px rgba(37, 28, 120, .28);
  --ring: 0 0 0 3px rgba(91, 76, 240, .35);
  --header-h: 64px;
  --glow-1: rgba(125, 109, 255, .22);
  --glow-2: rgba(245, 158, 11, .14);
  --band: #12112b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b0b17; --bg-2: #101024; --surface: #15152b; --surface-2: #1a1a33; --surface-3: #23233f;
    --ink: #eeedff; --ink-2: #bdbada; --ink-3: #9a97bd; --line: #26264a; --line-2: #34345c;
    --primary: #8b7dff; --primary-2: #a99fff; --primary-ink: #b3a9ff; --primary-soft: #232050; --on-primary: #0b0b17;
    --accent: #fbbf24; --accent-ink: #fcd34d; --accent-soft: #33280f;
    --success: #34d399; --success-ink: #6ee7b7; --success-soft: #0f2e25;
    --danger: #f87171; --danger-ink: #fca5a5; --danger-soft: #3a1518;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -10px rgba(0, 0, 0, .6);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px -20px rgba(0, 0, 0, .8);
    --ring: 0 0 0 3px rgba(139, 125, 255, .45); --glow-1: rgba(125, 109, 255, .2); --glow-2: rgba(251, 191, 36, .08); --band: #08081a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b0b17; --bg-2: #101024; --surface: #15152b; --surface-2: #1a1a33; --surface-3: #23233f;
  --ink: #eeedff; --ink-2: #bdbada; --ink-3: #9a97bd; --line: #26264a; --line-2: #34345c;
  --primary: #8b7dff; --primary-2: #a99fff; --primary-ink: #b3a9ff; --primary-soft: #232050; --on-primary: #0b0b17;
  --accent: #fbbf24; --accent-ink: #fcd34d; --accent-soft: #33280f;
  --success: #34d399; --success-ink: #6ee7b7; --success-soft: #0f2e25;
  --danger: #f87171; --danger-ink: #fca5a5; --danger-soft: #3a1518;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -10px rgba(0, 0, 0, .6);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 30px 70px -20px rgba(0, 0, 0, .8);
  --ring: 0 0 0 3px rgba(139, 125, 255, .45); --glow-1: rgba(125, 109, 255, .2); --glow-2: rgba(251, 191, 36, .08); --band: #08081a;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-sans); font-size: 17px; line-height: 1.68;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: clip;
}
html[lang="th"] body { font-size: 17.5px; line-height: 1.8; }
img, svg { display: block; max-width: 100%; }
a { color: var(--primary-ink); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 700; letter-spacing: -.02em; color: var(--ink); text-wrap: balance; }
html[lang="th"] :is(h1, h2, h3, h4) { letter-spacing: 0; line-height: 1.45; }
p { margin: 0 0 1em; text-wrap: pretty; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 8px; }
:is(.movie, .band, .cta-band) :focus-visible { outline-color: #ffcf6b; }
::selection { background: color-mix(in srgb, var(--primary) 28%, transparent); }
html[lang="th"] [data-en], html[lang="en"] [data-th] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.25em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }

/* ---------- Layout utilities ---------- */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.section { padding-block: clamp(64px, 8vw, 112px); position: relative; }
.section-alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: clamp(32px, 4.5vw, 52px); }
.section-head .title { margin-bottom: .35em; }
.section-head .lead { max-width: 62ch; }
.section-head.center .lead { margin-inline: auto; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head .lead { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.grid-2, .grid-3 { display: grid; gap: 20px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 5px 12px 5px 9px; border-radius: 999px;
  font-size: .86rem; font-weight: 600; letter-spacing: .02em; color: var(--primary-ink); background: var(--primary-soft);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
html[lang="en"] .eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.eyebrow .ico { width: 15px; height: 15px; color: var(--accent); }
.title { font-size: clamp(1.75rem, 3.3vw, 2.7rem); font-weight: 800; }
html[lang="th"] .title { font-size: clamp(1.7rem, 3.1vw, 2.5rem); }
html[lang="th"] .title { font-weight: 700; }
.lead { font-size: clamp(1.08rem, 1.4vw, 1.22rem); color: var(--ink-2); max-width: 64ch; }
.muted { color: var(--ink-3); }
.grad {
  font-style: normal; background: linear-gradient(100deg, var(--primary) 10%, #b25cff 55%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Buttons, cards, chips ---------- */
.btn {
  --b: var(--surface); --c: var(--ink); --bd: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border-radius: 12px; border: 1px solid var(--bd); background: var(--b); color: var(--c); font-weight: 600; font-size: .95rem;
  line-height: 1.2; text-decoration: none; cursor: pointer; white-space: nowrap; transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn .ico { width: 18px; height: 18px; transition: transform .18s ease; }
.btn-primary {
  --c: #fff; --bd: transparent; background: linear-gradient(180deg, #6354f5, #4a3ae0); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 18px -6px rgba(79, 63, 230, .6);
}
.btn-primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 10px 26px -8px rgba(79, 63, 230, .75); }
.btn-accent { --c: #2b1a00; --bd: transparent; background: linear-gradient(180deg, #ffc94d, #f59e0b); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 6px 18px -8px rgba(245, 158, 11, .7); }
.btn-ghost { --b: transparent; --bd: var(--line-2); }
.btn-ghost:hover { --b: var(--surface); }
.btn-lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { min-height: 44px; padding: 9px 15px; font-size: .92rem; border-radius: 11px; }

/* Ultra-Prominent Typing Button & Shimmer */
.btn-typing-prominent {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #3730a3 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  font-weight: 700;
  letter-spacing: -0.01em;
  box-shadow: 0 10px 28px -4px rgba(79, 70, 229, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  transition: transform .22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .22s ease, filter .2s;
  animation: typingBtnPulse 3.5s ease-in-out infinite;
}
.btn-typing-prominent:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 36px -4px rgba(79, 70, 229, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
  filter: brightness(1.05);
}
.btn-typing-prominent:active {
  transform: translateY(0) scale(0.99);
}
.btn-typing-prominent:hover .ico-arrow,
.btn-typing-prominent:hover .ico:last-child {
  transform: translateX(5px);
}
@keyframes typingBtnPulse {
  0%, 100% {
    box-shadow: 0 10px 28px -4px rgba(79, 70, 229, 0.65), 0 0 0 0 rgba(99, 102, 241, 0), 0 0 0 1px rgba(255, 255, 255, 0.25) inset;
  }
  50% {
    box-shadow: 0 14px 34px -4px rgba(79, 70, 229, 0.85), 0 0 0 7px rgba(99, 102, 241, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.35) inset;
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn-typing-prominent { animation: none; }
}
.btn-shimmer::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 50%;
  height: 200%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: rotate(25deg);
  pointer-events: none;
  animation: btnShimmerSweep 4.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes btnShimmerSweep {
  0%, 70% { left: -60%; opacity: 0; }
  72% { opacity: 1; }
  85% { left: 140%; opacity: 1; }
  86%, 100% { left: 140%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .btn-shimmer::after { animation: none; display: none; }
}
.hero-cta-wrapper {
  margin: 28px 0 22px;
}
.hero-cta-wrapper .hero-cta {
  margin: 0;
}
.hero-microcopy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  font-size: .88rem;
  font-weight: 500;
  color: var(--ink-2);
}
.hero-microcopy .ico {
  width: 16px;
  height: 16px;
  color: var(--success);
  flex: none;
}
.hdr-cta.btn-primary {
  box-shadow: 0 4px 14px -3px rgba(79, 70, 229, 0.65);
}
.btn[disabled], .btn[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 2.4vw, 28px); box-shadow: var(--shadow-sm); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink-2); font-size: .9rem; font-weight: 600; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.chip:hover { border-color: var(--primary); color: var(--ink); }
.chip[aria-pressed="true"], .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-tile {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; color: var(--primary-ink);
  background: linear-gradient(160deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft) 40%, var(--surface)));
  border: 1px solid color-mix(in srgb, var(--primary) 16%, transparent);
}
.icon-tile .ico { width: 26px; height: 26px; }
.icon-tile.amber { color: var(--accent-ink); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.icon-tile.green { color: var(--success-ink); background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.icon-tile.purple { color: #6366f1; background: #eef2ff; border-color: rgba(99, 102, 241, 0.22); }
:root[data-theme="dark"] .icon-tile.purple { color: #a5b4fc; background: rgba(99, 102, 241, 0.2); border-color: rgba(99, 102, 241, 0.35); }
.icon-tile.sky { color: #0284c7; background: #f0f9ff; border-color: rgba(2, 132, 199, 0.22); }
:root[data-theme="dark"] .icon-tile.sky { color: #7dd3fc; background: rgba(2, 132, 199, 0.2); border-color: rgba(2, 132, 199, 0.35); }
.icon-tile.indigo { color: #7c3aed; background: #faf5ff; border-color: rgba(124, 58, 237, 0.22); }
:root[data-theme="dark"] .icon-tile.indigo { color: #c4b5fd; background: rgba(124, 58, 237, 0.2); border-color: rgba(124, 58, 237, 0.35); }
.icon-tile.rose { color: #e11d48; background: #fff1f2; border-color: rgba(225, 29, 72, 0.22); }
:root[data-theme="dark"] .icon-tile.rose { color: #fb7185; background: rgba(225, 29, 72, 0.2); border-color: rgba(225, 29, 72, 0.35); }

/* ---------- Prose (privacy / terms / guides) ---------- */
.prose { max-width: 72ch; font-family: var(--font-prose); font-size: 1.04rem; color: var(--ink); }
html[lang="th"] .prose { --font-prose: "Sarabun", var(--font-sans); font-size: 1.1rem; line-height: 1.85; }
.prose h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 800; }
.prose h2 { font-size: 1.5rem; margin-top: 2.2em; padding-top: .2em; }
.prose h3 { font-size: 1.18rem; margin-top: 1.8em; }
.prose :is(h1, h2, h3) { font-family: var(--font-sans); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--primary); }
.prose blockquote { margin: 1.5em 0; padding: 14px 18px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 12px 12px 0; color: var(--ink-2); }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: .95em; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { background: var(--surface-2); font-family: var(--font-sans); font-weight: 600; }
.prose code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-3); padding: .12em .4em; border-radius: 6px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose img { border-radius: var(--radius); }
.page-hero { padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); border-bottom: 1px solid var(--line); background: radial-gradient(800px 300px at 10% 0%, var(--glow-1), transparent 70%), var(--bg); }
.page-hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); font-weight: 800; margin-bottom: .3em; }
html[lang="th"] .page-hero h1 { font-weight: 700; }
.breadcrumb {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  margin: 0 0 16px;
  padding: 5px 12px;
  list-style: none;
  font-size: .85rem;
  line-height: 1.4;
  color: var(--ink-2);
  background: color-mix(in srgb, var(--surface-2) 75%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 2px rgba(15, 12, 41, 0.03);
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
}
.breadcrumb li + li::before {
  content: "/";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 4px;
  color: var(--ink-3);
  opacity: .45;
  font-size: .82em;
  font-weight: 300;
  user-select: none;
}
.breadcrumb a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ink-2) !important;
  text-decoration: none !important;
  font-weight: 500;
  transition: color .15s, background-color .15s;
}
.breadcrumb li:first-child a::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 2px;
  background-color: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") no-repeat center / contain;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Cpolyline points='9 22 9 12 15 12 15 22'/%3E%3C/svg%3E") no-repeat center / contain;
  opacity: .85;
  flex: none;
}
.breadcrumb a:hover {
  color: var(--primary) !important;
  background: color-mix(in srgb, var(--primary-soft) 80%, transparent);
  text-decoration: none !important;
}
.breadcrumb [aria-current='page'] {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  color: var(--ink) !important;
  font-weight: 600;
  user-select: text;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: saturate(1.6) blur(14px); backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, background-color .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); background: color-mix(in srgb, var(--bg) 90%, transparent); }
.hdr { display: flex; align-items: center; gap: 12px; height: 100%; }
.brand { display: inline-flex; align-items: center; min-height: 44px; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.06rem; letter-spacing: -.02em; flex: none; }
.brand:hover { text-decoration: none; }
.brand svg { width: 34px; height: 34px; filter: drop-shadow(0 4px 10px rgba(91, 76, 240, .35)); }
.brand small { display: block; font-size: .74rem; font-weight: 600; color: var(--ink-3); letter-spacing: .02em; line-height: 1; margin-top: 2px; }
.brand span { line-height: 1.1; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .93rem; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface-3); }
.hdr-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
  color: var(--ink-2); cursor: pointer; text-decoration: none; transition: color .15s, border-color .15s;
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-2); }
.icon-btn .ico { width: 20px; height: 20px; }
.lang-link { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .88rem; }
.lang-link:hover { color: var(--ink); text-decoration: none; }
.lang-link .ico { width: 18px; height: 18px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .sun { display: none; } :root:not([data-theme="light"]) .theme-btn .moon { display: block; } }
.menu-btn { display: none; }
.theme-btn { display: none; }
.js .theme-btn { display: inline-grid; }
@media (max-width: 1020px) {
  .hdr-cta { display: none; }
}
@media (max-width: 900px) {
  .js .menu-btn { display: inline-grid; }
  .js .nav { position: fixed; inset: var(--header-h) 0 auto 0; margin: 0; padding: 12px 16px 20px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: opacity .2s, transform .2s, visibility .2s; max-height: calc(100vh - var(--header-h)); overflow-y: auto; }
  .js .nav.open { transform: none; opacity: 1; visibility: visible; }
  .js .nav ul { flex-direction: column; gap: 2px; }
  .js .nav a { padding: 12px 14px; font-size: 1.02rem; }
  .js .nav .nav-cta { display: block; margin-top: 10px; }
  html:not(.js) .site-header { height: auto; }
  html:not(.js) .hdr { flex-wrap: wrap; padding-block: 10px; }
  html:not(.js) .nav { order: 3; width: 100%; overflow-x: auto; }
}
.nav-cta { display: none; }
.nav-cta .btn { width: 100%; }
@media (max-width: 768px) {
  .lang-link span { display: none !important; }
  .lang-link { width: 40px; height: 40px; min-width: 40px; padding: 0; justify-content: center; }
  .theme-btn, .menu-btn { width: 40px; height: 40px; min-width: 40px; }
  .hdr-tools { gap: 6px; flex-shrink: 0; }
  .hdr { gap: 8px; }
}
@media (max-width: 520px) {
  .brand small { display: none; }
  .brand { font-size: 1rem; gap: 8px; flex-shrink: 1; min-width: 0; }
  .brand svg { width: 30px; height: 30px; flex-shrink: 0; }
  .hdr { padding-inline: 12px; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 56px 0 28px; font-size: .94rem; color: var(--ink-2); }
.ftr { display: grid; gap: 32px; grid-template-columns: 1fr; }
@media (min-width: 480px) and (max-width: 759px) { .ftr { grid-template-columns: 1fr 1fr; } .ftr-brand { grid-column: 1 / -1; } }
@media (min-width: 760px) { .ftr { grid-template-columns: 1.5fr repeat(3, 1fr); } }
.ftr h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 12px; font-weight: 700; }
html[lang="th"] .ftr h2 { text-transform: none; letter-spacing: 0; font-size: .92rem; }
.ftr ul { list-style: none; margin: 0; padding: 0; }
.ftr li { margin: 0; }
.ftr li a { display: inline-flex; align-items: center; min-height: 44px; }
.ftr a { color: var(--ink-2); text-decoration: none; }
.ftr a:hover { color: var(--ink); text-decoration: underline; }
.ftr-brand p { max-width: 36ch; margin-top: 12px; }
.socials { display: flex; gap: 10px; margin-top: 16px; }
.socials a { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: transform .15s, box-shadow .15s; }
.socials a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.socials svg { width: 24px; height: 24px; }
.ftr-legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .84rem; color: var(--ink-3); }
.ftr-legal p { margin: 0; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: clamp(36px, 6vw, 80px) 0 clamp(40px, 6vw, 72px); overflow: hidden; isolation: isolate; }
.hero-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(700px 420px at 85% 10%, var(--glow-1), transparent 70%),
    radial-gradient(520px 360px at 8% 90%, var(--glow-2), transparent 70%),
    linear-gradient(var(--bg), var(--bg));
}
.hero-bg::after { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px; -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%); mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 20%, transparent 75%);
}
.hero-grid { display: grid; gap: clamp(32px, 5vw, 64px); align-items: center; }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); } }
.hero-title { font-size: clamp(2.3rem, 5.2vw, 4rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; margin-bottom: 20px; }
html[lang="th"] .hero-title { font-weight: 700; letter-spacing: 0; line-height: 1.32; font-size: clamp(2rem, 4.4vw, 3.4rem); }
.hero-title .kicker { display: block; font-size: clamp(1.02rem, 1.5vw, 1.25rem); letter-spacing: 0; font-weight: 600; color: var(--ink-2); margin-bottom: .55em; line-height: 1.5; }
.hero-title .kicker::before { content: ""; display: inline-block; width: 28px; height: 3px; margin-right: 10px; vertical-align: middle; border-radius: 3px; background: linear-gradient(90deg, var(--primary), var(--accent)); }
.hero-title em { font-style: normal; }
.hero .lead { max-width: 54ch; font-size: clamp(1.1rem, 1.5vw, 1.25rem); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 22px; }
@media (max-width: 520px) { .hero-cta .btn { flex: 1 1 100%; } .modal-head p { display: none; } }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0; padding: 0; list-style: none; font-size: .95rem; color: var(--ink-2); }
.hero-points li { display: inline-flex; align-items: center; gap: 7px; }
.hero-points .ico { width: 18px; height: 18px; color: var(--success); }
.hero-visual { position: relative; }
.hero-visual::before { content: ""; position: absolute; inset: 8% 4% -6%; background: radial-gradient(closest-side, rgba(110, 90, 255, .45), transparent); filter: blur(40px); z-index: -1; }
.player-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.scene-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; margin: 0; padding: 0; list-style: none; }
.scene-tab { position: relative; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 6px 14px 6px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: .88rem; font-weight: 600; cursor: pointer; }
.scene-tab b { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-3); font-size: .8rem; font-family: var(--font-mono); }
.scene-tab[aria-current="true"] { color: var(--ink); border-color: color-mix(in srgb, var(--primary) 50%, var(--line)); }
.scene-tab[aria-current="true"] b { background: var(--primary); color: var(--on-primary); }
.pp-btn { width: 44px; height: 44px; }
.pp-btn .i-play { display: none; }
.pp-btn[aria-pressed="true"] .i-play { display: block; }
.pp-btn[aria-pressed="true"] .i-pause { display: none; }
html:not(.js) .player-ctrl { display: none; }
/* Phones: the five scene tabs fit on one row as numbered dots; only the current tab shows its label. */
@media (max-width: 560px) {
  .scene-tabs { flex-wrap: nowrap; gap: 6px; min-width: 0; }
  .scene-tab { padding: 6px 8px; gap: 0; }
  .scene-tab > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .scene-tab[aria-current="true"] { padding-right: 14px; gap: 7px; }
  .scene-tab[aria-current="true"] > span { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  .player-ctrl { flex-wrap: nowrap; }
}
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin: clamp(40px, 6vw, 72px) 0 0; padding: 0; list-style: none; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--line); background: var(--line); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1080px) { .stats { grid-template-columns: repeat(6, 1fr); } }
.stats li { background: var(--surface); padding: 18px 20px; display: flex; flex-direction: column; gap: 2px; }
.stats b { display: block; font-family: var(--font-mono); font-size: clamp(1.5rem, 2.4vw, 2rem); font-weight: 700; letter-spacing: -.03em; color: var(--ink); line-height: 1.2; }
.stats span { font-size: .9rem; color: var(--ink-3); line-height: 1.45; }

/* ---------- Live stats (#live, filled by live.js; hidden until the first valid response) ---------- */
.live[hidden] { display: none !important; }
.live { padding-block: clamp(48px, 6vw, 88px); }
.live-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 24px; margin-bottom: clamp(20px, 3vw, 32px); }
.live-head .title { margin: 0; }
.live-dot { position: relative; width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--success); }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: inherit; animation: live-pulse 1.8s ease-out infinite; }
@keyframes live-pulse { 0% { transform: scale(1); opacity: .7; } 80%, 100% { transform: scale(2.8); opacity: 0; } }
.rm .live-dot::after { animation: none; opacity: 0; }
@media (prefers-reduced-motion: reduce) { .live-dot::after { animation: none; opacity: 0; } }
.live.is-offline .live-dot { background: var(--ink-3); }
.live.is-offline .live-dot::after { animation: none; opacity: 0; }
.live-meta { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: .88rem; color: var(--ink-3); }
.live-meta .ico { width: 16px; height: 16px; }
.live-meta time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink-2); }
.live-off { padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-3); font-weight: 600; font-size: .8rem; }
.live-off[hidden] { display: none; }
.live b { font-variant-numeric: tabular-nums; }

.live-now {
  min-width: 0;
  margin-top: 16px;
  padding: clamp(16px, 2.5vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.live-now-label { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 1rem; }
.live-now-counts { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 6px 0 0; padding: 0; list-style: none; color: var(--ink-2); }
.live-now-counts b { font-family: var(--font-mono); color: var(--ink); }
.live-quiet-cta { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--ink-2); font-size: .92rem; }
.live-quiet-cta img { flex: none; object-fit: contain; }
.live-quiet-cta p { margin: 0; }
.live-quiet-cta[hidden], .live.is-offline .live-quiet-cta, .live.live-empty .live-details { display: none; }
.live.live-empty .live-dot::after { animation: none; opacity: 0; }
.live-details { margin-top: 12px; font-size: .9rem; }
.live-details summary { width: fit-content; cursor: pointer; color: var(--primary-ink); }
.live-details[open] summary { margin-bottom: 10px; }
.live-u-minutes { display: none; }
.live-tile.is-minutes .live-u-hours { display: none; }
.live-tile.is-minutes .live-u-minutes { display: inline; }
.live-bar { display: flex; gap: 3px; height: 14px; padding: 0; border-radius: 999px; overflow: hidden; background: var(--line); }
.live-seg { flex: 0 1 0; min-width: 0; border-radius: 999px; transition: flex-grow .8s cubic-bezier(.2, .8, .2, 1); }
.rm .live-seg { transition: none; }
.g-racing { background: linear-gradient(90deg, #ffc94d, #f59e0b); }
.g-room { background: linear-gradient(90deg, #c4b5fd, #8b7dff); }
.g-ranked { background: linear-gradient(90deg, #ff9ff0, #e879f9); }
.g-practice { background: linear-gradient(90deg, #7fe7ff, #38bdf8); }
.live-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; margin: 16px 0 22px; padding: 0; list-style: none; font-size: .9rem; }
.live-legend li { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--ink-2); }
.live-legend li > span { flex: 1 1 auto; min-width: 0; line-height: 1.35; }
.live-legend b { font-family: var(--font-mono); color: var(--ink); }
.live-sw { width: 10px; height: 10px; flex: none; border-radius: 3px; }
.live-modes-title { display: flex; align-items: center; gap: 8px; margin: auto 0 10px; min-height: 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.live-modes-title .ico { width: 16px; height: 16px; color: var(--primary-ink); }
.live-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 520px) { .live-modes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.live-modes li { --p: 0; display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: border-color .3s, background-color .3s; }
.live-modes li.on { border-color: rgba(255, 207, 107, .35); background: rgba(255, 207, 107, .07); }
.live-mode-name { font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
.live-modes b { font-family: var(--font-mono); font-size: 1.15rem; color: var(--ink); }
.live-meter { grid-column: 1 / -1; height: 4px; margin-top: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.live-meter i { display: block; height: 100%; width: calc(var(--p) * 1%); border-radius: inherit; background: linear-gradient(90deg, #ffc94d, #ff7a1a); transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.rm .live-meter i { transition: none; }

/* Totals tiles */
.live-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.live-totals { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .live-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 760px) { .live-totals-extra { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.live-totals-extra { margin-top: 12px; }
.live-tile { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: clamp(16px, 2vw, 22px); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.live-tile .icon-tile { width: 42px; height: 42px; border-radius: 12px; }
.live-tile .icon-tile .ico { width: 22px; height: 22px; }
.live-tile div { display: flex; flex-direction: column; min-width: 0; }
.live-tile b { display: block; font-family: var(--font-mono); font-weight: 700; font-size: clamp(1.45rem, 3.4vw, 2rem); line-height: 1.15; letter-spacing: -.03em; color: var(--ink); overflow-wrap: anywhere; }
.live-totals .live-tile { flex-direction: row; align-items: flex-start; gap: 10px; background: linear-gradient(135deg, var(--primary-soft), var(--surface) 74%); }
.live-totals .icon-tile { flex: none; }
.live-totals .live-tile b { font-size: clamp(1.35rem, 3vw, 2.45rem); color: var(--primary-ink); }
.live-totals-extra .live-tile { gap: 6px; box-shadow: none; }
.live-totals-extra .live-tile b { font-size: clamp(1.05rem, 2vw, 1.4rem); }
.live-tile div > span { font-size: .88rem; line-height: 1.4; color: var(--ink-3); }
.live-tile small { margin-top: 2px; font-size: .8rem; color: var(--ink-3); }
@media (max-width: 380px) { .live-tile { padding: 14px; } .live-tile b { font-size: 1.3rem; } }

/* ---------- Movie (scroll-driven) ---------- */
.movie { position: relative; background: var(--band); color: #eceaff; padding-top: clamp(64px, 8vw, 104px); isolation: isolate; }
.movie::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(900px 500px at 70% 20%, rgba(91, 76, 240, .28), transparent 70%), radial-gradient(600px 400px at 10% 80%, rgba(245, 158, 11, .1), transparent 70%); }
.movie :is(h2, h3) { color: #fff; }
.movie .lead, .movie p { color: #c4c1e6; }
.movie .eyebrow { background: rgba(139, 125, 255, .16); color: #cfc9ff; border-color: rgba(139, 125, 255, .3); }
.movie-head { text-align: center; max-width: 780px; }
.movie-head .lead { margin-inline: auto; }
.movie-head .skip {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  margin-top: 10px;
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.movie-head .skip:hover {
  background: rgba(255, 255, 255, .18);
  border-color: rgba(255, 255, 255, .4);
  text-decoration: none;
  transform: translateY(-1px);
}
.movie-sticky { display: grid; gap: 28px; padding-block: 40px clamp(64px, 8vw, 104px); }
.movie-caps { list-style: none; margin: 0; padding: 0; }
.cap-n { display: inline-block; font-family: var(--font-mono); font-size: .84rem; font-weight: 700; color: #ffcf6b; letter-spacing: .1em; margin-bottom: 6px; }
.cap h3 { font-size: clamp(1.35rem, 2.3vw, 1.85rem); margin-bottom: .35em; }
.cap p { margin: 0; font-size: 1.05rem; max-width: 46ch; }
.cap ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.cap li { font-size: .85rem; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); color: #dcd9ff; }
.movie-end { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding-bottom: clamp(64px, 8vw, 104px); }
.movie-end .btn-ghost { --c: #fff; --bd: rgba(255, 255, 255, .25); }
.movie-end .btn-ghost:hover { --b: rgba(255, 255, 255, .08); }
.movie-rail { display: none; }

/* Static / fallback layout (no JS, reduced motion): caption + frame per scene. */
html:not(.js) .movie-sticky, .rm .movie-sticky { grid-template-columns: 1fr; }
html:not(.js) :is(.movie-side, .movie-caps, .movie-screen, .movie-screen .stage, .movie-screen .scenes),
.rm :is(.movie-side, .movie-caps, .movie-screen, .movie-screen .stage, .movie-screen .scenes) { display: contents; }
html:not(.js) .movie-screen :is(.stage-bar, .stage-progress), .rm .movie-screen :is(.stage-bar, .stage-progress) { display: none; }
html:not(.js) .movie-screen .scene, .rm .movie-screen .scene {
  position: relative; inset: auto; opacity: 1; visibility: visible; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: var(--stage-bg); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), 0 30px 60px -20px rgba(0, 0, 0, .6); margin-bottom: 24px;
}
html:not(.js) .movie-caps .cap, .rm .movie-caps .cap { align-self: end; }
@media (min-width: 900px) {
  html:not(.js) .movie-sticky, .rm .movie-sticky { grid-template-columns: minmax(240px, .75fr) 1.6fr; column-gap: 48px; }
  html:not(.js) .cap, .rm .cap { grid-column: 1; align-self: center !important; }
  html:not(.js) .movie-screen .scene, .rm .movie-screen .scene { grid-column: 2; }
  html:not(.js) .cap:nth-child(1), .rm .cap:nth-child(1), html:not(.js) .scene:nth-child(1), .rm .movie-screen .scene:nth-child(1) { grid-row: 1; }
  html:not(.js) .cap:nth-child(2), .rm .cap:nth-child(2), html:not(.js) .scene:nth-child(2), .rm .movie-screen .scene:nth-child(2) { grid-row: 2; }
  html:not(.js) .cap:nth-child(3), .rm .cap:nth-child(3), html:not(.js) .scene:nth-child(3), .rm .movie-screen .scene:nth-child(3) { grid-row: 3; }
  html:not(.js) .cap:nth-child(4), .rm .cap:nth-child(4), html:not(.js) .scene:nth-child(4), .rm .movie-screen .scene:nth-child(4) { grid-row: 4; }
  html:not(.js) .cap:nth-child(5), .rm .cap:nth-child(5), html:not(.js) .scene:nth-child(5), .rm .movie-screen .scene:nth-child(5) { grid-row: 5; }
}
@media (max-width: 899px) {
  html:not(.js) .cap:nth-child(1), .rm .cap:nth-child(1) { grid-row: 1; } html:not(.js) .scene:nth-child(1), .rm .movie-screen .scene:nth-child(1) { grid-row: 2; }
  html:not(.js) .cap:nth-child(2), .rm .cap:nth-child(2) { grid-row: 3; } html:not(.js) .scene:nth-child(2), .rm .movie-screen .scene:nth-child(2) { grid-row: 4; }
  html:not(.js) .cap:nth-child(3), .rm .cap:nth-child(3) { grid-row: 5; } html:not(.js) .scene:nth-child(3), .rm .movie-screen .scene:nth-child(3) { grid-row: 6; }
  html:not(.js) .cap:nth-child(4), .rm .cap:nth-child(4) { grid-row: 7; } html:not(.js) .scene:nth-child(4), .rm .movie-screen .scene:nth-child(4) { grid-row: 8; }
  html:not(.js) .cap:nth-child(5), .rm .cap:nth-child(5) { grid-row: 9; } html:not(.js) .scene:nth-child(5), .rm .movie-screen .scene:nth-child(5) { grid-row: 10; }
  html:not(.js) .cap, .rm .cap { margin-bottom: 12px; }
}

/* Scroll-driven layout (JS, motion allowed). */
.js:not(.rm) .movie-track { height: 280vh; height: 280svh; position: relative; }
@media (max-width: 899px) {
  .js:not(.rm) .movie-track { height: 200vh; height: 200svh; }
}
.js:not(.rm) .movie-sticky {
  position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h));
  grid-template-columns: 1fr; grid-template-rows: auto auto; align-content: center; padding-block: 12px 20px; gap: 18px;
}
.js:not(.rm) .movie-caps { display: grid; }
.js:not(.rm) .cap { grid-area: 1 / 1; align-self: center; opacity: 0; transform: translateY(14px); transition: opacity .45s ease, transform .45s ease; pointer-events: none; }
.js:not(.rm) .cap.on { opacity: 1; transform: none; pointer-events: auto; }
.js:not(.rm) .movie-screen { align-self: center; justify-self: center; width: 100%; max-width: min(100%, calc((100svh - var(--header-h) - 13rem) * 1.6)); }
.js:not(.rm) .movie-rail { display: flex; gap: 6px; margin-top: 14px; }
.movie-rail i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .14); overflow: hidden; position: relative; }
.movie-rail i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #8b7dff, #ffcf6b); transform-origin: left; transform: scaleX(var(--p, 0)); }
@media (min-width: 900px) {
  .js:not(.rm) .movie-sticky { grid-template-columns: minmax(260px, .72fr) 1.6fr; grid-template-rows: 1fr; align-items: center; gap: 48px; }
  .js:not(.rm) .movie-screen { max-width: min(100%, calc((100svh - var(--header-h) - 80px) * 1.6)); }
}

/* ---------- Stage (the movie screen; always "cinema dark") ---------- */
:root { --stage-bg: radial-gradient(120% 95% at 18% 0%, #2c2675 0%, #15143a 48%, #0b0b1c 100%); }
.stage {
  position: relative; aspect-ratio: 16 / 10; border-radius: clamp(14px, 1.8vw, 22px); overflow: hidden; isolation: isolate; container-type: inline-size;
  background: var(--stage-bg); color: #ecebff; font-family: var(--font-sans); line-height: 1.4; user-select: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .08), 0 40px 80px -30px rgba(20, 12, 90, .65);
}
.stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(80% 60% at 50% 0%, rgba(255, 255, 255, .06), transparent 60%); z-index: 3; }
.stage-bar { position: absolute; inset: 0 0 auto 0; height: 6.4cqw; display: flex; align-items: center; gap: .9cqw; padding: 0 2.4cqw; border-bottom: 1px solid rgba(255, 255, 255, .06); background: rgba(255, 255, 255, .02); z-index: 2; }
.stage-bar > i { width: 1.15cqw; height: 1.15cqw; border-radius: 50%; background: #ff5f57; opacity: .85; }
.stage-bar > i:nth-child(2) { background: #febc2e; }
.stage-bar > i:nth-child(3) { background: #28c840; }
.stage-url { margin: 0 auto; padding: .5cqw 2.4cqw; border-radius: 99px; background: rgba(255, 255, 255, .06); font-family: var(--font-mono); font-size: 1.35cqw; color: #a9a5d9; letter-spacing: .02em; }
.stage-live { display: inline-flex; align-items: center; gap: .7cqw; font-size: 1.3cqw; font-weight: 700; color: #ff9cab; text-transform: uppercase; letter-spacing: .08em; }
.stage-live i { width: .9cqw; height: .9cqw; border-radius: 50%; background: #ff4d6d; box-shadow: 0 0 0 0 rgba(255, 77, 109, .6); animation: live 1.6s ease-out infinite; }
.scenes { position: absolute; inset: 6.4cqw 0 0 0; }
.scene { position: absolute; inset: 0; container-type: inline-size; opacity: 0; visibility: hidden; transition: opacity .5s ease, visibility .5s; }
html:not(.js) .scene:first-child, .js .scene.on { opacity: 1; visibility: visible; }
.rm .hero .scene { transition: none; }
.stage-progress { position: absolute; left: 50%; bottom: 1.5cqw; width: 30cqw; transform: translateX(-50%); display: flex; gap: .6cqw; z-index: 2; }
.stage-progress i { flex: 1; height: .45cqw; border-radius: 1cqw; background: rgba(255, 255, 255, .14); position: relative; overflow: hidden; }
.stage-progress i::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; transform: scaleX(var(--p, 0)); }
html:not(.js) .stage-progress { display: none; }
.s-label { display: inline-flex; font-size: 1.45cqw; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: #a9a5d9; }
html[lang="th"] .s-label { text-transform: none; letter-spacing: .02em; font-size: 1.6cqw; }
.caret { display: inline-block; width: .32cqw; height: 1.1em; margin-left: .15cqw; vertical-align: -.18em; border-radius: .2cqw; background: #8b7dff; box-shadow: 0 0 1.2cqw #8b7dff; animation: blink 1.05s steps(1) infinite; }

/* Scene 1: typing + keyboard */
.s1 { display: flex; flex-direction: column; padding: 2.6cqw 5cqw 4.6cqw; gap: 2.2cqw; }
.s1-screen { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1cqw; min-height: 0; }
.s1-line { font-size: 4.5cqw; font-weight: 700; color: #fff; line-height: 1.5; white-space: nowrap; letter-spacing: -.01em; min-height: 1.5em; }
html[lang="th"] .s1-line { font-size: 4.3cqw; letter-spacing: 0; }
.s1-finger { display: inline-flex; align-items: center; gap: .9cqw; font-size: 1.55cqw; color: #c9c5f0; }
.fdot { width: 1.3cqw; height: 1.3cqw; border-radius: 50%; background: var(--fc, #8b7dff); box-shadow: 0 0 1.4cqw var(--fc, #8b7dff); transition: background-color .2s; }
.kb { display: flex; flex-direction: column; gap: .62cqw; padding: 1.2cqw; border-radius: 1.6cqw; background: rgba(0, 0, 0, .28); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 1.4cqw 3cqw -1cqw rgba(0, 0, 0, .5); }
.kr { display: flex; gap: .62cqw; }
.k {
  --z: #94a3b8; flex: 1 1 0; height: 4.3cqw; border-radius: .85cqw; display: grid; place-items: center; position: relative;
  background: rgba(148, 163, 184, .14); background: color-mix(in srgb, var(--z) 15%, #1a1938); color: color-mix(in srgb, var(--z) 55%, #fff);
  box-shadow: inset 0 -.32cqw 0 rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .07);
  font-size: 1.65cqw; font-weight: 600; transition: background-color .14s ease, transform .14s ease, box-shadow .14s ease, color .14s;
}
.k b { font-weight: inherit; line-height: 1; }
.k.mod b { font-size: 1.2cqw; opacity: .7; font-weight: 600; }
.k .kb-ico { width: 2cqw; height: 2cqw; opacity: .7; }
.k.bump::after { content: ""; position: absolute; bottom: .75cqw; width: 1.2cqw; height: .22cqw; border-radius: 1cqw; background: currentColor; opacity: .6; }
.f-p { --z: #f472b6; } .f-r { --z: #fbbf24; } .f-m { --z: #34d399; } .f-il { --z: #60a5fa; } .f-ir { --z: #a78bfa; } .f-t { --z: #94a3b8; } .f-x { --z: #8088a8; }
.w15 { flex-grow: 1.5; } .w175 { flex-grow: 1.75; } .w2 { flex-grow: 2; } .w225 { flex-grow: 2.25; } .w275 { flex-grow: 2.75; }
.kr:last-child { justify-content: center; }
.w625 { flex: 0 0 37%; }
.k.on { background: var(--z); color: #14122b; transform: translateY(.22cqw); box-shadow: inset 0 -.12cqw 0 rgba(0, 0, 0, .3), 0 0 2.2cqw var(--z); }
.k.next { box-shadow: inset 0 -.32cqw 0 rgba(0, 0, 0, .35), 0 0 0 .22cqw color-mix(in srgb, var(--z) 85%, #fff); }
@container (max-width: 560px) {
  .s1 { padding: 2cqw 4cqw 4.4cqw; }
  .kr:first-child { display: none; }
  .k { height: 6cqw; font-size: 2.5cqw; border-radius: 1.1cqw; }
  .s1-line, html[lang="th"] .s1-line { font-size: 5.4cqw; }
  .s-label, html[lang="th"] .s-label, .s1-finger { font-size: 2.3cqw; }
}

/* Scene 2: speed + keystroke bar */
.s2 { display: grid; grid-template-columns: 1fr 1.18fr; gap: 4.5cqw; padding: 3cqw 5cqw 5.6cqw; align-items: center; }
.s2-wpm { display: flex; align-items: baseline; gap: 1.2cqw; margin-top: .6cqw; }
.s2-wpm .num { font-family: var(--font-mono); font-size: 12.5cqw; font-weight: 700; line-height: 1; letter-spacing: -.06em; background: linear-gradient(180deg, #fff, #b9b0ff); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.s2-wpm span { font-family: var(--font-mono); font-size: 2.2cqw; font-weight: 700; color: #ffcf6b; }
.s2-unit { font-size: 1.6cqw; color: #a9a5d9; }
.s2-graph { width: 100%; height: 12cqw; margin-top: 2.2cqw; overflow: visible; }
.s2-graph .grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; fill: none; vector-effect: non-scaling-stroke; }
.s2-graph .area { fill: rgba(139, 125, 255, .18); opacity: var(--g, 1); }
.s2-graph .line { fill: none; stroke: #a99fff; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--g, 1)); }
.s2-miles { display: flex; justify-content: space-between; margin-top: 1.2cqw; }
.s2-miles .m { display: flex; flex-direction: column; font-size: 1.3cqw; color: #8f8bbd; transition: color .3s; }
.s2-miles .m b { font-family: var(--font-mono); font-size: 2.2cqw; color: #c9c5f0; transition: color .3s; }
.s2-miles .m.on b { color: #ffcf6b; }
.s2-miles .m.on { color: #e4e1ff; }
.s2-miles .m3 { text-align: right; align-items: flex-end; }
.s2-right { display: flex; flex-direction: column; gap: 1.6cqw; }
.s2-text { font-size: 3.2cqw; font-weight: 600; white-space: nowrap; line-height: 1.6; padding: 1.6cqw 2cqw; border-radius: 1.4cqw; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); overflow: hidden; }
.s2-text i { font-style: normal; color: rgba(255, 255, 255, .3); border-radius: .4cqw; transition: color .12s, background-color .12s; }
.s2-text i.ok { color: #fff; }
.s2-text i.err { color: #ff8095; background: rgba(255, 77, 109, .22); }
.s2-text i.fix { color: #ffd27a; background: rgba(251, 191, 36, .16); }
.s2-text i.cur { box-shadow: inset .3cqw 0 0 #8b7dff; }
.js:not(.rm) .s2-text .caret { display: none; }
.s2-bar { display: flex; gap: .32cqw; margin-top: 1.2cqw; }
.s2-bar i { flex: 1; height: 1.7cqw; border-radius: .4cqw; background: rgba(255, 255, 255, .08); transition: background-color .15s; }
.s2-bar i.sp { flex: .5; opacity: .5; }
.s2-bar i.ok { background: #34d399; }
.s2-bar i.err { background: #ff4d6d; box-shadow: 0 0 1.2cqw #ff4d6d; }
.s2-bar i.fix { background: #fbbf24; }
.s2-legend { display: flex; gap: 2cqw; font-size: 1.3cqw; color: #a9a5d9; }
.s2-legend span { display: inline-flex; align-items: center; gap: .6cqw; }
.s2-legend i { width: 1.2cqw; height: 1.2cqw; border-radius: .3cqw; }
.s2-legend .ok { background: #34d399; } .s2-legend .err { background: #ff4d6d; } .s2-legend .fix { background: #fbbf24; }
.s2-acc { display: flex; align-items: baseline; justify-content: space-between; padding-top: 1.4cqw; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 1.6cqw; color: #c9c5f0; }
.s2-acc b { font-family: var(--font-mono); font-size: 4cqw; color: #6ee7b7; font-variant-numeric: tabular-nums; }
@container (max-width: 560px) {
  .s2 { gap: 3cqw; padding: 2.4cqw 4cqw 5.6cqw; }
  .s2-unit, .s2-miles .m, .s2-legend, .s2-acc { font-size: 2.1cqw; }
  .s2-miles .m b { font-size: 2.8cqw; }
  .s2-text { font-size: 3.6cqw; }
}

/* Scene 3: race lanes */
.s3 { display: flex; flex-direction: column; gap: 1.6cqw; padding: 2.6cqw 4cqw 9cqw; }
.s3-hud { display: flex; justify-content: space-between; align-items: center; gap: 2cqw; }
.s3-rules, .s3-modes { display: flex; gap: .7cqw; }
.s3-rules .rule, .s3-modes span { padding: .55cqw 1.3cqw; border-radius: 99px; font-size: 1.3cqw; font-weight: 600; color: #b7b3e0; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .08); transition: background-color .3s, color .3s; white-space: nowrap; }
.s3-rules .rule.on { background: #5b4cf0; color: #fff; border-color: #7d6dff; }
.s3-modes span { font-family: var(--font-mono); }
.s3-modes span.on { background: rgba(255, 207, 107, .16); color: #ffcf6b; border-color: rgba(255, 207, 107, .4); }
.lanes { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 1.2cqw; }
.lane { --lc: #38bdf8; display: grid; grid-template-columns: 7.5cqw 1fr 5cqw; align-items: center; gap: 1.4cqw; height: 7.4cqw; padding: 0 1.4cqw; border-radius: 1.3cqw; background: rgba(255, 255, 255, .035); border: 1px solid rgba(255, 255, 255, .06); }
.lane.l1 { --lc: #38bdf8; } .lane.l2 { --lc: #34d399; } .lane.l3 { --lc: #f472b6; }
.lane.me { --lc: #a99fff; background: rgba(91, 76, 240, .14); border-color: rgba(139, 125, 255, .45); }
.lane-name { font-size: 1.6cqw; font-weight: 600; color: #d6d3fa; white-space: nowrap; }
.lane.me .lane-name { color: #fff; }
.lane-wpm { font-family: var(--font-mono); font-size: 1.9cqw; text-align: right; color: #c9c5f0; font-variant-numeric: tabular-nums; }
.lane.me .lane-wpm { color: #ffcf6b; }
.track { position: relative; height: 100%; background: linear-gradient(90deg, rgba(255, 255, 255, .1) 50%, transparent 0) 0 50% / 2cqw 1px repeat-x; }
.run { position: absolute; top: 0; bottom: 0; left: 0; width: calc(100% - 5cqw); transform: translateX(calc(var(--x, 1) * 100%)); will-change: transform; }
.racer { position: absolute; left: 0; top: 50%; width: 5cqw; height: 5cqw; margin-top: -2.5cqw; display: grid; place-items: center; border-radius: 1.1cqw; background: linear-gradient(180deg, #fff, #dedaff); color: #1d1a4a; font-size: 2.2cqw; font-weight: 800; box-shadow: 0 .4cqw 0 color-mix(in srgb, var(--lc) 70%, #000), 0 0 2.4cqw color-mix(in srgb, var(--lc) 60%, transparent); }
.racer b { position: relative; z-index: 1; }
.trail { position: absolute; top: 50%; right: calc(100% - 1.4cqw); width: 18cqw; height: 1.8cqw; margin-top: -.9cqw; border-radius: 2cqw; transform-origin: right center; transform: scaleX(var(--s, .7)); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--lc) 75%, transparent)); filter: blur(.25cqw); }
.aura { display: none; }
.me .aura { display: block; position: absolute; inset: -2cqw; border-radius: 50%; background: radial-gradient(circle, rgba(169, 159, 255, .7), rgba(139, 125, 255, .2) 45%, transparent 68%); opacity: var(--combo, 1); animation: aura 1.1s ease-in-out infinite; z-index: 0; }
.finish { position: absolute; top: -.6cqw; bottom: -.6cqw; right: 7.8cqw; width: 1.1cqw; background: repeating-conic-gradient(#fff 0 25%, #1b1a3a 0 50%) 0 0 / .55cqw .55cqw; opacity: .55; border-radius: .2cqw; }
.s3-pop { position: absolute; right: 4cqw; bottom: 3.6cqw; display: flex; align-items: center; gap: 1.4cqw; pointer-events: none; }
.overtake { font-size: 3cqw; font-weight: 800; font-style: italic; color: #ffd54a; text-shadow: 0 0 2cqw rgba(255, 180, 40, .6); transform: scale(calc(.6 + .4 * var(--ov, 1))) rotate(-4deg); opacity: var(--ov, 1); transform-origin: right center; }
.combo { font-family: var(--font-mono); font-size: 1.7cqw; color: #cfc9ff; letter-spacing: .06em; padding: .3cqw 1.1cqw; border-radius: 99px; background: rgba(139, 125, 255, .2); border: 1px solid rgba(139, 125, 255, .4); }
.combo b { color: #fff; }
@container (max-width: 560px) {
  .s3-rules .rule:nth-child(n+4) { display: none; }
  .s3-rules .rule, .s3-modes span { font-size: 2cqw; }
  .lane-name { font-size: 2.2cqw; }
  .lane-wpm { font-size: 2.4cqw; }
  .lane { grid-template-columns: 8cqw 1fr 5.4cqw; }
  .finish { right: 8.2cqw; }
}

/* Scene 4: rank up */
.s4 { --tc: #ff8a1f; }
.s4[data-tier="0"] { --tc: #e4a466; } .s4[data-tier="1"] { --tc: #dfe5ef; } .s4[data-tier="2"] { --tc: #ffd54a; } .s4[data-tier="3"] { --tc: #7fe7ff; } .s4[data-tier="4"] { --tc: #ff8a1f; }
.s4-rays { position: absolute; left: 24cqw; top: 22cqw; width: 64cqw; height: 64cqw; margin: -32cqw 0 0 -32cqw; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--tc) 30%, transparent) 0deg 5deg, transparent 5deg 16deg);
  -webkit-mask-image: radial-gradient(circle, #000 8%, transparent 62%); mask-image: radial-gradient(circle, #000 8%, transparent 62%); animation: spin 40s linear infinite; opacity: .8; transition: background .4s; }
.s4-hero { position: absolute; left: 11cqw; top: 6cqw; width: 26cqw; aspect-ratio: 120 / 138; }
.s4-hero .em { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: scale(.55) translateY(4cqw); transition: opacity .35s ease, transform .5s cubic-bezier(.2, 1.5, .4, 1); filter: drop-shadow(0 1.4cqw 2.4cqw rgba(0, 0, 0, .5)); }
.s4-hero .em.on { opacity: 1; transform: none; }
.flames { position: absolute; left: -16%; right: -16%; bottom: 2%; width: 132%; height: auto; opacity: 0; transition: opacity .4s; mix-blend-mode: screen; }
.s4[data-tier="4"] .flames { opacity: 1; }
.fl { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .9s ease-in-out infinite alternate; }
.fl2 { animation-duration: 1.15s; animation-delay: -.4s; } .fl3 { animation-duration: .75s; animation-delay: -.2s; }
.s4-confetti { position: absolute; left: 24cqw; top: 20cqw; width: 0; height: 0; }
.js:not(.rm) .s4-confetti { opacity: 0; }
.js:not(.rm) .s4-confetti.go { opacity: 1; }
.s4-confetti i { position: absolute; left: 0; top: 0; width: var(--w); height: calc(var(--w) * .5); border-radius: .15cqw; background: var(--c);
  transform: translate(calc(var(--dx) * var(--p, .6)), calc(var(--dy) * var(--p, .6) + 24cqw * var(--p, .6) * var(--p, .6))) rotate(calc(var(--rot) * var(--p, .6)));
  opacity: calc(1.15 - var(--p, .6) * var(--p, .6)); }
.s4-title { position: absolute; left: 46cqw; right: 4cqw; top: 6.5cqw; display: flex; flex-direction: column; gap: .6cqw; align-items: flex-start; }
.s4-kicker { font-size: 1.9cqw; font-weight: 800; text-transform: uppercase; letter-spacing: .18em; color: #ffcf6b; }
html[lang="th"] .s4-kicker { letter-spacing: .04em; font-size: 2.2cqw; }
.s4-name { font-size: 6.6cqw; font-weight: 800; line-height: 1.2; color: var(--tc); text-shadow: 0 0 3cqw color-mix(in srgb, var(--tc) 45%, transparent); letter-spacing: -.02em; transition: color .3s; }
.s4-name .tn { display: none; }
.s4-name .tn.on { display: inline; }
.s4-trial { display: inline-flex; align-items: center; gap: .8cqw; padding: .6cqw 1.4cqw; margin-top: .6cqw; border-radius: 99px; font-size: 1.5cqw; font-weight: 600; color: #b8f5d6; background: rgba(52, 211, 153, .14); border: 1px solid rgba(52, 211, 153, .35); }
.s4-trial .ico { width: 2cqw; height: 2cqw; }
.s4-ladder { position: absolute; left: 46cqw; right: 4cqw; bottom: 7cqw; display: flex; align-items: center; }
.rung { width: 6.4cqw; flex: none; opacity: .28; filter: grayscale(1); transition: opacity .3s, filter .3s, transform .3s; }
.rung svg { width: 100%; height: auto; }
.rung.got { opacity: 1; filter: none; }
.rung.cur { transform: scale(1.22); }
.s4-ladder .link { flex: 1; height: .35cqw; margin: 0 .4cqw; border-radius: 1cqw; background: rgba(255, 255, 255, .14); }
@container (max-width: 560px) {
  .s4-trial { font-size: 2.1cqw; }
  .s4-kicker, html[lang="th"] .s4-kicker { font-size: 2.6cqw; }
}

/* Scene 5: certificate */
.s5 { display: grid; place-items: center; padding: 0 0 4cqw; }
.cert { --e: 1; position: relative; width: 66cqw; padding: .8cqw; border-radius: 1.6cqw; background: #fffdf7; color: #1d1b3a;
  transform: translate(calc((1 - var(--e)) * 26cqw), calc((1 - var(--e)) * 44cqw)) rotate(calc((1 - var(--e)) * 9deg - 1.6deg));
  box-shadow: 0 3cqw 6cqw -2cqw rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .4); will-change: transform; }
.cert-in { position: relative; padding: 2.8cqw 3.4cqw 2.6cqw; border-radius: 1.1cqw; border: .25cqw solid #d9d4ff; overflow: hidden;
  background: radial-gradient(circle at 100% 0%, rgba(91, 76, 240, .08), transparent 40%), repeating-radial-gradient(circle at 0 100%, rgba(91, 76, 240, .05) 0 .3cqw, transparent .3cqw 1.2cqw), #fffdf7; }
.cert-head { display: flex; align-items: center; gap: 1cqw; }
.cert-logo { width: 3.6cqw; height: 3.6cqw; }
.cert-brand { font-size: 1.8cqw; font-weight: 800; color: #3b2fc9; letter-spacing: -.01em; }
.cert-no { margin-left: auto; font-family: var(--font-mono); font-size: 1.25cqw; color: #6b6889; }
.cert-title { margin-top: 2.2cqw; font-size: 1.5cqw; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #6b6889; }
html[lang="th"] .cert-title { letter-spacing: .02em; font-size: 1.8cqw; }
.cert-name { margin: .4cqw 0 1.6cqw; padding-bottom: 1.2cqw; font-size: 4.2cqw; font-weight: 800; color: #15132e; border-bottom: 1px dashed #cfcbe8; letter-spacing: -.02em; }
.cert-stats { display: flex; gap: 3.2cqw; font-size: 1.45cqw; color: #6b6889; }
.cert-stats b { font-family: var(--font-mono); font-size: 2.7cqw; color: #15132e; margin-right: .3cqw; }
.cert-stats span:last-child b { font-family: var(--font-sans); }
.cert-foot { display: flex; align-items: center; gap: 1.8cqw; margin-top: 2.2cqw; }
.seal { width: 6.2cqw; height: 6.2cqw; filter: drop-shadow(0 .4cqw .6cqw rgba(160, 100, 0, .35)); }
.cert-verify { display: flex; flex-direction: column; font-size: 1.4cqw; font-weight: 600; color: #3b2fc9; }
.cert-verify small { font-family: var(--font-mono); font-size: 1.2cqw; color: #6b6889; font-weight: 500; }
.qr-wrap { position: relative; margin-left: auto; width: 10cqw; border-radius: .6cqw; overflow: hidden; box-shadow: 0 0 0 1px #e4e1f2; }
.qr-wrap .qr { width: 100%; height: auto; }
.scan { position: absolute; left: 0; right: 0; height: 1.4cqw; top: calc(var(--q, 1) * 100% - .7cqw); background: linear-gradient(180deg, transparent, rgba(91, 76, 240, .55), transparent); opacity: var(--qo, 0); }
.stamp { position: absolute; right: -2.4cqw; top: -2.6cqw; display: inline-flex; align-items: center; gap: .6cqw; padding: .8cqw 1.8cqw; border-radius: 99px; border: .3cqw solid #16a34a;
  background: rgba(229, 248, 236, .97); color: #137a3a; font-size: 1.75cqw; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  transform: rotate(8deg) scale(calc(1 + (1 - var(--st, 1)) * .9)); opacity: var(--st, 1); box-shadow: 0 1cqw 2cqw -1cqw rgba(22, 163, 74, .5); }
.stamp .ico { width: 2.2cqw; height: 2.2cqw; }
@container (max-width: 560px) {
  .cert { width: 80cqw; }
  .cert-stats, .cert-verify { font-size: 2cqw; }
  .cert-title, html[lang="th"] .cert-title { font-size: 2.2cqw; }
  .stamp { font-size: 2.3cqw; }
}

/* ---------- Features / Presentation Grid ---------- */
.feat-grid { display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .feat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .feat-grid { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 1fr; } }
.feat {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3.2vw, 30px);
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 4px 20px -4px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(0, 0, 0, 0.02);
  transition: border-color .24s ease, transform .24s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow .24s ease;
}
.feat:hover {
  border-color: color-mix(in srgb, var(--primary) 46%, var(--line));
  transform: translateY(-4px);
  box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.09), 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent);
}
.feat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.feat-top .icon-tile { width: 48px; height: 48px; border-radius: 14px; box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.05); }
.feat-badge-step {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--ink-3);
  opacity: .25;
  line-height: 1;
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
}
.feat h3 { font-size: 1.18rem; font-weight: 700; margin: 0 0 8px; line-height: 1.38; color: var(--ink); }
.feat p { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.58; }
.feat .badge { position: absolute; top: 20px; right: 20px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); }
.feat .badge.amber { background: var(--warning-soft); color: var(--warning-ink); }
.feat .badge.badge-plus { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
:root[data-theme="dark"] .feat .badge.badge-plus { background: rgba(245, 158, 11, 0.22); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.45); }
.feat .badge.green { background: var(--success-soft); color: var(--success-ink); }
.mini-keys { display: flex; gap: 6px; margin-top: auto; padding-top: 18px; flex-wrap: wrap; align-items: center; }
.mini-keys span {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: inset 0 -2px 0 var(--line), 0 1px 2px rgba(0, 0, 0, 0.03);
  font-family: var(--font-sans);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  user-select: none;
  flex-shrink: 0;
}
.mini-keys span.hl {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: #ffffff !important;
  border-color: #4338ca;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25), 0 3px 10px rgba(79, 70, 229, 0.35);
}
.mini-keys span.bump::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  opacity: 0.85;
}
.mini-keys span.key-tone {
  font-size: 1.25rem;
  line-height: 1;
  padding-bottom: 2px;
}
.feat-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  align-items: center;
}
.feat-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: .82rem;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap !important;
  word-break: keep-all !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  flex-shrink: 0;
  line-height: 1.25;
  user-select: none;
  transition: all .18s ease;
}
.feat-tag.hl {
  border-color: color-mix(in srgb, var(--primary) 45%, var(--line-2));
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-weight: 700;
}
.feat:hover .feat-tag {
  border-color: color-mix(in srgb, var(--primary) 25%, var(--line-2));
}
.rules-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.rules-list a { display: inline-flex; align-items: center; min-height: 44px; font-size: .9rem; font-weight: 600; }
.rules-list span { font-size: .84rem; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

/* ---------- How it works ---------- */
.steps { display: grid; gap: 16px; counter-reset: step; margin: 0; padding: 0; list-style: none; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.steps { margin-top: 18px; }
.step { position: relative; padding-top: 30px; }
.step-n { position: absolute; top: -18px; left: 24px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ink); color: var(--bg); font-family: var(--font-mono); font-weight: 700; box-shadow: var(--shadow); }
.step h3 { font-size: 1.2rem; margin: 14px 0 8px; }
.step p { margin: 0; color: var(--ink-2); }
@media (min-width: 860px) { .steps::before { content: ""; position: absolute; } }

/* ---------- Live demo ---------- */
.demo-grid { display: grid; gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (min-width: 980px) { .demo-grid { grid-template-columns: .85fr 1.15fr; } }
.demo-notes { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; font-size: 1.02rem; }
.demo-notes li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.demo-notes .ico { color: var(--success); margin-top: 3px; }
.demo { position: relative; padding: 0; overflow: hidden; }
.demo-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.demo-layout { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.demo-layout .ico { color: var(--primary-ink); }
.demo-stats { display: flex; gap: 18px; font-size: .86rem; color: var(--ink-3); }
.demo-stats b { display: block; font-family: var(--font-mono); font-size: 1.25rem; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; }
.demo-body { position: relative; padding: 28px 22px 18px; cursor: text; }
.demo-text { font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 600; line-height: 1.8; letter-spacing: .01em; color: var(--ink-3); word-break: break-word; min-height: 3.6em; }
html[lang="en"] .demo-text { font-family: var(--font-mono); font-weight: 500; font-size: clamp(1.15rem, 2.2vw, 1.5rem); letter-spacing: 0; }
.demo-text i { font-style: normal; border-radius: 4px; }
.demo-text i.ok { color: var(--ink); }
.demo-text i.err { color: var(--danger-ink); background: var(--danger-soft); text-decoration: underline wavy; text-decoration-color: var(--danger); text-underline-offset: 6px; }
.demo-text i.cur { box-shadow: inset 2px 0 0 var(--primary); animation: caret-in 1.05s steps(1) infinite; }
.demo-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0; font-size: 16px; cursor: text; color: transparent; background: transparent; caret-color: transparent; }
.demo:focus-within { border-color: var(--primary); box-shadow: var(--ring), var(--shadow); }
.demo-hint { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 18px 16px; font-size: .95rem; color: var(--ink-3); border-top: 1px dashed var(--line); }
.demo-next { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; }
.demo-next kbd { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 7px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2); box-shadow: inset 0 -2px 0 var(--line-2); font-family: var(--font-sans); font-size: .95rem; font-weight: 700; color: var(--ink); }
.demo-next .fdot2 { width: 10px; height: 10px; border-radius: 50%; background: var(--fc, var(--primary)); }
.demo-done { display: none; padding: 16px 18px; margin: 0 18px 18px; border-radius: 14px; background: var(--success-soft); color: var(--success-ink); font-weight: 600; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.demo.done .demo-done { display: flex; }
.demo-mobile-tip { display: none; align-items: center; gap: 8px; margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--primary-ink); font-size: .88rem; line-height: 1.4; border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent); }
.demo-mobile-tip .ico { width: 16px; height: 16px; flex-shrink: 0; color: var(--primary); }
@media (max-width: 768px) { .demo-mobile-tip { display: flex; } }
.demo-nojs { margin: 0 18px 18px; font-size: .9rem; color: var(--ink-3); }
.js .demo-nojs { display: none; }

/* ---------- Ranks (dark band) ---------- */
.band { background: var(--band); color: #eceaff; position: relative; overflow: hidden; isolation: isolate; }
.band::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(800px 400px at 50% 110%, rgba(255, 122, 26, .2), transparent 70%), radial-gradient(700px 400px at 50% -10%, rgba(91, 76, 240, .3), transparent 70%); }
.band :is(h2, h3) { color: #fff; }
.band .lead, .band p { color: #c4c1e6; }
.band .eyebrow { background: rgba(255, 207, 107, .12); color: #ffd98a; border-color: rgba(255, 207, 107, .3); }
.tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .tiers { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .tiers { grid-template-columns: repeat(5, 1fr); } }
.tier { --tc: #e4a466; position: relative; text-align: center; padding: 22px 14px 18px; border-radius: 20px; background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); border: 1px solid rgba(255, 255, 255, .08); transition: transform .25s, border-color .25s; }
.tier:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tc) 50%, transparent); }
.tier.silver { --tc: #dfe5ef; } .tier.gold { --tc: #ffd54a; } .tier.diamond { --tc: #7fe7ff; } .tier.dragon { --tc: #ff8a1f; background: linear-gradient(180deg, rgba(255, 122, 26, .14), rgba(255, 255, 255, .02)); border-color: rgba(255, 122, 26, .35); }
.tier .art { position: relative; width: min(120px, 70%); margin: 0 auto 10px; aspect-ratio: 120 / 138; }
.tier .art > svg { position: absolute; inset: 0; width: 100%; height: 100%; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .45)); }
.tier .art .flames { position: absolute; inset: auto -18% 0; width: 136%; height: auto; opacity: 1; filter: none; }
.tier h3 { font-size: 1.08rem; margin: 0; color: var(--tc); }
.tier p { margin: 2px 0 0; font-size: .88rem; font-family: var(--font-mono); color: #b9b5e6; }
.tier-notes { display: grid; gap: 14px; margin-top: 28px; }
@media (min-width: 860px) { .tier-notes { grid-template-columns: repeat(3, 1fr); } }
.tier-note { display: flex; gap: 14px; padding: 18px; border-radius: 16px; background: rgba(255, 255, 255, .04); border: 1px solid rgba(255, 255, 255, .08); }
.tier-note .ico { width: 26px; height: 26px; color: #ffcf6b; flex: none; margin-top: 2px; }
.tier-note h3 { font-size: 1rem; margin: 0 0 4px; }
.tier-note h3 { font-size: 1.05rem; }
.tier-note p { margin: 0; font-size: .98rem; }

/* ---------- Pricing ---------- */
.billing { display: inline-flex; padding: 4px; border-radius: 14px; background: var(--surface-3); border: 1px solid var(--line); margin-top: 22px; }
.billing button { min-height: 44px; padding: 6px 18px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.billing button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.billing .save { font-size: .8rem; padding: 2px 7px; border-radius: 99px; background: var(--success-soft); color: var(--success-ink); }
html:not(.js) .billing { display: none; }
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 700px) { .plans { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1120px) { .plans { grid-template-columns: repeat(4, 1fr); } }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.pop { border: 1.5px solid var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 12%, transparent), var(--shadow-lg); }
.plan .ribbon { position: absolute; top: -13px; left: 24px; padding: 4px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; color: #fff; background: linear-gradient(90deg, #5b4cf0, #8a3ff0); box-shadow: var(--shadow); }
.plan h3 { font-size: 1.2rem; margin: 0; }
.plan .tagline { font-size: .95rem; color: var(--ink-3); margin: 4px 0 18px; min-height: 2.8em; }
html[lang="th"] .plan .tagline { min-height: 3.5em; }
.price { display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.price b { font-size: 2.4rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.1; font-family: var(--font-sans); }
.price span { color: var(--ink-3); font-size: .92rem; }
.price-note { font-size: .9rem; color: var(--ink-3); min-height: 2.6em; margin-bottom: 16px; }
.price-note strong { color: var(--success-ink); font-weight: 600; }
[data-billing="yearly"] .pm, [data-billing="monthly"] .py, html:not(.js) .py { display: none; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 10px; font-size: .98rem; color: var(--ink-2); }
.plan li { display: flex; gap: 9px; align-items: flex-start; }
.plan li .ico { width: 18px; height: 18px; color: var(--success); margin-top: 3px; }
.plan .btn { margin-top: auto; width: 100%; }
.pay-row { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: center; margin-top: 28px; font-size: .95rem; color: var(--ink-3); }
.pay-row span { display: inline-flex; align-items: center; gap: 7px; }
.pay-row a { display: inline-flex; align-items: center; min-height: 44px; }
.pay-row .ico { width: 18px; height: 18px; color: var(--primary-ink); }

/* ---------- Download ---------- */
.dl { display: grid; gap: 24px; align-items: center; padding: clamp(24px, 4vw, 44px); background: radial-gradient(600px 300px at 100% 0%, var(--glow-1), transparent 70%), var(--surface); }
@media (min-width: 900px) { .dl { grid-template-columns: 1.1fr 1fr; } }
.dl h2 { margin-bottom: 8px; }
.dl-btns { display: grid; gap: 12px; }
.dl-btn { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .2s, border-color .2s; }
.dl-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.dl-btn .ico { width: 28px; height: 28px; color: var(--primary-ink); }
.dl-btn b { display: block; font-size: 1rem; }
.dl-btn { min-height: 64px; }
.dl-btn small { display: block; color: var(--ink-3); font-size: .88rem; }
.dl-btn .arrow { margin-left: auto; width: 20px; height: 20px; color: var(--ink-3); }
.dl-btn.primary { background: linear-gradient(180deg, #6354f5, #4a3ae0); color: #fff; border-color: transparent; }
.dl-btn.primary .ico, .dl-btn.primary small, .dl-btn.primary .arrow { color: rgba(255, 255, 255, .9); }

/* ---------- FAQ ---------- */
.faq { max-width: 860px; margin-inline: auto; display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: border-color .2s, box-shadow .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); box-shadow: var(--shadow); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; padding: 16px 22px; cursor: pointer; list-style: none; font-weight: 600; font-size: 1.06rem; border-radius: 16px; }
.faq summary:hover { color: var(--primary-ink); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .ico { width: 20px; height: 20px; color: var(--ink-3); transition: transform .25s; flex: none; }
.faq details[open] summary .ico { transform: rotate(180deg); color: var(--primary-ink); }
.faq .ans { padding: 0 22px 20px; color: var(--ink-2); max-width: 72ch; }
.faq .ans p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1080px) { .contact-grid { grid-template-columns: repeat(4, 1fr); } }
.c-card { display: flex; flex-direction: column; gap: 6px; padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; transition: transform .2s, box-shadow .2s, border-color .2s; }
.c-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.c-card svg.b { width: 44px; height: 44px; margin-bottom: 10px; }
.c-card b { font-size: 1.05rem; }
.c-card span { color: var(--ink-3); font-size: .95rem; overflow-wrap: anywhere; }
.c-card .go { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-weight: 600; color: var(--primary-ink); font-size: .95rem; }
.c-card .go .ico { width: 16px; height: 16px; }
.contact-more { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 900px) { .contact-more { grid-template-columns: 1fr 1.6fr; } }
.line-qr { display: flex; gap: 18px; align-items: center; }
.line-qr img { width: 120px; height: 120px; border-radius: 12px; border: 1px solid var(--line); background: #fff; padding: 6px; flex: none; }
.line-qr p { margin: 0; font-size: .98rem; color: var(--ink-2); }
.line-qr b { display: block; color: var(--ink); margin-bottom: 4px; }
.interest-card { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface) 60%), var(--surface); }
.interest-card h3 { margin: 0 0 4px; font-size: 1.2rem; }
.interest-card p { margin: 0; color: var(--ink-2); }

/* ---------- Final CTA ---------- */
.cta-band { position: relative; overflow: hidden; text-align: center; border-radius: 28px; padding: clamp(40px, 6vw, 72px) clamp(20px, 4vw, 48px); background: radial-gradient(600px 300px at 20% 0%, rgba(139, 125, 255, .5), transparent 70%), radial-gradient(500px 300px at 90% 100%, rgba(245, 158, 11, .3), transparent 70%), #16133f; color: #fff; isolation: isolate; }
.cta-band h2 { color: #fff; font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; }
.cta-band p { color: #d2cff5; max-width: 56ch; margin: 0 auto 26px; }
.cta-band .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-band .btn-ghost { --c: #fff; --bd: rgba(255, 255, 255, .3); }
.cta-band .keys-deco { position: absolute; inset: 0; z-index: -1; opacity: .12; background-image: linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px); background-size: 48px 48px; -webkit-mask-image: radial-gradient(ellipse at center, #000, transparent 70%); mask-image: radial-gradient(ellipse at center, #000, transparent 70%); }

/* ---------- Offers modal & lead form ---------- */
.modal { width: min(760px, calc(100vw - 24px)); max-height: min(92vh, 920px); padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden; }
.modal::backdrop { background: rgba(10, 8, 30, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal[open] { display: flex; flex-direction: column; animation: pop .28s cubic-bezier(.2, 1.2, .4, 1); }
.modal-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.35rem; margin: 0; }
.modal-head p { margin: 2px 0 0; color: var(--ink-3); font-size: .93rem; }
.modal-head .icon-btn { margin-left: auto; flex: none; }
.modal-head .icon-tile { flex: none; }
.modal-body { padding: 18px 24px 24px; overflow-y: auto; overscroll-behavior: contain; }
.modal-step[hidden] { display: none; }
.aud-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.offers { display: grid; gap: 12px; }
@media (min-width: 640px) { .offers { grid-template-columns: repeat(2, 1fr); } }
.offer { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.offer-top { display: flex; align-items: center; gap: 10px; }
.offer-top .icon-tile { width: 38px; height: 38px; border-radius: 11px; }
.offer-top .icon-tile .ico { width: 20px; height: 20px; }
.offer-aud { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
html[lang="th"] .offer-aud { text-transform: none; letter-spacing: 0; font-size: .8rem; }
.offer h3 { font-size: 1.02rem; margin: 6px 0 0; }
.offer p { margin: 0 0 10px; font-size: .9rem; color: var(--ink-2); }
.offer .btn { margin-top: auto; align-self: flex-start; }
.offers-empty { padding: 20px; text-align: center; color: var(--ink-3); }
.modal-alt { margin-top: 16px; font-size: .92rem; color: var(--ink-3); }
.modal-alt button { background: none; border: 0; padding: 0; min-height: 44px; color: var(--primary-ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: .2em; }
.form { display: grid; gap: 14px; }
.form .row2 { display: grid; gap: 14px; }
@media (min-width: 600px) { .form .row2 { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: 6px; align-content: start; }
.field label, .field legend { font-size: .9rem; font-weight: 600; color: var(--ink); }
.field .opt { font-weight: 400; color: var(--ink-3); }
.field input, .field select, .field textarea { width: 100%; min-height: 46px; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 16px; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 96px; resize: vertical; }
.field :is(input, select, textarea):focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.field [aria-invalid="true"] { border-color: var(--danger); }
.field .err { font-size: .84rem; color: var(--danger-ink); min-height: 0; }
.field .err:empty { display: none; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.pick { display: grid; gap: 8px; }
@media (min-width: 600px) { .pick { grid-template-columns: 1fr 1fr; } }
.pick label, .consent { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-weight: 500; font-size: .9rem; cursor: pointer; }
.pick input, .consent input { width: 18px; height: 18px; min-height: 0; margin: 2px 0 0; accent-color: var(--primary); flex: none; }
.consent { background: transparent; border: 0; padding: 4px 0; color: var(--ink-2); }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.form-actions .btn-primary { min-width: 180px; }
.back-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; background: none; border: 0; color: var(--ink-2); font-weight: 600; cursor: pointer; padding: 6px 0; margin-bottom: 8px; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: .93rem; }
.alert .ico { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.alert-error { background: var(--danger-soft); color: var(--danger-ink); }
.alert-error a { color: inherit; font-weight: 700; }
.alert p { margin: 4px 0 0; }
.alert[hidden] { display: none; }
.done-box { text-align: center; padding: 28px 8px 8px; }
.done-box .big { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; display: grid; place-items: center; background: var(--success-soft); color: var(--success); }
.done-box .big .ico { width: 38px; height: 38px; }
.done-box h3 { font-size: 1.4rem; }
.done-box p { color: var(--ink-2); max-width: 46ch; margin-inline: auto; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
.busy .spinner { display: inline-block; }
.busy .ico { display: none; }

/* ---------- Reveal on scroll (only when JS + motion) ---------- */
.js:not(.rm) .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
.js:not(.rm) .reveal.in { opacity: 1; transform: none; }

@media (max-width: 899px) { .js:not(.rm) .cap ul { display: none; } .js:not(.rm) .cap p { font-size: 1rem; } }

/* ---------- 404 (pages/404.html): open book + keyboard with a missing key ---------- */
.nf { position: relative; isolation: isolate; overflow: hidden; padding-block: clamp(36px, 6vw, 88px) clamp(56px, 8vw, 112px); }
.nf-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(640px 380px at 80% 8%, var(--glow-1), transparent 70%), radial-gradient(520px 340px at 4% 96%, var(--glow-2), transparent 70%); }
.nf-wrap { display: grid; gap: clamp(20px, 5vw, 64px); align-items: center; }
@media (min-width: 900px) { .nf-wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); } }
.nf-art { width: 100%; max-width: 300px; margin-inline: auto; }
@media (min-width: 900px) { .nf-art { max-width: 520px; } }
.nf-svg { width: 100%; height: auto; overflow: visible; }
.nf-shadow { fill: color-mix(in srgb, var(--ink) 12%, transparent); }
.nf-cover { fill: var(--primary); }
.nf-page { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; }
.nf-page-l { fill: color-mix(in srgb, var(--surface) 90%, var(--primary-soft)); }
.nf-fold { stroke: var(--line-2); stroke-width: 2; }
.nf-lines rect { fill: var(--line-2); }
.nf-caret { fill: var(--primary); animation: blink 1.05s steps(1) infinite; }
.nf-key rect { fill: var(--surface-2); stroke: var(--line-2); stroke-width: 1.5; }
.nf-key text, .nf-lost-t { font-family: var(--font-sans); font-weight: 700; font-size: 17px; text-anchor: middle; fill: var(--ink); }
.nf-hot rect { fill: var(--primary-soft); stroke: color-mix(in srgb, var(--primary) 45%, transparent); }
.nf-hot text { fill: var(--primary-ink); font-family: var(--font-mono); }
.nf-slot { fill: color-mix(in srgb, var(--accent) 8%, transparent); stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 4; animation: nf-march 1.6s linear infinite; }
.nf-flip { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.5; opacity: 0; transform-box: view-box; transform-origin: 200px 160px; animation: nf-flip 7s cubic-bezier(.45, .05, .55, .95) 1.2s infinite; }
.nf-float { transform-box: fill-box; transform-origin: 50% 50%; animation: nf-bob 3.4s ease-in-out infinite; }
.nf-lost { fill: #ffc94d; stroke: #d98a06; stroke-width: 1.5; }
.nf-lost-t { fill: #2b1a00; font-size: 21px; }
.nf-spark path { fill: var(--accent); transform-box: fill-box; transform-origin: center; animation: nf-twinkle 2.4s ease-in-out infinite; }
.nf-spark path:nth-child(2) { animation-delay: 1.2s; }
.nf-copy { max-width: 640px; }
.nf-copy > * { animation: nf-up .6s cubic-bezier(.2, .8, .2, 1) both; }
.nf-copy > :nth-child(2) { animation-delay: .06s; } .nf-copy > :nth-child(3) { animation-delay: .12s; }
.nf-copy > :nth-child(4) { animation-delay: .18s; } .nf-copy > :nth-child(5) { animation-delay: .24s; }
.nf-code { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 14px; font-weight: 600; font-size: .95rem; color: var(--ink-2); }
.nf-badge { font-family: var(--font-mono); font-weight: 700; padding: 3px 12px; border-radius: 99px; background: var(--ink); color: var(--bg); letter-spacing: .08em; }
.nf-sep { color: var(--ink-3); }
.nf-block h1 { font-size: clamp(1.85rem, 4.2vw, 2.8rem); line-height: 1.35; margin-bottom: .3em; }
.nf-lead { font-size: clamp(1.08rem, 1.5vw, 1.22rem); color: var(--ink-2); max-width: 52ch; margin-bottom: 0; }
.nf-block-en { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.nf-block-en h2 { font-size: 1.25rem; margin-bottom: .25em; letter-spacing: -.01em; }
.nf-block-en p { color: var(--ink-2); max-width: 56ch; margin: 0; }
.nf-links { display: grid; gap: 12px; margin-top: 28px; }
@media (min-width: 520px) { .nf-links { grid-template-columns: 1fr 1fr; } }
.nf-link { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .2s, border-color .2s; }
.nf-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); }
.nf-link .icon-tile { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.nf-link .icon-tile .ico { width: 22px; height: 22px; }
.nf-link b { display: block; font-size: 1.05rem; line-height: 1.4; }
.nf-link small { display: block; color: var(--ink-3); font-size: .9rem; line-height: 1.35; }
.nf-link-main { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 10%, var(--surface)), var(--surface) 70%); }
.nf-en-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; margin: 18px 0 0; color: var(--ink-3); font-size: .95rem; }
.nf-en-row a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.nf-en-row .ico { width: 18px; height: 18px; color: var(--primary-ink); }
.rm :is(.nf-svg *, .nf-copy > *) { animation: none !important; }
@keyframes nf-bob { 0%, 100% { transform: translateY(0) rotate(-8deg); } 50% { transform: translateY(-9px) rotate(-3deg); } }
@keyframes nf-march { to { stroke-dashoffset: -18; } }
@keyframes nf-twinkle { 0%, 100% { opacity: .35; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes nf-up { from { transform: translateY(14px); } }
@keyframes nf-flip {
  0%, 60% { opacity: 0; transform: scaleX(1); }
  63% { opacity: 1; transform: scaleX(1); }
  78% { opacity: 1; transform: scaleX(.12) skewY(-5deg); }
  93% { opacity: 1; transform: scaleX(-1); }
  100% { opacity: 0; transform: scaleX(-1); }
}

/* ---------- Page turn between pages (cross-document View Transitions) ----------
   Same-origin navigations between site pages: the old page turns away on its left edge like a book page
   (rotateY with perspective, darkening as it turns) and uncovers the new page, which eases up from the shade.
   History back/forward plays it in reverse (theme-init.js adds the "back" type). The header has its own
   view-transition-name so it stays put while the page turns under it. Browsers without cross-document view
   transitions just navigate. Off under prefers-reduced-motion (the @media below; theme-init.js also skips it on .rm). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}
.site-header { view-transition-name: site-header; }
::view-transition-group(site-header) { animation-duration: .3s; }
::view-transition-old(root), ::view-transition-new(root) { mix-blend-mode: normal; backface-visibility: hidden; }
::view-transition-old(root) { z-index: 2; transform-origin: 0 50%; animation: .56s cubic-bezier(.5, .05, .6, .95) both ttl-page-out; }
::view-transition-new(root) { z-index: 1; animation: .56s cubic-bezier(.2, .7, .3, 1) both ttl-page-under; }
html:active-view-transition-type(back)::view-transition-old(root) { z-index: 1; transform-origin: 50% 50%; animation-name: ttl-page-sink; }
html:active-view-transition-type(back)::view-transition-new(root) { z-index: 2; transform-origin: 0 50%; animation-name: ttl-page-in; animation-timing-function: cubic-bezier(.25, .6, .3, 1); }
html.rm::view-transition-old(root), html.rm::view-transition-new(root) { animation: none; }
@keyframes ttl-page-out {
  from { transform: perspective(260vw) rotateY(0); filter: brightness(1); }
  to { transform: perspective(260vw) rotateY(-90deg); filter: brightness(.55); }
}
@keyframes ttl-page-under { from { transform: scale(.985); filter: brightness(.82); } to { transform: none; filter: none; } }
@keyframes ttl-page-in {
  from { transform: perspective(260vw) rotateY(-90deg); filter: brightness(.6); }
  to { transform: perspective(260vw) rotateY(0); filter: brightness(1); }
}
@keyframes ttl-page-sink { from { transform: none; filter: none; } to { transform: scale(.985); filter: brightness(.82); } }

/* ---------- Keyframes ---------- */
@keyframes blink { 50% { opacity: 0; } }
@keyframes caret-in { 50% { box-shadow: inset 2px 0 0 transparent; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(255, 77, 109, .6); } 100% { box-shadow: 0 0 0 1cqw rgba(255, 77, 109, 0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes aura { 50% { transform: scale(1.18); } }
@keyframes flick { 0% { transform: scale(1, 1) skewX(0); } 50% { transform: scale(.94, 1.08) skewX(3deg); } 100% { transform: scale(1.05, .9) skewX(-3deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  .caret { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* ---------- Generated (site/tools/gen-partials.ts) ---------- */
/* @gen:start confetti vectors */
.s4-confetti i:nth-child(1){--dx:-22.09cqw;--dy:-21.4cqw;--rot:254deg;--c:#fff2b0;--w:1.2cqw}
.s4-confetti i:nth-child(2){--dx:13.56cqw;--dy:8.57cqw;--rot:-163deg;--c:#ffc23d;--w:1.16cqw}
.s4-confetti i:nth-child(3){--dx:18.69cqw;--dy:-24.75cqw;--rot:-180deg;--c:#ff7a1a;--w:1.39cqw}
.s4-confetti i:nth-child(4){--dx:-0.62cqw;--dy:-26.24cqw;--rot:-218deg;--c:#8b7dff;--w:1.05cqw}
.s4-confetti i:nth-child(5){--dx:-12.53cqw;--dy:-30.85cqw;--rot:-357deg;--c:#5b4cf0;--w:1.02cqw}
.s4-confetti i:nth-child(6){--dx:8.1cqw;--dy:-19.28cqw;--rot:66deg;--c:#34d399;--w:0.63cqw}
.s4-confetti i:nth-child(7){--dx:-1.69cqw;--dy:1.03cqw;--rot:-226deg;--c:#ffffff;--w:1.31cqw}
.s4-confetti i:nth-child(8){--dx:-14.55cqw;--dy:-11.96cqw;--rot:-235deg;--c:#ff9ff0;--w:1.36cqw}
.s4-confetti i:nth-child(9){--dx:-38.16cqw;--dy:-7.94cqw;--rot:-130deg;--c:#7fe7ff;--w:1cqw}
.s4-confetti i:nth-child(10){--dx:15.11cqw;--dy:-7.46cqw;--rot:41deg;--c:#fff2b0;--w:1.14cqw}
.s4-confetti i:nth-child(11){--dx:1.01cqw;--dy:13.35cqw;--rot:-209deg;--c:#ffc23d;--w:0.87cqw}
.s4-confetti i:nth-child(12){--dx:-2.84cqw;--dy:-37.76cqw;--rot:6deg;--c:#ff7a1a;--w:0.78cqw}
.s4-confetti i:nth-child(13){--dx:-4.86cqw;--dy:5.59cqw;--rot:-306deg;--c:#8b7dff;--w:1.19cqw}
.s4-confetti i:nth-child(14){--dx:-14.66cqw;--dy:-32.09cqw;--rot:308deg;--c:#5b4cf0;--w:0.68cqw}
.s4-confetti i:nth-child(15){--dx:25.27cqw;--dy:-16.53cqw;--rot:318deg;--c:#34d399;--w:0.72cqw}
.s4-confetti i:nth-child(16){--dx:11.1cqw;--dy:-3.5cqw;--rot:-100deg;--c:#ffffff;--w:1.03cqw}
.s4-confetti i:nth-child(17){--dx:-31.26cqw;--dy:-28.55cqw;--rot:-304deg;--c:#ff9ff0;--w:1.25cqw}
.s4-confetti i:nth-child(18){--dx:20.5cqw;--dy:-16.22cqw;--rot:149deg;--c:#7fe7ff;--w:0.76cqw}
.s4-confetti i:nth-child(19){--dx:-38.34cqw;--dy:-13.44cqw;--rot:-273deg;--c:#fff2b0;--w:1.5cqw}
.s4-confetti i:nth-child(20){--dx:-38.3cqw;--dy:-21.16cqw;--rot:-48deg;--c:#ffc23d;--w:1.12cqw}
.s4-confetti i:nth-child(21){--dx:-16.57cqw;--dy:9.07cqw;--rot:-127deg;--c:#ff7a1a;--w:1.26cqw}
.s4-confetti i:nth-child(22){--dx:-7.7cqw;--dy:8.47cqw;--rot:247deg;--c:#8b7dff;--w:1.23cqw}
.s4-confetti i:nth-child(23){--dx:40.68cqw;--dy:-11.07cqw;--rot:-49deg;--c:#5b4cf0;--w:1.09cqw}
.s4-confetti i:nth-child(24){--dx:-4.85cqw;--dy:1.43cqw;--rot:142deg;--c:#34d399;--w:0.88cqw}
.s4-confetti i:nth-child(25){--dx:9.21cqw;--dy:-38.07cqw;--rot:-293deg;--c:#ffffff;--w:1.03cqw}
.s4-confetti i:nth-child(26){--dx:7.82cqw;--dy:-21.27cqw;--rot:340deg;--c:#ff9ff0;--w:0.76cqw}
.s4-confetti i:nth-child(27){--dx:-8.82cqw;--dy:-33.7cqw;--rot:-199deg;--c:#7fe7ff;--w:0.97cqw}
.s4-confetti i:nth-child(28){--dx:17.41cqw;--dy:10.15cqw;--rot:-118deg;--c:#fff2b0;--w:0.79cqw}
.s4-confetti i:nth-child(29){--dx:-28cqw;--dy:-30.59cqw;--rot:-125deg;--c:#ffc23d;--w:1.31cqw}
.s4-confetti i:nth-child(30){--dx:-14.03cqw;--dy:-2.17cqw;--rot:262deg;--c:#ff7a1a;--w:0.93cqw}
/* @gen:end */


/* ---------- Solutions (#for): individuals / schools / business, plus events and creators ---------- */
.sol-grid { display: grid; gap: 18px; grid-template-columns: 1fr; align-items: stretch; }
@media (min-width: 760px) and (max-width: 1079px) { .sol-grid { grid-template-columns: repeat(2, 1fr); } .sol-hl { grid-column: 1 / -1; order: -1; } }
@media (min-width: 1080px) { .sol-grid { grid-template-columns: repeat(3, 1fr); } }
.sol { position: relative; display: flex; flex-direction: column; gap: 0; }
.sol-hl { border: 1.5px solid color-mix(in srgb, var(--success) 55%, var(--line)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 10%, transparent), var(--shadow); }
.sol-flag { position: absolute; top: -13px; left: 24px; padding: 4px 12px; border-radius: 99px; font-size: .82rem; font-weight: 700; color: #fff; background: linear-gradient(90deg, #0f9f6e, #10b981); box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .6); }
.sol-top { display: flex; align-items: center; gap: 12px; }
.sol-kicker { margin: 0; font-size: .9rem; font-weight: 700; color: var(--ink-3); line-height: 1.4; }
.sol h3 { font-size: 1.25rem; margin: 16px 0 10px; }
.sol-price { display: flex; flex-direction: column; gap: 2px; margin: 0 0 18px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.sol-price b { font-size: 1.2rem; font-weight: 800; color: var(--ink); line-height: 1.3; }
.sol-price span { font-size: .9rem; color: var(--ink-3); line-height: 1.45; }
.sol-list { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 10px; font-size: .98rem; color: var(--ink-2); }
.sol-list li { display: flex; gap: 9px; align-items: flex-start; line-height: 1.55; }
.sol-list .ico { width: 18px; height: 18px; margin-top: 4px; color: var(--success); }
.sol-cta { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.sol-cta .btn { flex: none; justify-content: center; text-align: center; white-space: normal; }
.sol-more { display: grid; gap: 14px; margin-top: 18px; }
@media (min-width: 760px) { .sol-more { grid-template-columns: repeat(2, 1fr); } }
.sol-mini { display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 16px 18px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .15s, box-shadow .15s, border-color .15s; }
.sol-mini:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.sol-mini .icon-tile { width: 44px; height: 44px; border-radius: 12px; flex: none; }
.sol-mini .icon-tile .ico { width: 22px; height: 22px; }
.sol-mini > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.sol-mini b { font-size: 1rem; line-height: 1.4; }
.sol-mini > span > span { font-size: .9rem; color: var(--ink-3); line-height: 1.45; }
.sol-mini .go { width: 20px; height: 20px; color: var(--primary-ink); flex: none; }

/* ---------- Mascot Presentation (น้องที) ---------- */
.mascot-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px 8px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 92%, var(--primary-soft));
  box-shadow: 0 4px 16px -4px rgba(79, 70, 229, 0.15);
  margin-bottom: 18px;
  max-width: 100%;
}
.mascot-avatar {
  width: 44px;
  height: 44px;
  object-fit: contain;
  flex: none;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}
.mascot-badge-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mascot-badge-tag {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--primary);
  line-height: 1.2;
}
.mascot-badge-msg {
  margin: 0;
  font-size: .88rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  white-space: normal;
}

/* Mascot Presenter Guide for each Section */
.mascot-guide {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0 0 28px;
  max-width: 760px;
}
.mascot-guide.center {
  margin-inline: auto;
  justify-content: center;
}
.mascot-figure {
  position: relative;
  flex: none;
  filter: drop-shadow(0 10px 20px rgba(79, 70, 229, 0.22));
  animation: mascotFloat 3.8s ease-in-out infinite;
}
.mascot-sticker {
  display: block;
  width: 72px;
  height: 72px;
  object-fit: contain;
}
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (prefers-reduced-motion: reduce) {
  .mascot-figure { animation: none; }
}

.mascot-bubble {
  position: relative;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-radius: 18px;
  box-shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.08);
  font-size: .95rem;
  line-height: 1.5;
  color: var(--ink);
}
.mascot-bubble::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  width: 14px;
  height: 14px;
  background: inherit;
  border-left: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  transform: translateY(-50%) rotate(45deg);
}
.mascot-bubble-title {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .03em;
  margin-bottom: 4px;
}
.mascot-bubble-text {
  margin: 0;
  font-size: .95rem;
  color: var(--ink-2);
  line-height: 1.5;
}

@media (max-width: 640px) {
  .mascot-guide {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .mascot-sticker {
    width: 60px;
    height: 60px;
  }
  .mascot-bubble::before {
    top: -7px;
    left: 24px;
    border-left: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-top: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
    border-bottom: none;
    transform: rotate(45deg);
  }
}

/* ---------- Step 4: Lessons Section ---------- */
.lessons-steps {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
}
@media (min-width: 768px) {
  .lessons-steps {
    grid-template-columns: repeat(3, 1fr);
  }
}
.lessons-step {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
}
.lessons-step-n {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ink-3);
  opacity: .3;
  line-height: 1;
}
.lessons-step h3 {
  font-size: 1.15rem;
  margin: 14px 0 8px;
  font-weight: 700;
}
.lessons-step p {
  margin: 0;
  font-size: .94rem;
  color: var(--ink-2);
  line-height: 1.55;
}
.lessons-step-keys {
  display: flex;
  gap: 5px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.lessons-step-keys span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: .84rem;
  color: var(--ink);
  white-space: nowrap;
}
.lessons-step-keys span.hl {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-ink);
}

.lessons-action, .ranks-action {
  text-align: center;
  margin-top: 36px;
}

/* ---------- Step 6: Pricing Highlight Frame (Green outline in flowchart) ---------- */
.pricing-conversion-frame {
  position: relative;
  border: 2px solid rgba(16, 185, 129, 0.55);
  border-radius: 28px;
  background: radial-gradient(1200px 500px at 50% 0%, rgba(16, 185, 129, 0.07), transparent 75%), var(--bg);
  padding: clamp(28px, 4vw, 56px) clamp(16px, 3.5vw, 40px);
  box-shadow: 0 16px 40px -12px rgba(16, 185, 129, 0.16);
  margin-block: 20px;
}
.conversion-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #059669;
  font-weight: 700;
  font-size: .9rem;
  margin-bottom: 20px;
}
:root[data-theme="dark"] .conversion-pill {
  color: #34d399;
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.45);
}
.conversion-pill .ico {
  width: 16px;
  height: 16px;
  flex: none;
}

.ribbon-pilot {
  background: linear-gradient(90deg, #059669, #10b981) !important;
}

.cta-mascot-wrap {
  margin-bottom: 18px;
}

.cta-mascot-img {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}
