/* Studyfin — modern, flashy design system */

:root {
  --bg: #fafaff;
  --bg-deep: #0b0b1a;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --ink: #0b0b1a;
  --ink-soft: #2a2b3d;
  --muted: #6b7280;
  --border: #ececf4;

  --brand-1: #7c3aed;
  --brand-2: #ec4899;
  --brand-3: #06b6d4;
  --accent: #f59e0b;
  --success: #10b981;
  --danger:  #ef4444;

  --grad-primary: linear-gradient(135deg, #7c3aed 0%, #ec4899 50%, #f97316 100%);
  --grad-cool:    linear-gradient(135deg, #06b6d4 0%, #6366f1 100%);
  --grad-warm:    linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 18px 60px rgba(124, 58, 237, 0.35);

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Decorative background blobs === */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}
.bg-orbs::before, .bg-orbs::after {
  content: "";
  position: absolute;
  width: 520px; height: 520px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite alternate;
}
.bg-orbs::before {
  background: radial-gradient(circle at 30% 30%, #ec4899, transparent 70%);
  top: -120px; left: -120px;
}
.bg-orbs::after {
  background: radial-gradient(circle at 60% 60%, #6366f1, transparent 70%);
  bottom: -180px; right: -180px;
  animation-delay: -6s;
}
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(60px, 40px) scale(1.1); }
}

/* === Nav === */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(20px, 4vw, 40px);
  background: rgba(255,255,255,0.7);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand img.logo { width: 30px; height: 30px; display: block; }
.brand .mark {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand .dot { color: var(--brand-2); }
.nav .who { color: var(--muted); font-size: 14px; }

/* === Container === */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 36px);
}
.container.narrow { max-width: 760px; }
.container.wide   { max-width: 1240px; }

/* === Hero === */
.hero {
  text-align: center;
  padding: clamp(56px, 8vw, 110px) 24px 36px;
}
.hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124, 58, 237, 0.1);
  color: #6d28d9;
  border: 1px solid rgba(124, 58, 237, 0.2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0 0 18px;
}
.hero h1 .grad {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-block;
}
.hero p.lead {
  color: var(--muted);
  font-size: clamp(16px, 2vw, 19px);
  max-width: 680px;
  margin: 0 auto 36px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; }

.btn-primary {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.btn-primary:hover { filter: brightness(1.05); box-shadow: 0 22px 70px rgba(236, 72, 153, 0.45); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: var(--surface-2); }

.btn-google {
  background: #fff;
  border: 1px solid var(--border);
  color: #3c4043;
  font-weight: 600;
  width: 100%;
}
.btn-google img { width: 18px; height: 18px; }

.btn-lg { padding: 14px 22px; font-size: 16px; border-radius: 14px; }
.btn-full { width: 100%; }

/* === Cards === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  position: relative;
}
.card.tight { padding: 22px; }
.card.lift { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.card.lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

/* === Role chooser cards === */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 720px) { .role-grid { grid-template-columns: 1fr; } }

.role-card {
  padding: 36px 28px;
  text-align: left;
  position: relative;
  overflow: hidden;
  cursor: default;
}
.role-card .icon {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 16px;
  font-size: 28px;
  color: #fff;
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
.role-card.student .icon { background: var(--grad-primary); }
.role-card.parent  .icon { background: var(--grad-cool); }
.role-card h3 { margin: 0 0 6px; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.role-card p  { color: var(--muted); margin: 0 0 22px; font-size: 14px; }

/* === Feature strip === */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 56px;
}
@media (max-width: 800px) { .features { grid-template-columns: 1fr; } }
.feature {
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.feature .badge { font-size: 22px; }
.feature h4 { margin: 8px 0 4px; font-size: 16px; }
.feature p  { color: var(--muted); margin: 0; font-size: 14px; line-height: 1.5; }

/* === Subject tiles === */
.subjects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}
.subject-tile {
  position: relative;
  border-radius: var(--r-lg);
  padding: 22px 20px 20px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  border: none;
  background: var(--grad-primary);
  text-align: left;
  font-family: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 130px;
  box-shadow: var(--shadow-md);
}
.subject-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.subject-tile .emoji { font-size: 30px; }
.subject-tile .name {
  font-weight: 700;
  font-size: 18px;
  margin-top: 8px;
  letter-spacing: -0.01em;
}
.subject-tile .count {
  position: absolute;
  bottom: 14px; right: 16px;
  font-size: 12px;
  opacity: 0.85;
}

/* === Forms === */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}
.form-row label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.form-row input,
.form-row select,
.form-row textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 15px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-row input:focus,
.form-row select:focus {
  outline: none;
  border-color: var(--brand-1);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
}
.id-input {
  font-feature-settings: "tnum";
  letter-spacing: 0.3em;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

/* === Status === */
.status {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 14px;
  margin-top: 14px;
  display: none;
}
.status.show { display: block; }
.status.err { background: #fef2f2; color: #b91c1c; }
.status.ok  { background: #ecfdf5; color: #047857; }
.status.warn{ background: #fff7ed; color: #c2410c; }

/* === Section titles === */
.section-title {
  margin: 32px 0 14px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 60px 24px 80px;
  color: var(--muted);
  font-size: 13px;
}
.staff-link {
  display: inline-block;
  margin-top: 10px;
  color: var(--muted);
}

/* === Dashboard header === */
.dash-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 24px 0 28px;
}
.dash-header h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.02em;
  font-weight: 800;
}

/* === Placeholder === */
.placeholder {
  border: 1px dashed var(--border);
  background: rgba(255,255,255,0.6);
  border-radius: var(--r-lg);
  padding: 56px 28px;
  text-align: center;
  color: var(--muted);
}

/* === Tables === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-2);
}

/* === Badges === */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(124,58,237,0.1);
  color: #6d28d9;
}
.badge.linked  { background: rgba(16,185,129,0.12); color: #047857; }
.badge.pending { background: rgba(245,158,11,0.14); color: #b45309; }
.badge.mastered{ background: var(--grad-primary); color: white; }
.badge.work    { background: rgba(245,158,11,0.18); color: #b45309; }

/* === Tile list (parent dashboard) === */
.tile-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
}
.tile .name { font-weight: 700; margin-bottom: 4px; }
.tile .meta { color: var(--muted); font-size: 13px; }

/* === Subtle text === */
.subtle  { color: var(--muted); font-size: 13px; }
.empty   { color: var(--muted); font-size: 14px; font-style: italic; }

/* === Learn UI === */
.learn-shell {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 22px;
}
@media (max-width: 900px) { .learn-shell { grid-template-columns: 1fr; } }

.lesson-card {
  position: relative;
}
.lesson-card h2 {
  margin: 4px 0 10px;
  font-size: 26px;
  letter-spacing: -0.02em;
  font-weight: 800;
}
.lesson-card .pillrow {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  border: 1px solid var(--border);
}
.pill.brand { background: rgba(124,58,237,0.1); color: #6d28d9; border-color: rgba(124,58,237,0.18); }
.pill.warn  { background: rgba(245,158,11,0.12); color: #b45309; border-color: rgba(245,158,11,0.2); }

.lesson-body p { margin: 0 0 12px; }

.svg-frame {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #ffffff 0%, #f7f7fc 100%);
  padding: 12px;
  margin: 16px 0;
  display: flex;
  justify-content: center;
}
.svg-frame svg { max-width: 100%; height: auto; }
.svg-frame.inline {
  margin: 10px 0 18px;
  padding: 10px;
  background: linear-gradient(180deg, #fafbff 0%, #f3f4fb 100%);
}
.svg-frame.inline svg { max-height: 260px; width: 100%; }
.svg-frame.inline svg * { transform-box: fill-box; }

.lesson-block { margin-bottom: 8px; position: relative; }
.lesson-block p { margin: 0 0 8px; }

.lesson-image {
  margin: 10px 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #fafbff 0%, #f3f4fb 100%);
  overflow: hidden;
}
.lesson-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
}
.lesson-image .img-attr {
  font-size: 11px;
  color: var(--muted);
  padding: 6px 10px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.lesson-image img {
  animation: imgZoomIn 600ms ease-out;
}
@keyframes imgZoomIn {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}

/* === Sequential block reveal === */
.lesson-card .lesson-block,
.lesson-card .worked {
  opacity: 0;
  animation: blockSlideIn 480ms cubic-bezier(.2,.9,.3,1) forwards;
}
.lesson-card .lesson-block:nth-child(1) { animation-delay:   60ms; }
.lesson-card .lesson-block:nth-child(2) { animation-delay:  220ms; }
.lesson-card .lesson-block:nth-child(3) { animation-delay:  380ms; }
.lesson-card .lesson-block:nth-child(4) { animation-delay:  540ms; }
.lesson-card .lesson-block:nth-child(5) { animation-delay:  700ms; }
.lesson-card .lesson-block:nth-child(6) { animation-delay:  860ms; }
.lesson-card .worked                     { animation-delay: 1000ms; }
@keyframes blockSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* === Mascot mentor === */
.mascot {
  position: absolute;
  bottom: 16px;
  right: 16px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  z-index: 4;
  pointer-events: none;
  max-width: 280px;
}
.mascot-speech {
  background: var(--surface);
  padding: 9px 14px;
  border-radius: 18px 18px 18px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative;
  animation: speechIn 380ms cubic-bezier(.2,.9,.3,1);
  pointer-events: auto;
}
.mascot-speech::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 8px;
  border: 7px solid transparent;
  border-left-color: var(--surface);
}
.mascot-body {
  font-size: 40px;
  line-height: 1;
  animation: bob 2.6s ease-in-out infinite;
  transition: transform 0.3s ease;
}
.mascot.cheer .mascot-body { animation: cheerJump 0.6s ease-in-out 2; }
.mascot.encourage .mascot-body { animation: tilt 0.6s ease-in-out 2; }
@keyframes bob       { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes cheerJump { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px) scale(1.18); } }
@keyframes tilt      { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-15deg); } }
@keyframes speechIn  { from { opacity: 0; transform: translateY(8px) scale(0.92); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 720px) {
  .mascot { bottom: 8px; right: 8px; max-width: 200px; }
  .mascot-body { font-size: 32px; }
  .mascot-speech { font-size: 11px; padding: 6px 10px; }
}

/* === Step-by-step worked example === */
.worked .step-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.worked .step-row.visible {
  opacity: 1;
  transform: translateY(0);
}
.worked .step-row:last-child { border-bottom: none; }
.worked .step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}
.worked .step-body { flex: 1; font-size: 14.5px; line-height: 1.5; }
.worked .reveal-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}
.worked .reveal-progress {
  flex: 1;
  height: 5px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.worked .reveal-progress > div {
  height: 100%;
  background: var(--grad-primary);
  width: 0;
  transition: width 0.4s ease;
}

/* === Quiz options stagger + satisfying pick feedback === */
.q-opt {
  opacity: 0;
  animation: optIn 350ms ease-out forwards;
  transition: transform 0.12s ease, box-shadow 0.2s ease, border-color 0.15s ease, background 0.15s ease;
}
.q-opt:nth-child(1) { animation-delay:  80ms; }
.q-opt:nth-child(2) { animation-delay: 180ms; }
.q-opt:nth-child(3) { animation-delay: 280ms; }
.q-opt:nth-child(4) { animation-delay: 380ms; }
@keyframes optIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: translateX(0); } }
.q-opt.picked { transform: scale(1.02); box-shadow: 0 6px 20px rgba(124,58,237,0.25); }
.q-opt.correct { animation: optCorrect 0.6s ease; }
.q-opt.wrong   { animation: optWrong   0.5s ease; }
@keyframes optCorrect {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateY(-3px) scale(1.03); }
  50% { transform: translateY(0) scale(1); }
}
@keyframes optWrong {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Sound mute toggle in nav */
.sfx-toggle {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-soft);
  transition: background 0.15s ease, color 0.15s ease;
}
.sfx-toggle:hover { background: var(--surface-2); }
.sfx-toggle.muted { color: var(--muted); }

/* === Listen / TTS controls === */
.listen-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(124,58,237,0.06), rgba(6,182,212,0.06));
  border: 1px solid rgba(124,58,237,0.18);
  border-radius: var(--r-md);
  margin: 10px 0 18px;
}
.listen-row .label {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.btn-listen {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-listen:hover  { border-color: var(--brand-1); color: var(--brand-1); }
.btn-listen.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(124,58,237,0.4);
}
.btn-listen.active .icon { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.btn-listen-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.btn-listen-mini:hover { border-color: var(--brand-1); color: var(--brand-1); }
.btn-listen-mini.active {
  background: var(--brand-1);
  border-color: var(--brand-1);
  color: #fff;
  animation: pulse 1.4s ease-in-out infinite;
}

.speed-select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

/* ============================================================
   Chatbot widget
   ============================================================ */
.chat-widget {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 70;
  font-family: inherit;
}
.chat-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  border: none;
  background: var(--grad-primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-glow);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.chat-toggle:hover { transform: translateY(-2px); }
.chat-toggle-icon { font-size: 18px; }
@media (max-width: 540px) {
  .chat-toggle-label { display: none; }
  .chat-toggle { padding: 14px; }
}

.chat-panel {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: chatSlide 0.22s ease;
}
@keyframes chatSlide {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--grad-primary);
  color: #fff;
}
.chat-header strong { font-size: 15px; }
.chat-subtitle { font-size: 11.5px; opacity: 0.85; letter-spacing: 0.02em; }
.chat-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
}
.chat-close:hover { background: rgba(255,255,255,0.28); }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #fafbff 0%, #ffffff 60%);
}
.chat-msg {
  max-width: 86%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--grad-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg-assistant {
  align-self: flex-start;
  background: var(--surface-2);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.chat-msg-assistant a {
  color: var(--brand-1);
  text-decoration: underline;
}
.chat-msg-assistant ul { margin: 6px 0; padding-left: 18px; }
.chat-msg-assistant li { margin-bottom: 2px; }
.chat-msg-assistant strong { font-weight: 700; }

.chat-typing { padding: 12px 14px; }
.chat-typing span {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--muted);
  margin-right: 3px;
  animation: chatDot 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes chatDot {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30%           { opacity: 1;    transform: translateY(-3px); }
}

.chat-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-self: flex-start;
  margin-top: 4px;
}
.chat-quick {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s ease;
}
.chat-quick:hover { border-color: var(--brand-1); color: var(--brand-1); }

.chat-actions-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}
.chat-link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0;
}
.chat-link:hover { color: var(--brand-1); }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.chat-input-row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font: inherit;
  font-size: 14px;
}
.chat-input-row input:focus {
  outline: none;
  border-color: var(--brand-1);
  background: #fff;
}
.chat-send {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--grad-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.chat-send:hover  { filter: brightness(1.08); }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Currently-being-read paragraph */
.lesson-block.reading,
.q-prompt.reading {
  background: linear-gradient(90deg, rgba(124,58,237,0.08), transparent);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  margin-left: -10px;
  transition: background 0.3s ease;
}
.worked .step-row.reading {
  background: linear-gradient(90deg, rgba(124,58,237,0.10), transparent);
  border-radius: var(--r-sm);
  transition: background 0.3s ease;
}
.worked .step-row.reading .step-num {
  box-shadow: 0 0 0 3px rgba(124,58,237,0.25);
}

/* ============================================================
   Pricing
   ============================================================ */
.bill-toggle {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin: 0 auto 36px;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.bill-toggle button {
  background: transparent;
  border: none;
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 999px;
  transition: color 0.15s ease;
}
.bill-toggle button.active {
  background: var(--grad-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.bill-toggle .save {
  display: inline-block;
  background: rgba(16,185,129,0.15);
  color: #047857;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 6px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 1100px) { .tier-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .tier-grid { grid-template-columns: 1fr; } }

.tier {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  overflow: hidden;
}
.tier::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 60% at 100% 0%, rgba(124,58,237,0.06), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.tier:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: rgba(124,58,237,0.25); }
.tier:hover::before { opacity: 1; }
.tier.popular {
  border-color: transparent;
  background:
    linear-gradient(rgba(255,255,255,0.95), rgba(255,255,255,0.95)) padding-box,
    var(--grad-primary) border-box;
  border: 2px solid transparent;
  box-shadow: var(--shadow-glow);
}
.tier.popular::before {
  background: radial-gradient(120% 60% at 100% 0%, rgba(236,72,153,0.10), transparent 70%);
  opacity: 1;
}
.tier .badge-top {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad-primary);
  color: #fff;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tier h3 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.01em; }
.tier .tag-line { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.tier .price {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-bottom: 6px;
}
.tier .price .num {
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tier .price .per { color: var(--muted); font-size: 14px; }
.tier .price.custom .num { font-size: 28px; }
.tier .price-note { color: var(--muted); font-size: 13px; margin-bottom: 18px; min-height: 18px; }
.tier ul { list-style: none; padding: 0; margin: 0 0 22px; font-size: 14px; }
.tier ul li {
  padding: 6px 0 6px 26px;
  position: relative;
  color: var(--ink-soft);
  line-height: 1.45;
}
.tier ul li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 6px;
  width: 18px; height: 18px;
  display: grid; place-items: center;
  background: rgba(16,185,129,0.15);
  color: #047857;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}
.tier ul li.no::before { content: "—"; background: var(--surface-2); color: var(--muted); }
.tier ul li.star::before { content: "★"; background: rgba(245,158,11,0.18); color: #b45309; }
.tier .cta { margin-top: auto; }

/* Comparison table */
.comp-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-x: auto;
}
.comp-wrap table { min-width: 720px; }
.comp-wrap th, .comp-wrap td { padding: 14px 18px; vertical-align: middle; font-size: 14px; }
.comp-wrap th { background: var(--surface-2); }
.comp-wrap th.col-q { background: var(--grad-primary); color: #fff; text-align: center; }
.comp-wrap td.col-q { text-align: center; font-weight: 700; color: #6d28d9; }
.comp-wrap td.check { text-align: center; color: var(--success); font-weight: 700; }
.comp-wrap td.cross { text-align: center; color: var(--muted); }
.comp-wrap td.note { text-align: center; font-weight: 600; color: var(--ink-soft); }

.worked {
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 16px 18px;
  border-left: 4px solid var(--brand-1);
}
.worked h4 { margin: 0 0 8px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.worked ol { margin: 0; padding-left: 22px; }
.worked ol li { margin-bottom: 4px; }

/* === Quiz === */
.quiz-card { padding: 28px; }
.quiz-progress {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.qbar {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 22px;
}
.qbar > div {
  height: 100%;
  background: var(--grad-primary);
  transition: width 0.4s ease;
}
.q-prompt {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: -0.01em;
}
.q-options { display: grid; gap: 10px; }
.q-opt {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 14px 16px;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: all 0.12s ease;
}
.q-opt:hover { border-color: var(--brand-1); transform: translateY(-1px); }
.q-opt.picked { border-color: var(--brand-1); background: rgba(124,58,237,0.08); }
.q-opt.correct { border-color: var(--success); background: rgba(16,185,129,0.1); }
.q-opt.wrong   { border-color: var(--danger);  background: rgba(239,68,68,0.08); }
.q-opt[disabled] { cursor: default; }

/* === Result === */
.score-hero {
  text-align: center;
  padding: 40px 24px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  box-shadow: var(--shadow-glow);
}
.score-hero .num {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}
.score-hero .label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  opacity: 0.85;
}

.result-row {
  display: flex;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-row .ico {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.ico.ok { background: var(--success); }
.ico.no { background: var(--danger);  }

/* === Sidebar (right column) === */
.side h4 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.side ul { padding-left: 18px; margin: 0; color: var(--ink-soft); font-size: 14px; }
.side ul li { margin-bottom: 6px; }

/* === Progress (parent) === */
.progress-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.progress-card {
  position: relative;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}
.progress-card .bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  margin-top: 10px;
  overflow: hidden;
}
.progress-card .bar > div {
  height: 100%;
  background: var(--grad-primary);
}

/* === Modal === */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(11,11,26,0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: var(--r-xl);
  max-width: 460px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
}

/* === Loader === */
.loader {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(124,58,237,0.25);
  border-top-color: var(--brand-1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-block {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: var(--surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}

/* === Confetti / sparkle === */
.confetti { position: fixed; pointer-events: none; inset: 0; z-index: 90; }

/* === Utility === */
.hide { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack-12 > * + * { margin-top: 12px; }
.stack-20 > * + * { margin-top: 20px; }

/* ============================================================
   Landing-page-only enhancements (marketing sections)
   ============================================================ */

/* Hero — rotating phrase + shimmer */
.hero .grad {
  background-size: 200% 200%;
  animation: gradShift 8s ease infinite;
}
@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}

.cycle {
  display: inline-block;
  position: relative;
  min-width: 7ch;
  text-align: left;
  vertical-align: bottom;
}
.cycle span {
  display: inline-block;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: cycleIn 600ms ease both;
}
@keyframes cycleIn {
  from { opacity: 0; transform: translateY(14px) rotateX(40deg); }
  to   { opacity: 1; transform: translateY(0)    rotateX(0); }
}

.hero-cta { display: inline-flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.hero-meta {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}
.hero-meta .dotsep { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.5; }

/* Subject marquee row */
.marquee {
  margin: 48px 0 0;
  padding: 14px 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee .track {
  display: inline-flex;
  gap: 14px;
  white-space: nowrap;
  animation: scrollX 40s linear infinite;
}
.marquee:hover .track { animation-play-state: paused; }
.marquee .chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.marquee .chip .e { font-size: 18px; }
@keyframes scrollX {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Section heading */
.section {
  padding: clamp(60px, 9vw, 110px) 0;
}
.section.gradient {
  background:
    radial-gradient(1200px 400px at 0% 0%,   rgba(124,58,237,0.10), transparent 60%),
    radial-gradient(1000px 400px at 100% 100%, rgba(236,72,153,0.10), transparent 60%);
}
.section-head { text-align: center; max-width: 700px; margin: 0 auto 48px; padding: 0 20px; }
.section-head .eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(6,182,212,0.1);
  color: #0e7490;
  border: 1px solid rgba(6,182,212,0.25);
  padding: 5px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: clamp(28px, 4.4vw, 48px);
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 12px;
  line-height: 1.1;
}
.section-head .grad {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-head p {
  color: var(--muted);
  font-size: clamp(15px, 1.6vw, 18px);
  margin: 0 auto;
  max-width: 600px;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* Live demo (3 cards: lesson, quiz, mastered) */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1000px) { .demo-grid { grid-template-columns: 1fr; } }

.demo-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.demo-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.demo-card .tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 12px; font-weight: 700;
  color: var(--ink-soft);
  align-self: flex-start;
}
.demo-card.demo-lesson .tag    { background: rgba(124,58,237,0.1); color: #6d28d9; }
.demo-card.demo-quiz .tag      { background: rgba(6,182,212,0.1); color: #0e7490; }
.demo-card.demo-result .tag    { background: rgba(16,185,129,0.12); color: #047857; }

.demo-card h3 { margin: 0; font-size: 19px; letter-spacing: -0.01em; }
.demo-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.demo-card .demo-svg {
  background: linear-gradient(180deg, #fff, #f7f7fc);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: grid; place-items: center;
}
.demo-card .demo-svg svg { max-width: 100%; height: auto; }

/* Repeating SVG step animation (auto-loop for marketing) */
.demo-svg svg .step {
  opacity: 0;
  transform-origin: center;
  animation: stepIn 4.8s linear infinite both;
}
.demo-svg svg .step:nth-child(1) { animation-delay: 0s; }
.demo-svg svg .step:nth-child(2) { animation-delay: 0.8s; }
.demo-svg svg .step:nth-child(3) { animation-delay: 1.6s; }
.demo-svg svg .step:nth-child(4) { animation-delay: 2.4s; }
.demo-svg svg .step:nth-child(5) { animation-delay: 3.2s; }
@keyframes stepIn {
  0%   { opacity: 0; transform: translateY(6px) scale(0.96); }
  6%   { opacity: 1; transform: translateY(0)   scale(1); }
  80%  { opacity: 1; }
  92%  { opacity: 0.95; }
  100% { opacity: 0; }
}

/* Mini quiz mock */
.mock-q { display: grid; gap: 8px; margin-top: 4px; }
.mock-q .opt {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  background: var(--surface);
}
.mock-q .opt.wrong  { border-color: var(--danger); background: rgba(239,68,68,0.06); color: #b91c1c; position: relative; }
.mock-q .opt.right  { border-color: var(--success); background: rgba(16,185,129,0.08); color: #047857; }
.mock-q .opt.wrong::after { content: "✗"; position: absolute; right: 12px; }
.mock-q .opt.right::after { content: "✓"; position: absolute; right: 12px; }

.mini-score {
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--r-md);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow-glow);
}
.mini-score .num { font-size: 44px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.mini-score .lbl { text-transform: uppercase; font-size: 11px; opacity: 0.85; letter-spacing: 0.1em; margin-top: 4px; }

.arrow {
  display: grid; place-items: center;
  font-size: 28px; color: var(--brand-2);
  animation: arrowPulse 2.4s ease-in-out infinite;
}
@keyframes arrowPulse {
  0%, 100% { transform: translateX(0); opacity: 0.7; }
  50%      { transform: translateX(6px); opacity: 1; }
}

/* How it works — 3-step flow */
.flow {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  position: relative;
}
@media (max-width: 900px) { .flow { grid-template-columns: 1fr; } }
.flow-step {
  background: var(--surface);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.flow-step::before {
  content: attr(data-step);
  position: absolute;
  top: 18px; right: 22px;
  font-size: 64px; font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: 0.18;
  line-height: 1;
}
.flow-step h3 { margin: 0 0 8px; font-size: 19px; letter-spacing: -0.01em; }
.flow-step p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.flow-step .icon {
  width: 44px; height: 44px;
  background: var(--grad-primary);
  border-radius: 12px;
  display: grid; place-items: center;
  color: #fff; font-size: 22px;
  margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(124,58,237,0.25);
}

/* Personas / use cases */
.personas {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 900px) { .personas { grid-template-columns: 1fr; } }

.persona {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  position: relative;
  overflow: hidden;
}
.persona .avatar {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid; place-items: center;
  font-size: 32px;
  color: #fff;
  margin-bottom: 14px;
}
.persona.maya  .avatar { background: var(--grad-primary); }
.persona.alex  .avatar { background: var(--grad-cool); }
.persona.dana  .avatar { background: var(--grad-warm); }
.persona h3 { margin: 0 0 6px; font-size: 19px; letter-spacing: -0.01em; }
.persona .meta { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.persona blockquote {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.5;
  border-left: 3px solid var(--brand-1);
  padding-left: 14px;
}
.persona ul { padding-left: 18px; margin: 14px 0 0; font-size: 14px; color: var(--ink-soft); }
.persona ul li { margin-bottom: 6px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  text-align: center;
}
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.stat .n {
  font-size: clamp(34px, 4.5vw, 52px);
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
  line-height: 1;
}
.stat .l { color: var(--muted); font-size: 14px; margin-top: 6px; }

/* Comparison table */
.compare {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.compare table { width: 100%; }
.compare th, .compare td { padding: 14px 18px; vertical-align: top; }
.compare th { background: var(--surface-2); font-weight: 700; color: var(--ink); text-transform: none; letter-spacing: 0; font-size: 14px; }
.compare th.col-q { background: var(--grad-primary); color: #fff; }
.compare td.has  { color: var(--success); font-weight: 700; }
.compare td.no   { color: var(--muted); }

/* CTA panel */
.cta-panel {
  position: relative;
  border-radius: var(--r-xl);
  padding: 56px clamp(24px, 4vw, 56px);
  background: var(--grad-primary);
  color: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-glow);
}
.cta-panel::before, .cta-panel::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.35;
  pointer-events: none;
}
.cta-panel::before { width: 360px; height: 360px; background: #fff; top: -120px; right: -120px; }
.cta-panel::after  { width: 280px; height: 280px; background: #06b6d4; bottom: -100px; left: -80px; }
.cta-panel h2 {
  font-size: clamp(28px, 4.6vw, 44px);
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  font-weight: 800;
  position: relative;
}
.cta-panel p {
  margin: 0 0 28px;
  font-size: 17px;
  opacity: 0.92;
  position: relative;
  max-width: 560px;
}
.cta-panel .btn-light {
  background: #fff;
  color: var(--ink);
  border: none;
  box-shadow: 0 10px 28px rgba(0,0,0,0.18);
  position: relative;
}
.cta-panel .btn-light:hover { transform: translateY(-1px); }
.cta-panel .btn-clear {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  position: relative;
}

/* FAQ */
.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 10px; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 6px 18px;
  transition: box-shadow 0.2s ease;
}
.faq details[open] { box-shadow: var(--shadow-md); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 0;
  font-weight: 700;
  font-size: 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 22px;
  color: var(--brand-1);
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
}

/* Floating mini badges (hero decoration) */
.float-badges {
  position: relative;
  margin: 32px auto 0;
  width: 100%;
  max-width: 560px;
  height: 56px;
}
.float-badges .fb {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  animation: bob 6s ease-in-out infinite;
}
.float-badges .fb.b1 { left: 0%;   top: 0;   animation-delay: 0s; }
.float-badges .fb.b2 { left: 32%;  top: 30px; animation-delay: -1.6s; }
.float-badges .fb.b3 { left: 64%;  top: -4px; animation-delay: -3s; }
.float-badges .fb.b4 { left: 84%;  top: 24px; animation-delay: -4.4s; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
@media (max-width: 700px) { .float-badges { display: none; } }

/* ============================================================
   Book-a-demo: calendar strip + time slots
   ============================================================ */
.calendar-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 22px;
  align-items: start;
}
@media (max-width: 900px) { .calendar-shell { grid-template-columns: 1fr; } }

.cal-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 560px) { .cal-strip { grid-template-columns: repeat(4, 1fr); } }
.cal-day {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 6px;
  text-align: center;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.14s ease;
}
.cal-day:hover { border-color: var(--brand-1); transform: translateY(-1px); }
.cal-day .dow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.cal-day .num {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.1;
  margin: 4px 0 2px;
}
.cal-day .mo {
  font-size: 11px;
  color: var(--muted);
}
.cal-day.active {
  background: var(--grad-primary);
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}
.cal-day.active .dow, .cal-day.active .num, .cal-day.active .mo { color: #fff; }

.slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 500px) { .slots-grid { grid-template-columns: repeat(2, 1fr); } }
.slot {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 0.14s ease;
  font-family: inherit;
}
.slot:hover { border-color: var(--brand-1); color: var(--brand-1); }
.slot.active {
  background: var(--grad-primary);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.demo-summary {
  position: sticky;
  top: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 22px;
  box-shadow: var(--shadow-md);
}
.demo-summary h3 { margin: 0 0 4px; font-size: 18px; }
.demo-summary .picked {
  background: var(--surface-2);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.demo-summary .picked strong { color: var(--ink); }

/* === Admin tabs === */
.tabs {
  display: flex;
  gap: 4px;
  margin: 8px 0 22px;
  border-bottom: 1px solid var(--border);
}
.tabs button {
  background: none;
  border: none;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tabs button:hover { color: var(--ink); }
.tabs button.active {
  color: var(--brand-1);
  border-bottom-color: var(--brand-1);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.ticket-msg, .demo-msg {
  margin-top: 6px;
  white-space: pre-wrap;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.sev-low    { background: rgba(100,116,139,0.12); color: #475569; }
.sev-medium { background: rgba(245,158,11,0.18); color: #b45309; }
.sev-high   { background: rgba(239,68,68,0.14); color: #b91c1c; }

/* ============================================================
   Gamification: XP bar, level pill, streak counter, confetti, toast
   ============================================================ */
.xp-bar {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  position: relative;
  min-width: 180px;
}
.xp-bar .level-tag {
  background: var(--grad-primary);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.xp-bar .xp-track {
  flex: 1;
  height: 6px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.xp-bar .xp-fill {
  height: 100%;
  background: var(--grad-primary);
  width: 0%;
  transition: width 600ms cubic-bezier(.2,.9,.3,1);
}
.xp-bar .xp-text { color: var(--muted); font-size: 11.5px; font-weight: 600; white-space: nowrap; }

.streak-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(245,158,11,0.15);
  color: #b45309;
  font-weight: 700; font-size: 13px;
}
.streak-pill.cold {
  background: var(--surface-2);
  color: var(--muted);
}
.streak-pill .fire {
  font-size: 14px;
  animation: flicker 1.8s ease-in-out infinite;
}
@keyframes flicker { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* +XP floating animation */
.xp-pop {
  position: fixed;
  z-index: 100;
  font-weight: 800;
  font-size: 18px;
  pointer-events: none;
  color: #fff;
  background: var(--grad-primary);
  padding: 6px 12px;
  border-radius: 999px;
  animation: xpRise 1.4s ease-out forwards;
  box-shadow: var(--shadow-glow);
}
@keyframes xpRise {
  0%   { opacity: 0; transform: translate(-50%, 0)    scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -10px) scale(1.08); }
  100% { opacity: 0; transform: translate(-50%, -80px) scale(1); }
}

/* Level-up toast */
.level-toast {
  position: fixed;
  inset: auto 50% 28px auto;
  transform: translateX(50%);
  z-index: 101;
  padding: 14px 22px;
  background: var(--grad-primary);
  color: #fff;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(124,58,237,0.5);
  font-weight: 700;
  display: flex; align-items: center; gap: 10px;
  animation: toastIn 350ms ease-out, toastOut 350ms ease-in 3.5s forwards;
}
.level-toast .badge-icon { font-size: 26px; }
.level-toast small { font-weight: 500; opacity: 0.9; display: block; font-size: 12px; }
@keyframes toastIn  { from { opacity: 0; transform: translate(50%, 30px); } to { opacity: 1; transform: translate(50%, 0); } }
@keyframes toastOut { to   { opacity: 0; transform: translate(50%, -20px); } }

/* Confetti pieces */
.confetti-host {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 99;
}
.confetti-piece {
  position: absolute;
  width: 8px; height: 14px;
  border-radius: 2px;
  animation: confettiFall 2.8s cubic-bezier(.2,.5,.4,1) forwards;
}
@keyframes confettiFall {
  0%   { transform: translate(0, -10vh) rotate(0deg);    opacity: 1; }
  100% { transform: translate(var(--dx, 0), 110vh) rotate(var(--rot, 720deg)); opacity: 0.95; }
}

/* === Top promo bar === */
.topbar {
  background: var(--grad-primary);
  color: #fff;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 16px;
  position: relative;
  z-index: 60;
}
.topbar a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 6px;
}
.topbar a:hover { opacity: 0.9; }
.topbar .sep { opacity: 0.6; margin: 0 10px; }

/* 3-column role grid */
.role-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 920px) { .role-grid.three { grid-template-columns: 1fr; } }

.role-card.school .icon {
  background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
}

/* School dashboard */
.school-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
@media (max-width: 800px) { .school-stats { grid-template-columns: repeat(2, 1fr); } }
.school-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 18px;
}
.school-stat .num {
  font-size: 32px;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}
.school-stat .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 2px;
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.student-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
}
.student-tile .head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.student-tile .avatar {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad-primary);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 800;
  font-size: 14px;
}
.student-tile .name { font-weight: 700; font-size: 15px; }
.student-tile .meta { color: var(--muted); font-size: 13px; }
.student-tile .stats { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }
.search-row { display: flex; gap: 10px; margin-bottom: 16px; }
.search-row input { flex: 1; }


