/* ═══════════════════════════════════════════════════════════
   ENGAME LEARN — Premium Design System v3
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900;1,600&display=swap');

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

/* ── TOKENS ─────────────────────────────────────────── */
:root {
  --p600: #4f46e5;   --p700: #4338ca;   --p800: #3730a3;   --p900: #312e81;
  --p100: #e0e7ff;   --p50:  #eef2ff;   --p25:  #f8f7ff;
  --v600: #7c3aed;   --v400: #a78bfa;   --v100: #ede9fe;   --v50:  #f5f3ff;

  --ink-900: #1a1040;
  --ink-700: #374151;
  --ink-500: #6b7280;
  --ink-300: #9ca3af;
  --ink-100: #f3f4f6;

  --bg:       #f7f5ff;
  --bg-card:  #ffffff;
  --bg-muted: #fafafe;

  --bdr-xs: rgba(79,70,229,.07);
  --bdr-sm: rgba(79,70,229,.13);
  --bdr:    rgba(79,70,229,.22);

  --ok: #059669;  --ok-bg: #d1fae5;
  --no: #dc2626;  --no-bg: #fee2e2;
  --wn: #f97316;  --wn-bg: #fff7ed;  --wn-bdr: #fed7aa;

  --r-xs: 6px;   --r-sm: 8px;   --r: 12px;   --r-lg: 16px;
  --r-xl: 20px;  --r-full: 100px;

  --sh-xs: 0 1px 2px rgba(26,16,64,.06);
  --sh-sm: 0 1px 3px rgba(26,16,64,.06), 0 2px 8px rgba(26,16,64,.04);
  --sh-md: 0 2px 6px rgba(26,16,64,.05), 0 8px 20px rgba(26,16,64,.07);
  --sh-lg: 0 4px 12px rgba(26,16,64,.05), 0 16px 36px rgba(26,16,64,.09);
  --sh-p:  0 4px 20px rgba(79,70,229,.25);
  --sh-ph: 0 8px 32px rgba(79,70,229,.32);

  --grad:      linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --grad-h:    linear-gradient(90deg, #4338ca 0%, #6d28d9 100%);
  --grad-soft: linear-gradient(135deg, #f0eeff 0%, #e0e7ff 100%);

  --font: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.4,0,.2,1);
  --ease-out: cubic-bezier(0,0,.2,1);
  --spring: cubic-bezier(.34,1.56,.64,1);
}

/* ── DARK MODE ──────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:       #0d0b1e;
    --bg-card:  #181530;
    --bg-muted: #130f28;

    --ink-900: #ede9fe;
    --ink-700: #c4bfe0;
    --ink-500: #8b86ab;
    --ink-300: #4a4670;
    --ink-100: #1f1c38;

    --bdr-xs: rgba(139,122,255,.08);
    --bdr-sm: rgba(139,122,255,.14);
    --bdr:    rgba(139,122,255,.25);

    --wn-bg:  #2a1a0a;
    --wn-bdr: #7c3a18;

    --grad-soft: linear-gradient(135deg, #2a2050 0%, #1e1f4a 100%);

    --sh-xs: 0 1px 2px rgba(0,0,0,.3);
    --sh-sm: 0 1px 3px rgba(0,0,0,.3), 0 2px 8px rgba(0,0,0,.2);
    --sh-md: 0 2px 6px rgba(0,0,0,.25), 0 8px 20px rgba(0,0,0,.28);
    --sh-lg: 0 4px 12px rgba(0,0,0,.3), 0 16px 36px rgba(0,0,0,.35);
  }
}

/* ── BASE ───────────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink-700);
  line-height: 1.7;
  font-size: 15.5px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--p600); }
strong, b { color: var(--ink-900); font-weight: 800; }

/* ── READING PROGRESS BAR (JS-driven via data-progress) ── */
.learn-nav::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: calc(var(--progress, 0) * 1%);
  height: 3px;
  background: rgba(255,255,255,.6);
  border-radius: 0 2px 2px 0;
  transition: width .1s linear;
}

/* ── NAVIGATION ─────────────────────────────────────── */
.learn-nav {
  background: var(--grad-h);
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 1px 0 rgba(255,255,255,.08),
              0 4px 24px rgba(55,48,163,.45);
}

.learn-nav-brand {
  color: #fff;
  font-weight: 900;
  font-size: 20px;
  text-decoration: none;
  letter-spacing: -.4px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.learn-nav-brand::before {
  content: '';
  width: 28px; height: 28px;
  background: rgba(255,255,255,.18);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  /* E letter as brand mark */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 28'%3E%3Crect width='28' height='28' rx='8' fill='rgba(255,255,255,.2)'/%3E%3Ctext x='14' y='20' text-anchor='middle' font-family='Nunito,sans-serif' font-weight='900' font-size='16' fill='white'%3EE%3C/text%3E%3C/svg%3E");
  background-size: cover;
}

.learn-nav-sep {
  color: rgba(255,255,255,.3);
  font-size: 17px;
  user-select: none;
}

.learn-nav-crumb {
  color: rgba(255,255,255,.82);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color .15s;
}
.learn-nav-crumb:hover { color: #fff; }

.learn-nav-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.14);
  border: 1.5px solid rgba(255,255,255,.32);
  color: #fff;
  font-weight: 800;
  font-size: 13.5px;
  padding: 7px 20px;
  border-radius: var(--r-full);
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--ease) .18s, border-color var(--ease) .18s, transform var(--ease) .18s;
}
.learn-nav-cta::after { content: '→'; font-size: 14px; }
.learn-nav-cta:hover {
  background: rgba(255,255,255,.26);
  border-color: rgba(255,255,255,.6);
  transform: translateY(-1px);
}

/* ── CONTAINER ──────────────────────────────────────── */
.learn-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 36px 20px 100px;
}

/* ── BREADCRUMB ─────────────────────────────────────── */
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-500);
  margin-bottom: 24px;
  background: var(--bg-card);
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--bdr-xs);
  box-shadow: var(--sh-xs);
}
.breadcrumb a {
  color: var(--p600);
  text-decoration: none;
  transition: color .15s;
}
.breadcrumb a:hover { color: var(--p700); }
.breadcrumb-sep { color: var(--bdr); }

/* ── HERO ───────────────────────────────────────────── */
.learn-hero {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--r-xl);
  padding: 44px 44px 40px;
  margin-bottom: 28px;
  border: 1px solid var(--bdr-sm);
  box-shadow: var(--sh-md);
  overflow: hidden;
}

/* Decorative orbs */
.learn-hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(99,102,241,.12) 0%, transparent 65%);
  pointer-events: none;
}
.learn-hero::after {
  content: '';
  position: absolute;
  bottom: -60px; left: 10%;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(124,58,237,.09) 0%, transparent 65%);
  pointer-events: none;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  background: var(--grad);
  color: #fff;
  font-weight: 800;
  font-size: 11.5px;
  letter-spacing: .6px;
  padding: 4px 14px;
  border-radius: var(--r-full);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
  box-shadow: var(--sh-p);
}

.learn-hero h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(24px, 4vw, 38px);
  font-weight: 900;
  color: var(--ink-900);
  line-height: 1.2;
  letter-spacing: -.5px;
  margin-bottom: 16px;
}

.learn-hero-desc {
  position: relative;
  z-index: 1;
  font-size: 16px;
  color: var(--ink-500);
  max-width: 600px;
  line-height: 1.8;
}

/* ── SECTIONS ───────────────────────────────────────── */
.learn-section {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: 32px 36px;
  margin-bottom: 20px;
  border: 1px solid var(--bdr-xs);
  box-shadow: var(--sh-sm);
}

/* Section heading with gradient left bar */
.learn-section h2 {
  font-size: 19px;
  font-weight: 900;
  color: var(--ink-900);
  letter-spacing: -.2px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--bdr-xs);
  display: flex;
  align-items: center;
  gap: 12px;
}
.learn-section h2::before {
  content: '';
  flex-shrink: 0;
  width: 4px;
  height: 22px;
  background: var(--grad);
  border-radius: 2px;
}

.learn-section h3 {
  font-size: 15px;
  font-weight: 800;
  color: var(--p600);
  margin: 24px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.learn-section h3::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--grad);
  border-radius: 50%;
  flex-shrink: 0;
}

.learn-section p { line-height: 1.85; margin-bottom: 12px; }
.learn-section ul,
.learn-section ol  { padding-left: 20px; margin-bottom: 14px; }
.learn-section li  { margin-bottom: 8px; line-height: 1.8; }

/* ── FORMULA TABLE ──────────────────────────────────── */
.formula-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin: 20px 0;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}

.formula-table th {
  background: var(--grad-h);
  color: #fff;
  padding: 13px 18px;
  text-align: left;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.formula-table td {
  padding: 13px 18px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--bdr-xs);
  vertical-align: middle;
  line-height: 1.6;
}
.formula-table tr:last-child td { border-bottom: none; }
.formula-table tr:nth-child(even) td { background: var(--bg-muted); }
.formula-table tr:hover td {
  background: var(--v50);
  transition: background .12s var(--ease);
}

.formula-em {
  display: inline-block;
  background: var(--v50);
  color: var(--p700);
  font-weight: 800;
  font-style: normal;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--bdr-sm);
}

/* ── VOCAB TABLE ────────────────────────────────────── */
.vocab-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  margin: 16px 0;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh-sm);
}
.vocab-table th {
  background: var(--grad-h);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 900;
  font-size: 11.5px;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.vocab-table td {
  padding: 11px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--bdr-xs);
  vertical-align: middle;
}
.vocab-table tr:nth-child(even) td { background: var(--bg-muted); }
.vocab-table tr:last-child td { border-bottom: none; }
.vocab-table tr:hover td { background: var(--v50); transition: background .12s; }

.vocab-hanzi  { font-size: 22px; font-weight: 700; color: var(--p600); line-height: 1.3; }
.vocab-pinyin { font-weight: 800; color: var(--v600); font-size: 14px; font-style: italic; }
.vocab-word   { font-weight: 800; color: var(--ink-900); }
.vocab-ipa    { color: var(--ink-300); font-size: 12px; font-style: italic; }

.level-tag {
  display: inline-block;
  background: var(--grad);
  color: #fff;
  font-size: 10.5px;
  font-weight: 900;
  padding: 2px 9px;
  border-radius: var(--r-full);
  letter-spacing: .3px;
}

/* ── EXAMPLE LIST ───────────────────────────────────── */
.example-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.example-item {
  padding: 13px 18px;
  background: var(--bg-card);
  border: 1px solid var(--bdr-xs);
  border-left: 3.5px solid var(--p600);
  border-radius: 0 var(--r) var(--r) 0;
  transition: border-left-color .2s, transform .2s var(--ease);
}
.example-item:hover {
  border-left-color: var(--v600);
  transform: translateX(6px);
}
.example-en {
  font-weight: 700;
  color: var(--ink-900);
  font-size: 15px;
  line-height: 1.5;
}
.example-vi {
  color: var(--ink-500);
  font-size: 13px;
  margin-top: 4px;
  line-height: 1.5;
}

/* ── SIGNAL PILLS ───────────────────────────────────── */
.signal-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}
.signal-pill {
  display: inline-flex;
  align-items: center;
  background: var(--v50);
  color: var(--p700);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 16px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--bdr-sm);
  cursor: default;
  transition: all .2s var(--ease);
}
.signal-pill:hover {
  background: var(--p600);
  color: #fff;
  border-color: var(--p600);
  transform: translateY(-2px);
  box-shadow: var(--sh-p);
}

/* ── MISTAKE BOX ────────────────────────────────────── */
.mistake-box {
  background: var(--wn-bg);
  border: 1.5px solid var(--wn-bdr);
  border-left: 4px solid var(--wn);
  border-radius: 0 var(--r) var(--r) 0;
  padding: 18px 22px;
  margin: 16px 0;
}
.mistake-box-title {
  font-weight: 900;
  color: #c2410c;
  font-size: 14.5px;
  margin-bottom: 10px;
}
.mistake-box p { font-size: 14px; line-height: 1.75; margin-bottom: 8px; }
.mistake-box p:last-child { margin-bottom: 0; }

@media (prefers-color-scheme: dark) {
  .mistake-box { background: #2a1a0a; border-color: var(--wn-bdr); }
}

/* ── TIP BOX ────────────────────────────────────────── */
.tip-box {
  background: #eff6ff;
  border: 1.5px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: 0 var(--r) var(--r) 0;
  padding: 16px 22px;
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.75;
}
@media (prefers-color-scheme: dark) {
  .tip-box { background: #0c1a30; border-color: #1e3a5f; }
}
.tip-box-title { font-weight: 900; color: #1d4ed8; margin-bottom: 6px; font-size: 13.5px; }

/* ── ANSWER BOX (TL;DR / direct answer for AI & readers) ── */
.answer-box {
  background: var(--grad-soft);
  border: 1px solid var(--bdr-sm);
  border-left: 4px solid var(--p600);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  padding: 22px 26px;
  margin-bottom: 22px;
  box-shadow: var(--sh-sm);
}
.answer-box-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--p600);
  margin-bottom: 8px;
}
.answer-box-label::before { content: '⚡'; font-size: 13px; }
.answer-box p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-900);
  font-weight: 600;
  margin: 0;
}
.answer-box p + p { margin-top: 10px; }

/* ── BYLINE (E-E-A-T: author + updated date) ────────── */
.learn-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: var(--ink-500);
  margin: 2px 0 22px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--bdr-xs);
  border-radius: var(--r-full);
  box-shadow: var(--sh-xs);
}
.learn-byline strong { color: var(--ink-900); font-weight: 800; }
.learn-byline-dot { color: var(--bdr); }
.learn-byline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 800;
  color: var(--ok);
}
.learn-byline-badge::before { content: '✓'; }

/* ── CTA BOX ────────────────────────────────────────── */
.cta-box {
  background: var(--grad-h);
  border-radius: var(--r-xl);
  padding: 52px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin: 28px 0;
  box-shadow: var(--sh-ph);
}

/* Layered background orbs */
.cta-box::before {
  content: '';
  position: absolute;
  top: -100px; right: -80px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 60%);
  pointer-events: none;
}
.cta-box::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(255,255,255,.07) 0%, transparent 60%);
  pointer-events: none;
}

.cta-box h2 {
  font-size: 26px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.4px;
  margin-bottom: 10px;
  position: relative; z-index: 1;
}
.cta-box p {
  font-size: 15.5px;
  color: rgba(255,255,255,.82);
  margin-bottom: 28px;
  position: relative; z-index: 1;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--p700);
  font-weight: 900;
  font-size: 16px;
  padding: 14px 36px;
  border-radius: var(--r-full);
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.2), 0 0 0 0 rgba(255,255,255,0);
  transition: transform .3s var(--spring), box-shadow .3s var(--spring);
  position: relative; z-index: 1;
}
.cta-btn::after { content: '→'; font-size: 17px; }
.cta-btn:hover {
  transform: translateY(-4px) scale(1.04);
  box-shadow: 0 12px 36px rgba(0,0,0,.25);
}

.cta-features {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
  position: relative; z-index: 1;
}
.cta-features span {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.12);
  padding: 5px 14px;
  border-radius: var(--r-full);
  border: 1px solid rgba(255,255,255,.2);
}

/* ── RELATED GRID ───────────────────────────────────── */
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 12px;
  margin: 4px 0;
}

.related-card {
  background: var(--bg-card);
  border: 1.5px solid var(--bdr-xs);
  border-radius: var(--r);
  padding: 16px 16px 38px;
  text-decoration: none;
  color: var(--ink-700);
  display: block;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .25s var(--ease);
}
.related-card::after {
  content: '→';
  position: absolute;
  bottom: 14px; right: 16px;
  font-size: 16px;
  color: var(--bdr);
  transition: color .2s, transform .2s var(--ease);
}
.related-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.related-card:hover {
  border-color: var(--bdr);
  box-shadow: var(--sh-md);
  transform: translateY(-4px);
}
.related-card:hover::after { color: var(--p600); transform: translateX(3px); }
.related-card:hover::before { transform: scaleX(1); }

.related-card-title { font-weight: 900; font-size: 14px; color: var(--ink-900); margin-bottom: 6px; line-height: 1.4; }
.related-card-desc  { font-size: 12.5px; color: var(--ink-500); line-height: 1.55; }

/* ── QUIZ SECTION ───────────────────────────────────── */
.quiz-section {
  background: var(--grad-soft);
  border: 1px solid var(--bdr-sm);
  border-radius: var(--r-lg);
  padding: 36px 36px 32px;
  margin: 24px 0;
}

.quiz-section h2 {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink-900);
  letter-spacing: -.2px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.quiz-section h2::before {
  content: '✏️';
  font-size: 18px;
  line-height: 1;
}

.quiz-question {
  background: var(--bg-card);
  border: 1.5px solid var(--bdr-xs);
  border-radius: var(--r);
  padding: 22px 22px 18px;
  margin-bottom: 14px;
  box-shadow: var(--sh-xs);
  transition: border-color .2s;
}
.quiz-question[data-answered] { border-color: var(--bdr-sm); }
.quiz-question[data-answered] .quiz-q-text { color: var(--ink-500); }

.quiz-q-text {
  font-weight: 800;
  font-size: 15px;
  color: var(--ink-900);
  line-height: 1.6;
  margin-bottom: 14px;
}

.quiz-options { list-style: none; display: flex; flex-direction: column; gap: 9px; }

.quiz-option {
  padding: 11px 16px;
  border: 1.5px solid var(--bdr-xs);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--bg-muted);
  transition: background .14s, border-color .14s, transform .14s var(--ease);
  user-select: none;
  line-height: 1.5;
}
.quiz-option:hover:not(.correct):not(.wrong) {
  background: var(--v50);
  border-color: var(--bdr-sm);
  transform: translateX(6px);
  color: var(--ink-900);
}
.quiz-option.correct {
  background: var(--ok-bg);
  border-color: var(--ok);
  color: #065f46;
  font-weight: 700;
}
.quiz-option.wrong {
  background: var(--no-bg);
  border-color: var(--no);
  color: #7f1d1d;
}

/* ── HUB PAGE: STAT BAR ─────────────────────────────── */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--bg-card);
  border-radius: var(--r-lg);
  border: 1px solid var(--bdr-sm);
  overflow: hidden;
  margin-bottom: 40px;
  box-shadow: var(--sh-md);
}

.stat-item {
  text-align: center;
  padding: 28px 12px 22px;
  border-right: 1px solid var(--bdr-xs);
  position: relative;
  transition: background .2s;
}
.stat-item:last-child { border-right: none; }

.stat-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform .3s var(--spring);
}
.stat-item:hover { background: var(--v50); }
.stat-item:hover::after { transform: scaleX(1); }

.stat-num {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: var(--p600);
  letter-spacing: -1.5px;
  line-height: 1.1;
}
.stat-lbl {
  display: block;
  font-size: 11px;
  font-weight: 800;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: .6px;
  margin-top: 6px;
}

/* ── HUB PAGE: CATEGORY HEADER ──────────────────────── */
.hub-category {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  font-weight: 900;
  color: var(--p600);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin: 44px 0 16px;
}
.hub-category::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--bdr-sm) 0%, transparent 100%);
}

/* ── HUB PAGE: CARD GRID ────────────────────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 4px;
}

.hub-card {
  background: var(--bg-card);
  border: 1.5px solid var(--bdr-xs);
  border-radius: var(--r-lg);
  padding: 24px 22px;
  text-decoration: none;
  color: var(--ink-700);
  display: block;
  position: relative;
  overflow: hidden;
  transition: border-color .2s, box-shadow .25s, transform .25s var(--ease);
}
.hub-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s var(--ease);
}
.hub-card:hover {
  border-color: var(--bdr-sm);
  box-shadow: var(--sh-md);
  transform: translateY(-5px);
}
.hub-card:hover::before { transform: scaleX(1); }

.hub-card-icon {
  display: block;
  font-size: 28px;
  margin-bottom: 14px;
  line-height: 1;
}
.hub-card-title {
  font-weight: 900;
  font-size: 15px;
  color: var(--ink-900);
  margin-bottom: 7px;
  line-height: 1.35;
  letter-spacing: -.1px;
}
.hub-card-desc {
  font-size: 13px;
  color: var(--ink-500);
  line-height: 1.6;
}

/* ── FOOTER ─────────────────────────────────────────── */
.learn-footer {
  background: #0f0d22;
  color: rgba(255,255,255,.45);
  text-align: center;
  padding: 40px 24px;
  font-size: 13.5px;
  line-height: 1.8;
}
.learn-footer a {
  color: rgba(255,255,255,.8);
  text-decoration: none;
  font-weight: 700;
  transition: color .15s;
}
.learn-footer a:hover { color: var(--v400); }

/* ── RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 680px) {
  .learn-container     { padding: 20px 16px 80px; }
  .learn-hero          { padding: 28px 24px 26px; }
  .learn-section       { padding: 24px 20px; }
  .quiz-section        { padding: 24px 20px; }
  .cta-box             { padding: 36px 24px; }
  .cta-box h2          { font-size: 22px; }
  .cta-btn             { width: 100%; justify-content: center; }

  .formula-table       { font-size: 12.5px; }
  .formula-table th,
  .formula-table td    { padding: 10px 12px; }

  .stat-bar            { grid-template-columns: repeat(3, 1fr); }
  .stat-item:nth-child(4),
  .stat-item:nth-child(5) { border-top: 1px solid var(--bdr-xs); }

  .hub-grid            { grid-template-columns: 1fr 1fr; gap: 12px; }
  .related-grid        { grid-template-columns: 1fr 1fr; }
  .learn-nav           { padding: 0 16px; }
  .learn-nav-brand     { font-size: 18px; }
}

@media (max-width: 460px) {
  .hub-grid            { grid-template-columns: 1fr; }
  .related-grid        { grid-template-columns: 1fr; }
  .stat-bar            { grid-template-columns: repeat(2, 1fr); }
}

/* ── PRINT ──────────────────────────────────────────── */
@media print {
  .learn-nav, .cta-box, .quiz-section, .learn-footer { display: none; }
  .learn-section { box-shadow: none; border: 1px solid #ddd; }
}
