/* ============================================================
   MIND Classroom — Trainual-style LMS
   Palette: cream #F8ECDC · plate #0c0c0c · signal red #F43F3F
   ============================================================ */

:root {
  --cream: #F8ECDC;
  --cream-deep: #F1E0C8;
  --plate: #0c0c0c;
  --ink: #141414;
  --red: #F43F3F;
  --red-soft: rgba(244, 63, 63, 0.08);
  --green: #1F9D55;
  --green-soft: rgba(31, 157, 85, 0.10);
  --card: #FFFFFF;
  --line: rgba(12, 12, 12, 0.10);
  --line-soft: rgba(12, 12, 12, 0.06);
  --muted: rgba(20, 20, 20, 0.62);
  --shadow: 0 1px 2px rgba(12,12,12,.05), 0 8px 24px -12px rgba(12,12,12,.18);
  --shadow-lift: 0 2px 4px rgba(12,12,12,.06), 0 18px 44px -16px rgba(12,12,12,.28);
  --radius: 14px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
button { font-family: inherit; }

/* ---------- reveal motion ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s cubic-bezier(.22,1,.36,1), transform .5s cubic-bezier(.22,1,.36,1);
}
[data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  * { animation: none !important; transition-duration: .01ms !important; }
}

/* ============================================================
   TOP NAV (shared)
   ============================================================ */
.topnav {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 16px;
  background: var(--plate);
  color: #fff;
  padding: 0 22px;
  height: 58px;
}
.topnav .wordmark {
  display: flex; align-items: baseline; gap: 8px;
  font-weight: 800; letter-spacing: -0.02em; font-size: 17px;
  text-decoration: none; white-space: nowrap;
}
.topnav .wordmark .dot { color: var(--red); }
.topnav .wordmark .sub {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 14px; color: rgba(255,255,255,.66); letter-spacing: 0;
}
.topnav .spacer { flex: 1; }
.nav-pill {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid rgba(255,255,255,.16);
  color: rgba(255,255,255,.85);
  background: transparent;
  border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  text-decoration: none;
  transition: border-color .2s, background .2s;
}
.nav-pill:hover { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.05); }
.nav-pill.red { background: var(--red); border-color: var(--red); color: #fff; }
.nav-pill.red:hover { background: #e23434; }

/* ============================================================
   HOME
   ============================================================ */
.home-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px 90px; }

.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 44px;
  align-items: center; padding: 72px 0 56px;
}
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--red); margin: 0 0 14px;
}
.hero h1 {
  font-size: clamp(40px, 5vw, 62px);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.02;
  margin: 0 0 18px;
}
.hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--red); }
.hero .lede { font-size: 18px; color: var(--muted); max-width: 52ch; margin: 0 0 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  border: none; cursor: pointer; text-decoration: none;
  border-radius: 999px; padding: 13px 24px;
  font-size: 15px; font-weight: 700;
  transition: transform .18s cubic-bezier(.22,1,.36,1), background .2s, box-shadow .2s;
}
.btn:active { transform: scale(.985); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 10px 24px -10px rgba(244,63,63,.55); }
.btn-red:hover { background: #e23434; transform: translateY(-1px); }
.btn-dark { background: var(--plate); color: #fff; }
.btn-dark:hover { background: #232323; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }

.hero-art {
  border-radius: 22px; overflow: hidden;
  box-shadow: var(--shadow-lift);
  border: 1px solid var(--line-soft);
  background: var(--card);
}
.hero-art img { display: block; width: 100%; height: 100%; object-fit: cover; }

.stat-strip {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin: 8px 0 54px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 18px 20px;
  box-shadow: var(--shadow);
}
.stat-card .num {
  font-size: 28px; font-weight: 800; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.stat-card .num span { color: var(--red); }
.stat-card .lbl { font-size: 12.5px; color: var(--muted); font-weight: 600; margin-top: 2px; }

.section-h {
  display: flex; align-items: baseline; gap: 14px;
  margin: 0 0 18px;
}
.section-h h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; margin: 0; }
.section-h .rule { flex: 1; height: 1px; background: var(--line); }

.course-card {
  display: grid; grid-template-columns: 132px 1fr auto; gap: 26px;
  align-items: center;
  background: var(--plate); color: #fff;
  border-radius: 20px; padding: 28px 32px;
  box-shadow: var(--shadow-lift);
  margin-bottom: 54px;
  cursor: pointer; text-decoration: none;
  transition: transform .22s cubic-bezier(.22,1,.36,1);
}
.course-card:hover { transform: translateY(-3px); }
.ring-wrap { position: relative; width: 116px; height: 116px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg { stroke: rgba(255,255,255,.12); }
.ring-fg { stroke: var(--red); transition: stroke-dashoffset .9s cubic-bezier(.22,1,.36,1); }
.ring-label {
  position: absolute; inset: 0; display: grid; place-content: center;
  font-weight: 800; font-size: 23px; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.course-card h3 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.025em; }
.course-card h3 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--red); }
.course-card .meta { color: rgba(255,255,255,.6); font-size: 14px; margin-bottom: 14px; }
.module-chiplets { display: flex; gap: 8px; flex-wrap: wrap; }
.chiplet {
  font-size: 12px; font-weight: 600; padding: 5px 11px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1);
  border-radius: 999px; color: rgba(255,255,255,.82);
}
.chiplet.done { background: rgba(31,157,85,.22); border-color: rgba(31,157,85,.4); }
.course-card .go {
  font-size: 38px; color: var(--red); font-weight: 300;
  padding: 0 6px;
}

.brief-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; margin-bottom: 14px; }
.brief-card {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); padding: 24px 26px; box-shadow: var(--shadow);
}
.brief-card h4 { margin: 0 0 12px; font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.brief-card h4 .tag {
  font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--red); display: block; margin-bottom: 6px;
}
.brief-card ol, .brief-card ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14.5px; }
.brief-card li { margin-bottom: 7px; }
.brief-card li strong { color: var(--ink); }
.brief-card a { color: var(--red); font-weight: 600; text-decoration: none; }
.brief-card a:hover { text-decoration: underline; }

.footer-note {
  text-align: center; color: var(--muted); font-size: 13px; margin-top: 70px;
}
.footer-note .dot { color: var(--red); }

/* ============================================================
   COURSE SHELL
   ============================================================ */
.shell { display: flex; min-height: calc(100vh - 58px); }

/* ----- sidebar ----- */
.side {
  width: 312px; flex-shrink: 0;
  background: var(--plate); color: #fff;
  padding: 26px 0 40px;
  position: sticky; top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
}
.side-head { padding: 0 24px 18px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-head .kicker {
  font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255,255,255,.45); margin-bottom: 6px;
}
.side-head h2 { margin: 0 0 14px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.side-head h2 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--red); }
.progress-track {
  height: 7px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 999px; background: var(--red);
  transition: width .7s cubic-bezier(.22,1,.36,1);
}
.progress-text { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 7px; font-variant-numeric: tabular-nums; }

.mod-group { border-bottom: 1px solid rgba(255,255,255,.06); }
.mod-head {
  width: 100%; display: flex; align-items: center; gap: 12px;
  background: none; border: none; color: #fff; text-align: left;
  padding: 15px 24px; cursor: pointer; font-size: 14.5px; font-weight: 700;
}
.mod-head:hover { background: rgba(255,255,255,.04); }
.mod-head .icon { width: 22px; text-align: center; }
.mod-head .count { margin-left: auto; font-size: 11.5px; color: rgba(255,255,255,.4); font-weight: 600; font-variant-numeric: tabular-nums; }
.mod-head .chev { color: rgba(255,255,255,.4); font-size: 11px; transition: transform .25s; }
.mod-group.open .chev { transform: rotate(90deg); }
.mod-lessons { display: none; padding: 2px 0 10px; }
.mod-group.open .mod-lessons { display: block; }

.lesson-link {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 24px 8px 30px;
  font-size: 13.5px; color: rgba(255,255,255,.66);
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  font-family: inherit;
}
.lesson-link:hover { color: #fff; background: rgba(255,255,255,.04); }
.lesson-link.active { color: #fff; background: rgba(244,63,63,.13); box-shadow: inset 3px 0 0 var(--red); }
.tick {
  width: 17px; height: 17px; flex-shrink: 0; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.28);
  display: grid; place-content: center; font-size: 10px; color: transparent;
  transition: all .25s;
}
.lesson-link.done .tick { background: var(--green); border-color: var(--green); color: #fff; }

/* ----- main column ----- */
.main { flex: 1; min-width: 0; }
.course-topbar {
  position: sticky; top: 58px; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  background: rgba(248, 236, 220, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line-soft);
  padding: 12px 30px;
}
.search-box {
  flex: 1; max-width: 430px; display: flex; align-items: center; gap: 9px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px;
}
.search-box input {
  border: none; outline: none; background: none; width: 100%;
  font-size: 14px; font-family: inherit; color: var(--ink);
}
.search-box .kbd {
  font-family: var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px;
}
.topbar-progress {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.topbar-progress .mini-track { width: 110px; height: 6px; background: rgba(12,12,12,.1); border-radius: 999px; overflow: hidden; }
.topbar-progress .mini-fill { height: 100%; background: var(--red); border-radius: 999px; transition: width .6s cubic-bezier(.22,1,.36,1); }

.lesson-wrap { max-width: 800px; margin: 0 auto; padding: 44px 34px 110px; }
.lesson-head .crumb {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
}
.lesson-head h1 {
  font-size: clamp(28px, 3.4vw, 40px); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.08; margin: 0 0 12px;
}
.lesson-meta {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 13.5px; margin-bottom: 34px;
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.lesson-meta .done-badge { color: var(--green); font-weight: 700; }

/* prose */
.prose { font-size: 16.5px; }
.prose h2 {
  font-size: 23px; font-weight: 800; letter-spacing: -0.02em;
  margin: 42px 0 14px; padding-top: 8px;
}
.prose h2::before { content: ""; display: block; width: 34px; height: 3px; background: var(--red); border-radius: 2px; margin-bottom: 12px; }
.prose h3 { font-size: 18px; font-weight: 700; margin: 30px 0 10px; }
.prose p { margin: 0 0 16px; }
.prose li { margin-bottom: 7px; }
.prose strong { font-weight: 700; }
.prose code {
  font-family: var(--mono); font-size: .86em;
  background: rgba(12,12,12,.06); border-radius: 5px; padding: 2px 6px;
}
.prose pre {
  background: var(--plate); color: #f3f3f3; border-radius: 12px;
  padding: 18px 20px; overflow-x: auto; font-size: 13.5px; line-height: 1.6;
}
.prose pre code { background: none; padding: 0; color: inherit; }
.prose table {
  width: 100%; border-collapse: collapse; font-size: 14px; margin: 18px 0;
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow); display: block; overflow-x: auto;
}
.prose th {
  background: var(--plate); color: #fff; text-align: left;
  padding: 11px 14px; font-size: 12.5px; letter-spacing: .04em; white-space: nowrap;
}
.prose td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.prose tr:last-child td { border-bottom: none; }
.prose blockquote {
  margin: 18px 0; padding: 14px 20px;
  border-left: 3px solid var(--red); background: var(--red-soft);
  border-radius: 0 10px 10px 0; color: var(--ink);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; }

/* callouts */
.callout {
  border-radius: var(--radius); padding: 22px 24px; margin: 34px 0;
  border: 1px solid var(--line-soft); box-shadow: var(--shadow);
}
.callout h4 {
  margin: 0 0 12px; font-size: 13px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.callout ul { margin: 0; padding-left: 20px; }
.callout li { margin-bottom: 8px; font-size: 15px; }
.callout.takeaways { background: var(--card); }
.callout.takeaways h4 { color: var(--green); }
.callout.traps { background: #100d0b; color: #f5ede2; border-color: transparent; }
.callout.traps h4 { color: var(--red); }
.callout.traps li { color: rgba(245,237,226,.88); }

/* quiz */
.quiz {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 18px; padding: 28px 30px; margin: 40px 0 8px;
  box-shadow: var(--shadow);
}
.quiz > h3 { margin: 0 0 4px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.quiz > .quiz-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 22px; }
.q-item { margin-bottom: 26px; }
.q-item .q-text { font-weight: 700; font-size: 15.5px; margin-bottom: 12px; }
.q-opt {
  display: flex; align-items: flex-start; gap: 11px;
  border: 1.5px solid var(--line); border-radius: 11px;
  padding: 11px 15px; margin-bottom: 8px; cursor: pointer;
  font-size: 14.5px; transition: border-color .18s, background .18s;
}
.q-opt:hover { border-color: var(--ink); }
.q-opt input { margin-top: 3px; accent-color: var(--red); }
.q-opt.correct { border-color: var(--green); background: var(--green-soft); }
.q-opt.incorrect { border-color: var(--red); background: var(--red-soft); }
.q-expl {
  display: none; font-size: 13.5px; color: var(--muted);
  background: rgba(12,12,12,.04); border-radius: 9px; padding: 11px 14px; margin-top: 6px;
}
.q-item.revealed .q-expl { display: block; }
.quiz-actions { display: flex; align-items: center; gap: 16px; margin-top: 4px; }
.quiz-score { font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.quiz-score.pass { color: var(--green); }
.quiz-score.fail { color: var(--red); }

/* lesson footer nav */
.lesson-nav {
  display: flex; align-items: center; gap: 14px;
  margin-top: 44px; padding-top: 28px; border-top: 1px solid var(--line);
}
.lesson-nav .spacer { flex: 1; }

/* ----- chat dock ----- */
.chat-dock {
  width: 374px; flex-shrink: 0;
  border-left: 1px solid var(--line-soft);
  background: #FBF4E8;
  position: sticky; top: 58px; height: calc(100vh - 58px);
  display: flex; flex-direction: column;
}
.chat-dock.hidden { display: none; }
.chat-head {
  padding: 18px 22px 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--card);
}
.chat-head h3 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 9px; }
.chat-head h3 .pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(31,157,85,.45); }
  70% { box-shadow: 0 0 0 8px rgba(31,157,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); }
}
.chat-head .handle { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-top: 3px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 18px 18px 8px; }
.msg { margin-bottom: 14px; max-width: 92%; }
.msg .bubble {
  border-radius: 14px; padding: 11px 15px; font-size: 14px; line-height: 1.55;
  box-shadow: var(--shadow);
}
.msg.user { margin-left: auto; }
.msg.user .bubble { background: var(--plate); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bubble { background: var(--card); border-bottom-left-radius: 4px; }
.msg.bot .bubble p { margin: 0 0 10px; } .msg.bot .bubble p:last-child { margin: 0; }
.msg.bot .bubble ul, .msg.bot .bubble ol { margin: 6px 0; padding-left: 18px; }
.msg.bot .bubble code { background: rgba(12,12,12,.07); border-radius: 4px; padding: 1px 5px; font-size: .85em; font-family: var(--mono); }
.msg .who { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.msg.user .who { text-align: right; }
.typing { display: inline-flex; gap: 4px; padding: 13px 16px; }
.typing i {
  width: 7px; height: 7px; border-radius: 50%; background: rgba(12,12,12,.35);
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .18s; }
.typing i:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.chat-quick { display: flex; gap: 7px; flex-wrap: wrap; padding: 6px 18px 10px; }
.quick-chip {
  font-size: 12px; font-weight: 600; cursor: pointer;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; color: var(--ink);
  transition: border-color .18s;
}
.quick-chip:hover { border-color: var(--red); color: var(--red); }
.chat-input {
  display: flex; gap: 9px; padding: 12px 16px 16px;
  border-top: 1px solid var(--line-soft); background: var(--card);
}
.chat-input textarea {
  flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 14px; padding: 10px 13px; outline: none;
  max-height: 110px; background: #fff; color: var(--ink);
}
.chat-input textarea:focus { border-color: var(--red); }
.chat-send {
  align-self: flex-end;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  border-radius: 11px; width: 42px; height: 42px; font-size: 17px;
  display: grid; place-content: center;
  transition: background .2s, transform .15s;
}
.chat-send:hover { background: #e23434; }
.chat-send:disabled { opacity: .45; cursor: default; }

/* ----- search modal ----- */
.modal-veil {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(12,12,12,.45); backdrop-filter: blur(3px);
  display: grid; place-items: start center; padding-top: 12vh;
}
.search-modal {
  width: min(640px, 92vw); background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow-lift); overflow: hidden;
}
.search-modal input {
  width: 100%; border: none; outline: none; font-family: inherit;
  font-size: 17px; padding: 19px 24px; border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
}
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.s-hit {
  display: block; width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; padding: 12px 16px; border-radius: 11px; font-family: inherit;
}
.s-hit:hover, .s-hit.sel { background: var(--red-soft); }
.s-hit .s-mod { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.s-hit .s-title { font-weight: 700; font-size: 15px; margin: 2px 0; color: var(--ink); }
.s-hit .s-snip { font-size: 13px; color: var(--muted); }
.s-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 14px; }

/* ----- mobile FABs / drawer ----- */
.fab {
  display: none;
  position: fixed; z-index: 70; bottom: 20px;
  width: 54px; height: 54px; border-radius: 50%;
  border: none; cursor: pointer; font-size: 21px;
  box-shadow: var(--shadow-lift);
  place-content: center;
}
.fab.chat-fab { right: 18px; background: var(--red); color: #fff; }
.fab.menu-fab { left: 18px; background: var(--plate); color: #fff; }

.module-empty {
  margin: 60px auto; max-width: 560px; text-align: center;
  background: var(--card); border-radius: 18px; padding: 44px 36px;
  box-shadow: var(--shadow);
}
.module-empty h2 { margin: 0 0 10px; }
.module-empty p { color: var(--muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1180px) {
  .chat-dock {
    position: fixed; right: 0; top: 58px; bottom: 0; height: auto;
    z-index: 80; box-shadow: -18px 0 44px -20px rgba(12,12,12,.4);
    transform: translateX(105%); transition: transform .32s cubic-bezier(.22,1,.36,1);
    display: flex;
  }
  .chat-dock.open { transform: none; }
  .chat-dock.hidden { display: flex; }
  .fab.chat-fab { display: grid; }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 30px; padding-top: 44px; }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
  .brief-grid { grid-template-columns: 1fr; }
  .course-card { grid-template-columns: 92px 1fr; }
  .course-card .go { display: none; }
  .ring-wrap { width: 88px; height: 88px; }
  .ring-wrap svg { width: 88px; height: 88px; }
  .ring-label { font-size: 17px; }

  .side {
    position: fixed; left: 0; top: 58px; bottom: 0; height: auto; z-index: 80;
    transform: translateX(-105%); transition: transform .32s cubic-bezier(.22,1,.36,1);
    box-shadow: 18px 0 44px -20px rgba(12,12,12,.4);
    width: min(320px, 86vw);
  }
  .side.open { transform: none; }
  .fab.menu-fab { display: grid; }
  .lesson-wrap { padding: 30px 20px 120px; }
  .course-topbar { padding: 10px 16px; }
  .topbar-progress .mini-track { display: none; }
  .search-box .kbd { display: none; }
}

@media (max-width: 480px) {
  .topnav { padding: 0 14px; }
  .topnav .wordmark .sub { display: none; }
  .nav-pill span.lbl { display: none; }
  .home-wrap { padding: 0 16px 60px; }
  .hero h1 { font-size: 36px; }
  .stat-card .num { font-size: 22px; }
  .chat-dock { width: 100vw; }
  .quiz { padding: 20px 18px; }
  .course-card { padding: 22px 20px; }
}

/* ============================================================
   MARKETPLACE + COMMERCE
   ============================================================ */
.market-hero {
  background: var(--plate); color: #fff;
  padding: 78px 24px 64px;
}
.market-hero-inner { max-width: 1180px; margin: 0 auto; }
.eyebrow.light { color: var(--red); }
.market-hero h1 {
  font-size: clamp(42px, 5.4vw, 68px);
  font-weight: 800; letter-spacing: -0.035em; line-height: 1.02;
  margin: 0 0 16px;
}
.market-hero h1 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--red); }
.market-hero .lede { font-size: 18px; color: rgba(255,255,255,.64); max-width: 60ch; margin: 0; }

.market-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-bottom: 30px;
}
.market-card {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 18px; overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .22s cubic-bezier(.22,1,.36,1), box-shadow .22s;
}
.market-card:not(.soon):hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.market-thumb { position: relative; aspect-ratio: 16/9; background: var(--cream-deep); overflow: hidden; }
.market-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.price-chip, .own-chip {
  position: absolute; top: 12px; right: 12px;
  font-size: 13px; font-weight: 800; padding: 6px 13px; border-radius: 999px;
  box-shadow: var(--shadow);
}
.price-chip { background: var(--red); color: #fff; }
.own-chip { background: var(--green); color: #fff; }
.soon-thumb { display: grid; place-content: center; font-size: 44px; filter: grayscale(.3); }
.market-body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.market-body h3 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.market-body h3 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--red); }
.market-body p { margin: 0; color: var(--muted); font-size: 14px; flex: 1; }
.market-meta { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.market-cta { color: var(--red); font-weight: 700; font-size: 14.5px; margin-top: 4px; }
.market-card.soon { opacity: .62; }

.locked-note {
  margin: 22px 0 -18px; padding: 13px 18px;
  background: var(--red-soft); border: 1px solid rgba(244,63,63,.25);
  border-radius: 12px; font-size: 14px; font-weight: 600;
}

.pricing-grid {
  display: grid; grid-template-columns: .9fr 1.1fr; gap: 16px; margin-bottom: 54px;
}
.price-card {
  background: var(--plate); color: #fff;
  border-radius: 20px; padding: 30px 30px 26px;
  box-shadow: var(--shadow-lift);
  display: flex; flex-direction: column;
}
.price-big { font-size: 46px; font-weight: 800; letter-spacing: -0.03em; margin-bottom: 14px; }
.price-big .once { font-size: 15px; font-weight: 600; color: rgba(255,255,255,.55); letter-spacing: 0; }
.price-list { list-style: none; margin: 0 0 22px; padding: 0; }
.price-list li { padding: 7px 0; font-size: 14.5px; color: rgba(255,255,255,.85); border-bottom: 1px solid rgba(255,255,255,.07); }
.price-list li:last-child { border-bottom: none; }
.btn-wide { width: 100%; justify-content: center; }
.code-link {
  background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.55); font-size: 13px; font-weight: 600;
  margin-top: 13px; text-decoration: underline; font-family: inherit;
}
.code-link:hover { color: #fff; }
.curr-card {
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: 20px; padding: 26px 28px; box-shadow: var(--shadow);
}
.curr-card h4 {
  margin: 0 0 14px; font-size: 13px; font-weight: 800;
  letter-spacing: .13em; text-transform: uppercase; color: var(--red);
}
.curr-row {
  display: grid; grid-template-columns: 30px 1fr auto; grid-template-rows: auto auto;
  gap: 0 10px; padding: 11px 0; border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
}
.curr-row:last-child { border-bottom: none; }
.curr-icon { grid-row: span 2; font-size: 17px; }
.curr-title { font-weight: 700; font-size: 15px; }
.curr-sub { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.curr-count { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }

.unlock-modal {
  width: min(440px, 92vw); background: var(--card);
  border-radius: 18px; box-shadow: var(--shadow-lift);
  padding: 30px 30px 26px; text-align: center;
}
.unlock-modal h3 { margin: 0 0 8px; font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.unlock-modal h3 em { font-family: var(--serif); font-style: italic; font-weight: 500; color: var(--red); }
.unlock-note { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.unlock-modal input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: var(--mono); font-size: 16px; letter-spacing: .06em;
  padding: 13px 16px; outline: none; text-align: center; text-transform: uppercase;
  color: var(--ink); background: #fff;
}
.unlock-modal input:focus { border-color: var(--red); }
.unlock-actions { margin-top: 14px; }
.unlock-actions .btn { width: 100%; justify-content: center; }
.unlock-msg { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--muted); min-height: 18px; }

@media (max-width: 900px) {
  .market-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .market-hero { padding: 54px 18px 44px; }
}

.locked-note.claimed {
  background: var(--green-soft); border-color: rgba(31,157,85,.3);
  color: var(--ink);
}

/* ---------- email capture + course requests ---------- */
.capture-band {
  display: flex; align-items: center; gap: 26px; flex-wrap: wrap;
  background: var(--plate); color: #fff;
  border-radius: 20px; padding: 28px 32px; margin: 10px 0 44px;
  box-shadow: var(--shadow-lift);
}
.capture-band .capture-copy { flex: 1; min-width: 260px; }
.capture-band h3 { margin: 0 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.capture-band p { margin: 0; color: rgba(255,255,255,.62); font-size: 14px; }
.capture-form { display: flex; gap: 10px; flex-wrap: wrap; }
.capture-form input {
  border: 1.5px solid rgba(255,255,255,.18); background: rgba(255,255,255,.06);
  color: #fff; border-radius: 999px; padding: 12px 20px; font-family: inherit;
  font-size: 14.5px; outline: none; min-width: 240px;
}
.capture-form input:focus { border-color: var(--red); }
.capture-form input::placeholder { color: rgba(255,255,255,.4); }
.capture-request {
  flex-basis: 100%; background: none; border: none; cursor: pointer;
  color: rgba(255,255,255,.5); font-size: 13px; font-weight: 600;
  text-align: left; padding: 0; font-family: inherit; text-decoration: underline;
}
.capture-request:hover { color: #fff; }
.capture-band.done { background: var(--card); color: var(--ink); border: 1px solid var(--line-soft); box-shadow: var(--shadow); }
.capture-band.done p { color: var(--muted); }

.market-card.request-card {
  cursor: pointer; border: 1.5px dashed rgba(12,12,12,.22); background: transparent;
  box-shadow: none; text-align: left; font-family: inherit; font-size: inherit; padding: 0;
}
.market-card.request-card:hover { border-color: var(--red); transform: translateY(-4px); }
.market-card.request-card .soon-thumb { background: var(--red-soft); }

.request-modal input, .request-modal textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  font-family: inherit; font-size: 14.5px; padding: 12px 14px; outline: none;
  margin-bottom: 10px; text-align: left; text-transform: none; letter-spacing: 0;
  color: var(--ink); background: #fff; resize: vertical;
}
.request-modal input:focus, .request-modal textarea:focus { border-color: var(--red); }
