/* ============================================================
   Sparkbright — design system v2
   Same brand as v1 (indigo #5B5BD6, Duolingo-green CTAs, gold XP,
   Fredoka display + Nunito body, CSS owl mascot, light theme
   locked), rebuilt for depth, motion and rhythm. One file serves
   marketing (landing, pricing), auth, and the app shell.

   Contracts that must not change (JS + Playwright depend on them):
   [hidden] display:none, .auth-* classes, .is-loading, .btn-link,
   .subject-card/.badge/.two/.chev/.count, .course-tile/.ct-code/
   .ct-name, .resume-card family, .progress-track/.progress-fill,
   .empty-resume, .home-toast.show, .course-* shell classes,
   .plan-badge, .nav-greet, .sr-only, data-kind="success".
   ============================================================ */

:root {
  /* brand */
  --indigo:        #5B5BD6;
  --indigo-deep:   #4646C0;
  --indigo-soft:   #EEF0FF;
  --indigo-mist:   #F6F7FF;
  /* ink */
  --ink:           #1B1E33;
  --ink-2:         #2B2F4C;
  --ink-3:         #3A3F63;
  --muted:         #5C6184;
  --muted-2:       #7E83A3;
  --muted-3:       #9094B0;
  --muted-4:       #9AA0BE;
  /* accents — feather green, gold XP, error red, sky */
  --amber:         #FFC800;
  --amber-soft:    #FFF6D6;
  --amber-ink:     #B38600;
  --green:         #58CC02;
  --green-deep:    #58A700;
  --green-soft:    #D7FFB8;
  --green-ink:     #3C8400;
  --coral:         #FF4B4B;
  --coral-deep:    #E63A3A;
  --coral-soft:    #FFE0E0;
  --coral-ink:     #D43535;
  --sky:           #1CB0F6;
  --sky-soft:      #DDF4FE;
  /* subjects (Sparkbright's six worlds) */
  --languages:     #5B5BD6;
  --languages-soft:#EEF0FF;
  --maths:         #2563EB;
  --maths-soft:    #E4EDFE;
  --words:         #7C3AED;
  --words-soft:    #F1EAFE;
  --science:       #059669;
  --science-soft:  #DCF6EC;
  --world:         #EA580C;
  --world-soft:    #FFE9DC;
  --logic:         #D97706;
  --logic-soft:    #FDF0D8;
  /* surfaces */
  --bg:            #FFFFFF;
  --bg-tint:       #F7F8FD;
  --line:          #EEEFF6;
  --line-2:        #E2E4F2;
  --line-3:        #E7E9F4;
  /* tinted shadow scale (one light source, indigo-cast) */
  --shadow-sm:     0 2px 8px -2px rgba(43,47,105,.10);
  --shadow-md:     0 10px 24px -14px rgba(43,47,105,.28);
  --shadow-lg:     0 24px 48px -20px rgba(43,47,105,.35);
  --card-shadow:   0 14px 30px -22px rgba(40,40,90,.35);
  --shadow-pop:    0 30px 60px -20px rgba(20,20,50,.5);

  --r-sm: 12px; --r-md: 16px; --r-lg: 20px; --r-xl: 24px; --r-pill: 999px;
  --maxw: 1180px;

  --ease-out:  cubic-bezier(.22,.61,.36,1);
  --ease-back: cubic-bezier(.34,1.56,.64,1);

  --font-display: 'Fredoka', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
::selection { background: #D9DCFF; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.5px; margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }

/* keyboard focus — one visible ring everywhere */
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; border-radius: 6px; }
.btn:focus-visible, .subject-card:focus-visible, .course-tile:focus-visible { outline-offset: 3px; }

/* skip link for keyboard users */
.skip-link {
  position: absolute; top: -60px; left: 16px; z-index: 100;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px;
  padding: 12px 18px; border-radius: 0 0 12px 12px; transition: top .15s var(--ease-out);
}
.skip-link:focus-visible { top: 0; outline-offset: 0; }

/* ---- icon glyphs ---- */
.ico { display: inline-flex; align-items: center; justify-content: center; }
.ico svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.fill svg { fill: currentColor; stroke: none; }

/* ============ ANIMATIONS ============ */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes floaty-soft { 0%,100% { transform: translateY(0) rotate(var(--tilt,0deg)); } 50% { transform: translateY(-8px) rotate(var(--tilt,0deg)); } }
@keyframes pop { 0% { transform: scale(.55); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(22px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.floaty { animation: floaty 4s ease-in-out infinite; }

/* scroll reveal — js/reveal.js adds .sb-reveal to <html>; without JS
   (or with reduced motion) everything stays visible */
.sb-reveal [data-reveal] { opacity: 0; transform: translateY(20px); }
.sb-reveal [data-reveal].is-in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
}
.sb-reveal [data-reveal="2"].is-in { transition-delay: .08s; }
.sb-reveal [data-reveal="3"].is-in { transition-delay: .16s; }
.sb-reveal [data-reveal="4"].is-in { transition-delay: .24s; }

/* ============ BUTTONS (chunky 3D push) ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-weight: 800; font-size: 16px; padding: 14px 26px; border-radius: var(--r-md);
  line-height: 1; white-space: nowrap;
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), filter .12s var(--ease-out), background .12s var(--ease-out);
}
.btn .ico { font-size: 20px; }
.btn-lg { padding: 17px 34px; font-size: 18px; border-radius: 18px; text-transform: uppercase; letter-spacing: .3px; }
.btn-block { width: 100%; }

/* Primary = feather green (the signature CONTINUE button) */
.btn-primary { color: #fff; background: var(--green); box-shadow: 0 5px 0 var(--green-deep); }
.btn-primary:hover { filter: brightness(1.04); transform: translateY(-1px); box-shadow: 0 6px 0 var(--green-deep); }
.btn-primary:active { filter: none; transform: translateY(3px); box-shadow: 0 2px 0 var(--green-deep); }
.btn-lg.btn-primary { box-shadow: 0 6px 0 var(--green-deep); }
.btn-lg.btn-primary:hover { box-shadow: 0 7px 0 var(--green-deep); }
.btn-lg.btn-primary:active { box-shadow: 0 2px 0 var(--green-deep); }

.btn-indigo { color: #fff; background: var(--indigo); box-shadow: 0 5px 0 var(--indigo-deep); }
.btn-indigo:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 6px 0 var(--indigo-deep); }
.btn-indigo:active { filter: none; transform: translateY(3px); box-shadow: 0 2px 0 var(--indigo-deep); }
.btn-lg.btn-indigo { box-shadow: 0 6px 0 var(--indigo-deep); }
.btn-lg.btn-indigo:active { box-shadow: 0 2px 0 var(--indigo-deep); }

.btn-ghost { color: var(--ink-3); background: #fff; box-shadow: 0 5px 0 var(--line-2); }
.btn-ghost:hover { transform: translateY(-1px); box-shadow: 0 6px 0 var(--line-2); color: var(--ink); }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--line-2); }
.btn-lg.btn-ghost { box-shadow: 0 6px 0 var(--line-2); }
.btn-lg.btn-ghost:active { box-shadow: 0 2px 0 var(--line-2); }

/* on dark/indigo panels */
.btn-white { color: var(--indigo); background: #fff; box-shadow: 0 5px 0 rgba(20,20,60,.35); }
.btn-white:hover { transform: translateY(-1px); box-shadow: 0 6px 0 rgba(20,20,60,.35); }
.btn-white:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(20,20,60,.35); }

.btn-flat { background: #F1F2FA; color: var(--ink-3); font-weight: 900; }
.btn-flat:hover { background: #E9EAF6; }
.btn-flat:active { transform: translateY(1px); }
.btn-soft { background: var(--indigo-soft); color: var(--indigo); font-weight: 900; }
.btn-soft:hover { background: #E3E6FF; }
.btn-soft:active { transform: translateY(1px); }
.btn-text { color: var(--ink-3); font-weight: 800; padding: 10px 16px; border-radius: 12px; }
.btn-text:hover { background: var(--bg-tint); color: var(--ink); }
.btn-link { color: var(--indigo); font-weight: 900; padding: 0; display: inline; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn-nav { padding: 11px 20px; border-radius: 14px; box-shadow: 0 4px 0 var(--green-deep); }
.btn-nav:hover { box-shadow: 0 5px 0 var(--green-deep); }
.btn-nav:active { box-shadow: 0 1px 0 var(--green-deep); }

button:disabled { cursor: not-allowed; opacity: .7; }

/* ============ NAV ============ */
.nav {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 14px clamp(16px,4vw,48px);
  background: rgba(255,255,255,.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; border-radius: 10px; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -.2px; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links .navlink { font-weight: 800; font-size: 15px; color: var(--muted); padding: 10px 14px; border-radius: 12px; transition: background .12s var(--ease-out), color .12s var(--ease-out); }
.nav-links .navlink:hover { color: var(--ink-2); background: var(--bg-tint); }
.nav-links .navlink[aria-current="page"] { color: var(--indigo); background: var(--indigo-soft); }
@media (max-width: 760px) { .nav-links .navlink.hide-sm { display: none; } }

/* mascot (CSS owl, brand mark) */
.owl { position: relative; flex: none; }
.owl .body { position: absolute; inset: 0; background: var(--indigo); border-radius: 48% 48% 46% 46%/52% 52% 48% 48%; box-shadow: inset 0 -12px 0 rgba(0,0,0,.07); }
.owl .ear { position: absolute; top: -9%; width: 22%; height: 22%; background: var(--indigo); }
.owl .ear.l { left: 16%; border-radius: 50% 50% 0 50%; transform: rotate(18deg); }
.owl .ear.r { right: 16%; border-radius: 50% 50% 50% 0; transform: rotate(-18deg); }
.owl .eye { position: absolute; top: 27%; width: 27%; height: 27%; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; animation: blink 5s infinite; }
.owl .eye.l { left: 18%; } .owl .eye.r { right: 18%; }
.owl .eye i { width: 40%; height: 40%; background: var(--ink); border-radius: 50%; }
.owl .beak { position: absolute; top: 50%; left: 50%; transform: translateX(-50%) rotate(45deg); width: 14%; height: 14%; background: var(--amber); border-radius: 3px; }
.owl.on-color .body { background: #fff; box-shadow: none; }
.owl.on-color .ear { background: #fff; }
.owl.on-color .eye { background: var(--indigo-soft); }
.owl.on-color .beak { background: var(--amber); }

.logo-chip { position: relative; width: 34px; height: 34px; flex: none; }
.logo-chip .face { position: absolute; inset: 0; background: var(--indigo); border-radius: 46%; }
.logo-chip .e { position: absolute; top: 26%; width: 29%; height: 29%; background: #fff; border-radius: 50%; }
.logo-chip .e.l { left: 20%; } .logo-chip .e.r { right: 20%; }
.logo-chip .e i { position: absolute; top: 22%; left: 22%; width: 50%; height: 50%; background: var(--ink); border-radius: 50%; }
.logo-chip .bk { position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%) rotate(45deg); width: 24%; height: 24%; background: var(--amber); border-radius: 2px; }

/* ============ SHARED SECTION FURNITURE ============ */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(34px,5.5vw,76px) clamp(16px,4vw,48px); }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: clamp(24px,3vw,36px); }
.section-head .lede { margin: 10px 0 0; text-align: left; }
.section-more { flex: none; font-weight: 900; font-size: 15px; color: var(--indigo); display: inline-flex; align-items: center; gap: 6px; padding-bottom: 4px; }
.section-more .ico { font-size: 17px; transition: transform .15s var(--ease-out); }
.section-more:hover .ico { transform: translateX(3px); }

.kicker {
  display: inline-flex; align-items: center; gap: 7px; margin-bottom: 12px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase;
}
.kicker::before { content: ""; width: 22px; height: 3px; border-radius: 2px; background: currentColor; opacity: .85; }
.kicker.indigo { color: var(--indigo); }
.kicker.green { color: var(--green-ink); }
.kicker.amber { color: var(--amber-ink); }
.kicker.coral { color: var(--coral-ink); }

.pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--r-pill); font-weight: 800; font-size: 13px; }
.pill.amber { background: var(--amber-soft); color: var(--amber-ink); }
.pill.green { background: var(--green-soft); color: var(--green-ink); }
.pill.indigo { background: var(--indigo-soft); color: var(--indigo); }

.heading-2 { font-size: clamp(28px,4vw,42px); letter-spacing: -.8px; margin: 0; }
.lede { color: var(--muted-2); font-weight: 600; font-size: 17px; margin: 10px auto 0; max-width: 560px; line-height: 1.55; }
.centered { text-align: center; }
.centered .lede { margin-left: auto; margin-right: auto; }

/* faint brand dot texture for feature surfaces */
.dotted {
  background-image: radial-gradient(rgba(91,91,214,.10) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

/* ============ HERO (landing) ============ */
.hero { position: relative; overflow: hidden; background:
  radial-gradient(720px 420px at 12% -10%, var(--indigo-soft) 0%, rgba(238,240,255,0) 60%),
  radial-gradient(640px 420px at 94% 8%, #E7F9F0 0%, rgba(231,249,240,0) 60%);
}
.hero-inner {
  position: relative; z-index: 1; max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0,1.04fr) minmax(0,.96fr); align-items: center;
  gap: clamp(24px,4vw,56px); padding: clamp(40px,6vw,84px) clamp(16px,4vw,48px) clamp(36px,5vw,64px);
}
.hero-copy .pill { margin-bottom: 20px; }
.hero-copy h1 { font-size: clamp(38px,5.2vw,62px); line-height: 1.04; letter-spacing: -1.5px; }
.hero-copy h1 .accent { color: var(--indigo); }
.hero-copy .sub { font-size: clamp(17px,2vw,20px); color: var(--muted); max-width: 520px; margin: 18px 0 0; line-height: 1.55; font-weight: 600; }

/* the product, on the landing page: type a topic */
.hero-builder {
  display: flex; gap: 10px; align-items: stretch; max-width: 560px; margin: 26px 0 0;
  padding: 8px; background: #fff; border: 2px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--shadow-md); transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.hero-builder:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft), var(--shadow-md); }
.hero-builder input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  padding: 10px 12px; font-size: 17px; font-weight: 700; color: var(--ink);
}
.hero-builder input::placeholder { color: var(--muted-3); font-weight: 600; }
.hero-builder .btn { flex: none; }

.hero-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; max-width: 560px; }
.hero-chips .label { font-weight: 800; font-size: 13px; color: var(--muted-3); margin-right: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px;
  background: #fff; border: 2px solid var(--line-2); border-radius: var(--r-pill);
  font-weight: 800; font-size: 13px; color: var(--ink-3);
  transition: border-color .12s var(--ease-out), transform .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
a.chip:hover, button.chip:hover { border-color: var(--indigo); color: var(--indigo); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

.hero-proof { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; }
.hero-proof span { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--muted-2); font-weight: 800; }
.hero-proof .ico { color: var(--green); font-size: 16px; }

/* hero demo — lesson / practice / game card stack (decorative) */
.hero-demo { position: relative; min-height: 460px; }
.demo-card {
  position: absolute; width: min(78%, 330px); background: #fff;
  border: 2px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--shadow-lg);
}
.demo-card.d-lesson  { top: 4%; left: 2%; --tilt: -4deg; transform: rotate(-4deg); }
.demo-card.d-practice{ top: 30%; right: 0; --tilt: 2deg; transform: rotate(2deg); z-index: 2; animation: floaty-soft 5s ease-in-out infinite; }
.demo-card.d-game    { bottom: 2%; left: 8%; --tilt: -2deg; transform: rotate(-2deg); }
.demo-chip {
  display: inline-block; font-family: var(--font-display); font-weight: 600; font-size: 11px;
  letter-spacing: 1px; text-transform: uppercase; padding: 5px 10px; border-radius: 8px; margin-bottom: 12px;
}
.demo-chip.c-lesson { background: var(--indigo-soft); color: var(--indigo); }
.demo-chip.c-practice { background: var(--amber-soft); color: var(--amber-ink); }
.demo-chip.c-game { background: var(--green-soft); color: var(--green-ink); }
.demo-card h3 { font-size: 20px; margin-bottom: 10px; }
.demo-lines { display: grid; gap: 8px; }
.demo-lines i { height: 9px; border-radius: 6px; background: var(--line); }
.demo-lines i:nth-child(1) { width: 92%; }
.demo-lines i:nth-child(2) { width: 72%; background: var(--line-2); }
.demo-lines i:nth-child(3) { width: 83%; }
.demo-q { font-weight: 800; font-size: 15px; color: var(--ink-2); margin: 0 0 10px; }
.demo-opts { display: grid; gap: 8px; }
.demo-opt {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 2px solid var(--line-2); border-radius: 12px; font-weight: 800; font-size: 14px; color: var(--ink-3);
}
.demo-opt .ico { font-size: 15px; }
.demo-opt.is-right { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); }
.demo-xp { display: inline-flex; align-items: center; gap: 7px; font-weight: 900; font-size: 15px; color: var(--amber-ink); }
.demo-xp .ico { color: var(--amber); font-size: 18px; }
.demo-owl { position: absolute; top: -4%; right: 6%; z-index: 3; width: 108px; height: 108px; }
.float-badge {
  position: absolute; z-index: 3; background: #fff; border-radius: 14px; padding: 8px 14px;
  font-weight: 900; font-size: 15px; box-shadow: 0 6px 14px rgba(20,20,60,.14);
  display: flex; align-items: center; gap: 6px;
}
.float-badge .ico { font-size: 17px; }
.fb-streak { bottom: 26%; right: 4%; color: var(--coral-ink); }
.fb-streak .ico { color: var(--coral); }

/* ============ MARQUEE (real course names) ============ */
.marquee {
  overflow: hidden; padding: 6px 0 clamp(28px,4vw,44px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; gap: 10px; width: max-content; animation: marquee 46s linear infinite; }
.marquee-row { display: flex; gap: 10px; padding-right: 10px; }
.marquee .chip { flex: none; }

/* ============ SUBJECTS (bento of six worlds) ============ */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.world-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 22px;
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out), border-color .16s var(--ease-out);
}
.world-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--wc, var(--indigo)); }
.world-card .badge {
  width: 52px; height: 52px; border-radius: 15px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 24px; color: #fff; background: var(--wc, var(--indigo));
  box-shadow: 0 4px 0 rgba(20,20,60,.18);
}
.world-card h3 { font-size: 21px; margin: 14px 0 4px; }
.world-card .wc-count { font-weight: 900; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted-3); margin-bottom: 8px; }
.world-card p { color: var(--muted-2); font-weight: 600; font-size: 15px; line-height: 1.5; margin: 0 0 14px; }
.world-card .topics { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.world-card .topics span { font-weight: 800; font-size: 12px; color: var(--ink-3); background: var(--bg-tint); border: 1px solid var(--line-2); padding: 5px 10px; border-radius: var(--r-pill); }
.world-card.is-flag { background: linear-gradient(135deg, var(--indigo-mist), #fff 60%); }
.world-card.is-flag .topics span { background: #fff; }

.w-languages { --wc: var(--languages); }
.w-maths     { --wc: var(--maths); }
.w-words     { --wc: var(--words); }
.w-science   { --wc: var(--science); }
.w-world     { --wc: var(--world); }
.w-logic     { --wc: var(--logic); }

/* ============ HOW IT WORKS (dotted path) ============ */
.howto { background: var(--bg-tint); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.howto-inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(36px,5.5vw,72px) clamp(16px,4vw,48px); }
.path { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(18px,3vw,36px); list-style: none; margin: 0; padding: 0; counter-reset: step; }
.path-step { position: relative; padding-top: 8px; }
.path-step::before {
  content: ""; position: absolute; top: 36px; left: calc(50% + 44px); width: calc(100% - 88px); height: 0;
  border-top: 3px dashed var(--line-2);
}
.path-step:last-child::before { display: none; }
.path-num {
  position: relative; z-index: 1; width: 60px; height: 60px; margin: 0 auto; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 24px; color: #fff;
  box-shadow: 0 5px 0 rgba(20,20,60,.16);
}
.path-step:nth-child(1) .path-num { background: var(--indigo); }
.path-step:nth-child(2) .path-num { background: var(--amber); color: var(--ink); }
.path-step:nth-child(3) .path-num { background: var(--green); }
.path-step h3 { font-size: 20px; text-align: center; margin: 16px 0 6px; }
.path-step p { color: var(--muted-2); font-weight: 600; font-size: 14.5px; line-height: 1.55; text-align: center; margin: 0 auto; max-width: 300px; }

/* ============ PROOF (alternating feature rows) ============ */
.proof-row { display: flex; flex-wrap: wrap; gap: clamp(22px,4vw,56px); align-items: center; margin-bottom: clamp(38px,5vw,80px); }
.proof-row:last-child { margin-bottom: 0; }
.proof-panel {
  flex: 1 1 340px; min-height: 320px; border-radius: 30px; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 28px;
}
.proof-panel .deco { position: absolute; border-radius: 50%; }
.proof-panel.p-indigo { background: var(--indigo); }
.proof-panel.p-green { background: var(--green); }
.proof-panel.p-amber { background: var(--amber); }
.proof-text { flex: 1 1 320px; padding: 4px clamp(4px,2vw,20px); }
.proof-text h3 { font-size: clamp(24px,3.4vw,34px); line-height: 1.12; margin: 0 0 12px; }
.proof-text p { font-size: 17px; color: var(--muted); font-weight: 600; line-height: 1.6; margin: 0 0 18px; }
.quote { display: flex; align-items: center; gap: 12px; padding-left: 14px; border-left: 3px solid var(--line-2); }
.quote p { font-weight: 700; font-size: 15px; color: var(--ink-2); margin: 0; line-height: 1.45; }
.quote .who { display: block; margin-top: 4px; color: var(--muted-3); font-weight: 800; font-size: 13px; }

/* in-panel illustrations */
.panel-card { background: #fff; border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-lg); width: min(84%, 320px); }
.panel-card .demo-q { margin-bottom: 10px; }
.panel-progress { display: grid; gap: 14px; }
.panel-progress .row { display: flex; align-items: center; gap: 10px; }
.panel-progress .code {
  width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .3px;
}
.panel-progress .meta { flex: 1; min-width: 0; display: block; }
.panel-progress .name { display: block; font-weight: 800; font-size: 13.5px; color: var(--ink-2); margin-bottom: 5px; }
.panel-progress .progress-track { display: block; margin-top: 0; height: 9px; }
.panel-progress .progress-fill { display: block; }
.fill-80 { width: 80%; } .fill-45 { width: 45%; } .fill-20 { width: 20%; }
.panel-ages { display: flex; align-items: flex-end; gap: 14px; }
.panel-ages .age {
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: #fff; color: var(--amber-ink); font-family: var(--font-display); font-weight: 600;
  box-shadow: var(--shadow-md);
}
.panel-ages .age:nth-child(1) { width: 64px; height: 64px; font-size: 22px; }
.panel-ages .age:nth-child(2) { width: 84px; height: 84px; font-size: 28px; }
.panel-ages .age:nth-child(3) { width: 64px; height: 64px; font-size: 22px; }

/* ============ PLANS TEASER (landing) ============ */
.grid-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(238px,1fr)); gap: 18px; align-items: stretch; }
.plan-card { position: relative; display: flex; flex-direction: column; border-radius: 22px; padding: 24px; background: #fff; color: var(--ink); border: 2px solid var(--line-2); }
.plan-card.is-popular { background: var(--indigo); color: #fff; border-color: var(--indigo); box-shadow: var(--shadow-lg); }
.plan-card .name { font-family: var(--font-display); font-weight: 600; font-size: 22px; }
.plan-card .price { margin: 8px 0 4px; }
.plan-card .price b { font-family: var(--font-display); font-weight: 600; font-size: 34px; font-variant-numeric: tabular-nums; }
.plan-card .per { font-weight: 700; opacity: .7; font-size: 14px; }
.plan-card .uses { font-weight: 800; font-size: 14px; opacity: .85; margin-bottom: 18px; }
.plan-card .btn { margin-top: auto; padding: 12px; font-weight: 900; }
.most-popular {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--amber); color: var(--ink); font-weight: 900; font-size: 12px;
  padding: 5px 14px; border-radius: var(--r-pill); letter-spacing: .4px; white-space: nowrap;
}
.plans-family-note { text-align: center; margin: 22px 0 0; font-weight: 700; color: var(--muted-2); }

/* ============ CLOSING CTA ============ */
.cta-panel {
  position: relative; overflow: hidden; text-align: center;
  background: var(--indigo); color: #fff; border-radius: 32px;
  padding: clamp(40px,6vw,72px) clamp(20px,5vw,64px);
  background-image: radial-gradient(rgba(255,255,255,.14) 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}
.cta-panel h2 { font-size: clamp(28px,4vw,44px); color: #fff; }
.cta-panel p { color: rgba(255,255,255,.88); font-weight: 600; font-size: 17px; max-width: 480px; margin: 14px auto 26px; }
.cta-panel .owl { margin: 0 auto 18px; }
.cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.fineprint { font-size: 14px; color: var(--muted-3); margin-top: 16px; font-weight: 700; }
.cta-panel .fineprint { color: rgba(255,255,255,.7); }

/* ============ FOOTER ============ */
.footer { background: var(--ink); color: #B7BAD6; padding: clamp(36px,5vw,56px) clamp(16px,4vw,48px) 28px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding-bottom: 26px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { margin: 10px 0 0; font-weight: 600; font-size: 14px; max-width: 300px; color: #8F93B8; line-height: 1.55; }
.footer .links { display: flex; gap: 6px 22px; flex-wrap: wrap; font-weight: 700; font-size: 14px; }
.footer .links a { padding: 6px 0; }
.footer .links a:hover { color: #fff; }
.footer-base { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 18px; font-weight: 700; font-size: 13px; color: #8F93B8; }

/* ============ PRICING PAGE ============ */
.pricing-head { max-width: 1080px; margin: 0 auto; padding: clamp(30px,5vw,60px) clamp(16px,4vw,40px) 0; text-align: center; }
.pricing-wrap { max-width: 1080px; margin: 0 auto; padding: clamp(26px,4vw,44px) clamp(16px,4vw,40px) clamp(28px,5vw,56px); }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); gap: 18px; align-items: stretch; }
.pricing-group { margin-bottom: clamp(26px,4vw,40px); }
.pricing-group:last-of-type { margin-bottom: 0; }
.group-label { display: flex; align-items: center; gap: 12px; font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: .8px; text-transform: uppercase; color: var(--muted-2); margin: 0 0 16px; }
.group-label::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.pricing-grid.solo { grid-template-columns: repeat(auto-fit, minmax(250px,1fr)); }
.pricing-grid.family { grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); max-width: 760px; }
.most-popular.value { background: var(--ink); color: #fff; }
.pricing-card {
  position: relative; display: flex; flex-direction: column;
  background: #fff; border: 2px solid var(--line-2); border-radius: var(--r-xl); padding: 28px 24px 24px;
  box-shadow: var(--shadow-sm);
  transition: transform .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pricing-card .name { font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.pricing-card .price { margin: 6px 0 2px; }
.pricing-card .price b { font-family: var(--font-display); font-weight: 600; font-size: 38px; font-variant-numeric: tabular-nums; }
.pricing-card .per { font-weight: 700; color: var(--muted-3); font-size: 15px; }
.pricing-card .uses { font-weight: 800; font-size: 14px; color: var(--indigo); margin: 4px 0 20px; }
.pricing-card .btn { margin-top: auto; }
.pricing-card.popular { background: var(--indigo); border-color: var(--indigo); color: #fff; box-shadow: var(--shadow-lg); }
.pricing-card.popular .per, .pricing-card.popular .uses { color: rgba(255,255,255,.82); }
.pricing-card.popular .feat { color: rgba(255,255,255,.94); }
.pricing-card.popular .feat .tick { background: rgba(255,255,255,.18); color: #fff; }
.feat-list { display: flex; flex-direction: column; gap: 11px; margin-bottom: 24px; }
.feat { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; color: var(--ink-3); }
.feat .tick { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green-ink); display: flex; align-items: center; justify-content: center; font-size: 12px; }
.tick svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }

.faq-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 18px; margin-top: clamp(30px,4vw,48px); }
.faq-item { background: var(--bg-tint); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.faq-item h3 { font-size: 17px; margin-bottom: 8px; }
.faq-item p { color: var(--muted); font-weight: 600; font-size: 14.5px; line-height: 1.6; margin: 0; }

.pricing-note { text-align: center; color: var(--muted-3); font-weight: 700; font-size: 13px; margin-top: 28px; }

/* ============ LEGAL PAGES ============ */
.legal-wrap { max-width: 760px; margin: 0 auto; padding: clamp(30px,5vw,60px) clamp(18px,4vw,32px) clamp(40px,6vw,72px); }
.legal-wrap h1 { font-size: clamp(30px,5vw,44px); margin: 6px 0 10px; }
.legal-meta { color: var(--muted-2); font-weight: 700; font-size: 15px; margin: 0 0 28px; line-height: 1.6; }
.legal-wrap h2 { font-size: clamp(19px,2.6vw,23px); margin: 30px 0 8px; }
.legal-wrap p { color: var(--ink-3); font-weight: 600; font-size: 16px; line-height: 1.7; margin: 0 0 12px; }
.legal-wrap a:not(.btn-link):not(.btn) { color: var(--indigo); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.legal-list { margin: 0 0 12px; padding-left: 22px; }
.legal-list li { color: var(--ink-3); font-weight: 600; font-size: 16px; line-height: 1.7; margin-bottom: 8px; }
.legal-list strong { color: var(--ink); }
.legal-back { margin-top: 34px; }

/* consent checkbox on signup */
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 18px; }
.consent-row input { flex: none; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--indigo); }
.consent-row span { font-weight: 700; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.consent-row a { color: var(--indigo); font-weight: 800; }
body[data-auth-mode="login"] .auth-signup-only { display: none; }

/* ============ AUTH ============ */
.auth { min-height: 100dvh; display: grid; grid-template-columns: repeat(auto-fit, minmax(330px,1fr)); }
.auth-aside {
  background: var(--indigo); color: #fff; padding: clamp(28px,5vw,56px);
  display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden;
  background-image: radial-gradient(rgba(255,255,255,.1) 1.5px, transparent 1.5px);
  background-size: 26px 26px;
}
.auth-aside .deco { position: absolute; border-radius: 50%; }
.auth-aside .deco.d1 { top: -50px; right: -50px; width: 220px; height: 220px; background: rgba(255,255,255,.1); }
.auth-aside .deco.d2 { bottom: -40px; left: -30px; width: 180px; height: 180px; background: rgba(255,255,255,.08); }
.auth-aside .back { position: absolute; top: 22px; left: 22px; color: #fff; opacity: .9; padding: 6px 10px 6px 6px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; border-radius: 10px; }
.auth-aside .back:hover { background: rgba(255,255,255,.12); opacity: 1; }
.auth-aside h2 { font-size: clamp(26px,3.6vw,36px); margin: 24px 0 10px; line-height: 1.1; color: #fff; }
.auth-aside p { font-weight: 600; font-size: 17px; opacity: .92; max-width: 380px; line-height: 1.5; margin: 0; }
.aside-ticks { list-style: none; margin: 22px 0 0; padding: 0; display: grid; gap: 12px; }
.aside-ticks li { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.aside-ticks .tick { flex: none; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: clamp(24px,5vw,56px); background: #fff; }
.auth-form { width: 100%; max-width: 380px; }
.auth-form h1 { font-size: 30px; margin: 0 0 6px; }
.auth-form .subtitle { color: var(--muted-2); font-weight: 600; margin: 0 0 26px; }
.auth-form .subtitle strong { color: var(--ink); }
.field-label { display: block; font-weight: 800; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field-label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.field-label-row .field-label { margin-bottom: 6px; }
.auth-link { font-size: 13px; white-space: nowrap; }
.field {
  width: 100%; padding: 14px 16px; border-radius: 14px; border: 2px solid var(--line-3);
  font-size: 16px; font-weight: 600; margin-bottom: 16px; outline: none;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.field:hover { border-color: var(--line-2); }
.field:focus { border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.field::placeholder { color: var(--muted-4); font-weight: 600; }
.auth-alt { text-align: center; color: var(--muted-2); font-weight: 700; font-size: 14px; margin: 20px 0 0; }
.auth-view[hidden], .auth-message[hidden], [hidden] { display: none !important; }
.auth-view { width: 100%; }
.auth-message { width: 100%; margin: 0 0 18px; padding: 12px 14px; border: 1px solid #F1B8B2; border-radius: 12px; background: #FFF1EF; color: #A7352B; font-weight: 800; font-size: 14px; line-height: 1.4; }
.auth-message[data-kind="success"] { border-color: #A8DEC4; background: #EAF8F1; color: #176642; }
.auth-submit { position: relative; }
.auth-spinner { display: none; width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: auth-spin .7s linear infinite; }
.auth-submit.is-loading .auth-spinner { display: inline-block; }
.btn-secondary { margin-top: 12px; background: var(--indigo-soft); color: var(--indigo); border: 2px solid transparent; }
.btn-secondary:hover { border-color: var(--indigo); }
.btn-secondary:active { transform: translateY(1px); }
body[data-auth-mode="signup"] .auth-login-only { display: none; }
.otp-code { text-align: center; font-family: var(--font-display); font-size: clamp(28px,8vw,38px); letter-spacing: .28em; font-variant-numeric: tabular-nums; padding-left: calc(16px + .28em); }
.field-help { color: var(--muted-3); font-size: 13px; font-weight: 700; margin: -8px 0 18px; }
.auth-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; }
.auth-actions .btn-link { font-size: 14px; }
.auth-actions .btn-link:disabled { color: var(--muted-4); cursor: not-allowed; text-decoration: none; }

/* ============ PROTECTED COURSE SHELL ============ */
.course-page { min-height: 100dvh; background: #F7F8FF; }
.course-loading { min-height: 100dvh; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted-2); font-weight: 900; }
.course-spinner { display: inline-block; color: var(--indigo); }
.course-shell { min-height: 100dvh; }
.course-nav { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px clamp(18px,4vw,48px); background: #fff; border-bottom: 1px solid var(--line); }
.course-placeholder { min-height: calc(100dvh - 76px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(34px,7vw,80px) 18px; }
.course-placeholder .pill { margin: 22px 0 14px; }
.course-placeholder h1 { font-size: clamp(32px,5vw,54px); max-width: 720px; margin: 0; }
.course-placeholder > p:not(.pill):not(.auth-message) { max-width: 570px; color: var(--muted-2); font-size: 17px; font-weight: 700; line-height: 1.6; margin: 14px 0 0; }
.course-identity { display: flex; flex-direction: column; gap: 3px; min-width: min(100%,320px); margin-top: 26px; padding: 15px 20px; background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--card-shadow); }
.course-identity strong { color: var(--ink); font-family: var(--font-display); font-size: 20px; }
.course-identity span { color: var(--muted-2); font-size: 14px; font-weight: 800; overflow-wrap: anywhere; }
.course-error { margin-top: 20px; max-width: 460px; }

/* ============ COURSE HOME (subject picker) ============ */
.nav-account { display: flex; align-items: center; gap: 14px; }
.nav-avatar {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--indigo-soft); color: var(--indigo);
  font-family: var(--font-display); font-weight: 600; font-size: 17px;
}
.nav-greet { font-weight: 900; font-size: 14px; color: var(--ink-2); }
.nav-greet span { color: var(--indigo); }
.plan-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); font-weight: 900; font-size: 12px; letter-spacing: .3px; background: var(--indigo-soft); color: var(--indigo); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* language picker */
.lang-picker { font-family: inherit; font-weight: 800; font-size: 13px; color: var(--ink-3); background: #fff; border: 2px solid var(--line-2); border-radius: 12px; padding: 8px 10px; cursor: pointer; }
.lang-picker:hover { border-color: var(--indigo); }
.lang-picker:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
.footer-lang { margin-top: 18px; }
.footer-lang label { font-weight: 800; font-size: 13px; color: #8F93B8; margin-right: 8px; }
.footer-lang .lang-picker { background: transparent; color: #B7BAD6; border-color: rgba(255,255,255,.2); }
@media (max-width: 520px) { .lang-picker { display: none; } .footer-lang .lang-picker { display: inline-block; } }

.course-home { max-width: 1080px; margin: 0 auto; padding: clamp(24px,4vw,44px) clamp(18px,4vw,40px) 90px; }
.home-greeting { margin: 0 0 6px; font-size: 13px; font-weight: 900; letter-spacing: .4px; text-transform: uppercase; color: var(--indigo); }
.home-title { font-size: clamp(28px,4.4vw,44px); }
.home-sub { color: var(--muted-2); font-weight: 700; font-size: 16px; margin: 8px 0 26px; max-width: 560px; }

.home-search {
  display: flex; gap: 8px; align-items: stretch; max-width: 600px; margin: 0 0 40px;
  padding: 7px; background: #fff; border: 2px solid var(--line-2); border-radius: 20px;
  box-shadow: var(--shadow-sm); transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.home-search:focus-within { border-color: var(--indigo); box-shadow: 0 0 0 4px var(--indigo-soft); }
.home-search input { flex: 1; min-width: 0; padding: 9px 12px; border: none; background: none; font-size: 16px; font-weight: 700; color: var(--ink); outline: none; }
.home-search input::placeholder { color: var(--muted-3); font-weight: 600; }
.home-search .btn { flex: none; }

.section-label { font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .6px; text-transform: uppercase; color: var(--muted-2); margin: 0 0 14px; }

/* ============ DASHBOARD ============ */
.dashboard { margin: 0 0 38px; }
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-card { background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; box-shadow: var(--shadow-sm); text-align: center; }
.stat-card strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: clamp(24px,4vw,34px); color: var(--indigo); font-variant-numeric: tabular-nums; }
.stat-card span { font-weight: 800; font-size: 12px; color: var(--muted-2); }
.dash-week { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 14px; padding: 12px 14px; background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.dash-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.dash-bar { width: 60%; min-height: 4px; border-radius: 6px 6px 0 0; background: var(--line-2); }
.dash-bar.has { background: var(--green); }
.dash-bar-label { font-weight: 800; font-size: 11px; color: var(--muted-3); }
.dash-empty { color: var(--muted-2); font-weight: 700; font-size: 14px; margin: 12px 0 0; }
@media (max-width: 560px) { .dash-grid { grid-template-columns: repeat(2, 1fr); } }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px,1fr)); gap: 16px; }
.subject-card {
  position: relative; text-align: left; display: flex; flex-direction: column; align-items: flex-start;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), border-color .14s var(--ease-out);
}
.subject-card:hover { transform: translateY(-4px); border-color: var(--sc, var(--line-2)); box-shadow: var(--shadow-md); }
.subject-card:active { transform: translateY(-1px); }
.subject-card .badge {
  width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 600; font-size: 26px; color: #fff;
  box-shadow: 0 4px 0 rgba(20,20,60,.16);
}
.subject-card .badge.two { font-size: 20px; }
.badge svg { width: 58%; height: 58%; color: #fff; }
.world-card .badge svg { width: 56%; height: 56%; color: #fff; }
.detail-head .badge svg { width: 56%; height: 56%; color: #fff; }
.subject-card h3 { font-size: 20px; margin: 14px 0 3px; }
.subject-card .sc-desc { font-weight: 600; font-size: 13.5px; color: var(--muted-2); line-height: 1.45; margin: 0 0 10px; }
.subject-card .count { font-weight: 900; font-size: 12px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted-3); margin-top: auto; }
.subject-card .chev { position: absolute; top: 22px; right: 20px; color: var(--muted-3); font-weight: 900; font-size: 18px; transition: transform .14s var(--ease-out), color .14s var(--ease-out); }
.subject-card:hover .chev { transform: translateX(3px); color: var(--indigo); }

.continue-wrap { margin-top: 44px; }
.resume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 14px; }
.resume-card {
  text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--shadow-sm); transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out);
}
.resume-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.resume-card .rc-top { display: flex; align-items: center; gap: 10px; }
.resume-card .rc-ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 900; letter-spacing: .3px; color: #fff; flex: none; }
.resume-card h4 { font-size: 16px; margin: 0; }
.resume-card .rc-sub { font-size: 12px; font-weight: 800; color: var(--muted-2); }
.resume-copy { margin: 13px 0 0; color: var(--muted-2); font-size: 13.5px; font-weight: 700; line-height: 1.45; }
.progress-track { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 14px; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--green); }
.resume-card .rc-pct { font-size: 12px; font-weight: 900; color: var(--green-ink); margin-top: 7px; }
.resume-action { display: inline-flex; align-items: center; justify-content: center; margin-top: 14px; min-height: 38px; padding: 9px 14px; border-radius: 12px; background: var(--indigo-soft); color: var(--indigo); font-weight: 900; font-size: 13px; }
.resume-action:hover { background: #E3E6FF; }

.empty-resume {
  grid-column: 1 / -1; display: flex; align-items: center; gap: 18px;
  background: #fff; border: 2px dashed var(--line-2); border-radius: var(--r-lg); padding: 22px;
  color: var(--muted-2); font-weight: 700; font-size: 15px; line-height: 1.6;
}
.empty-resume .er-owl { flex: none; width: 56px; height: 56px; position: relative; }
.empty-resume .er-title { display: block; font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink-2); margin-bottom: 2px; }

.detail-back { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; color: var(--ink-3); margin-bottom: 18px; padding: 8px 12px 8px 8px; border-radius: 12px; }
.detail-back:hover { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.detail-back .ico { font-size: 18px; }
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.detail-head .badge { width: 60px; height: 60px; border-radius: 17px; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 28px; color: #fff; flex: none; box-shadow: 0 4px 0 rgba(20,20,60,.16); }
.detail-head .badge.two { font-size: 22px; }
.detail-head h2 { font-size: clamp(24px,3.6vw,34px); }
.detail-desc { color: var(--muted-2); font-weight: 700; margin: 0 0 26px; max-width: 640px; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 12px; }
.course-tile {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-md); padding: 14px 16px;
  font-weight: 800; color: var(--ink-2); box-shadow: var(--shadow-sm);
  transition: transform .12s var(--ease-out), border-color .12s var(--ease-out), box-shadow .12s var(--ease-out);
}
.course-tile:hover { transform: translateY(-2px); border-color: var(--indigo); box-shadow: var(--shadow-md); }
.course-tile .ct-code { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 13px; letter-spacing: .3px; flex: none; }
.course-tile .ct-name { font-size: 14px; line-height: 1.25; }

.home-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; font-weight: 800; font-size: 15px; padding: 14px 22px;
  border-radius: 14px; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease-out), transform .2s var(--ease-out);
  z-index: 50; max-width: calc(100vw - 32px); text-align: center;
}
.home-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ LESSON PLAYER ============ */
.lesson-wrap { max-width: 680px; margin: 0 auto; padding: clamp(18px,4vw,36px) clamp(16px,4vw,32px) 90px; }
.lesson-top { display: flex; align-items: center; gap: 14px; margin-bottom: clamp(22px,4vw,38px); }
.lesson-quit { flex: none; width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--muted-2); background: #fff; border: 2px solid var(--line-2); }
.lesson-quit:hover { color: var(--coral-ink); border-color: var(--coral); }
.lesson-quit .ico { font-size: 18px; }
.lesson-progress { flex: 1; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.lesson-progress-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--green); transition: width .3s var(--ease-out); }
.hud { display: flex; align-items: center; gap: 8px; flex: none; }
.hud-chip { display: inline-flex; align-items: center; gap: 5px; font-weight: 900; font-size: 14px; padding: 6px 12px; border-radius: var(--r-pill); }
.hud-xp { background: var(--amber-soft); color: var(--amber-ink); } .hud-xp .ico { color: var(--amber); font-size: 16px; }
.hud-combo { background: var(--coral-soft); color: var(--coral-ink); }

.lesson-state { text-align: center; padding: clamp(40px,8vw,90px) 12px; color: var(--muted-2); font-weight: 700; }
.lesson-state p { margin: 14px 0 20px; font-size: 17px; }
.lesson-state .cta-row { justify-content: center; }

.q-card { background: #fff; border: 2px solid var(--line); border-radius: var(--r-xl); padding: clamp(22px,4vw,34px); box-shadow: var(--shadow-md); }
.q-kind { font-family: var(--font-display); font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted-3); margin: 0 0 12px; }
.q-prompt { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px,6vw,44px); color: var(--indigo); text-align: center; margin: 0 0 14px; letter-spacing: .5px; }
.q-stem { font-size: clamp(20px,3.4vw,26px); line-height: 1.3; margin: 0 0 22px; }
.choice-grid { display: grid; gap: 12px; }
.choice-btn { text-align: left; background: #fff; border: 2px solid var(--line-2); border-radius: var(--r-md); padding: 16px 18px; font-weight: 800; font-size: 16px; color: var(--ink-2); box-shadow: 0 3px 0 var(--line-2); transition: transform .08s var(--ease-out), border-color .1s, box-shadow .08s; }
.choice-btn:hover:not(:disabled) { border-color: var(--indigo); transform: translateY(-1px); }
.choice-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line-2); }
.choice-btn.dim { opacity: .45; }
.choice-btn.right { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); box-shadow: 0 3px 0 var(--green-deep); }
.choice-btn.wrong { border-color: var(--coral); background: var(--coral-soft); color: var(--coral-ink); box-shadow: 0 3px 0 var(--coral-deep); }

.scramble-slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 18px; min-height: 48px; }
.scramble-slot { width: 40px; height: 48px; border-bottom: 3px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 24px; color: var(--ink); }
.scramble-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px; }
.scramble-chip { width: 46px; height: 52px; border-radius: 12px; background: #fff; border: 2px solid var(--line-2); font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--ink-2); box-shadow: 0 3px 0 var(--line-2); }
.scramble-chip.used { visibility: hidden; }
.scramble-undo { display: block; margin: 0 auto; }

.flashcard-back { text-align: center; font-family: var(--font-display); font-weight: 600; font-size: clamp(24px,5vw,36px); color: var(--indigo); margin: 18px 0; }
.input-answer { display: flex; gap: 10px; }
.input-answer .field { margin-bottom: 0; flex: 1; }

.fb-panel { border-radius: var(--r-xl); padding: clamp(20px,4vw,30px); text-align: center; }
.fb-panel.is-right { background: var(--green-soft); }
.fb-panel.is-wrong { background: var(--coral-soft); }
.fb-head { font-family: var(--font-display); font-weight: 600; font-size: clamp(20px,3.4vw,26px); margin: 0 0 8px; }
.fb-panel.is-right .fb-head { color: var(--green-ink); }
.fb-panel.is-wrong .fb-head { color: var(--coral-ink); }
.fb-why { color: var(--ink-3); font-weight: 700; font-size: 15px; line-height: 1.5; margin: 0 0 18px; max-width: 520px; margin-inline: auto; }

.finish-screen { text-align: center; padding: clamp(24px,5vw,50px) 12px; }
.finish-screen .owl { margin: 0 auto 16px; }
.finish-screen h1 { font-size: clamp(28px,5vw,40px); margin: 0 0 22px; }
.finish-stats { display: flex; justify-content: center; gap: clamp(16px,4vw,40px); margin-bottom: 28px; }
.finish-stat { display: flex; flex-direction: column; }
.finish-stat strong { font-family: var(--font-display); font-weight: 600; font-size: clamp(30px,6vw,46px); color: var(--indigo); }
.finish-stat span { font-weight: 800; font-size: 13px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .4px; }
.finish-screen .cta-row { justify-content: center; }
.lesson-analysis { max-width: 620px; margin: 0 auto 24px; text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-sm); }
.lesson-analysis h2 { margin: 0 0 4px; font-size: 18px; }
.lesson-analysis p { margin: 0 0 12px; color: var(--muted-2); font-size: 13px; font-weight: 700; }
.ai-data-block { max-height: 280px; overflow: auto; margin: 0; padding: 12px; border-radius: 12px; background: #111827; color: #DFF7EA; font-size: 11px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

@media (max-width: 420px) {
  .scramble-chip { width: 40px; height: 46px; font-size: 19px; }
  .scramble-slot { width: 32px; }
  .input-answer { flex-direction: column; }
}

/* ============ GAMES / ARCADE ============ */
.games-wrap { max-width: 760px; margin: 0 auto; padding: clamp(20px,4vw,40px) clamp(16px,4vw,32px) 90px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 16px; margin-top: 22px; }
.game-card { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-sm); transition: transform .14s var(--ease-out), box-shadow .14s var(--ease-out), border-color .14s; }
.game-card:hover { transform: translateY(-4px); border-color: var(--indigo); box-shadow: var(--shadow-md); }
.game-code { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 17px; box-shadow: 0 4px 0 rgba(20,20,60,.16); }
.game-card h3 { font-size: 19px; margin: 14px 0 4px; }
.game-card p { color: var(--muted-2); font-weight: 600; font-size: 14px; line-height: 1.5; margin: 0; }

.game-hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.game-timer { font-family: var(--font-display); font-weight: 600; font-size: 26px; color: var(--indigo); font-variant-numeric: tabular-nums; }
.game-timer.low { color: var(--coral); }
.game-loading { text-align: center; color: var(--muted-2); font-weight: 700; padding: 40px 12px; }
#gameStage .q-prompt { margin-bottom: 20px; }
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.memory-card { min-height: 72px; border-radius: var(--r-md); border: 2px solid var(--line-2); background: var(--indigo-soft); color: var(--indigo); font-weight: 800; font-size: 14px; padding: 8px; box-shadow: 0 3px 0 var(--line-2); }
.memory-card.open { background: #fff; color: var(--ink-2); }
.memory-card.done { background: var(--green-soft); color: var(--green-ink); border-color: var(--green); box-shadow: 0 3px 0 var(--green-deep); }
.scramble-hint { text-align: center; font-weight: 800; color: var(--ink-2); font-size: 16px; margin: 0 0 16px; }
#gameResult { text-align: center; padding: clamp(20px,4vw,44px) 12px; }
#gameResult .owl { margin: 0 auto 14px; }
#gameResult h1 { font-size: clamp(26px,4.4vw,36px); margin: 0 0 20px; }
#gameResult .cta-row { justify-content: center; }
.arcade-link { display: flex; align-items: center; gap: 14px; margin-top: 42px; background: linear-gradient(135deg, var(--indigo-mist), #fff 60%); border: 2px solid var(--line); border-radius: var(--r-lg); padding: 18px 22px; box-shadow: var(--shadow-sm); transition: transform .14s var(--ease-out), box-shadow .14s; }
.arcade-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.arcade-link .game-code { flex: none; }
.arcade-link .al-text { flex: 1; }
.arcade-link h4 { font-size: 17px; margin: 0 0 2px; }
.arcade-link p { color: var(--muted-2); font-weight: 700; font-size: 13.5px; margin: 0; }
.arcade-link .chev { color: var(--muted-3); font-weight: 900; font-size: 20px; }
@media (max-width: 560px) { .memory-grid { grid-template-columns: repeat(3, 1fr); } }

/* ============ CHECKOUT ============ */
.checkout-card {
  display: flex; flex-direction: column; align-items: center;
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-xl);
  padding: clamp(28px,4vw,44px) clamp(22px,4vw,40px); margin-top: 26px;
  box-shadow: var(--shadow-md); max-width: 520px;
}
.checkout-card h1 { font-size: clamp(26px,3.6vw,34px); }
.checkout-card .pill { margin: 0 0 14px; }
.checkout-card p { max-width: 460px; color: var(--muted-2); font-size: 16px; font-weight: 700; line-height: 1.6; margin: 12px 0 0; }

/* ============ 404 ============ */
.lost { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: clamp(34px,7vw,80px) 18px; background: #F7F8FF; }
.lost .code { font-family: var(--font-display); font-weight: 700; font-size: clamp(64px,12vw,110px); letter-spacing: -3px; color: var(--indigo); line-height: 1; }
.lost h1 { font-size: clamp(24px,4vw,34px); margin: 10px 0 8px; }
.lost p { color: var(--muted-2); font-weight: 700; font-size: 16px; max-width: 420px; margin: 0 0 26px; line-height: 1.6; }
.lost .owl { margin-bottom: 18px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .bento { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero-copy .sub { margin-left: auto; margin-right: auto; }
  .hero-builder { margin-left: auto; margin-right: auto; }
  .hero-chips, .hero-proof { justify-content: center; }
  .hero-demo { min-height: 430px; max-width: 480px; margin: 8px auto 0; width: 100%; }
  .path { grid-template-columns: 1fr; gap: 26px; max-width: 420px; margin: 0 auto; }
  .path-step { display: grid; grid-template-columns: 60px 1fr; column-gap: 16px; align-items: start; text-align: left; padding-top: 0; }
  .path-step::before { top: 64px; left: 29px; width: 0; height: calc(100% - 56px); border-top: 0; border-left: 3px dashed var(--line-2); }
  .path-num { margin: 0; }
  .path-step h3, .path-step p { grid-column: 2; text-align: left; margin-left: 0; }
  .path-step h3 { margin-top: 6px; }
  .section-head { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 640px) {
  .bento { grid-template-columns: 1fr; }
  .world-card.is-wide { grid-column: auto; }
  .hero-builder { flex-direction: column; padding: 10px; }
  .hero-builder .btn { width: 100%; }
  .hero-builder input { padding: 8px 6px; text-align: center; }
  .home-search { flex-direction: column; padding: 10px; }
  .home-search .btn { width: 100%; }
  .home-search input { text-align: center; padding: 8px 6px; }
  .footer-top { flex-direction: column; }
}
@media (max-width: 520px) {
  .hero-copy h1 { letter-spacing: -1px; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { min-height: 260px; padding-top: 72px; }
  .auth-main { align-items: flex-start; }
  .otp-code { letter-spacing: .2em; padding-left: calc(16px + .2em); }
  .nav-greet { display: none; }
  .nav-account { gap: 10px; }
  .plan-badge { display: none; }
  .course-nav { padding-left: 14px; padding-right: 14px; }
  .hero-demo { min-height: 380px; }
  .demo-owl { width: 84px; height: 84px; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .floaty, .owl .eye, .demo-card, .marquee-track { animation: none !important; }
  .sb-reveal [data-reveal] { opacity: 1; transform: none; }
}
