:root {
  --ink: #0A0A0A; --body: #2C2A26; --paper: #F4F2EC; --panel: #FBFAF6;
  --line-soft: #C9C6BF; --mute: #807D77; --gold: #B3951A; --gold-deep: #8F760F;
  --kali: #D03878; --kali-deep: #C93372; --ok: #2F6B3F;
  --sans: "Satoshi", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --serif: 'EB Garamond', Georgia, "Times New Roman", serif;
  --pad: clamp(18px, 4vw, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--body); font-family: var(--sans); font-size: 1rem; line-height: 1.6; }
a { color: var(--gold-deep); text-decoration: none; }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; color: var(--ink); letter-spacing: -0.015em; line-height: 1.12; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: balance; }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px var(--pad); border-bottom: 1px solid var(--line-soft); }
.top__mark { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); letter-spacing: -0.01em; }
.top__mark span { font-family: var(--sans); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); margin-left: 6px; }
.top__nav { display: flex; align-items: center; gap: clamp(12px, 2.4vw, 26px); font-size: 0.9375rem; }
.top__nav a { color: var(--body); }
.top__nav a:hover { color: var(--ink); }
.top__nav button { background: none; border: 0; padding: 0; color: var(--mute); }
.top__nav button:hover { color: var(--ink); }

.app { max-width: 1160px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) var(--pad) 96px; }
.eyebrow { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); margin: 0 0 12px; }
.lede { font-size: 1.125rem; color: var(--body); max-width: 40rem; }
.btn { display: inline-block; background: var(--ink); color: #fff; border: 1px solid var(--ink); border-radius: 999px; padding: 13px 26px; font-weight: 500; font-size: 0.9375rem; }
.btn:hover { background: #2a2a2a; color: #fff; }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: 0.55; cursor: default; }
.note { color: var(--mute); font-size: 0.9375rem; }
.error { color: #9B2C2C; font-size: 0.9375rem; min-height: 1.5em; margin: 12px 0 0; }

/* sign in and register */
.door { max-width: 30rem; margin: 0 auto; }
.door h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin-bottom: 14px; }
.door form { margin-top: 28px; display: grid; gap: 16px; }
.field { display: grid; gap: 6px; position: relative; }
.field > span { font-size: 0.8125rem; font-weight: 500; color: var(--ink); }
.field input, .field select { width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); }
.field small { color: var(--mute); font-size: 0.8125rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9375rem; }
.check input { margin-top: 5px; accent-color: var(--ink); }
.picks { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,0.08); }
.picks button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 10px 14px; color: var(--ink); }
.picks button:hover, .picks button:focus { background: var(--paper); outline: none; }
.picks button small { display: block; color: var(--mute); }
.picks button[disabled] { color: var(--mute); cursor: default; }
.door__swap { margin-top: 22px; font-size: 0.9375rem; color: var(--mute); }

/* layout shared by home and lesson */
.cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 4vw, 56px); align-items: start; }
.side { display: grid; gap: 22px; position: sticky; top: 24px; }
.card { background: var(--panel); border: 1px solid var(--line-soft); border-radius: 12px; padding: 22px; }
.card h3 { font-family: var(--sans); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 14px; }
.facts { margin: 0; display: grid; gap: 12px; }
.facts div { display: grid; gap: 1px; }
.facts dt { font-size: 0.8125rem; color: var(--mute); }
.facts dd { margin: 0; color: var(--ink); font-size: 0.9375rem; line-height: 1.45; }
.learned { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 0.9375rem; color: var(--ink); line-height: 1.45; }
.learned li { padding-left: 18px; position: relative; }
.learned li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.card details summary { cursor: pointer; list-style: none; }
.card details summary::-webkit-details-marker { display: none; }

.bar { display: flex; gap: 4px; margin: 0 0 clamp(22px, 3vw, 34px); }
.bar i { flex: 1; height: 5px; border-radius: 3px; background: var(--line-soft); }
.bar i.is-done { background: var(--ink); }
.bar i.is-now { background: var(--gold); }

/* home */
.home h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin-bottom: 10px; }
.nextup { margin: 30px 0 38px; background: var(--ink); color: #fff; border-radius: 14px; padding: clamp(24px, 3.4vw, 36px); }
.nextup .eyebrow { color: #D9C36A; }
.nextup h2 { color: #fff; font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-bottom: 20px; }
.nextup .btn { background: #fff; color: var(--ink); border-color: #fff; }
.nextup .btn:hover { background: var(--paper); color: var(--ink); }
.list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.list li { display: flex; align-items: baseline; gap: 14px; padding: 14px 2px; border-bottom: 1px solid var(--line-soft); }
.list .n { width: 1.6em; color: var(--mute); font-variant-numeric: tabular-nums; }
.list .t { flex: 1; color: var(--ink); }
.list .t small { display: block; color: var(--mute); font-size: 0.8125rem; }
.list .s { font-size: 0.8125rem; color: var(--mute); white-space: nowrap; }
.list .is-passed .s { color: var(--ok); }
.list .is-locked .t { color: var(--mute); }
.list a.t:hover { color: var(--gold-deep); }

/* lesson */
.lesson h1 { font-size: clamp(2rem, 4.6vw, 2.9rem); margin-bottom: 22px; }
.lesson__body p { font-size: 1.0625rem; line-height: 1.7; }
.turn { margin-top: 30px; border-top: 1px solid var(--ink); padding-top: 24px; }
.turn h2 { font-size: 1.6rem; margin-bottom: 10px; }
.turn__q { font-size: 1.125rem; color: var(--ink); }
.turn__shown { margin: 4px 0 18px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 10px; font-size: 0.9375rem; }
.turn__shown p { margin: 0 0 4px; }
.turn__shown p:last-child { margin: 0; }
.thread { display: grid; gap: 14px; margin: 22px 0; }
.msg { max-width: 92%; padding: 14px 18px; border-radius: 14px; white-space: pre-wrap; overflow-wrap: anywhere; text-wrap: pretty; }
.msg--kali { background: #fff; border: 1px solid var(--line-soft); color: var(--ink); justify-self: start; border-top-left-radius: 4px; }
.msg--learner { background: var(--ink); color: #fff; justify-self: end; border-top-right-radius: 4px; }
.msg__who { display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 4px; }
.msg--pass { border-color: var(--ok); }
.msg--wait { color: var(--mute); font-style: italic; }
.passed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 6px 0 22px; padding: 16px 20px; border: 1px solid var(--ok); border-radius: 12px; background: #F1F6F1; color: var(--ink); }
.passed strong { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.say { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.say textarea { width: 100%; min-height: 58px; max-height: 240px; resize: vertical; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; }
.say textarea:focus { outline: none; border-color: var(--ink); }
.say button { background: var(--kali); color: #fff; border: 0; border-radius: 999px; padding: 15px 24px; font-weight: 500; }
.say button:hover { background: var(--kali-deep); }
.say button[disabled] { opacity: 0.55; cursor: default; }

/* accreditation */
.acc h1 { font-size: clamp(2.1rem, 5vw, 3.1rem); margin-bottom: 14px; }
.acc__sheet { margin-top: 30px; background: var(--panel); border: 1px solid var(--line-soft); border-radius: 14px; padding: clamp(26px, 4vw, 48px); max-width: 44rem; }
.acc__sheet h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 6px 0 4px; }
.acc__sheet .who { font-family: var(--serif); font-size: 1.5rem; color: var(--ink); margin: 18px 0 2px; }
.acc__terms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line-soft); }
.acc__terms span { display: block; font-size: 0.8125rem; color: var(--mute); }
.acc__terms b { font-weight: 500; color: var(--ink); }

@media (max-width: 860px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .two { grid-template-columns: 1fr; }
  .acc__terms { grid-template-columns: 1fr; }
  .msg { max-width: 100%; }
}
@media (max-width: 520px) {
  .top__nav a:first-child { display: none; }
  .say { grid-template-columns: 1fr; }
  .say button { width: 100%; }
}
@media (prefers-reduced-motion: no-preference) {
  .msg { animation: rise .25s ease both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
}
