/* Wuanberri — design system
   Cream background, dark text, single terracotta accent.
   Mirrors the rhythm of Lemma's marketing site. */

:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-muted: #7a7a7a;
  --line: #ece6dc;
  --line-strong: #d8cfc1;
  --accent: #c2410c;        /* terracotta */
  --accent-soft: #fbe9dc;
  --accent-ink: #7a2a08;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 16, 12, 0.04), 0 4px 14px rgba(20, 16, 12, 0.05);
  --maxw: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: ui-serif, Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

img { max-width: 100%; display: block; }

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 80px 0; }
section.tight { padding: 48px 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  z-index: 50;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.nav a {
  font-size: 14px;
  color: var(--ink-soft);
}
.nav a:hover { color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: #000; }
.btn-accent {
  background: var(--accent);
  color: #fff;
}
.btn-accent:hover { background: var(--accent-ink); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-ghost:hover { background: var(--surface); }

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 64px;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  font-weight: 600;
}
.hero .sub {
  max-width: 640px;
  margin: 0 auto 36px;
  color: var(--ink-soft);
  font-size: 18px;
}
.hero .ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 56px;
  flex-wrap: wrap;
}

/* Hero flashcard */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
}
.flashcard .glyph {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  margin-bottom: 4px;
}
.flashcard .meta {
  color: var(--ink-muted);
  font-size: 14px;
  margin-bottom: 16px;
  font-style: italic;
}
.flashcard .meaning {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 12px;
}
.flashcard .example {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 16px;
}
.flashcard .example code {
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", ui-serif, Georgia, serif;
  color: var(--accent-ink);
  font-size: 15px;
}
.flashcard .decomp {
  display: none;
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--accent-ink);
  margin-bottom: 16px;
}
.flashcard .decomp.show { display: block; }
.flashcard .actions {
  display: flex;
  gap: 8px;
}
.flashcard .actions .btn { flex: 1; padding: 8px 12px; font-size: 13px; }

/* ---------- Section header ---------- */
.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
  font-weight: 600;
}
.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 600;
}
.section-head p {
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- "What sets us apart" — three points ---------- */
.points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.point h3 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0 0 8px;
  font-weight: 600;
}
.point p {
  color: var(--ink-soft);
  margin: 0;
  font-size: 15px;
}

/* ---------- Subject profile tabs ---------- */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  max-width: 880px;
  margin: 0 auto;
  box-shadow: var(--shadow);
}
.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  padding: 4px 4px 0;
}
.tab {
  background: transparent;
  border: 0;
  padding: 12px 18px;
  font-size: 14px;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  font-weight: 500;
}
.tab[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.profile-body {
  padding: 24px 16px 16px;
}
.profile-body h4 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 600;
}
.profile-body p {
  color: var(--ink-soft);
  margin: 0 0 20px;
  font-size: 14px;
}
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px 1fr 40px; align-items: center; gap: 12px; }
.bar-row .label { font-size: 13px; color: var(--ink-soft); }
.bar-row .track { background: var(--bg); border-radius: 999px; height: 8px; overflow: hidden; }
.bar-row .fill { background: var(--accent); height: 100%; border-radius: 999px; }
.bar-row .val { font-size: 12px; color: var(--ink-muted); text-align: right; }

/* ---------- Features grid ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 220px;
}
.feature h3 {
  font-family: var(--font-display);
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}
.feature p { color: var(--ink-soft); font-size: 14px; margin: 0; }
.feature .preview {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}
.preview .chip {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--ink-soft);
  width: fit-content;
}
.preview .math { font-family: "Cambria Math", "STIX Two Math", ui-serif, Georgia, serif; color: var(--accent-ink); font-size: 15px; }

/* ---------- The Coach ---------- */
.coach {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.coach-copy h2 { font-family: var(--font-display); font-size: 36px; margin: 0 0 16px; font-weight: 600; letter-spacing: -0.01em; }
.coach-copy p { color: var(--ink-soft); }
.coach-copy ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; }
.coach-copy li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--ink-soft); }
.coach-copy li::before {
  content: "";
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 9px;
  flex-shrink: 0;
}

.chat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 380px;
}
.chat-head {
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.chat-body {
  flex: 1;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  max-height: 320px;
}
.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
}
.bubble.bot {
  background: var(--bg);
  border: 1px solid var(--line);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.bubble.user {
  background: var(--accent);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.bubble.bot .math { font-family: "Cambria Math", "STIX Two Math", ui-serif, Georgia, serif; }
.chips {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  background: #fcfaf6;
}
.chip {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.chat-input input:focus { border-color: var(--accent); }
.chat-input button { padding: 8px 16px; font-size: 13px; }

/* ---------- Pull quote ---------- */
.pullquote {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 0;
  position: relative;
}
.pullquote::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 2px;
  height: 32px;
  background: var(--accent);
}
.pullquote blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.35;
  margin: 24px 0 0;
  color: var(--ink);
}

/* ---------- Subjects row ---------- */
.subjects {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: center;
  font-size: 36px;
  margin-bottom: 16px;
}
.subjects .note { font-size: 14px; color: var(--ink-muted); text-align: center; }

/* ---------- Pricing ---------- */
.pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 820px;
  margin: 0 auto;
}
.plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
}
.plan.featured { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.plan h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 4px;
  font-weight: 600;
}
.plan .price { font-size: 32px; font-weight: 600; margin: 12px 0 4px; }
.plan .price small { font-size: 14px; font-weight: 400; color: var(--ink-muted); }
.plan .trial { font-size: 13px; color: var(--ink-muted); margin-bottom: 20px; }
.plan ul { list-style: none; padding: 0; margin: 0 0 24px; display: grid; gap: 8px; }
.plan li { font-size: 14px; color: var(--ink-soft); display: flex; gap: 8px; }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 600; }
.plan .btn { margin-top: auto; width: 100%; }

/* ---------- Closing CTA ---------- */
.closing {
  text-align: center;
  padding: 96px 0;
}
.closing h2 {
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 24px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 40px 0 48px;
  color: var(--ink-muted);
  font-size: 13px;
}
.site-footer .wrap {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.site-footer h5 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 12px;
  color: var(--ink-soft);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.site-footer a:hover { color: var(--accent); }
.copy {
  text-align: center;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ---------- Subject hub pages ---------- */
.subject-hero {
  padding: 80px 0 40px;
  text-align: center;
}
.subject-hero .eyebrow { color: var(--accent); }
.subject-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 56px);
  margin: 8px 0 16px;
  letter-spacing: -0.01em;
  font-weight: 600;
}
.subject-hero p { color: var(--ink-soft); max-width: 600px; margin: 0 auto; }

.unit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.unit {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.unit:hover { border-color: var(--accent); transform: translateY(-2px); }
.unit .tag { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.unit h3 { font-family: var(--font-display); font-size: 20px; margin: 0; font-weight: 600; }
.unit p { color: var(--ink-soft); font-size: 14px; margin: 0; }
.unit .meta { font-size: 12px; color: var(--ink-muted); margin-top: 8px; }

/* ---------- Lesson page ---------- */
.lesson-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 24px;
}
.lesson-wrap .back {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 16px;
  display: inline-block;
}
.lesson-wrap h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 44px);
  margin: 0 0 8px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.lesson-wrap .lede { color: var(--ink-soft); font-size: 17px; margin-bottom: 32px; }

.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.lesson-card h2 {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 12px;
  font-weight: 600;
}
.lesson-card p { color: var(--ink-soft); }
.lesson-card .math {
  font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", ui-serif, Georgia, serif;
  background: var(--bg);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: block;
  margin: 12px 0;
  color: var(--accent-ink);
  font-size: 17px;
}

.q-flashcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
}
.q-flashcard .q {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 6px;
  font-weight: 600;
}
.q-flashcard .hint { color: var(--ink-muted); font-size: 14px; margin-bottom: 20px; }
.q-flashcard .answer {
  display: none;
  font-family: "Cambria Math", "STIX Two Math", ui-serif, Georgia, serif;
  color: var(--accent-ink);
  font-size: 22px;
  margin: 16px 0;
}
.q-flashcard .answer.show { display: block; }
.q-flashcard .actions { display: flex; gap: 8px; justify-content: center; }

.mcq { display: grid; gap: 8px; margin-top: 16px; }
.mcq button {
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
.mcq button:hover { border-color: var(--accent); background: var(--surface); }
.mcq button.correct { background: #e9f5ec; border-color: #2f7a3e; color: #1f5028; }
.mcq button.wrong { background: #fbe9e6; border-color: #b53d2a; color: #7a2a1f; }
.mcq .feedback { font-size: 14px; margin-top: 8px; min-height: 1em; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .points, .features, .unit-grid { grid-template-columns: 1fr 1fr; }
  .coach { grid-template-columns: 1fr; }
  .pricing { grid-template-columns: 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .points, .features, .unit-grid { grid-template-columns: 1fr; }
  .nav { display: none; }
  .bar-row { grid-template-columns: 100px 1fr 36px; }
  section { padding: 56px 0; }
}

/* ---------- Polish: page-load fade, mobile menu, focus rings ---------- */
@keyframes wu-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
main, .lesson-wrap, .workout-wrap, .placement-wrap, .partner-grid {
  animation: wu-fade-in 0.45s ease both;
}

button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Mobile menu trigger (only shown when nav is hidden) */
.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  width: 40px; height: 40px;
  border-radius: 999px;
  padding: 0;
  align-items: center; justify-content: center;
}
.menu-toggle span, .menu-toggle span::before, .menu-toggle span::after {
  content: "";
  display: block;
  width: 16px; height: 1.5px;
  background: var(--ink);
  border-radius: 2px;
  position: relative;
}
.menu-toggle span::before { position: absolute; top: -5px; }
.menu-toggle span::after  { position: absolute; top:  5px; }

@media (max-width: 720px) {
  .menu-toggle { display: inline-flex; }
  .site-header .nav {
    display: none;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    align-items: stretch;
  }
  .site-header .nav.open { display: flex; }
  .site-header .nav a {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
  }
  .site-header .nav a:last-child { border-bottom: 0; }
  .site-header { position: sticky; }
}

/* Hover micro-interactions */
.btn, .tab, .chip, .partner-card, .unit, .plan {
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.unit:hover, .plan:hover { transform: translateY(-2px); }
.partner-card:hover, .tab:hover { transform: none; }

/* Smooth in-page anchor scrolling */
html { scroll-behavior: smooth; }

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ---------- Polish: skip link, empty/error states, loading dots ---------- */
.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--ink); color: var(--bg);
  padding: 8px 14px; border-radius: var(--radius-sm);
  z-index: 100; font-size: 13px; font-weight: 500;
}
.skip-link:focus { left: 8px; }

.empty-state {
  text-align: center; padding: 48px 24px;
  background: var(--surface); border: 1px dashed var(--line-strong);
  border-radius: var(--radius); color: var(--ink-soft);
}
.empty-state h3 { font-family: var(--font-display); font-size: 20px; margin: 0 0 8px; color: var(--ink); font-weight: 600; }
.empty-state p { margin: 0 0 16px; font-size: 14px; }
.empty-state .btn { margin: 0 auto; }

.error-banner {
  background: #fbe9e6; border: 1px solid #d6b8b1; color: #7a2a1f;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin: 12px 0;
}
.error-banner a { color: #7a2a1f; text-decoration: underline; }
