:root {
  --paper: #f5efe3;
  --paper-2: #ece4d3;
  --ink: #1f1d1a;
  --ink-2: #5c5649;
  --gold: #c9a227;
  --gold-ink: #8a6d12;
  --line: #d9cfba;
  --card: #fbf8f1;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--paper); color: var(--ink); font: 17px/1.6 "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); text-decoration-color: var(--gold); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: clamp(30px, 5vw, 48px); margin: 0 0 12px; }
h2 { font-size: clamp(22px, 3vw, 28px); margin: 32px 0 12px; }
h3 { font-size: 19px; margin: 24px 0 8px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.pad { padding-top: 32px; padding-bottom: 32px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
[hidden] { display: none !important; }

header.top { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { font-weight: 700; text-decoration: none; margin-right: auto; }
.brand span { color: var(--gold-ink); }
#nav { display: flex; gap: 18px; font-size: 15px; }
#nav a { text-decoration: none; }

.btn { display: inline-block; border: 0; cursor: pointer; text-decoration: none; background: var(--ink); color: var(--paper); font: inherit; font-weight: 600; padding: 12px 22px; border-radius: 999px; }
.btn.gold { background: var(--gold); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
input[type=text], input[type=email], textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 110px; resize: vertical; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }

.hero { padding: 56px 0 32px; display: grid; gap: 32px; grid-template-columns: 1.1fr 1fr; align-items: center; }
.lead { font-size: 20px; color: var(--ink-2); }
.stats { display: flex; gap: 28px; flex-wrap: wrap; margin: 18px 0 24px; }
.stats b { display: block; font-size: 26px; }

.video { position: relative; aspect-ratio: 16/9; background: var(--paper-2); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.video img, .video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.video .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--gold); color: var(--ink); font-weight: 700; padding: 14px 24px; border-radius: 999px; white-space: nowrap; box-shadow: 0 4px 18px rgba(0,0,0,.18); }
.video.live { cursor: default; }
.video .mark { position: absolute; right: 12px; bottom: 44px; font-size: 12px; color: rgba(255,255,255,.35); pointer-events: none; text-shadow: 0 0 2px rgba(0,0,0,.4); }

.modules { display: grid; gap: 12px; }
.module summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 12px; align-items: baseline; }
.module summary::-webkit-details-marker { display: none; }
.module ol { margin: 10px 0 0; padding-left: 22px; }
.module li { margin: 4px 0; }
.module li.done::marker { color: var(--gold-ink); }
.module li.done a::after { content: " ✓"; color: var(--gold-ink); font-weight: 700; }
.pill { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--paper-2); color: var(--ink-2); white-space: nowrap; }
.pill.gold { background: var(--gold); color: var(--ink); }
.right { margin-left: auto; }

.bar { height: 6px; background: var(--paper-2); border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width .4s; }

.lesson-grid { display: grid; grid-template-columns: 1fr 300px; gap: 28px; padding: 24px 20px 60px; }
.side { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow: auto; font-size: 14px; }
.side a { display: block; padding: 5px 8px; border-radius: 6px; text-decoration: none; }
.side a.on { background: var(--paper-2); font-weight: 700; }
.side a.done::before { content: "✓ "; color: var(--gold-ink); font-weight: 700; }
.side h4 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-2); }
.notes ul { padding-left: 22px; }
.notes li.todo { list-style: none; margin-left: -22px; }
.notes li.todo input { accent-color: var(--gold); margin-right: 8px; }
.notes blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--gold); color: var(--ink-2); }
.tabs { display: flex; gap: 8px; margin: 22px 0 6px; flex-wrap: wrap; }

.thread { border-top: 1px solid var(--line); padding: 14px 0; }
.meta { font-size: 13px; color: var(--ink-2); }
.reply { border-left: 3px solid var(--line); padding: 6px 0 6px 14px; margin: 12px 0; }
.reply.admin { border-left-color: var(--gold); }
.skeleton { color: var(--ink-2); font-size: 14px; }

footer.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; margin-top: 40px; font-size: 14px; color: var(--ink-2); }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 32px; }
  .lesson-grid { grid-template-columns: 1fr; }
  .side { position: static; max-height: none; }
  #nav { gap: 12px; font-size: 14px; }
}
