/* ============================================================
   Uniqcret — Uniqcret-dark / -light (toggleable)
   Glass surfaces, SVG + CSS only (no raster images). PGCE engine.

   TWO THEMES, one toggle (nav · persisted to localStorage):
   · DARK (default, [data-theme="dark"] / :root) — near-black navy
     canvas + indigo-violet accent (#8b8bf4). Reads "AI / research /
     cinematic". Dark ALSO carries the atmospheric extras the light
     theme drops (orbs, ambient glows, grain) — anything tagged
     .dark-only in the markup.
   · LIGHT ([data-theme="light"]) — cool near-white canvas + cyan/blue
     accent. Cleaner, no ambient glow.

   The hue lives ONLY in the --accent* tokens (+ --accent-rgb, the raw
   channels so rgba() tints follow the theme). Retune those per theme
   block to restyle everything.
   ============================================================ */

:root {
  color-scheme: dark;
  --bg: #0a0b12;
  --bg-2: #0e0f1a;
  --ink: #ecedf4;          /* headings */
  --body-c: #c6c9d6;       /* body text, >9:1 on bg */
  --muted: #9094a8;        /* secondary text, >5:1 on bg */
  --accent: #8b8bf4;       /* indigo-violet */
  --accent-bright: #a6a6ff;
  --accent-deep: #0c0a1f;  /* ink on accent fills */
  --accent-soft: rgba(139, 139, 244, 0.15);
  --accent-rgb: 139, 139, 244;  /* raw channels → rgba(var(--accent-rgb), a) */
  --glass: rgba(255, 255, 255, 0.05);
  --line: rgba(255, 255, 255, 0.09);
  --line-soft: rgba(255, 255, 255, 0.06);
  --radius: 18px;
  --font-display: "Sora", system-ui, sans-serif;
  --font-text: "Inter", system-ui, sans-serif;
  --nav-h: 72px;
}

/* ---------- LIGHT THEME (cyan/blue accent) ----------
   Placed AFTER :root so equal-specificity attribute overrides win.
   Cyan #0e7490 clears ~5:1 on the light canvas for small bold text. */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --ink: #0f1020;          /* dark navy headings */
  --body-c: #2b3245;
  --muted: #5a6478;
  --accent: #0e7490;       /* cyan / blue */
  --accent-bright: #0891b2;
  --accent-deep: #ffffff;  /* white text on cyan fills */
  --accent-soft: rgba(14, 116, 144, 0.10);
  --accent-rgb: 14, 116, 144;
  --glass: #ffffff;        /* solid cards (shadow instead of blur) */
  --line: rgba(15, 16, 32, 0.10);
  --line-soft: rgba(15, 16, 32, 0.06);
}
[data-theme="light"] body {
  background: radial-gradient(110% 55% at 50% 0%, #ffffff 0%, var(--bg) 55%) var(--bg);
}
[data-theme="light"] .nav.is-scrolled { background: rgba(255, 255, 255, 0.82); }

/* Theme-scoped visibility: dark's atmospheric extras vanish in light.
   Tag any future dark-only "gimmick" with class="dark-only". */
[data-theme="light"] .dark-only { display: none !important; }
[data-theme="dark"]  .light-only { display: none !important; }
html:not([data-theme="light"]) .light-only { display: none !important; }

/* In light, glass cards become solid white with a soft shadow (no blur). */
[data-theme="light"] .topic-card,
[data-theme="light"] .feature-card,
[data-theme="light"] .access-panel,
[data-theme="light"] .plan-card {
  box-shadow: 0 1px 2px rgba(15, 16, 32, 0.05), 0 14px 34px -24px rgba(15, 16, 32, 0.35);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
[data-theme="light"] .lesson-types li { background: #ffffff; }

/* Smooth the toggle, but only after first paint (no load flash); reduced
   motion still nukes it via the global rule at the foot of this file. */
html.theme-ready body,
html.theme-ready .topic-card,
html.theme-ready .feature-card,
html.theme-ready .access-panel,
html.theme-ready .plan-card,
html.theme-ready .stat,
html.theme-ready .icon,
html.theme-ready .nav-logo-mark,
html.theme-ready .theme-toggle,
html.theme-ready .lang-toggle,
html.theme-ready .timeline-rail {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-text);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body-c);
  background: radial-gradient(110% 55% at 50% 0%, #11121e 0%, var(--bg) 55%) var(--bg);
  overflow-x: clip; /* horizontal-scroll track + orbs may overflow */
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
svg { display: block; }
[hidden] { display: none !important; }

::selection { background: rgba(var(--accent-rgb), 0.34); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Native anchor jumps (reduced motion / JS or CDN blocked) must clear the
   fixed 72px nav — Lenis applies its own -76px offset on the smooth path. */
[id] { scroll-margin-top: calc(var(--nav-h) + 8px); }

/* ---------- Thai script fallback (for a future TH toggle) ---------- */
:lang(th), [lang="th"] { font-family: "Noto Sans Thai", var(--font-text); }

/* ---------- Global scroll-progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  z-index: 110;            /* above the fixed nav (z-index 100) */
  width: 100%;
  height: 3px;
  background: var(--line-soft);
  pointer-events: none;
}
.scroll-progress-bar {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0.6rem; left: 0.6rem;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  background: var(--accent);
  color: var(--accent-deep);
  font-weight: 600;
  border-radius: 999px;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ---------- Atmosphere: SVG grain (not raster) ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>");
}

/* ---------- Layout primitives ---------- */
.container { width: min(1280px, 92vw); margin-inline: auto; }

/* Big screens (your 2560×1600 etc.): scale the whole rem/clamp system up a notch
   so the page fills the display instead of sitting tiny in the middle. */
@media (min-width: 1900px) { html { font-size: 17.5px; } }
@media (min-width: 2400px) { html { font-size: 19px; } }

.section {
  padding: clamp(5.5rem, 11vw, 9rem) 0;
  border-top: 1px solid var(--line-soft); /* thin editorial dividers */
}

.section-head { max-width: 760px; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}
.section-head .lede { margin-top: 1rem; color: var(--muted); font-size: 1.05rem; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

.tint { color: var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-text);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: transform 0.25s ease, background-color 0.25s ease, border-color 0.25s ease;
}
.btn:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, 0.2); }

.btn-primary { background: var(--accent); border-color: transparent; color: var(--accent-deep); }
.btn-primary:hover { background: var(--accent-bright); }

.btn-ghost { background: var(--glass); }

.btn-cta { padding: 0.7rem 1.25rem; background: var(--glass); } /* ≥44px tap target */
.btn-cta:hover { border-color: var(--accent); color: var(--accent); }

/* Login / Sign-up — filled accent pill at nav size (see assets/js/auth.js) */
.btn-auth { padding: 0.7rem 1.15rem; background: var(--accent); border-color: transparent; color: var(--accent-deep); }
.btn-auth:hover { background: var(--accent-bright); border-color: transparent; color: var(--accent-deep); }
.btn-auth-ico { width: 17px; height: 17px; flex: none; }

.head-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  border-bottom: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}
.nav.is-scrolled {
  background: rgba(10, 11, 18, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--line-soft);
}
.nav-inner {
  height: var(--nav-h);
  width: min(1280px, 92vw);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  white-space: nowrap;
}
.nav-logo-mark {
  display: grid;
  place-items: center;
  width: auto; height: 32px;
}
.nav-logo-mark .logo-img { height: 32px; width: auto; display: block; }
.nav-links { display: flex; gap: 1.6rem; }
.nav-links a {
  font-size: 0.92rem;
  color: var(--body-c);
  transition: color 0.25s ease;
  /* expand the tap target to ≥44px without shifting the layout */
  padding: 0.75rem 0.4rem;
  margin: -0.75rem -0.4rem;
}
.nav-links a:hover { color: var(--accent); }

/* Right-hand nav cluster: theme toggle + language toggle + CTA */
.nav-actions { display: flex; align-items: center; gap: 0.9rem; }

/* ---------- Theme toggle (light / dark) ---------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;       /* ≥40px tap target */
  flex: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--body-c);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.25s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
/* show the icon of the theme you'll switch TO: sun in dark, moon in light */
.theme-ico { display: none; }
[data-theme="dark"]  .theme-ico-sun  { display: block; }
[data-theme="light"] .theme-ico-moon { display: block; }
html:not([data-theme="light"]) .theme-ico-sun { display: block; }

/* ---------- Language toggle (EN | ไทย — hook for future i18n) ---------- */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
}
.lang-btn {
  appearance: none;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  font-family: var(--font-text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.55rem 0.45rem;
  border-radius: 999px;
  transition: color 0.2s ease;
}
.lang-btn[lang="th"] { font-family: "Noto Sans Thai", var(--font-text); }
.lang-btn:hover { color: var(--ink); }
.lang-btn[aria-pressed="true"] { color: var(--accent); }
.lang-btn[aria-disabled="true"] { cursor: default; opacity: 0.55; }
.lang-btn[aria-disabled="true"]:hover { color: var(--muted); }
.lang-sep { color: var(--line); font-size: 0.82rem; user-select: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 90% at 72% 8%, rgba(139, 139, 244, 0.08), transparent 55%);
}
.orb {
  position: absolute;
  border-radius: 50%;
  will-change: transform; /* parallax-scrubbed */
}
.orb-a {
  width: 58vmax; height: 58vmax;
  top: -22%; left: -18%;
  background: radial-gradient(circle at 38% 38%, rgba(139, 139, 244, 0.18), transparent 62%);
}
.orb-b {
  width: 44vmax; height: 44vmax;
  top: 24%; right: -20%;
  background: radial-gradient(circle at 45% 45%, rgba(160, 140, 255, 0.10), transparent 60%);
}
.orb-c {
  width: 36vmax; height: 36vmax;
  bottom: -26%; left: 28%;
  background: radial-gradient(circle at 50% 40%, rgba(120, 130, 255, 0.12), transparent 65%);
}
.hero-inner { position: relative; z-index: 2; padding: clamp(1rem, 4vh, 3rem) 0 clamp(4rem, 11vh, 7rem); }
.hero-kicker {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 8vw, 6.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin: 1.4rem 0 1.6rem;
}
/* mask wrappers give the words a clean clipped reveal; padding keeps descenders */
.word-mask {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.12em;
  margin-bottom: -0.12em;
}
.word { display: inline-block; will-change: transform; }
.hero-tagline {
  max-width: 660px;
  margin: -0.2rem 0 1.2rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.7vw, 1.85rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.hero-sub {
  max-width: 640px;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: var(--body-c);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2.2rem; }
.scroll-cue {
  margin-top: clamp(2rem, 6vh, 4rem);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--muted);
}
.scroll-cue > span:first-child {
  width: 1px; height: 44px;
  background: linear-gradient(var(--accent), transparent);
  transform-origin: top;
  animation: cue 2.2s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: scaleY(0.25); opacity: 0.4; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- Icons ---------- */
.icon {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 12px;
  margin-bottom: 1.2rem;
}
.icon svg { width: 22px; height: 22px; }

/* ---------- AI search / GPTs ---------- */
.aisearch { position: relative; }
.aisearch-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5rem);
}
.aisearch-grid .section-head { margin-bottom: 0; max-width: 46ch; }
.aisearch-grid .section-head h2 { margin-bottom: 0.9rem; }
.tick-list { display: grid; gap: 0.7rem; margin-top: 1.4rem; }
.tick-list li {
  position: relative;
  padding-left: 1.7rem;
  color: var(--body-c);
  font-size: 0.98rem;
}
.tick-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.55em;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.aisearch-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1600px;
  perspective-origin: 50% 42%;
  overflow: hidden;            /* keep the device glow from overflowing the viewport */
  padding: 12px;
}
/* Pure-CSS "AI search" device — a glass terminal showing a typed query + answer.
   Decorative (aria-hidden); JS flies it in on desktop, transform/opacity only. */
.ai-device {
  position: relative;
  width: min(440px, 84vw);
  transform-style: preserve-3d;
}
.ai-glow {
  position: absolute;
  inset: -24% -8% -20%;
  z-index: 0;
  border-radius: 50%;
  background:
    radial-gradient(closest-side at 50% 40%, rgba(139, 139, 244, 0.26), rgba(139, 139, 244, 0) 70%),
    radial-gradient(closest-side at 50% 70%, rgba(120, 130, 255, 0.12), rgba(120, 130, 255, 0) 72%);
  filter: blur(12px);
  pointer-events: none;
}
.ai-screen {
  position: relative;
  z-index: 1;
  padding: 1.1rem 1.2rem 1.4rem;
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(160deg, rgba(22, 23, 38, 0.95), rgba(12, 13, 22, 0.92));
  border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 40px 90px -36px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(139, 139, 244, 0.08);
}
.ai-bar { display: flex; align-items: center; gap: 0.45rem; margin-bottom: 1rem; }
.ai-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.ai-dot:first-child { background: rgba(139, 139, 244, 0.7); }
.ai-bar-title {
  margin-left: auto;
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.ai-search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
}
.ai-search-ico { width: 18px; height: 18px; color: var(--accent); flex: none; }
.ai-query { font-size: 0.92rem; color: var(--ink); }
.ai-caret {
  width: 2px; height: 1.1em;
  background: var(--accent);
  flex: none;
  animation: ai-blink 1.1s step-end infinite;
}
@keyframes ai-blink { 50% { opacity: 0; } }
.ai-answer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line-soft);
}
.ai-tag {
  width: 100%;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.ai-line {
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05));
  flex: 0 0 100%;
}
.ai-line.w-90 { width: 90%; flex-basis: 90%; }
.ai-line.w-100 { width: 100%; flex-basis: 100%; }
.ai-line.w-70 { width: 70%; flex-basis: 70%; }
.ai-chip {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid rgba(var(--accent-rgb), 0.3);
  color: var(--accent-bright);
}

/* ---------- Numbers / counters ---------- */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.stat { padding: 1.4rem 0 1.4rem 1.4rem; border-left: 1px solid var(--line); }
.stat-value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stat-label { margin-top: 0.5rem; color: var(--muted); font-size: 0.92rem; }

/* ---------- Topic / feature card grids ---------- */
.topic-grid, .features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 1.25rem;
}
.topic-card, .feature-card {
  padding: 1.8rem;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.topic-card h3, .feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.55rem;
}
.topic-card p, .feature-card p { color: var(--muted); font-size: 0.95rem; }
/* link cards lift + glow on hover (transform/opacity + box-shadow only) */
.topic-card:hover, .app-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--accent-rgb), 0.45);
  box-shadow: 0 22px 50px -28px rgba(var(--accent-rgb), 0.6);
}

/* ---------- Curriculum timeline (How to learn) ---------- */
.timeline { position: relative; max-width: 760px; }
.timeline-rail {
  position: absolute;
  left: 10px; top: 6px; bottom: 6px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}
.timeline-progress {
  position: absolute;
  inset: 0;
  background: linear-gradient(var(--accent), rgba(139, 139, 244, 0.35));
  transform-origin: top; /* draws downward with scaleY scrub */
  border-radius: 2px;
}
.timeline-list { display: grid; gap: 3.2rem; }
.tl-node { position: relative; padding-left: 3.4rem; }
.tl-dot {
  position: absolute;
  left: 1px; top: 0.35rem;
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--bg-2);
  transition: border-color 0.4s ease, box-shadow 0.4s ease, background-color 0.4s ease;
}
.tl-node.is-lit .tl-dot {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.22);
  box-shadow: 0 0 0 5px var(--accent-soft);
}
.tl-tag {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.4s ease;
}
.tl-node.is-lit .tl-tag { color: var(--accent); }
.tl-body h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0.4rem 0 0.5rem;
}
.tl-body p { color: var(--muted); max-width: 56ch; }
.lesson-types { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.lesson-types li {
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--body-c);
}
.curriculum .head-actions { margin-top: clamp(2.5rem, 6vw, 4rem); }

/* ---------- Uniqcret Universe (atmospheric pinned statements) ---------- */
.universe { position: relative; overflow: hidden; }
.universe-bg { position: absolute; inset: 0; pointer-events: none; }
.orb-u-a {
  width: 50vmax; height: 50vmax;
  top: -18%; right: -16%;
  background: radial-gradient(circle at 45% 45%, rgba(160, 120, 255, 0.16), transparent 62%);
}
.orb-u-b {
  width: 42vmax; height: 42vmax;
  bottom: -24%; left: -14%;
  background: radial-gradient(circle at 50% 45%, rgba(110, 130, 255, 0.12), transparent 64%);
}
.universe-inner { position: relative; z-index: 2; }
.pillar-stack { display: grid; gap: 2.6rem; margin-top: 1.4rem; }
.pillar {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  color: var(--ink);
  max-width: 18ch;
  will-change: transform; /* crossfaded while pinned */
}
.universe .head-actions { margin-top: 2.6rem; }
/* .universe--pinned is added by JS on desktop only (motion allowed) */
.universe--pinned { min-height: 100vh; min-height: 100svh; padding: 0; display: flex; align-items: center; }
.universe--pinned .universe-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}
.universe--pinned .pillar-stack { display: grid; place-items: center; width: min(1000px, 92vw); }
.universe--pinned .pillar { grid-area: 1 / 1; max-width: 20ch; }
.universe--pinned .head-actions { position: relative; z-index: 3; }

/* ---------- Plans & pricing tier cards ---------- */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.plan-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2rem;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.plan-card--feature { border-color: rgba(var(--accent-rgb), 0.4); box-shadow: 0 22px 60px -34px rgba(var(--accent-rgb), 0.55); }
.plan-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.plan-price { margin: 0.7rem 0 0.2rem; display: flex; align-items: baseline; gap: 0.4rem; flex-wrap: wrap; }
.plan-amount {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.9rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  color: var(--accent);
}
.plan-period { font-size: 0.88rem; color: var(--muted); }
.plan-blurb { margin-top: 0.7rem; color: var(--muted); font-size: 0.94rem; }
.plan-trial {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--body-c);
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--accent-soft);
}
.plan-card .btn { margin-top: auto; align-self: stretch; justify-content: center; }
.plan-card > .plan-blurb { flex: 1 0 auto; }
.access .micro a { color: var(--accent); text-decoration: none; }
.access .micro a:hover { text-decoration: underline; }

/* ---------- Access / plans panels ---------- */
.access-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 1.5rem;
}
.access-panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 2.4rem;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.access-panel h3 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.7rem;
}
.access-panel > p { color: var(--muted); }
.access-panel .btn { margin-top: 1.6rem; }
.micro { font-size: 0.83rem; color: var(--muted); margin-top: 1rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line-soft); padding: 3.5rem 0 3rem; }
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-lead { max-width: 38ch; }
.footer-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: var(--ink); }
.footer-note { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 3rem; }
.footer-col { display: grid; gap: 0.55rem; align-content: start; }
.footer-col-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.footer-col a {
  font-size: 0.92rem;
  color: var(--body-c);
  transition: color 0.25s ease;
  padding: 0.25rem 0;
}
.footer-col a:hover { color: var(--accent); }
.footer-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line-soft);
  font-size: 0.85rem;
  color: var(--muted);
}
.footer-social a {
  color: var(--body-c);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
  transition: color 0.25s ease;
}
.footer-social a:hover { color: var(--accent); }

/* small legal cross-links in the footer meta row */
.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  justify-content: center;
}
.footer-legal-links a {
  font-size: 0.82rem;
  color: var(--muted);
  transition: color 0.25s ease;
}
.footer-legal-links a:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
/* breakpoint matches the JS matchMedia split at 768px */
@media (max-width: 767.98px) {
  .nav-links { display: none; } /* logo + theme toggle + lang toggle + CTA remain */
  .nav-actions { gap: 0.35rem; }
  .nav-logo { font-size: 0.98rem; }
  .theme-toggle { width: 36px; height: 36px; }
  .lang-toggle { padding: 0.15rem 0.3rem; }
  .lang-btn { padding: 0.5rem 0.32rem; }
  .btn-cta { padding: 0.5rem 0.8rem; font-size: 0.8rem; }
  .btn-auth { padding: 0.5rem 0.8rem; font-size: 0.8rem; }

  .aisearch-grid { grid-template-columns: 1fr; gap: clamp(1.8rem, 7vw, 2.6rem); }
  .aisearch-grid .section-head { max-width: none; }
  .aisearch-visual { order: -1; } /* device sits above the heading when stacked */
  .ai-device { width: min(420px, 90vw); }

  .pillar { max-width: none; }
}

/* Very small screens: collapse the Login button to its icon to save nav room */
@media (max-width: 480px) {
  .btn-auth .auth-label { display: none; }
  .btn-auth { padding: 0.5rem 0.62rem; }
}

/* ---------- Reduced motion: kill all CSS animation/transition ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .scroll-cue { display: none; }
  .ai-caret { display: none; }
  .wm-drop { width: auto !important; opacity: 1 !important; }  /* show full "Unique in Secret" */
}

/* =====================================================================
   v4 additions — bilingual font swap, wordmark merge, manifesto quote,
   slide deck, AI platform rows, brain/performance phone, plan scroll-rail.
   ===================================================================== */

/* Thai: swap BOTH font variables so all text (incl. Latin terms) uses Noto Thai */
[data-lang="th"] {
  --font-text: "Noto Sans Thai", "Inter", system-ui, sans-serif;
  --font-display: "Noto Sans Thai", "Sora", system-ui, sans-serif;
}
[data-lang="th"] body { line-height: 1.8; }

/* Bilingual inline blocks toggled by <html data-lang> (used by the auth button
   here and throughout the legal pages). The active language keeps its natural
   display; only the inactive one is hidden. Works even if i18n.js hasn't run. */
html[data-lang="th"] [data-l="en"] { display: none !important; }
html[data-lang="en"] [data-l="th"],
html:not([data-lang="th"]) [data-l="th"] { display: none !important; }

/* ---------- Hero wordmark: "Unique in Secret" -> "Uniqcret" ---------- */
.wordmark-stage {
  position: relative; z-index: 2;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: var(--nav-h) 1rem 0;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 12vw, 9rem);
  line-height: 1; letter-spacing: -0.02em;
  color: var(--ink); white-space: nowrap;
}
.wm { display: inline-block; will-change: transform; }
.wm-drop { color: var(--muted); overflow: hidden; }
.wordmark .wm-keep:last-of-type { color: var(--accent); }  /* the "cret" of Uniqcret */

/* ---------- Hero manifesto quote ---------- */
.hero-quote {
  max-width: 720px;
  margin: 0.4rem 0 1.6rem;
  padding-left: clamp(1rem, 2vw, 1.4rem);
  border-left: 3px solid var(--accent);
}
.hero-quote-lead {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.3rem, 3vw, 2.05rem); line-height: 1.2;
  letter-spacing: -0.01em; color: var(--ink);
}
.hero-quote-body {
  margin-top: 0.8rem;
  font-size: clamp(1rem, 1.6vw, 1.18rem); line-height: 1.6; color: var(--body-c);
}

/* ---------- Clinical-epi: teaching slide deck ---------- */
.epi-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: clamp(2rem, 6vw, 5rem); }
.epi-grid .section-head { margin-bottom: 0; }
.slide-deck { position: relative; display: block; width: min(440px, 100%); aspect-ratio: 4 / 3; margin-inline: auto; }
.slide { position: absolute; inset: 0; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform 0.4s ease; }
.slide-3 { transform: translate(26px, 26px) rotate(4deg); opacity: .5; }
.slide-2 { transform: translate(13px, 13px) rotate(2deg); opacity: .75; }
.slide-1 { display: flex; flex-direction: column; gap: 0.9rem; padding: 1.6rem; }
.slide-deck:hover .slide-3 { transform: translate(34px, 34px) rotate(5deg); }
.slide-deck:hover .slide-2 { transform: translate(19px, 19px) rotate(3deg); }
.slide-line { height: 12px; border-radius: 999px; background: var(--accent-soft); }
.slide-line.w-60 { width: 60%; } .slide-line.w-90 { width: 90%; }
.slide-chart { width: 100%; margin-top: auto; color: var(--accent); }

/* ---------- AI platform rows (ChatGPT live, Claude/Gemini soon) ---------- */
.ai-platforms { display: grid; gap: 0.7rem; margin-top: 1.6rem; }
.ai-platform { display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 1rem; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); transition: transform .25s ease, border-color .25s ease; }
.ai-platform.is-active:hover { transform: translateX(4px); border-color: var(--accent); }
.ai-plat-logo { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.ai-plat-logo svg { width: 20px; height: 20px; }
.ai-plat-text { display: flex; flex-direction: column; line-height: 1.25; }
.ai-plat-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); }
.ai-plat-status { font-size: 0.78rem; color: var(--muted); }
.ai-platform.is-active .ai-plat-status { color: var(--accent); }
.ai-platform.is-soon { opacity: 0.6; cursor: default; }
.ai-platform.is-soon .ai-plat-logo { background: var(--glass); color: var(--muted); }

/* ---------- Web apps: brain / performance phone + category entries ---------- */
.apps-stage { display: grid; grid-template-columns: 0.85fr 1.15fr; align-items: center; gap: clamp(2rem, 6vw, 4.5rem); }
.brain-phone { position: relative; display: grid; place-items: center; text-decoration: none; padding: 1rem 1rem 2.8rem; }
.bp-frame { position: relative; z-index: 2; width: min(232px, 66vw); aspect-ratio: 9 / 17; border-radius: 30px; padding: 13px; background: linear-gradient(160deg, rgba(22,23,38,.96), rgba(12,13,22,.92)); border: 1px solid var(--line); box-shadow: 0 40px 90px -36px rgba(0,0,0,.8); transition: transform .3s ease; }
.brain-phone:hover .bp-frame { transform: translateY(-5px); }
[data-theme="light"] .bp-frame { background: #0f1020; }
.bp-screen { height: 100%; border-radius: 20px; background: radial-gradient(120% 55% at 50% 0%, rgba(var(--accent-rgb), .20), transparent 62%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.1rem; padding: 1rem; text-align: center; }
.bp-brain { color: var(--accent-bright); animation: bp-pulse 2.4s ease-in-out infinite; }
.bp-brain svg { width: 62px; height: 62px; filter: drop-shadow(0 0 12px rgba(var(--accent-rgb), .6)); }
@keyframes bp-pulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
.bp-power { width: 80%; height: 8px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.bp-fill { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transform-origin: left; transform: scaleX(0); animation: bp-charge 2.8s ease-in-out infinite; }
@keyframes bp-charge { 0% { transform: scaleX(0); } 70%, 100% { transform: scaleX(1); } }
.bp-meta { display: flex; justify-content: space-between; width: 80%; font-size: 0.7rem; letter-spacing: .1em; }
.bp-label { color: #9094a8; } .bp-pct { color: var(--accent-bright); font-weight: 700; }
.bp-cta { position: absolute; z-index: 3; bottom: 0.4rem; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 0.88rem; font-weight: 600; color: var(--accent); }
.bp-spark { position: absolute; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); opacity: 0; z-index: 1; }
.bp-spark-1 { top: 24%; left: 26%; animation: bp-spark 2.8s ease-in-out .2s infinite; }
.bp-spark-2 { top: 32%; right: 24%; animation: bp-spark 2.8s ease-in-out 1s infinite; }
.bp-spark-3 { bottom: 30%; left: 32%; animation: bp-spark 2.8s ease-in-out 1.6s infinite; }
@keyframes bp-spark { 0% { transform: scale(0); opacity: 0; } 40% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.7) translateY(-16px); opacity: 0; } }
.apps-side { display: grid; gap: 0.8rem; }
.app-cat { display: flex; align-items: center; gap: 0.9rem; padding: 1rem 1.2rem; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); transition: transform .25s ease, border-color .25s ease; }
.app-cat:hover { transform: translateX(4px); border-color: rgba(var(--accent-rgb), .45); }
.app-cat .icon { width: 38px; height: 38px; margin: 0; }
.app-cat .icon svg { width: 20px; height: 20px; }
.app-cat-name { font-family: var(--font-display); font-weight: 600; color: var(--ink); flex: 1; }
.app-cat-arrow { width: 18px; height: 18px; color: var(--muted); flex: none; }
.apps-side .head-actions { margin-top: 0.4rem; }

/* ---------- Plans: horizontal scroll catalog ---------- */
.plan-hint { margin-top: 1rem; font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.plan-rail { display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.5rem clamp(1rem, 4vw, 4rem) 1.4rem; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.plan-rail .plan-card { scroll-snap-align: start; flex: 0 0 clamp(258px, 78vw, 318px); }
.plan-rail::-webkit-scrollbar { height: 8px; }
.plan-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.plan-rail::-webkit-scrollbar-track { background: transparent; }

/* ---------- Mock buttons / learn note / chat cue ---------- */
.btn[aria-disabled="true"] { opacity: 0.5; cursor: default; }
.btn[aria-disabled="true"]:hover { transform: none; border-color: var(--line); background: var(--glass); }
.learn-note { margin-top: 1rem; }
.chat-cue { margin-top: 1rem; display: inline-block; padding: 0.6rem 1rem; border-radius: 12px; background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .3); color: var(--accent-bright); font-weight: 600; font-size: 0.92rem; }

/* ---------- Tablet / iPad (768–1024) ---------- */
@media (min-width: 768px) and (max-width: 1024px) {
  .epi-grid, .apps-stage { grid-template-columns: 1fr; gap: clamp(2rem, 5vw, 3rem); }
  .slide-deck { width: min(420px, 70%); }
  .brain-phone { order: -1; }
}

/* ---------- New components on mobile ---------- */
@media (max-width: 767.98px) {
  .wordmark { font-size: clamp(1.7rem, 10.5vw, 4rem); }
  .epi-grid, .apps-stage { grid-template-columns: 1fr; gap: 2.2rem; }
  .slide-deck { width: min(320px, 78vw); }
  .brain-phone { order: -1; }
  .hero-quote-lead { font-size: clamp(1.2rem, 6.5vw, 1.7rem); }
}

/* ---------- Watch / YouTube showcase (badges, handle, note) ---------- */
.watch-badge { font-family: var(--font-display); font-size: 0.72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep); background: var(--accent); padding: 0.34rem 0.7rem; border-radius: 999px; }
.watch-badge-alt { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .35); }
.watch-handle { font-size: 0.85rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.watch-handle:hover { color: var(--accent); }
.watch-note { margin-top: 0.9rem; font-size: 0.92rem; color: var(--muted); }

/* =====================================================================
   v5 additions — pinned wordmark, course "beam into hand", YouTube
   catalog rails + lightbox, supermarket shop, community steps.
   ===================================================================== */

/* ---------- Hero wordmark: keep it on-screen while it merges ----------
   The wordmark now lives in its OWN top-level section (no overflow:hidden
   ancestor), so the pin holds exactly like the Universe section. JS pins
   .wordmark-stage and scrubs the merge. */
.wordmark-hero { position: relative; }
.wordmark-stage.is-pinned { will-change: transform; }
.wordmark-stage .scroll-cue { will-change: transform, opacity; }

/* ---------- Course: the screens beam knowledge into your hand ---------- */
.course-stage { display: grid; gap: clamp(1.8rem, 5vw, 3rem); }
.course-scene {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(60px, 1fr) auto;
  align-items: center;
  gap: clamp(0.4rem, 3vw, 1.8rem);
  min-height: clamp(220px, 34vw, 320px);
  padding: clamp(1.4rem, 4vw, 2.8rem) clamp(1rem, 3vw, 2.2rem);
  border-radius: calc(var(--radius) + 4px);
  border: 1px solid var(--line);
  background:
    radial-gradient(120% 120% at 16% 50%, rgba(var(--accent-rgb), 0.12), transparent 55%),
    var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  overflow: hidden;
}
[data-theme="light"] .course-scene { box-shadow: 0 1px 2px rgba(15,16,32,.05), 0 16px 40px -26px rgba(15,16,32,.35); }

/* devices: laptop (PC) + tablet (iPad), screens lit */
.cs-devices { position: relative; display: flex; align-items: flex-end; gap: clamp(8px, 1.6vw, 16px); justify-self: start; }
.cs-laptop { position: relative; width: clamp(118px, 22vw, 188px); }
.cs-lid {
  display: block; height: clamp(74px, 13.5vw, 116px);
  border-radius: 9px 9px 3px 3px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(28,30,52,.97), rgba(12,13,22,.94));
  position: relative; overflow: hidden;
  transform-origin: bottom center; animation: cs-open 5s ease-in-out infinite;
}
.cs-lid-glow, .cs-tablet-glow {
  position: absolute; inset: 6px; border-radius: 6px;
  background: radial-gradient(120% 100% at 50% 26%, rgba(var(--accent-rgb), 0.62), rgba(var(--accent-rgb), 0.12) 70%);
  animation: cs-flicker 3s ease-in-out infinite;
}
.cs-base { display: block; height: 9px; margin-top: 3px; border-radius: 2px 2px 7px 7px; background: linear-gradient(#2a2c45, #15172a); border: 1px solid var(--line); }
.cs-tablet {
  position: relative; width: clamp(54px, 9vw, 82px); height: clamp(82px, 14.5vw, 124px);
  border-radius: 11px; border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(28,30,52,.97), rgba(12,13,22,.94)); overflow: hidden;
}
.cs-tablet-glow { animation-delay: .6s; }
.cs-emit {
  position: absolute; right: -14px; top: 42%; z-index: 3;
  width: clamp(30px, 5vw, 46px); height: clamp(30px, 5vw, 46px); border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--accent-rgb), 0.9), transparent 68%);
  filter: blur(3px); animation: cs-pulse 2.4s ease-in-out infinite;
}

/* knowledge-transfer loading bar (scroll-driven fill, no infinite animation) */
.cs-progress { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 0.55rem; padding: 0 clamp(.4rem, 2vw, 1.4rem); }
.cs-progress-label { font-family: var(--font-display); font-size: clamp(.55rem, 1.3vw, .68rem); font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cs-track { position: relative; width: 100%; height: 12px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); overflow: hidden; }
[data-theme="light"] .cs-track { background: rgba(15,16,32,.08); }
.cs-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }
.cs-fill::after { content: ""; position: absolute; right: 0; top: 50%; transform: translate(45%, -50%); width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--accent-bright) 58%, transparent 72%); }
.cs-percent { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.1rem, 3vw, 1.7rem); letter-spacing: -0.02em; color: var(--accent-bright); }

/* the human head — glow intensity follows --glow (0..1), set on scroll */
.cs-head {
  --glow: 1; position: relative; justify-self: end; display: grid; place-items: center;
  width: clamp(80px, 13vw, 124px); height: clamp(80px, 13vw, 124px); color: var(--accent-bright);
}
.cs-head-glow { position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(circle, rgba(var(--accent-rgb), .65), rgba(var(--accent-rgb), .18) 45%, transparent 66%); opacity: calc(.06 + var(--glow) * .94); transform: scale(calc(.66 + var(--glow) * .52)); }
.cs-head svg { position: relative; width: 88%; height: 88%; }
.cs-head-shoulders, .cs-head-outline { opacity: calc(.4 + var(--glow) * .6); }
.cs-head-brain { stroke: var(--accent-bright); opacity: calc(.24 + var(--glow) * .76); }
@keyframes cs-open { 0%, 100% { transform: rotateX(0deg); } 50% { transform: rotateX(-7deg); } }
@keyframes cs-flicker { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }
@keyframes cs-pulse { 0%, 100% { transform: scale(.9); opacity: .55; } 50% { transform: scale(1.08); opacity: 1; } }

.course-cta { display: flex; flex-direction: column; align-items: center; gap: 0.85rem; text-align: center; }
.course-cta .micro { margin-top: 0; }
.course-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-family: var(--font-display); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); padding: .42rem .95rem; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .35);
}
.course-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: cs-flicker 1.6s ease-in-out infinite; }

@media (max-width: 560px) {
  .course-scene { grid-template-columns: auto 1fr auto; min-height: 190px; padding: 1.3rem 0.9rem; }
  .cs-devices { gap: 6px; }
}

/* ---------- Watch: two rows, each a slideshow ---------- */
.watch-room { margin-top: clamp(1.8rem, 4vw, 2.8rem); }
.watch-room-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.watch-room-id { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.watch-sort { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
/* slideshow: rail + big overlay arrows */
.video-slider { position: relative; }
.vs-arrow { position: absolute; top: 33%; z-index: 5; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; border: 1px solid var(--line); background: rgba(10,11,18,.74); color: var(--ink); cursor: pointer; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 12px 32px -12px rgba(0,0,0,.75); transition: color .2s ease, border-color .2s ease, background-color .2s ease, transform .2s ease; }
[data-theme="light"] .vs-arrow { background: rgba(255,255,255,.86); }
.vs-arrow:hover { color: var(--accent-deep); background: var(--accent); border-color: transparent; transform: scale(1.08); }
.vs-arrow svg { width: 22px; height: 22px; }
.vs-prev { left: -10px; }
.vs-next { right: -10px; }
.video-rail { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.4rem 0.2rem 1rem; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scroll-behavior: smooth; }
.video-rail::-webkit-scrollbar { height: 8px; }
.video-rail::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }
.video-rail::-webkit-scrollbar-track { background: transparent; }
.video-card { scroll-snap-align: start; flex: 0 0 clamp(258px, 80vw, 358px); display: flex; flex-direction: column; gap: 0.6rem; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; }
@media (max-width: 600px) { .vs-arrow { width: 40px; height: 40px; } .vs-prev { left: -4px; } .vs-next { right: -4px; } }
.vc-thumb { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; }
.vc-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.92; transition: transform .35s ease, opacity .35s ease; }
.vc-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 52%, rgba(0,0,0,.5)); }
.video-card:hover .vc-thumb img, .video-card:focus-visible .vc-thumb img { transform: scale(1.05); opacity: 1; }
.vc-play { position: absolute; inset: 0; margin: auto; z-index: 2; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(10,11,18,.58); border: 1px solid rgba(255,255,255,.35); color: #fff; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: transform .25s ease, background-color .25s ease, border-color .25s ease, color .25s ease; }
.video-card:hover .vc-play, .video-card:focus-visible .vc-play { transform: scale(1.12); background: var(--accent); border-color: transparent; color: var(--accent-deep); }
.vc-play svg { width: 20px; height: 20px; margin-left: 2px; }
.vc-title { font-size: 0.9rem; font-weight: 600; color: var(--body-c); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card:hover .vc-title { color: var(--ink); }

/* video lightbox */
.vlightbox { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: clamp(1rem, 4vw, 3rem); background: rgba(5,6,12,.82); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.vlightbox[hidden] { display: none; }
.vlightbox-stage { width: min(960px, 94vw); }
.vlightbox-slot { position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: 14px; overflow: hidden; background: #000; box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); }
.vlightbox-slot iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.vlightbox-close { position: absolute; top: 1.1rem; right: 1.1rem; width: 44px; height: 44px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.vlightbox-close:hover { background: var(--accent); color: var(--accent-deep); border-color: transparent; }
.vlightbox-close svg { width: 20px; height: 20px; }

/* ---------- Shop: the counter (goods on a lit shelf) ---------- */
.shop-counter { margin-top: clamp(1.4rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: calc(var(--radius) + 4px); overflow: hidden; background: var(--bg-2); }
/* fascia: OPEN sign · name · cart */
.shop-fascia { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem clamp(0.9rem, 3vw, 1.4rem); border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(var(--accent-rgb), .16), rgba(var(--accent-rgb), .04)); }
.shop-open { display: inline-flex; align-items: center; gap: 0.45rem; font-family: var(--font-display); font-weight: 700; font-size: 0.74rem; letter-spacing: .16em; text-transform: uppercase; color: #5fe6a0; }
.shop-open-dot { width: 8px; height: 8px; border-radius: 50%; background: #46e08a; box-shadow: 0 0 9px #46e08a; }
.shop-fascia-name { font-family: var(--font-display); font-weight: 800; letter-spacing: .16em; font-size: 0.82rem; text-transform: uppercase; color: var(--ink); }
.shop-cart { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--body-c); }
.shop-cart svg { width: 18px; height: 18px; color: var(--accent); }
/* shelf row of product tiles */
.shop-shelf-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; padding: clamp(1.2rem, 3vw, 1.8rem) clamp(1rem, 3vw, 1.5rem); }
html:not([data-theme="light"]) .shop-shelf-row { background: rgba(20, 22, 40, .35); }
.shop-tile { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.7rem; min-height: 150px; padding: 1.1rem 1rem 1.2rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.04); transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; }
[data-theme="light"] .shop-tile { background: #fff; box-shadow: 0 1px 2px rgba(15,16,32,.05), 0 12px 28px -22px rgba(15,16,32,.4); }
.shop-tile:hover { transform: translateY(-6px); border-color: rgba(var(--accent-rgb), .5); box-shadow: 0 18px 38px -22px rgba(var(--accent-rgb), .6); }
.shop-tile-ico { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .28); }
.shop-tile-ico svg { width: 22px; height: 22px; }
.shop-tile-name { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; color: var(--ink); line-height: 1.25; }
/* swing price-tag, hangs at the bottom of the tile */
.shop-tile-tag { position: relative; align-self: flex-start; margin-top: auto; padding: 0.28rem 0.6rem 0.28rem 0.85rem; font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; color: var(--accent-deep); background: var(--accent); border-radius: 4px 7px 7px 4px; transition: transform 0.25s ease; }
.shop-tile-tag::before { content: ""; position: absolute; left: 7px; top: 50%; transform: translateY(-50%); width: 5px; height: 5px; border-radius: 50%; background: var(--accent-deep); opacity: .5; }
.shop-tile:hover .shop-tile-tag { transform: rotate(-3deg); }
/* corner ribbons */
.shop-ribbon { position: absolute; top: 0; right: 0; padding: 0.18rem 0.5rem; font-family: var(--font-display); font-size: 0.56rem; font-weight: 800; letter-spacing: .06em; color: var(--accent-deep); border-radius: 0 12px 0 9px; }
.shop-ribbon-new { background: var(--accent); }
.shop-ribbon-sale { background: #f0a83c; color: #2a1c06; }
/* the 'browse all' tile */
.shop-tile-more { align-items: center; justify-content: center; text-align: center; border-style: dashed; }
.shop-tile-more .shop-tile-name { color: var(--accent); }
.shop-tile-more .shop-tile-ico svg { width: 24px; height: 24px; }
/* the lit shelf ledge the tiles sit on */
.shop-ledge { height: 12px; border-top: 1px solid var(--line); background: linear-gradient(180deg, rgba(var(--accent-rgb), .5), rgba(var(--accent-rgb), .1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.shop .head-actions { margin-top: clamp(1.6rem, 4vw, 2.2rem); }
@media (max-width: 560px) { .shop-fascia-name { display: none; } }

/* ---------- Community: join → post → approve → publish ---------- */
.community-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1.1rem; }
.cstep { position: relative; padding: 1.6rem 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
[data-theme="light"] .cstep { box-shadow: 0 1px 2px rgba(15,16,32,.05), 0 14px 34px -24px rgba(15,16,32,.35); -webkit-backdrop-filter: none; backdrop-filter: none; }
.cstep-n { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); border: 1px solid rgba(var(--accent-rgb), .3); color: var(--accent); font-family: var(--font-display); font-weight: 700; margin-bottom: 0.9rem; }
.cstep h3 { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--ink); margin-bottom: 0.4rem; }
.cstep p { font-size: 0.92rem; color: var(--muted); }
.community-note { margin-top: 1.4rem; }

/* =====================================================================
   PERFORMANCE — the page was pegging the GPU and lagging the machine.
   The dominant costs were (1) many backdrop-filter:blur() surfaces that
   re-blur the page behind them every scroll frame, (2) an animated
   drop-shadow on the scaling brain icon, and (3) permanent will-change
   layers on the huge gradient orbs. Neutralise all three. Cards keep a
   solid panel background so they still read with the blur gone.
   ===================================================================== */
.nav, .ai-screen, .topic-card, .feature-card, .plan-card, .access-panel,
.slide, .course-scene, .vs-arrow, .vc-play, .vlightbox, .cstep {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}
.orb { will-change: auto; }                 /* static now — don't keep a layer */
.bp-brain svg { filter: none; }             /* animated drop-shadow was costly */
html:not([data-theme="light"]) :is(.feature-card, .topic-card, .plan-card, .access-panel, .cstep, .shop-card) {
  background: rgba(22, 24, 42, 0.5);        /* visible card without the blur */
}
