:root {
  --paper: #FAF6EE;
  --card: #FFFDF8;
  --ink: #2A2A2A;
  --ink-soft: #5A5550;
  --accent: #E8590C;
  --accent-soft: #FBE3D4;
  --sage: #4C8577;
  --sage-soft: #DCEAE5;
  --line: #E5DCCB;
  --hl: #FFE8A3;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Inter", system-ui, sans-serif; background: var(--paper); color: var(--ink); line-height: 1.65; }
.hand { font-family: "Caveat", cursive; }

.layout { display: flex; min-height: 100vh; }

/* ---------- sidebar ---------- */
aside { width: 300px; flex-shrink: 0; border-right: 2px solid var(--line); padding: 28px 22px; background: var(--card); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.back-link { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); text-decoration: none; margin-bottom: 14px; }
.back-link:hover { color: var(--accent); }
.module-kicker { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.module-title { font-family: "Caveat", cursive; font-size: 30px; font-weight: 700; line-height: 1.15; margin: 6px 0 4px; }
.module-sub { font-size: 13px; color: var(--ink-soft); margin-bottom: 18px; }
.progress-wrap { margin-bottom: 20px; }
.progress-track { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: var(--sage); border-radius: 99px; transition: width .4s ease; }
.progress-label { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.nav-sectie { font-family: "Caveat", cursive; font-size: 19px; font-weight: 700; color: var(--accent); margin: 16px 4px 4px; }
nav button { display: flex; align-items: flex-start; gap: 10px; width: 100%; background: none; border: none; text-align: left; padding: 9px 12px; border-radius: 12px; cursor: pointer; font-family: inherit; font-size: 13.5px; color: var(--ink); line-height: 1.35; }
nav button:hover { background: var(--accent-soft); }
nav button.active { background: var(--accent-soft); font-weight: 600; }
.dot { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--card); margin-top: 1px; }
nav button.done .dot { background: var(--sage); border-color: var(--sage); color: #fff; }

/* ---------- main ---------- */
main { flex: 1; display: flex; justify-content: center; padding: 48px 32px 80px; }
.lesson { max-width: 680px; width: 100%; display: none; }
.lesson.visible { display: block; animation: fadein .35s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.kicker { font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
h1 { font-family: "Caveat", cursive; font-size: 46px; font-weight: 700; line-height: 1.1; margin: 8px 0 22px; }
h2 { font-size: 19px; font-weight: 800; margin: 34px 0 10px; }
p { margin-bottom: 16px; font-size: 16px; }
.muted { color: var(--ink-soft); }
mark { background: var(--hl); padding: 0 4px; border-radius: 4px; }

.illu { background: var(--card); border: 2px solid var(--ink); border-radius: 18px; padding: 18px; margin: 26px 0; box-shadow: 4px 4px 0 var(--line); transform: rotate(-0.4deg); }
.illu svg { display: block; width: 100%; height: auto; }
.illu-caption { font-family: "Caveat", cursive; font-size: 19px; text-align: center; color: var(--ink-soft); margin-top: 6px; }

.callout { border: 2px solid var(--ink); border-radius: 16px; background: var(--accent-soft); padding: 18px 20px; margin: 28px 0; box-shadow: 4px 4px 0 var(--line); }
.callout .label { font-family: "Caveat", cursive; font-size: 22px; font-weight: 700; color: var(--accent); }
.callout p { margin: 4px 0 0; font-size: 17px; font-weight: 600; }
.callout p.gewoon { font-weight: 400; }

.note { border-left: 4px solid var(--sage); background: var(--sage-soft); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 20px 0; font-size: 14.5px; }

table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 15px; }
th, td { border: 2px solid var(--line); padding: 10px 12px; text-align: left; }
th { background: var(--card); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 44px; }
.btn { font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer; border: 2px solid var(--ink); border-radius: 14px; padding: 12px 22px; background: var(--card); color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transition: transform .08s ease, box-shadow .08s ease; text-decoration: none; display: inline-block; }
.btn:hover { transform: translate(-1px,-1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--ink); }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* ---------- quiz ---------- */
.q { border: 2px solid var(--ink); border-radius: 16px; background: var(--card); padding: 18px 20px; margin-bottom: 18px; box-shadow: 4px 4px 0 var(--line); }
.q .stelling { font-weight: 600; font-size: 16px; margin-bottom: 12px; }
.q .opties { display: flex; gap: 10px; }
.q .opties button { font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; border: 2px solid var(--ink); border-radius: 10px; padding: 8px 18px; background: var(--paper); }
.q .opties button:hover { background: var(--accent-soft); }
.q.beantwoord .opties button { pointer-events: none; opacity: .5; }
.q.beantwoord .opties button.gekozen { opacity: 1; }
.q.goed .opties button.gekozen { background: var(--sage); color: #fff; border-color: var(--sage); }
.q.fout .opties button.gekozen { background: var(--accent); color: #fff; }
.q .uitleg { display: none; margin-top: 12px; font-size: 14.5px; background: var(--paper); border-radius: 10px; padding: 12px 14px; }
.q.beantwoord .uitleg { display: block; }
.score { font-family: "Caveat", cursive; font-size: 30px; text-align: center; margin: 24px 0 8px; display: none; }

/* ---------- keuzes-demo (mag dit de chat in?) ---------- */
#demo-keuzes { margin: 26px 0; }
#demo-keuzes .opties { flex-wrap: wrap; }
#demo-keuzes .opties button.juist { opacity: 1; background: var(--sage-soft); border-color: var(--sage); }
.keuzes-slot { display: none; font-family: "Caveat", cursive; font-size: 28px; text-align: center; color: var(--sage); margin: 24px 0 8px; }
.keuzes-slot.zichtbaar { display: block; }

.spiek { border: 2px dashed var(--ink); border-radius: 16px; padding: 20px 24px; margin: 24px 0; background: var(--card); }
.spiek li { margin-bottom: 10px; font-size: 15.5px; }
.spiek ol { padding-left: 20px; }

/* ---------- interactieve demo ---------- */
.demo { border: 2px solid var(--ink); border-radius: 16px; background: var(--card); padding: 20px; margin: 26px 0; box-shadow: 4px 4px 0 var(--line); }
.demo .demo-label { font-family: "Caveat", cursive; font-size: 22px; font-weight: 700; color: var(--sage); margin-bottom: 10px; }
.demo .zin { font-size: 20px; font-weight: 600; background: var(--paper); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; min-height: 56px; }
.demo .zin .nieuw { color: var(--accent); }
.demo .voorspellingen button { display: flex; align-items: center; gap: 12px; width: 100%; background: none; border: none; cursor: pointer; font-family: inherit; font-size: 15px; padding: 7px 10px; border-radius: 10px; color: var(--ink); }
.demo .voorspellingen button:hover { background: var(--accent-soft); }
.demo .voorspellingen .woord { min-width: 90px; font-weight: 700; text-align: left; }
.demo .voorspellingen .balk { height: 14px; background: var(--accent); border-radius: 99px; }
.demo .voorspellingen .pct { font-family: "Caveat", cursive; font-size: 18px; color: var(--ink-soft); }
.demo .demo-reset { margin-top: 12px; font-size: 13px; font-weight: 600; background: none; border: none; cursor: pointer; color: var(--ink-soft); text-decoration: underline; font-family: inherit; }
.demo .demo-klaar { font-family: "Caveat", cursive; font-size: 21px; color: var(--sage); margin-top: 6px; }

/* ---------- tokenizer-demo ---------- */
.demo-tokens .tok-invoer { width: 100%; box-sizing: border-box; border: 2px solid var(--ink); border-radius: 12px; padding: 11px 14px; font-family: "Inter", sans-serif; font-size: 16px; color: var(--ink); background: var(--paper); }
.demo-tokens .tok-invoer:focus { outline: 3px solid var(--accent-soft); }
.demo-tokens .tok-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.demo-tokens .tok-chips span { padding: 4px 9px; border-radius: 8px; font-size: 15px; border: 1.5px solid var(--line); }
.demo-tokens .tok-teller { font-family: "Caveat", cursive; font-size: 19px; color: var(--ink-soft); margin-top: 10px; }

/* ---------- landing ---------- */
.landing { max-width: 880px; margin: 0 auto; padding: 56px 24px 80px; }
.landing .badge { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); border: 2px solid var(--accent); border-radius: 99px; padding: 4px 14px; margin-bottom: 18px; }
.landing h1 { font-size: 58px; margin: 0 0 14px; }
.landing .intro { font-size: 18px; max-width: 620px; }
.landing .door { display: flex; align-items: center; gap: 10px; margin: 18px 0 38px; font-size: 14.5px; color: var(--ink-soft); }
.modules { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 40px; }
.module-card { border: 2px solid var(--ink); border-radius: 18px; background: var(--card); padding: 22px; box-shadow: 4px 4px 0 var(--line); display: flex; flex-direction: column; }
.module-card.binnenkort { opacity: .62; }
.module-card .tag { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--sage); margin-bottom: 8px; }
.module-card .tag.soon { color: var(--ink-soft); }
.module-card h2 { font-family: "Caveat", cursive; font-size: 30px; font-weight: 700; margin: 0 0 8px; line-height: 1.1; }
.module-card p { font-size: 14.5px; color: var(--ink-soft); flex: 1; }
.module-card .meta { font-size: 13px; color: var(--ink-soft); margin-bottom: 14px; }
.b2b { border: 2px solid var(--ink); border-radius: 18px; background: var(--sage-soft); padding: 24px 26px; box-shadow: 4px 4px 0 var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.b2b .tekst { flex: 1; min-width: 260px; }
.b2b h2 { font-family: "Caveat", cursive; font-size: 28px; margin: 0 0 6px; }
.b2b p { font-size: 14.5px; margin: 0; }
.landing footer { margin-top: 44px; font-size: 13.5px; color: var(--ink-soft); }
.landing footer a { color: var(--accent); }

/* ---------- certificaat ---------- */
.certificaat-blok { margin: 12px 0 32px; text-align: center; }
.certificaat-blok > p { font-size: 15px; color: var(--ink-soft); margin-bottom: 12px; }
.cert-formulier { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }
.cert-naam-invoer { border: 2px solid var(--ink); border-radius: 12px; padding: 11px 14px; font-family: "Inter", sans-serif; font-size: 15px; color: var(--ink); background: var(--paper); min-width: 220px; }
.cert-naam-invoer:focus { outline: 3px solid var(--accent-soft); }
.certificaat { background: var(--card); border: 3px solid var(--ink); outline: 2px solid var(--ink); outline-offset: 6px; border-radius: 4px; padding: 48px 36px 36px; margin: 34px 10px 0; text-align: center; }
.cert-accentlijn { width: 90px; height: 4px; background: var(--accent); border-radius: 99px; margin: 0 auto 22px; }
.certificaat .cert-accentlijn:last-of-type { margin: 26px auto 16px; }
.cert-kop { font-size: 44px; font-weight: 700; color: var(--accent); line-height: 1.1; margin-bottom: 18px; }
.cert-naam { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
.cert-tekst { font-size: 17px; margin-bottom: 22px; }
.cert-resultaat { font-size: 16px; font-weight: 600; margin-bottom: 22px; }
.cert-wet { font-size: 13.5px; color: var(--ink-soft); max-width: 420px; margin: 0 auto; }
.cert-colofon { font-size: 12.5px; color: var(--ink-soft); }
.cert-acties { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }
.cert-hint { font-size: 13.5px; color: var(--ink-soft); margin-top: 10px; }

@media print {
  body.print-certificaat * { visibility: hidden; }
  body.print-certificaat .certificaat, body.print-certificaat .certificaat * { visibility: visible; }
  body.print-certificaat .certificaat { position: absolute; top: 0; left: 0; right: 0; margin: 8mm; box-shadow: none; }
  body.print-certificaat .cert-acties { display: none; }
}

@media (max-width: 860px) {
  .layout { flex-direction: column; }
  aside { width: 100%; height: auto; position: static; border-right: none; border-bottom: 2px solid var(--line); }
  main { padding: 32px 18px 60px; }
  h1 { font-size: 36px; }
  .landing h1 { font-size: 42px; }
}
