/* ==========================================================================
   Training | Richard Koranteng
   Shares its look and feel with rkkoranteng.com
   ========================================================================== */

:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f3f2ee;
  --text: #1c1f24;
  --muted: #5b6270;
  --border: #e4e2dc;
  --accent: #0d6b68;
  --accent-hover: #0a5653;
  --accent-ink: #ffffff;
  --accent-soft: #e2f0ef;
  --good: #2f7a3e;
  --medium: #b45309;
  --low: #b42318;
  --shadow: 0 1px 2px rgba(20, 24, 30, .04), 0 4px 16px rgba(20, 24, 30, .06);
  --info: #2563a8;
  --info-soft: #e8f0fa;
  --tip: #2f7a3e;
  --tip-soft: #e8f4ea;
  --code-bg: #f4f3ef;
  --code-text: #24292f;

  --radius: 10px;
  --max: 1120px;
  --prose: 740px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417;
    --surface: #191c20;
    --surface-2: #1f2328;
    --text: #e8e6e1;
    --muted: #9aa1ad;
    --border: #2b3036;
    --accent: #45b8ad;
    --accent-hover: #63c9bf;
    --accent-ink: #08201e;
    --accent-soft: #17312f;
    --good: #7ccf8b;
    --medium: #f0b36a;
    --low: #f27a6b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    --info: #79aef0;
    --info-soft: #17243a;
    --tip: #7ccf8b;
    --tip-soft: #172b1c;
    --code-bg: #0e1013;
    --code-text: #d6d9de;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121417;
  --surface: #191c20;
  --surface-2: #1f2328;
  --text: #e8e6e1;
  --muted: #9aa1ad;
  --border: #2b3036;
  --accent: #45b8ad;
  --accent-hover: #63c9bf;
  --accent-ink: #08201e;
  --accent-soft: #17312f;
  --good: #7ccf8b;
  --medium: #f0b36a;
  --low: #f27a6b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
  --info: #79aef0;
  --info-soft: #17243a;
  --tip: #7ccf8b;
  --tip-soft: #172b1c;
  --code-bg: #0e1013;
  --code-text: #d6d9de;
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-underline-offset: .18em; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.015em; margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container { max-width: var(--max); margin: 0 auto; padding-inline: 20px; }

.skip-link {
  position: absolute; left: -999px; top: 8px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 14px; border-radius: 6px; z-index: 100;
}
.skip-link:focus { left: 12px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.hidden { display: none !important; }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }

.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--text); text-decoration: none;
  margin-right: auto;
}
.brand img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; }
.brand small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); line-height: 1.1; }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--text); text-decoration: none; font-weight: 500; font-size: .97rem;
}
.site-nav a:hover { background: var(--surface-2); color: var(--text); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

.nav-toggle { display: none; }
html:not(.js) .theme-toggle, html:not(.js) .lookup-toggle { display: none; }
.lookup-toggle { margin-right: -8px; }

@media (max-width: 920px) {
  .js .nav-toggle { display: inline-grid; }
  .site-nav {
    position: static;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: 8px 20px 16px;
  }
  .js .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; }
  .js .nav-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; }
  .site-nav .btn { margin: 8px 0 0; }
  .header-inner { flex-wrap: wrap; }
  .js .header-inner { flex-wrap: nowrap; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .98rem; text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--surface-2); color: var(--text); }
.btn.is-disabled, .btn.is-disabled:hover { cursor: default; background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.site-nav .btn-primary { color: var(--accent-ink); padding: 8px 16px; margin-left: 8px; }

/* ---------- Sections ---------- */

main { display: block; }
.section { padding-block: clamp(40px, 6vw, 64px); }
.section-alt { background: var(--surface); border-block: 1px solid var(--border); }
.eyebrow {
  display: inline-block; margin-bottom: 12px;
  font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--muted); max-width: 680px; }

.hero { padding-block: clamp(48px, 8vw, 88px) clamp(32px, 5vw, 56px); }

/* ---------- Cards & grids ---------- */

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
}
.section-alt .card { background: var(--bg); }

.section-head { max-width: 680px; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

/* ---------- Hero ---------- */

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.stats {
  display: flex; flex-wrap: wrap; gap: 12px 40px;
  margin: 40px 0 0; padding: 24px 0 0; border-top: 1px solid var(--border);
}
.stats div { min-width: 120px; }
.stats dt { font-size: .85rem; color: var(--muted); }
.stats dd { margin: 0; font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; color: var(--accent); }

/* ---------- Programs ---------- */

.program { display: flex; flex-direction: column; border-top: 3px solid var(--accent); }
.program .eyebrow { margin-bottom: 6px; }
.program h3 { font-size: 1.35rem; margin-bottom: .4em; }
.program > p { color: var(--muted); font-size: .98rem; }

.curriculum { list-style: none; margin: 4px 0 20px; padding: 0; font-size: .95rem; counter-reset: lesson; }
.curriculum li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.curriculum li:last-child { border-bottom: 0; }
.curriculum li::before {
  content: counter(lesson, decimal-leading-zero); counter-increment: lesson;
  flex: none; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--accent);
}

.program-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px;
  margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border);
  font-size: .9rem; color: var(--muted);
}
.program-meta .price { margin-left: auto; font-size: 1.35rem; font-weight: 700; color: var(--text); }
.program .btn { margin-top: 16px; }

/* ---------- Steps ---------- */

.step-num {
  display: inline-grid; place-items: center; width: 36px; height: 36px; margin-bottom: 14px;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.step h3 { margin-bottom: .4em; }
.step p { margin: 0; color: var(--muted); font-size: .97rem; }

.section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.section-actions p { margin: 0; font-size: .95rem; color: var(--muted); }

/* ---------- Coming soon ---------- */

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--muted);
}
.upcoming h3 { margin: 10px 0 .4em; }
.upcoming p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- FAQ ---------- */

.faq { max-width: 780px; }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 18px 0; cursor: pointer; list-style: none; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { margin: 0 0 18px; color: var(--muted); }

/* ---------- CTA band ---------- */

.cta-band {
  background: var(--accent); color: var(--accent-ink);
  border-radius: 16px; padding: clamp(32px, 6vw, 56px);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px;
}
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { margin: 0; opacity: .9; max-width: 560px; }
.cta-band .btn { background: var(--accent-ink); color: var(--accent); }
.cta-band .btn:hover { background: var(--bg); color: var(--accent-hover); }

@media (max-width: 480px) {
  .hero-actions .btn, .program .btn { width: 100%; }
}

/* ---------- Course catalog ---------- */

.course-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; counter-reset: course; }
.course-item {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 20px; align-items: start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 24px; box-shadow: var(--shadow); counter-increment: course;
}
.section-alt .course-item { background: var(--bg); }
.course-item::before {
  content: counter(course, decimal-leading-zero);
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.15rem;
}
.course-item h3 { margin: 0 0 .3em; font-size: 1.2rem; }
.course-item h3 a { color: var(--text); text-decoration: none; }
.course-item h3 a:hover { color: var(--accent); }
.course-item p { margin: 0 0 .5em; color: var(--muted); font-size: .97rem; }
.course-item.is-done::before { content: "\2713"; background: var(--accent); color: var(--accent-ink); }
.done-tag { color: var(--accent); font-weight: 600; }
.done-tag::before { content: "\2713\00a0"; }
.course-item.is-upcoming { box-shadow: none; padding-block: 16px; align-items: center; }
.course-item.is-upcoming::before { width: 40px; height: 40px; font-size: .95rem; background: var(--surface-2); color: var(--muted); }
.course-item.is-upcoming div { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.course-item.is-upcoming h3 { margin: 0; font-size: 1.05rem; color: var(--muted); }
.curriculum a { color: inherit; text-decoration-color: var(--accent); }
.curriculum a:hover { color: var(--accent); }
@media (max-width: 520px) {
  .course-item { grid-template-columns: 1fr; }
  .course-item::before { width: 44px; height: 44px; font-size: 1rem; margin-bottom: 8px; }
}

/* ---------- Path page: module thumbnails ---------- */

.stats-inline {
  display: flex; flex-wrap: wrap; gap: 8px 28px;
  margin-top: 8px; color: var(--muted); font-size: .95rem;
}
.stats-inline span { display: inline-flex; align-items: center; gap: 7px; }
.stats-inline svg { width: 18px; height: 18px; }
.topics-label { margin: 32px 0 10px; font-weight: 600; }
.topics { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.topics li {
  padding: 5px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: .88rem;
}

.bundle-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 32px 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.bundle-card { display: flex; flex-direction: column; }
.bundle-thumb {
  position: relative; display: block; aspect-ratio: 8 / 5; overflow: hidden;
  border-radius: 14px; box-shadow: var(--shadow); background: var(--surface-2);
  transition: transform .15s, box-shadow .15s;
}
.bundle-thumb svg { display: block; width: 100%; height: 100%; }
a.bundle-thumb:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(20, 24, 30, .14); }
.duration, .soon-flag {
  position: absolute; padding: 3px 9px; border-radius: 6px; font-size: .78rem; font-weight: 700;
}
.duration { right: 10px; bottom: 10px; background: rgba(0, 0, 0, .78); color: #fff; }
.soon-flag { left: 10px; top: 10px; background: rgba(255, 255, 255, .92); color: #1c1f24; }
.bundle-card.is-soon .bundle-thumb svg { filter: saturate(.45); opacity: .8; }
.bundle-num {
  margin-top: 16px; font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.bundle-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 2px 0 6px; }
.bundle-title h3 { margin: 0; font-size: 1.12rem; }
.bundle-title h3 a { color: var(--text); text-decoration: none; }
.bundle-title h3 a:hover { color: var(--accent); }
.bundle-card.is-soon h3 { color: var(--muted); }
.bundle-card p { margin: 0 0 6px; color: var(--muted); font-size: .95rem; }
.pill {
  flex: none; margin-top: 2px; padding: 1px 10px; border-radius: 999px;
  border: 1px solid var(--accent); color: var(--accent); font-size: .75rem; font-weight: 600; white-space: nowrap;
}
.pill-soon { border-color: var(--border); color: var(--muted); }

/* ---------- Glossary ---------- */

.glossary-letters { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 14px; }
.glossary-letters a {
  min-width: 34px; padding: 5px 8px; text-align: center; font-weight: 700; font-size: .9rem;
  color: var(--accent); text-decoration: none; border-radius: 6px;
}
.glossary-letters a:hover { background: var(--surface-2); }
.glossary-group { scroll-margin-top: 80px; }
.glossary-group h2 { margin: 28px 0 4px; padding-bottom: 6px; font-size: 1.4rem; color: var(--accent); border-bottom: 1px solid var(--border); }
.glossary { margin: 0; }
.glossary > div { padding: 14px 0; border-bottom: 1px solid var(--border); }
.glossary dt { font-weight: 700; scroll-margin-top: 80px; }
.glossary dd { margin: 4px 0 0; color: var(--muted); }
.glossary-link { white-space: nowrap; font-size: .9rem; color: var(--accent); }
.glossary > div[hidden], .glossary-group[hidden] { display: none; }
.glossary-filter { margin: 28px 0 0; max-width: 640px; }
.glossary-letters a.is-empty { color: var(--muted); opacity: .4; pointer-events: none; }
.glossary dt { display: flex; align-items: center; gap: 6px; }
.term-anchor {
  position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px;
  border-radius: 6px; color: var(--muted); opacity: 0; transition: opacity .15s;
}
.term-anchor svg { width: 15px; height: 15px; }
.glossary > div:hover .term-anchor, .term-anchor:focus-visible, .term-anchor[data-copied] { opacity: 1; }
.term-anchor:hover { color: var(--accent); background: var(--surface-2); }
.term-anchor[data-copied]::after {
  content: "Link copied"; position: absolute; left: 30px; white-space: nowrap;
  padding: 2px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600;
  background: var(--accent); color: var(--accent-ink);
}
.glossary > div:has(dt:target) { background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 8px; padding-inline: 12px; }
@media (hover: none) { .term-anchor { opacity: 1; } }

/* ---------- Quick lookup (header search) ---------- */

.lookup {
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, calc(100vh - 96px));
  margin: 72px auto 0; padding: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); color: var(--text); box-shadow: 0 16px 48px rgba(0, 0, 0, .25);
}
.lookup[open] { display: flex; flex-direction: column; }
.lookup::backdrop { background: rgba(10, 12, 15, .45); }
.lookup-head { position: relative; padding: 12px; border-bottom: 1px solid var(--border); }
.lookup-head svg {
  position: absolute; left: 26px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.lookup-head input {
  width: 100%; padding: 11px 14px 11px 42px; font: inherit; font-size: 1.05rem; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
}
.lookup-head input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.lookup-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.lookup-results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--text); text-decoration: none; }
.lookup-results a.is-active, .lookup-results a:hover { background: var(--surface-2); }
.lookup-results strong { display: block; }
.lookup-results .def { display: block; margin-top: 2px; color: var(--muted); font-size: .92rem; }
.lookup-results .where { display: block; margin-top: 4px; color: var(--accent); font-size: .82rem; font-weight: 600; }
.lookup-note { margin: 0; padding: 18px 16px; color: var(--muted); font-size: .92rem; }
.lookup-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem;
}
.lookup-foot kbd { font-size: .75rem; }
@media (hover: none) { .lookup-foot span { display: none; } }
@media (max-width: 520px) {
  .header-inner { gap: 8px; }
  .icon-btn { width: 36px; height: 36px; }
  .lookup-toggle { margin-right: 0; }
  .brand span { white-space: nowrap; }
}
@media (max-width: 370px) { .brand small { display: none; } }

/* ---------- External links and consulting ---------- */

.ext-icon { width: .8em; height: .8em; margin-left: 3px; vertical-align: -.05em; }
.consulting-note { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); }

/* ---------- Course catalog: search and filter ---------- */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.bundle-card[hidden] { display: none; }
.course-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.search-box { position: relative; flex: 1 1 320px; }
.search-box svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; color: var(--muted); pointer-events: none;
}
.search-box input {
  width: 100%; padding: 11px 16px 11px 44px; font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px;
}
.search-box input::placeholder { color: var(--muted); }
.search-box input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.filter-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 15px; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text);
  background: var(--bg); border: 1px solid var(--border); border-radius: 999px; cursor: pointer;
}
.chip:hover { background: var(--surface-2); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip.is-active, .chip.is-active:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.filter-count { margin: 0 0 28px; color: var(--muted); font-size: .9rem; }
.lesson-matches {
  margin: 4px 0 8px; padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); font-size: .9rem;
}
.lesson-matches span { display: block; margin-bottom: 4px; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lesson-matches ul { margin: 0; padding-left: 18px; }
.lesson-matches a { color: var(--accent); }
.filter-empty { padding: 40px 0 8px; text-align: center; color: var(--muted); }
.filter-empty p { margin: 0 0 14px; }
.catalog-note { margin: 40px 0 0; color: var(--muted); font-size: .92rem; }

/* ---------- Roadmap ---------- */

.rm-hero .topics { margin-top: 20px; }
.rm-hero .stats-inline { margin-top: 20px; }
.roadmap { padding-block: clamp(32px, 5vw, 48px) clamp(40px, 6vw, 64px); }
.roadmap .rm-card, .roadmap .rm-panel { background: var(--bg); }

.rm-line {
  width: 2px; height: 36px; margin: 0 auto;
  background: repeating-linear-gradient(to bottom, var(--muted) 0 6px, transparent 6px 12px);
  opacity: .5; animation: rm-march 1.2s linear infinite;
}
@keyframes rm-march { to { background-position: 0 12px; } }
@media (prefers-reduced-motion: reduce) { .rm-line { animation: none; } }

.rm-stage { text-align: center; }
.rm-stage a, .rm-stage span {
  display: inline-block; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent);
  font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
}
.rm-stage a:hover { background: var(--accent); color: var(--accent-ink); }

.rm-card {
  display: flex; align-items: center; gap: 14px;
  width: min(100%, 560px); margin: 0 auto; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow);
}
.rm-num {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-size: .82rem; font-weight: 700;
}
.rm-thumb { flex: none; width: 56px; height: 36px; border-radius: 6px; overflow: hidden; }
.rm-thumb svg { display: block; width: 100%; height: 100%; }
.rm-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.rm-text strong { font-size: .98rem; }
.rm-text small { color: var(--muted); font-size: .82rem; }
.rm-soon {
  flex: none; font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--medium); background: color-mix(in srgb, var(--medium) 12%, transparent);
  padding: 3px 8px; border-radius: 5px;
}
.rm-card.is-soon .rm-thumb { filter: saturate(.45); opacity: .8; }
.rm-soon-under { display: none; }
@media (max-width: 600px) {
  .rm-card > .rm-soon, .rm-card.is-soon .rm-text small { display: none; }
  .rm-soon-under { display: block; margin-top: 5px; }
}
.rm-card.is-soon strong { color: var(--muted); }

.rm-step { width: min(100%, 560px); margin: 0 auto; }
.rm-step > summary { list-style: none; cursor: pointer; width: 100%; }
.rm-step > summary::-webkit-details-marker { display: none; }
.rm-card.is-live { border-color: var(--accent); }
.rm-card.is-live .rm-num { background: var(--accent); color: var(--accent-ink); }
.rm-step.is-done .rm-card.is-live .rm-num { font-size: 0; }
.rm-step.is-done .rm-card.is-live .rm-num::before { content: "\2713"; font-size: .9rem; }
.rm-chev { flex: none; width: 20px; height: 20px; color: var(--muted); transition: transform .15s; }
.rm-step[open] .rm-chev { transform: rotate(180deg); }
.rm-panel {
  margin-top: 8px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
}
.rm-lessons { list-style: none; margin: 0 0 10px; padding: 0; counter-reset: rml; }
.rm-lesson {
  display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border);
  font-size: .95rem; counter-increment: rml;
}
.rm-lesson::before {
  content: counter(rml); flex: none; display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: var(--surface-2); color: var(--muted); font-size: .75rem; font-weight: 700;
}
.rm-lesson.is-done::before { content: "\2713"; background: var(--accent); color: var(--accent-ink); }
.rm-lesson a { flex: 1; color: var(--text); text-decoration: none; }
.rm-lesson a:hover { color: var(--accent); }
.rm-lesson span { color: var(--muted); font-size: .82rem; }
.rm-open { font-size: .92rem; font-weight: 600; text-decoration: none; }

/* A group step branches into parallel modules, then rejoins the line */
.rm-group-head { width: min(100%, 640px); }
.rm-branch {
  --gap: 16px;
  position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--gap);
  padding-block: 28px; margin-top: 0;
}
.rm-branch::before, .rm-branch::after {
  content: ""; position: absolute; height: 0;
  left: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n) / 2);
  right: calc((100% - (var(--n) - 1) * var(--gap)) / var(--n) / 2);
  border-top: 2px dashed color-mix(in srgb, var(--muted) 50%, transparent);
}
.rm-branch::before { top: 0; }
.rm-branch::after { bottom: 0; }
.rm-branch .rm-card { position: relative; width: 100%; margin: 0; align-items: flex-start; }
.rm-branch .rm-num { margin-top: 4px; }
.rm-branch .rm-text strong { font-size: .93rem; margin-bottom: 5px; }
.rm-branch .rm-card::before, .rm-branch .rm-card::after {
  content: ""; position: absolute; left: 50%; height: 28px;
  border-left: 2px dashed color-mix(in srgb, var(--muted) 50%, transparent);
}
.rm-branch .rm-card::before { bottom: 100%; }
.rm-branch .rm-card::after { top: 100%; }
/* Live modules in a branch: one dashed line runs behind each card, so it stays joined when a card opens */
.rm-branch-item { position: relative; isolation: isolate; }
.rm-branch-item::before {
  content: ""; position: absolute; z-index: -1; left: 50%; top: -28px; bottom: -28px;
  border-left: 2px dashed color-mix(in srgb, var(--muted) 50%, transparent);
}
.rm-branch-item .rm-step { width: 100%; }
.rm-branch-item .rm-card { align-items: center; }
.rm-branch-item .rm-card::before, .rm-branch-item .rm-card::after { display: none; }
.rm-branch-item .rm-text strong { margin-bottom: 2px; }
.rm-group-head { position: relative; margin-bottom: 14px; }
.rm-group-head.is-live { margin-inline: auto; }
.rm-group-head::after {
  content: ""; position: absolute; top: 100%; left: 50%; height: 14px;
  border-left: 2px dashed color-mix(in srgb, var(--muted) 50%, transparent);
}
@media (max-width: 760px) {
  .rm-branch { grid-template-columns: 1fr; padding-block: 16px; --gap: 10px; }
  .rm-branch::before, .rm-branch::after, .rm-branch .rm-card::before, .rm-branch .rm-card::after, .rm-branch-item::before { display: none; }
  .rm-branch .rm-thumb { display: none; }
}

.rm-cta { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px 48px; padding: clamp(24px, 4vw, 40px); }
.rm-cta h2 { margin-bottom: .4em; }
.rm-cta p { color: var(--muted); }
.rm-team { margin-top: 18px; font-size: .93rem; }
.rm-cta h3 { margin-bottom: 12px; }
.rm-included { list-style: none; margin: 0; padding: 0; }
.rm-included li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .93rem;
}
.rm-included li::before { content: "\2713"; color: var(--muted); font-weight: 700; margin-right: -4px; }
.rm-included li span { flex: 1; }
.rm-included li small { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.rm-included li.is-live::before, .rm-included li.is-live small { color: var(--accent); font-weight: 600; }
@media (max-width: 860px) { .rm-cta { grid-template-columns: 1fr; } }

/* ---------- Course page (matches rkkoranteng.com posts) ---------- */

.meta { font-size: .87rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; }

.post-header { padding-block: clamp(40px, 6vw, 64px) 24px; }
.post-header h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); }
.post-header .lead { margin-bottom: 16px; }
.prose-width { max-width: var(--prose); }
.breadcrumb { font-size: .9rem; margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

.post-layout {
  display: grid; grid-template-columns: minmax(0, var(--prose)) 220px; gap: 56px;
  justify-content: space-between; padding-bottom: clamp(40px, 6vw, 64px);
}
@media (max-width: 1000px) { .post-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }

.toc { position: sticky; top: 88px; align-self: start; font-size: .9rem; }
.toc h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 14px; color: var(--muted); text-decoration: none; margin-left: -1px; border-left: 2px solid transparent; }
.toc a:hover, .toc a.active { color: var(--accent); border-left-color: var(--accent); }

.prose { min-width: 0; }
.prose h2 { margin-top: 2em; font-size: 1.55rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.summary-lead { font-size: 1.15rem; font-weight: 600; }

.callout {
  margin: 1.4em 0; padding: 14px 18px 14px 16px;
  border-radius: 8px; border-left: 4px solid var(--info); background: var(--info-soft);
}
.callout > :last-child { margin-bottom: 0; }
.callout-tip { border-left-color: var(--tip); background: var(--tip-soft); }
.callout-label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; color: var(--info); }
.callout-tip .callout-label { color: var(--tip); }
.callout-warn { border-left-color: var(--medium); background: color-mix(in srgb, var(--medium) 10%, transparent); }
.callout-warn .callout-label { color: var(--medium); }

/* Commands and terminal output in lessons */
.prose pre {
  margin: 1em 0 1.4em; padding: 14px 18px;
  background: var(--code-bg); color: var(--code-text);
  border: 1px solid var(--border); border-radius: 8px;
  overflow-x: auto; font-family: var(--mono); font-size: .88rem; line-height: 1.6; tab-size: 2;
}
.prose pre code { font: inherit; }
.prose pre .c { color: var(--muted); }
.prose pre .out { color: var(--tip); }
.prose :not(pre) > code {
  font-family: var(--mono); font-size: .88em;
  background: var(--code-bg); border: 1px solid var(--border);
  padding: .1em .4em; border-radius: 5px; overflow-wrap: anywhere;
}
.prose kbd {
  font-family: var(--mono); font-size: .85em; padding: .1em .45em;
  border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; background: var(--surface);
}

/* Exercises: the answer stays hidden until the reader opens it */
.answer { margin: .6em 0 1.4em; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.answer > summary { cursor: pointer; padding: 8px 14px; font-weight: 600; font-size: .93rem; color: var(--accent); }
.answer > :not(summary) { margin: 0 14px 12px; }
.answer > pre { margin-top: 0; }
.exercise { font-weight: 600; margin-bottom: .4em; }

.table-wrap { overflow-x: auto; margin: 1.2em 0 1.5em; border: 1px solid var(--border); border-radius: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 520px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.prose th { background: var(--surface-2); font-weight: 700; font-size: .85rem; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td:first-child { font-weight: 600; }

/* Slide "cards" become a grid of terms */
.terms {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 12px; margin: 1.2em 0 1.5em; padding: 0;
}
.terms div {
  padding: 14px 16px; border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 8px; background: var(--surface);
}
.terms dt { font-weight: 700; margin-bottom: 4px; line-height: 1.3; }
.terms dd { margin: 0; font-size: .93rem; color: var(--muted); line-height: 1.5; }

.diagram {
  margin: 1.6em 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface);
}
.diagram-title { font-weight: 700; margin-bottom: 14px; }
.diagram > :last-child { margin-bottom: 0; }
.prose ol.flow { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px 28px; }
.flow li {
  position: relative; margin: 0; flex: 1 1 120px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg);
  font-size: .9rem; font-weight: 600; line-height: 1.35;
}
.flow li small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: 3px; }
.flow li:not(:last-child)::after {
  content: "\2192"; position: absolute; right: -21px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-weight: 400;
}
.flow li.highlight { background: var(--accent-soft); border-color: var(--accent); }
.diagram-note { font-size: .88rem; color: var(--muted); margin: 0; }
@media (max-width: 600px) {
  .prose ol.flow { flex-direction: column; gap: 22px; }
  .flow li { flex: none; }
  .flow li:not(:last-child)::after { content: "\2193"; right: auto; left: 50%; top: auto; bottom: -21px; transform: translateX(-50%); }
}

/* Stacked layers, top of the stack first */
.stack { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.prose .stack li { margin: 0; }
.stack li {
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
  font-size: .92rem;
}
.stack li strong { display: block; }
.stack li span { color: var(--muted); font-size: .88rem; }
.stack li.layer-top { background: var(--accent-soft); border-color: var(--accent); }

/* Lesson illustrations: inline SVG drawn with the theme tokens, so they follow dark mode */
.illustration {
  margin: 1.6em 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); overflow-x: auto;
}
.illustration figcaption { margin-top: 12px; font-size: .88rem; color: var(--muted); text-align: center; }
.ill { display: block; width: 100%; min-width: 520px; height: auto; }
.ill .o { fill: var(--surface); stroke: var(--text); stroke-width: 2; stroke-linejoin: round; }
.ill .l { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ill .lead { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 5; }
.ill .flowline { fill: none; stroke: var(--accent); stroke-width: 2; }
.ill .wifi { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 5 6; }
.ill .track { fill: none; stroke: var(--surface-2); stroke-width: 10; stroke-linecap: round; }
.ill .gauge { fill: none; stroke: var(--accent); stroke-width: 10; stroke-linecap: round; }
.ill .needle { stroke: var(--text); stroke-width: 3; stroke-linecap: round; }
.ill .vm { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
.ill .tile { fill: var(--bg); stroke: var(--border); }
.ill .blk { stroke: var(--border); stroke-width: 1.5; }
.ill .hl { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; }
.ill .surf, .ill .thr { fill: var(--surface); }
.ill .soft { fill: var(--accent-soft); }
.ill .mut { fill: var(--surface-2); }
.ill .acc { fill: var(--accent); }
.ill .t { fill: var(--text); font: 600 14px var(--font); }
.ill .t-tile { fill: var(--text); font: 700 13px var(--font); }
.ill .t-sm { fill: var(--muted); font: 12px var(--font); }
.ill .t-ac { fill: var(--accent); font: 700 13px var(--font); letter-spacing: .04em; }
.ill .t-in { fill: var(--accent-ink); font: 700 14px var(--font); }

.post-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.post-nav a {
  display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); text-decoration: none; color: var(--text);
}
.post-nav a:hover { border-color: var(--accent); color: var(--text); }
.post-nav small { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.post-nav .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .post-nav { grid-template-columns: 1fr; } .post-nav .next { grid-column: 1; } }
.post-cta { margin-top: 32px; }
.post-cta h3 { margin-top: 0; }

/* ---------- Footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding-block: 40px; font-size: .93rem; color: var(--muted); }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.footer-inner p { margin: 0; }
.footer-inner p a { color: inherit; text-decoration: none; }
.footer-inner p a:hover { color: var(--accent); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent); }

