:root {
  --ink: #1e1733;
  --muted: #6e6680;
  --paper: #fff7fb;
  --panel: rgba(255, 255, 255, 0.86);
  --line: rgba(72, 48, 112, 0.13);
  --purple: #7c3aed;
  --pink: #ec4899;
  --blue: #2dd4bf;
  --shadow: 0 24px 60px rgba(74, 45, 124, 0.16);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 0%, rgba(236, 72, 153, 0.18), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(45, 212, 191, 0.22), transparent 30rem),
    linear-gradient(180deg, #fff7fb 0%, #f7f0ff 44%, #f2fbff 100%);
}
button, a, select { font: inherit; }
a { color: inherit; text-decoration: none; }

.hero { min-height: 86vh; padding: 22px clamp(18px, 5vw, 72px) 58px; }
.topbar, .hero-grid, .section, .footer { max-width: 1160px; margin: 0 auto; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; }
.brand-mark { display: grid; width: 44px; height: 44px; place-items: center; color: white; border-radius: 16px; background: linear-gradient(135deg, var(--purple), var(--pink)); }
.nav-links { display: flex; gap: 18px; color: var(--muted); font-size: 0.95rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) 360px; align-items: center; gap: 42px; padding-top: 84px; }
.eyebrow { margin: 0 0 10px; color: var(--purple); font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 780px; margin-bottom: 22px; font-size: clamp(2.15rem, 5.9vw, 4.8rem); line-height: 1.02; letter-spacing: -0.06em; }
h2 { margin-bottom: 12px; font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.05; letter-spacing: -0.05em; }
.hero-copy, .section-heading p, .practice-panel p, .speaking-section p, .footer, .line-card p { color: var(--muted); line-height: 1.8; }
.hero-copy { max-width: 720px; font-size: 1.13rem; }
.hero-actions, .record-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.primary-button, .ghost-button, .light-button, .danger-button, .sound-button, .choice-button { min-height: 46px; border-radius: 999px; cursor: pointer; border: 0; transition: transform 160ms ease; }
.primary-button, .danger-button { padding: 13px 20px; color: white; font-weight: 900; background: linear-gradient(135deg, var(--purple), var(--pink)); box-shadow: 0 12px 26px rgba(124, 58, 237, 0.24); }
.danger-button { background: linear-gradient(135deg, #ef4444, #f97316); }
.ghost-button, .light-button, .sound-button, .choice-button { padding: 12px 18px; color: var(--ink); background: rgba(255,255,255,0.76); border: 1px solid var(--line); }
button:hover, a.primary-button:hover { transform: translateY(-2px); }
.progress-card, .line-card, .review-card, .curriculum-card, .practice-box, .pattern-card { background: var(--panel); border: 1px solid rgba(255,255,255,0.72); border-radius: 30px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.progress-card { padding: 28px; }
.progress-card span { color: var(--muted); }
.progress-card strong { display: block; margin: 10px 0; font-size: 4rem; letter-spacing: -0.07em; }
.progress-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e8def7; }
.progress-track div { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--purple), var(--pink), var(--blue)); transition: width 220ms ease; }
.section { padding: 70px clamp(18px, 4vw, 34px); }
.section-heading { max-width: 800px; margin-bottom: 28px; }
.day-picker { display: grid; max-width: 460px; gap: 8px; margin-top: 18px; }
.day-picker label { color: var(--muted); font-weight: 900; }
select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.lesson-grid, .review-grid, .pattern-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.line-card, .review-card, .pattern-card { display: grid; gap: 12px; padding: 22px; }
.line-type { width: fit-content; padding: 6px 10px; color: #6d28d9; font-size: 0.82rem; font-weight: 900; border-radius: 999px; background: #ede9fe; }
.thai-text { font-size: 2rem; line-height: 1.18; }
.sound-button { width: 100%; font-weight: 900; }
.completed { outline: 3px solid rgba(124, 58, 237, 0.24); }
.review-card span, .pattern-card span { font-size: 1.35rem; line-height: 1.45; }
.review-card small { color: var(--purple); font-weight: 900; }
.curriculum-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.curriculum-card { display: grid; gap: 8px; min-height: 170px; padding: 18px; text-align: left; color: var(--ink); }
.curriculum-card span, .curriculum-card em { color: var(--purple); font-size: 0.86rem; font-style: normal; font-weight: 900; }
.curriculum-card small { color: var(--muted); line-height: 1.55; }
.curriculum-card.active { background: #f3e8ff; outline: 3px solid rgba(124, 58, 237, 0.25); }
.pattern-section { max-width: none; padding-left: max(clamp(18px, 4vw, 34px), calc((100vw - 1160px) / 2 + 34px)); padding-right: max(clamp(18px, 4vw, 34px), calc((100vw - 1160px) / 2 + 34px)); background: #1e1733; }
.pattern-section h2, .pattern-section p, .pattern-section .eyebrow { color: white; }
.practice-panel, .speaking-section { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr); gap: 24px; align-items: center; }
.practice-box { padding: 24px; }
.quiz-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-weight: 900; }
.quiz-options { display: grid; gap: 10px; margin-top: 16px; }
.choice-button { border-radius: 18px; text-align: left; }
.choice-button.correct { color: #064e3b; background: #ccfbf1; }
.choice-button.wrong { color: #7f1d1d; background: #fee2e2; }
.feedback { min-height: 28px; margin-top: 14px; font-weight: 900; }
audio { width: 100%; margin-top: 16px; }
.muted { margin-top: 14px; color: var(--muted) !important; }
.footer { padding: 40px 24px 70px; text-align: center; }

@media (max-width: 920px) {
  .hero-grid, .practice-panel, .speaking-section { grid-template-columns: 1fr; }
  .lesson-grid, .review-grid, .pattern-grid, .curriculum-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-grid { padding-top: 52px; }
}

@media (max-width: 640px) {
  .topbar { align-items: flex-start; flex-direction: column; }
  .nav-links { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .lesson-grid, .review-grid, .pattern-grid, .curriculum-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .section { padding-top: 48px; padding-bottom: 48px; }
  .quiz-toolbar { align-items: stretch; flex-direction: column; }
}
