/* ============================================================
   CAAKE Academy — design system
   Brand: C.A.A.K.E. Corporation (caake.org)
   Dark midnight · royal gold · cosmic purple · glassy cards
   ============================================================ */

:root {
  --midnight: #07070e;
  --cosmic: #0c0c17;
  --surface: #11111f;
  --surface-2: #161627;
  --gold: #e9b949;
  --gold-2: #d4af37;
  --gold-deep: #b8860b;
  --gold-soft: rgba(233, 185, 73, 0.12);
  --purple: #8b5cf6;
  --teal: #2dd4bf;
  --rose: #fb7185;
  --text: #f5f3ee;
  --muted: #a9a8bd;
  --faint: #6f6e85;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", "Inter", system-ui, -apple-system, sans-serif;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-gold: 0 10px 40px -12px rgba(233, 185, 73, 0.45);
  --grad-gold: linear-gradient(135deg, #f6d876 0%, #e9b949 45%, #d4af37 100%);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--midnight);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- background orbs ---------- */
.bg-orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(110px); opacity: 0.5; }
.orb-gold { width: 46vw; height: 46vw; background: radial-gradient(circle, rgba(233,185,73,0.22), transparent 65%); top: -14vw; right: -10vw; animation: drift 26s ease-in-out infinite alternate; }
.orb-gold-2 { width: 40vw; height: 40vw; background: radial-gradient(circle, rgba(233,185,73,0.18), transparent 65%); bottom: -12vw; left: -8vw; animation: drift 32s ease-in-out infinite alternate-reverse; }
.orb-gold-3 { width: 26vw; height: 26vw; background: radial-gradient(circle, rgba(212,175,55,0.12), transparent 60%); top: 42%; left: 34%; animation: drift 38s ease-in-out infinite alternate; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
}

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }

main#app { padding-top: 108px; padding-bottom: 80px; min-height: 70vh; }

/* ---------- header ---------- */
#site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;
  border-bottom: 1px solid transparent;
  background: rgba(7, 7, 14, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
#site-header.scrolled {
  background: rgba(7, 7, 14, 0.88);
  border-color: var(--line);
  box-shadow: 0 12px 40px -20px rgba(0,0,0,.8);
}
.header-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-crown {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  background: var(--grad-gold); color: #1a1406;
  box-shadow: var(--shadow-gold);
}
.brand-crown svg { width: 22px; height: 22px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: .5px; }
.brand-name em { font-style: italic; color: var(--gold); }
.brand-tag { font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600; transition: color .2s; position: relative; }
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px; border-radius: 2px; background: var(--grad-gold); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: rgba(255,255,255,.04);
  color: var(--text); display: grid; place-items: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.icon-btn:hover { border-color: var(--gold); background: var(--gold-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.hamburger { display: none; }

/* search bar */
.search-bar { max-width: 720px; margin: 0 auto 12px; padding: 0 24px; position: relative; }
.search-bar.hidden { display: none; }
#search-input {
  width: 100%; padding: 14px 18px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--text);
  font-size: 15px; font-family: var(--font-body); outline: none;
}
#search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.search-results { position: absolute; top: calc(100% + 8px); left: 24px; right: 24px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; max-height: 380px; overflow-y: auto; z-index: 200; box-shadow: 0 24px 60px -20px rgba(0,0,0,.9); }
.search-results:empty { display: none; }
.search-result { display: block; padding: 10px 16px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line); font-size: 14px; }
.search-result:hover { background: rgba(255,255,255,.05); }
.search-result small { display: block; color: var(--faint); font-size: 12px; }
.search-result mark { background: var(--gold-soft); color: var(--gold); border-radius: 3px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 26px; border-radius: 999px; font-family: var(--font-body);
  font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: transform .18s ease, box-shadow .18s ease, background .18s, border-color .18s;
  line-height: 1.2; white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-gold { background: var(--grad-gold); color: #1a1406; box-shadow: var(--shadow-gold); }
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 16px 46px -10px rgba(233,185,73,.55); }
.btn-ghost { background: rgba(255,255,255,.03); border-color: var(--line-strong); color: var(--text); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-outline-gold { background: transparent; border-color: rgba(233,185,73,.55); color: var(--gold); }
.btn-outline-gold:hover { background: var(--gold-soft); border-color: var(--gold); }
.btn-sm { padding: 9px 18px; font-size: 13.5px; }
.btn-lg { padding: 16px 34px; font-size: 16.5px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg { width: 17px; height: 17px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 46px 0 30px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; background: var(--gold-soft);
  border: 1px solid rgba(233,185,73,.3); color: var(--gold);
  font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-title {
  font-family: var(--font-display); font-size: clamp(2.4rem, 5.4vw, 4.1rem);
  font-weight: 800; line-height: 1.08; letter-spacing: -.5px; margin-bottom: 18px;
}
.hero-title .accent { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-subtitle {
  max-width: 720px; margin: 0 auto; color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.18rem); font-weight: 500;
}
.hero-subtitle b { color: var(--text); font-weight: 700; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 30px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 12px 26px; justify-content: center; margin-top: 26px; color: var(--faint); font-size: 13.5px; font-weight: 600; }
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta svg { width: 16px; height: 16px; color: var(--gold); }

/* hero ring cluster */
.ring-cluster { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-top: 44px; }
.ring-item { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 118px; }
.ring-label { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: center; }
.ring-num { font-family: var(--font-display); font-size: 26px; font-weight: 800; }
.ring-wrap { position: relative; width: 108px; height: 108px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring-fg.ring-gold { stroke: var(--gold); }
.ring-fg.ring-purple { stroke: var(--purple); }
.ring-fg.ring-teal { stroke: var(--teal); }
.ring-fg.ring-rose { stroke: var(--rose); }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; }

/* ---------- section headings ---------- */
.section { margin-top: 64px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.section-title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 700; }
.section-title .kicker { display: block; font-family: var(--font-body); font-size: 12px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); margin-bottom: 6px; }
.section-link { color: var(--gold); text-decoration: none; font-size: 14px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.section-link:hover { text-decoration: underline; }

/* ---------- cards ---------- */
.card {
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; transition: border-color .25s, transform .25s, box-shadow .25s;
  position: relative; overflow: hidden;
}
.card:hover { border-color: rgba(233,185,73,.32); transform: translateY(-3px); box-shadow: 0 22px 50px -24px rgba(0,0,0,.85); }
.card.clickable { cursor: pointer; text-decoration: none; color: inherit; display: block; }
a.card { color: var(--text); text-decoration: none; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- module cards ---------- */
.module-card .mc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.mc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--gold-soft); border: 1px solid rgba(233,185,73,.28); color: var(--gold);
}
.mc-icon svg { width: 26px; height: 26px; }
.mc-num { font-family: var(--font-display); font-size: 40px; font-weight: 800; color: rgba(255,255,255,.06); line-height: 1; }
.mc-title { font-family: var(--font-display); font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.mc-sub { color: var(--muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 18px; }
.mc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 6px; }
.mc-stats { display: flex; gap: 14px; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.mc-stats span { display: inline-flex; align-items: center; gap: 5px; }
.mc-stats svg { width: 14px; height: 14px; }

.progress-track { height: 7px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin-top: 16px; }
.progress-fill { height: 100%; border-radius: 99px; background: var(--grad-gold); transition: width .6s ease; }

/* accent variants */
.accent-gold  { --acc: var(--gold);  --acc-soft: rgba(233,185,73,.12);  --acc-border: rgba(233,185,73,.3); }
.accent-purple{ --acc: var(--purple);--acc-soft: rgba(139,92,246,.13);  --acc-border: rgba(139,92,246,.34); }
.accent-teal  { --acc: var(--teal);  --acc-soft: rgba(45,212,191,.11);  --acc-border: rgba(45,212,191,.3); }
.accent-rose  { --acc: var(--rose);  --acc-soft: rgba(251,113,133,.11); --acc-border: rgba(251,113,133,.3); }

[class*="accent-"] .mc-icon { background: var(--acc-soft); border-color: var(--acc-border); color: var(--acc); }
[class*="accent-"] .ring-fg { stroke: var(--acc); }
[class*="accent-"] .progress-fill { background: linear-gradient(135deg, var(--acc), color-mix(in srgb, var(--acc) 55%, #fff)); }
[class*="accent-"] .kicker { color: var(--acc); }
[class*="accent-"] .btn-outline-gold { border-color: var(--acc-border); color: var(--acc); }
[class*="accent-"] .btn-outline-gold:hover { background: var(--acc-soft); border-color: var(--acc); }
[class*="accent-"] .lesson-dot.done { background: var(--acc); border-color: var(--acc); }
[class*="accent-"] .chip { border-color: var(--acc-border); color: var(--acc); background: var(--acc-soft); }

/* ---------- feature / tool cards ---------- */
.tool-card { text-align: left; }
.tool-card .tool-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--gold-soft); border: 1px solid rgba(233,185,73,.26); color: var(--gold);
  margin-bottom: 14px;
}
.tool-card .tool-icon svg { width: 23px; height: 23px; }
.tool-card h3 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.tool-card p { font-size: 13.5px; color: var(--muted); line-height: 1.55; }
.tool-card .tool-go { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; color: var(--gold); font-size: 13px; font-weight: 800; }
.tool-card .tool-go svg { width: 15px; height: 15px; }

/* ---------- steps (how it works) ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; padding: 24px 20px; border-radius: var(--radius); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.step .step-num { font-family: var(--font-display); font-size: 34px; font-weight: 800; color: rgba(233,185,73,.28); line-height: 1; margin-bottom: 10px; }
.step h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- page header ---------- */
.page-head { margin-bottom: 34px; }
.breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--faint); font-weight: 600; margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { opacity: .5; }
.page-title { font-family: var(--font-display); font-size: clamp(1.9rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.12; margin-bottom: 10px; }
.page-sub { color: var(--muted); max-width: 760px; font-size: 15.5px; }
.page-sub b { color: var(--text); }

/* ---------- lesson list ---------- */
.lesson-list { display: flex; flex-direction: column; gap: 12px; }
.lesson-row {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--radius-sm);
  text-decoration: none; color: inherit; transition: border-color .2s, transform .2s, background .2s;
}
.lesson-row:hover { border-color: var(--acc, var(--gold)); background: rgba(255,255,255,.05); transform: translateX(3px); }
.lesson-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; font-size: 12px;
}
.lesson-dot.done { background: var(--acc, var(--gold)); border-color: var(--acc, var(--gold)); color: #111; font-weight: 800; }
.lesson-dot.done svg { width: 13px; height: 13px; }
.lesson-main { flex: 1; min-width: 0; }
.lesson-main h3 { font-size: 15.5px; font-weight: 700; margin-bottom: 2px; }
.lesson-main p { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson-meta { display: flex; align-items: center; gap: 14px; color: var(--faint); font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.lesson-meta svg { width: 14px; height: 14px; vertical-align: -2px; }

/* ---------- lesson/article ---------- */
.article { max-width: 820px; margin: 0 auto; }
.article-shell { background: rgba(255,255,255,.025); border: 1px solid var(--line); border-radius: 20px; padding: clamp(22px, 4vw, 48px); }
.article-head { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.article-head h1 { font-family: var(--font-display); font-size: clamp(1.7rem, 3.4vw, 2.4rem); font-weight: 800; line-height: 1.15; margin-bottom: 10px; }
.article-head .article-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; color: var(--faint); font-size: 13px; font-weight: 600; }
.article-head .article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-head .article-meta svg { width: 15px; height: 15px; color: var(--acc, var(--gold)); }

/* markdown typography */
.md { font-size: 15.5px; color: #dedde8; }
.md > * + * { margin-top: 1.05em; }
.md h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; color: var(--text); margin-top: 1.7em; padding-top: .4em; border-top: 1px solid var(--line); }
.md h3 { font-family: var(--font-display); font-size: 19px; font-weight: 700; color: var(--text); margin-top: 1.5em; }
.md p { line-height: 1.75; }
.md strong { color: var(--text); font-weight: 700; }
.md em { color: var(--gold); }
.md a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.md ul, .md ol { padding-left: 1.5em; }
.md ul { list-style: none; }
.md ul li { position: relative; padding-left: 8px; margin-top: .45em; }
.md ul li::before { content: "◆"; position: absolute; left: -1.25em; color: var(--acc, var(--gold)); font-size: .72em; top: .42em; }
.md ol { list-style: decimal; }
.md ol li { margin-top: .45em; padding-left: 6px; }
.md ol li::marker { color: var(--acc, var(--gold)); font-weight: 800; }
.md blockquote { border-left: 3px solid var(--acc, var(--gold)); background: rgba(255,255,255,.03); padding: 14px 18px; border-radius: 0 12px 12px 0; color: var(--muted); font-style: italic; }
.md code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .88em; background: rgba(233,185,73,.1); color: #f2d488; padding: 2px 6px; border-radius: 6px; }
.md pre { background: #0a0a14; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; overflow-x: auto; }
.md pre code { background: none; color: #e8e6f0; padding: 0; }
.md hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 1.4em; }
.md th { text-align: left; font-family: var(--font-display); font-size: 15px; color: var(--gold); padding: 10px 12px; border-bottom: 2px solid var(--acc, var(--gold)); }
.md td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md tr:hover td { background: rgba(255,255,255,.02); }
.md .gloss-term { color: var(--gold); border-bottom: 1px dashed rgba(233,185,73,.5); cursor: help; }
.md .callout { border: 1px solid var(--line-strong); border-left: 4px solid var(--acc, var(--gold)); border-radius: 12px; padding: 16px 20px; background: rgba(255,255,255,.03); }
.md .callout.callout-tip { border-left-color: var(--teal); }
.md .callout.callout-warn { border-left-color: var(--rose); }
.md .callout .callout-label { font-size: 11.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.md .callout-tip .callout-label { color: var(--teal); }
.md .callout-warn .callout-label { color: var(--rose); }
.md .callout .callout-label svg { width: 15px; height: 15px; }

/* lesson nav */
.lesson-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.lesson-nav .btn { flex: 1; min-width: 200px; }
.lesson-complete-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 26px; padding: 16px 20px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: rgba(255,255,255,.03); flex-wrap: wrap; }

/* ---------- flashcards ---------- */
.flash-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.deck-picker { display: flex; gap: 10px; flex-wrap: wrap; }
.deck-pill {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255,255,255,.03); color: var(--muted); font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .18s; font-family: var(--font-body);
}
.deck-pill:hover { border-color: var(--gold); color: var(--gold); }
.deck-pill.active { background: var(--grad-gold); color: #1a1406; border-color: transparent; box-shadow: var(--shadow-gold); }

.flash-stage { max-width: 760px; margin: 0 auto; perspective: 1400px; }
.flash-card {
  position: relative; width: 100%; min-height: 340px; cursor: pointer;
  transform-style: preserve-3d; transition: transform .5s ease;
  border-radius: 22px;
}
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 22px; padding: 44px 40px; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center; gap: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--line-strong);
  box-shadow: 0 30px 70px -30px rgba(0,0,0,.8);
}
.flash-face .face-label { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.flash-face .face-text { font-family: var(--font-display); font-size: clamp(1.25rem, 2.6vw, 1.7rem); font-weight: 700; line-height: 1.4; max-width: 640px; }
.flash-face .face-hint { font-size: 13px; color: var(--faint); font-style: italic; }
.flash-back { transform: rotateY(180deg); }
.flash-back .face-text { font-size: clamp(1.05rem, 2.1vw, 1.35rem); font-weight: 500; font-family: var(--font-body); }
.flash-back .face-back-label { font-size: 11px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--purple); }

.flash-controls { display: flex; justify-content: center; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.flash-counter { text-align: center; color: var(--faint); font-size: 13px; font-weight: 700; margin-top: 18px; }
.flash-verdicts { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.flash-done { text-align: center; max-width: 560px; margin: 40px auto 0; }
.flash-done h2 { font-family: var(--font-display); font-size: 28px; margin-bottom: 10px; }
.flash-done .score-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--gold-soft); border: 1px solid rgba(233,185,73,.3); color: var(--gold); padding: 8px 18px; border-radius: 999px; font-weight: 800; margin: 12px 0 20px; }

/* ---------- quiz ---------- */
.quiz-shell { max-width: 760px; margin: 0 auto; }
.quiz-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.quiz-progress .progress-track { flex: 1; margin-top: 0; }
.quiz-qnum { font-weight: 800; color: var(--gold); font-size: 14px; white-space: nowrap; }
.quiz-question { font-family: var(--font-display); font-size: clamp(1.15rem, 2.4vw, 1.5rem); font-weight: 700; line-height: 1.35; margin-bottom: 24px; }
.quiz-options { display: flex; flex-direction: column; gap: 12px; }
.quiz-option {
  display: flex; align-items: flex-start; gap: 14px; text-align: left; width: 100%;
  padding: 16px 18px; border-radius: var(--radius-sm); cursor: pointer;
  background: rgba(255,255,255,.03); border: 1.5px solid var(--line-strong);
  color: var(--text); font-size: 14.5px; font-family: var(--font-body); font-weight: 600;
  transition: border-color .18s, background .18s; line-height: 1.5;
}
.quiz-option:hover { border-color: var(--gold); }
.quiz-option .opt-letter { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.07); display: grid; place-items: center; font-weight: 800; font-size: 13px; flex-shrink: 0; }
.quiz-option.correct { border-color: var(--teal); background: rgba(45,212,191,.1); }
.quiz-option.correct .opt-letter { background: var(--teal); color: #06201b; }
.quiz-option.wrong { border-color: var(--rose); background: rgba(251,113,133,.1); }
.quiz-option.wrong .opt-letter { background: var(--rose); color: #2a0a10; }
.quiz-option.disabled { pointer-events: none; }
.quiz-feedback { margin-top: 18px; padding: 16px 20px; border-radius: var(--radius-sm); border-left: 4px solid var(--teal); background: rgba(45,212,191,.07); font-size: 14px; line-height: 1.6; }
.quiz-feedback.wrong { border-left-color: var(--rose); background: rgba(251,113,133,.07); }
.quiz-feedback .fb-head { font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; flex-wrap: wrap; }

.quiz-results { text-align: center; max-width: 600px; margin: 30px auto 0; }
.result-ring { width: 150px; height: 150px; margin: 0 auto 18px; position: relative; }
.result-ring svg { transform: rotate(-90deg); }
.result-pct { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: 34px; font-weight: 800; }
.result-msg { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.result-msg b { color: var(--text); }
.result-stats { display: flex; justify-content: center; gap: 30px; margin: 22px 0; color: var(--muted); font-size: 14px; font-weight: 600; }
.result-stats b { display: block; font-family: var(--font-display); font-size: 26px; color: var(--text); }

/* ---------- cheatsheet ---------- */
.cheat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.cheat-card { display: flex; flex-direction: column; }
.cheat-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.cheat-card p { font-size: 13.5px; color: var(--muted); flex: 1; }
.cheat-card .cheat-foot { display: flex; gap: 10px; margin-top: 18px; align-items: center; justify-content: space-between; }
.cheat-card .cheat-mod { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--acc, var(--gold)); }

.cheat-sheet { max-width: 780px; margin: 0 auto; }
.cheat-sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.cheat-sheet .sheet-head h1 { font-family: var(--font-display); font-size: 28px; font-weight: 800; }
.cheat-paper {
  background: #fbfaf6; color: #23202b; border-radius: 18px; padding: clamp(24px, 4vw, 44px);
  box-shadow: 0 40px 90px -30px rgba(0,0,0,.9);
}
.cheat-paper .md { color: #33304a; font-size: 14.5px; }
.cheat-paper .md strong { color: #111; }
.cheat-paper .md em { color: #8a6d1d; }
.cheat-paper .md h2 { color: #1c1a2a; border-top-color: #e5e0d2; }
.cheat-paper .md h3 { color: #1c1a2a; }
.cheat-paper .md code { background: #f1ecd9; color: #6b4f0f; }
.cheat-paper .md ul li::before { color: var(--gold-deep); }
.cheat-paper .md th { color: #8a6d1d; border-bottom-color: #d8cfa8; }
.cheat-paper .md td { border-bottom-color: #ece7d8; }
.cheat-paper .md blockquote { border-left-color: #d4af37; background: #f6f1e3; color: #5c563f; }
.cheat-paper .md hr { background: #e5e0d2; }
.cheat-paper .md .gloss-term { color: #8a6d1d; }

/* ---------- visuals gallery ---------- */
.visual-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.visual-thumb { background: #0a0a15; border-bottom: 1px solid var(--line); padding: 18px; position: relative; }
.visual-thumb svg { width: 100%; height: auto; display: block; }
.visual-thumb .zoom-hint { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.55); border: 1px solid var(--line-strong); display: grid; place-items: center; color: var(--gold); opacity: 0; transition: opacity .2s; }
.visual-card:hover .zoom-hint { opacity: 1; }
.visual-thumb .zoom-hint svg { width: 15px; height: 15px; }
.visual-body { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.visual-body h3 { font-family: var(--font-display); font-size: 16.5px; font-weight: 700; margin-bottom: 5px; }
.visual-body p { font-size: 13px; color: var(--muted); flex: 1; }
.visual-body .visual-mod { margin-top: 12px; font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--acc, var(--gold)); }

/* modal */
.modal-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(4,4,10,.82); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; animation: fadeIn .2s forwards; }
.modal { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; max-width: 980px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; animation: rise .25s ease; }
.modal-close { position: sticky; top: 14px; float: right; margin: 14px 14px -46px 0; z-index: 5; }
.modal-body { padding: clamp(20px, 4vw, 40px); }
.modal-body .modal-svg { background: #0a0a15; border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.modal-body .modal-svg svg { width: 100%; height: auto; }
.modal-body h2 { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.modal-body .modal-caption { color: var(--muted); font-size: 15px; line-height: 1.6; margin-bottom: 16px; }
.modal-body .takeaways { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; }
.modal-body .takeaways h4 { font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.modal-body .takeaways li { margin-top: 6px; font-size: 14px; color: #cfcedb; margin-left: 1.2em; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---------- glossary ---------- */
.gloss-search { max-width: 560px; margin-bottom: 24px; position: relative; }
.gloss-search input { width: 100%; padding: 13px 18px 13px 46px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong); color: var(--text); font-size: 14.5px; font-family: var(--font-body); outline: none; }
.gloss-search input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.gloss-search .g-icon { position: absolute; left: 17px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--faint); }
.gloss-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.gloss-item { background: rgba(255,255,255,.03); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.gloss-item h3 { font-family: var(--font-display); font-size: 16px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.gloss-item p { font-size: 13.5px; color: var(--muted); line-height: 1.6; }

/* ---------- recordings ---------- */
.session-card { display: flex; gap: 20px; padding: 24px; }
.session-card .sess-num {
  width: 54px; height: 54px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  font-family: var(--font-display); font-size: 22px; font-weight: 800;
  background: var(--grad-gold); color: #1a1406; box-shadow: var(--shadow-gold);
}
.session-card .sess-body { flex: 1; }
.session-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.session-card .sess-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12.5px; color: var(--faint); font-weight: 700; margin-bottom: 10px; }
.session-card .sess-meta svg { width: 14px; height: 14px; vertical-align: -2px; color: var(--gold); }
.session-card p { font-size: 13.5px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.session-card .sess-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; border: 1px solid var(--line-strong); color: var(--muted); background: rgba(255,255,255,.03); }

/* ---------- progress page ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.stat-card { text-align: center; padding: 26px 20px; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 42px; font-weight: 800; line-height: 1.1; }
.stat-card .stat-label { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.stat-card .stat-icon { width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 12px; display: grid; place-items: center; background: var(--gold-soft); color: var(--gold); }
.stat-card .stat-icon svg { width: 22px; height: 22px; }

/* ---------- empty / misc ---------- */
.empty { text-align: center; padding: 60px 20px; color: var(--faint); }
.empty svg { width: 44px; height: 44px; margin: 0 auto 14px; opacity: .5; }
.empty h3 { font-family: var(--font-display); color: var(--muted); margin-bottom: 6px; }
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface-2); border: 1px solid var(--gold); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600; z-index: 400;
  opacity: 0; transition: all .3s; box-shadow: 0 20px 50px -18px rgba(0,0,0,.9); pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer ---------- */
.footer { position: relative; z-index: 1; margin-top: 40px; background: var(--cosmic); border-top: 1px solid var(--line); padding-top: 48px; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 34px; padding-bottom: 36px; }
.footer .brand-name { font-size: 22px; }
.footer-tagline { color: var(--muted); font-size: 13.5px; margin-top: 12px; font-style: italic; }
.footer-expand { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.footer-expand .letter { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: var(--gold); display: flex; flex-direction: column; line-height: 1; }
.footer-expand .letter span { font-family: var(--font-body); font-size: 11px; font-weight: 600; color: var(--faint); letter-spacing: .04em; margin-top: 3px; }
.footer-links { display: flex; gap: 40px; }
.footer-col h4 { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.footer-col a { display: block; color: var(--faint); text-decoration: none; font-size: 13.5px; margin-top: 9px; }
.footer-col a:hover { color: var(--gold); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 20px; padding-bottom: 26px; color: var(--faint); font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 26px; }
  .footer-expand { justify-content: center; }
  .nav-links {
    position: fixed; top: 72px; left: 0; right: 0; flex-direction: column; gap: 0;
    background: rgba(7,7,14,.97); border-bottom: 1px solid var(--line);
    padding: 8px 24px 20px; display: none; backdrop-filter: blur(16px);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 4px; width: 100%; border-bottom: 1px solid var(--line); }
  .nav-links a.active::after { display: none; }
  .hamburger { display: grid; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .hero-cta .btn { width: 100%; }
  main#app { padding-top: 92px; }
  .header-inner { height: 64px; }
  .brand-name { font-size: 17px; }
  .brand-tag { display: none; }
  .flash-face { padding: 30px 24px; }
  .flash-card { min-height: 300px; }
  .session-card { flex-direction: column; }
}

/* ---------- print ---------- */
@media print {
  body { background: #fff; }
  .bg-orbs, #site-header, .footer, .lesson-nav, .lesson-complete-bar, .no-print, .breadcrumb { display: none !important; }
  main#app { padding: 0; }
  .cheat-sheet .sheet-head .no-print { display: none !important; }
  .cheat-paper { box-shadow: none; border-radius: 0; padding: 0; }
}

/* ---------- auth gate (Clerk) ---------- */
.auth-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--midnight);
  display: grid; place-items: center; padding: 24px;
}
html.auth-disabled #auth-gate { display: none !important; }
body.auth-locked { overflow: hidden; }
.auth-gate-inner {
  width: 100%; max-width: 420px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 22px; padding: 40px 32px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.9);
  animation: rise .3s ease;
}
.auth-gate-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 24px; }
.auth-gate-brand .brand-crown { width: 56px; height: 56px; }
.auth-gate-title { font-family: var(--font-display); font-size: 24px; font-weight: 800; color: var(--text); }
.auth-gate-title em { font-style: italic; color: var(--gold); }
.auth-gate-sub { color: var(--muted); font-size: 13px; }
.auth-gate-status { color: var(--muted); font-size: 14.5px; margin: 6px 0; line-height: 1.6; }
.auth-gate-status b { color: var(--text); }
.auth-gate-hint { color: var(--faint); font-size: 12.5px; margin-top: 10px; line-height: 1.6; }
.auth-gate-actions-row { display: flex; gap: 12px; justify-content: center; margin-top: 20px; flex-wrap: wrap; }
.auth-spinner {
  width: 34px; height: 34px; margin: 0 auto 14px; border-radius: 50%;
  border: 3px solid rgba(233,185,73,.2); border-top-color: var(--gold);
  animation: authspin .8s linear infinite;
}
@keyframes authspin { to { transform: rotate(360deg); } }

/* Clerk account button in the header */
.clerk-user-button { margin-left: 2px; }

@media print { .auth-gate { display: none !important; } }
