/* NRP theme: matches gitlab.nrp-nautilus.io/prp/nrp-site (AstroWind, Inter,
   primary #0161ef / secondary #0154cf / accent #6d28d9, navy #030620). */
:root {
  color-scheme: light;
  --fg: #101010; --muted: rgba(16,16,16,.66); --bg: #ffffff; --surface: #ffffff; --panel: #f6f8fa;
  --border: #e5e9f0; --accent: #0161ef; --accent-2: #0154cf; --accent-weak: #e7f0ff;
  --obj: #0161ef; --challenge: #b45309; --solution: #0f766e;
  --important: #d97706; --important-weak: #fff7d6; --danger: #dc2626; --danger-weak: #fee2e2;
  --keypoints: #6d28d9; --note: #475569; --navy: #030620;
  --header: #ffffff; --menu: #ffffff; --shadow: rgb(140 152 164 / 10%);
  --menu-shadow: rgb(3 6 32 / 14%); --selection: lavender;
  --syntax-keyword: #6d28d9; --syntax-string: #b91c1c; --syntax-comment: #64748b;
  --syntax-number: #b45309; --syntax-builtin: #047857; --syntax-var: #0369a1;
  --syntax-option: #15803d; --syntax-key: #0154cf; --syntax-pre: #9f1239;
  --max: 1024px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fg: #eef3f8; --muted: rgba(238,243,248,.70); --bg: #18202b; --surface: #202a36; --panel: #273342;
  --border: #39495b; --accent: #91c2ff; --accent-2: #b4d5ff; --accent-weak: rgb(145 194 255 / 16%);
  --obj: #91c2ff; --challenge: #f4b350; --solution: #46d6c6;
  --important: #facc15; --important-weak: rgb(250 204 21 / 14%); --danger: #f87171; --danger-weak: rgb(248 113 113 / 15%);
  --keypoints: #cfbdff; --note: #adbac8; --navy: #f5f8fb;
  --header: #1a2330; --menu: #202a36; --shadow: rgb(0 0 0 / 20%);
  --menu-shadow: rgb(0 0 0 / 34%); --selection: rgb(145 194 255 / 30%);
  --syntax-keyword: #cfbdff; --syntax-string: #fca5a5; --syntax-comment: #9aa8b8;
  --syntax-number: #f4b350; --syntax-builtin: #46d6c6; --syntax-var: #91c2ff;
  --syntax-option: #86efac; --syntax-key: #b4d5ff; --syntax-pre: #f0abfc;
}

:root[data-theme="warm-dark"] {
  color-scheme: dark;
  --fg: #f0eee9; --muted: rgba(240,238,233,.70); --bg: #1d1c1a; --surface: #25231f; --panel: #2c2924;
  --border: #413c34; --accent: #9abfff; --accent-2: #b8d3ff; --accent-weak: rgb(154 191 255 / 15%);
  --obj: #9abfff; --challenge: #e7a94c; --solution: #56c9b8;
  --important: #f3c45b; --important-weak: rgb(243 196 91 / 15%); --danger: #ef8a84; --danger-weak: rgb(239 138 132 / 16%);
  --keypoints: #d1bfff; --note: #b6aea2; --navy: #f7f3ed;
  --header: #211f1c; --menu: #25231f; --shadow: rgb(0 0 0 / 20%);
  --menu-shadow: rgb(0 0 0 / 34%); --selection: rgb(154 191 255 / 28%);
  --syntax-keyword: #d1bfff; --syntax-string: #f2a4a4; --syntax-comment: #a99f92;
  --syntax-number: #e7a94c; --syntax-builtin: #56c9b8; --syntax-var: #9abfff;
  --syntax-option: #9fdc8b; --syntax-key: #b8d3ff; --syntax-pre: #e9b8ff;
}

/* Presenter mode: light, low-glare theme instead of a true dark mode. */
:root[data-theme="presenter"] {
  color-scheme: light;
  --fg: #141615; --muted: rgba(20,22,21,.66); --bg: #f4f5f2; --surface: #ffffff; --panel: #ecefeb;
  --border: #d8ddd5; --accent: #0161ef; --accent-2: #0154cf; --accent-weak: #e4edff;
  --obj: #0161ef; --challenge: #a05a00; --solution: #087568;
  --important: #b77900; --important-weak: #fff4c2; --danger: #c32222; --danger-weak: #fde1df;
  --keypoints: #6d28d9; --note: #58636f; --navy: #030620;
  --header: #ffffff; --menu: #ffffff; --shadow: rgb(87 97 92 / 12%);
  --menu-shadow: rgb(87 97 92 / 18%); --selection: rgb(1 97 239 / 18%);
  --syntax-keyword: #6d28d9; --syntax-string: #b42318; --syntax-comment: #667085;
  --syntax-number: #a05a00; --syntax-builtin: #087568; --syntax-var: #0154cf;
  --syntax-option: #17803d; --syntax-key: #0154cf; --syntax-pre: #9f1239;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg);
  font: 16px/1.7 "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -.012em; color: var(--navy); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; }
::selection { background: var(--selection); }
.site-header { display: flex; align-items: center; gap: 16px; background: var(--header);
  padding: 11px 28px; border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px var(--shadow); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; line-height: 0; }
.brand-logo { height: 30px; width: auto; display: block; }
.site-title { color: var(--fg); font-weight: 700; font-size: 1.0rem;
  padding-left: 16px; border-left: 1px solid var(--border); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-title:hover { text-decoration: none; color: var(--accent); }
.header-controls { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.icon-toggle { display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--muted); cursor: pointer;
  font: inherit; font-size: 1rem; line-height: 1; padding: 0; }
.icon-toggle:hover { background: var(--panel); border-color: var(--border); color: var(--fg); }
.icon-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lesson-nav { background: var(--surface); border-bottom: 1px solid var(--border); position: relative; z-index: 10; }
.lesson-nav-inner { display: flex; align-items: center; gap: 8px; max-width: 1180px; margin: 0 auto;
  padding: 10px 24px; }
.lesson-nav a,
.lesson-menu summary { flex: 0 0 auto; border: 1px solid transparent; border-radius: 6px;
  color: var(--fg); font-size: .92rem; line-height: 1.25; padding: 6px 10px;
  white-space: nowrap; }
.lesson-nav a:hover,
.lesson-menu summary:hover { background: var(--panel); color: var(--accent); text-decoration: none; }
.lesson-nav .nav-all { color: var(--muted); }
.lesson-nav .nav-home { font-weight: 600; }
.lesson-menu { position: relative; }
.lesson-menu summary { display: flex; align-items: center; cursor: pointer; font-weight: 600;
  list-style: none; user-select: none; }
.lesson-menu summary::-webkit-details-marker { display: none; }
.lesson-menu summary::after { content: ""; border-left: 4px solid transparent;
  border-right: 4px solid transparent; border-top: 5px solid currentColor; margin-left: 8px; }
.lesson-menu[open] summary { background: var(--panel); color: var(--accent); }
.lesson-menu-list { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30;
  min-width: 240px; max-width: min(420px, calc(100vw - 48px)); background: var(--menu);
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 12px 28px var(--menu-shadow);
  padding: 6px; }
.lesson-menu-list a { display: block; white-space: normal; }
.lesson-menu-list a + a { margin-top: 2px; }
.lesson-menu-list .active { background: var(--accent-weak); border-color: rgb(1 97 239 / 24%);
  color: var(--accent); font-weight: 700; }
.nav-hidden .lesson-nav { display: none; }
.content { max-width: var(--max); margin: 0 auto; min-width: 0; padding: 32px 24px 28px; }
.content-wide { max-width: calc(var(--max) * 1.4); }
.details-group { margin: 1em 0; }
.details-group [data-expand-all] { display: inline-block; margin-bottom: .6em; padding: 6px 14px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--accent); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; }
.details-group [data-expand-all]:hover { background: var(--panel); border-color: var(--accent); }
.details-group [data-expand-all]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.details-group details { margin: .6em 0; border: 1px solid var(--border); border-radius: 8px;
  padding: 4px 16px; background: var(--surface); }
.details-group summary { cursor: pointer; font-size: 1.12rem; font-weight: 700; padding: 10px 4px;
  list-style: none; }
.details-group summary::-webkit-details-marker { display: none; }
.details-group summary::before { content: "▸"; display: inline-block; margin-right: 8px;
  color: var(--accent); transition: transform .15s ease; }
.details-group details[open] summary::before { transform: rotate(90deg); }
.content h1 { margin-top: 0; line-height: 1.2; }
.subtitle { color: var(--muted); font-size: 1.1rem; margin-top: -8px; }
.facilitators { color: var(--muted); margin: 0.75em 0 0; }
.facilitators strong { color: var(--fg); }
.lesson-meta { color: var(--muted); font-size: .9rem; margin-top: -6px; }
.content li > ol, .content li > ul { margin: .3em 0 .3em 1.4em; }
.content ol { list-style-type: decimal; }
.content ol ol { list-style-type: lower-alpha; }
.content ol ol ol { list-style-type: lower-roman; }
.content ol ol ol ol { list-style-type: decimal; }
.code-block { margin: 1em 0; border: 1px solid var(--keypoints); border-radius: 6px;
  overflow: hidden; background: var(--panel); }
.code-label { padding: 6px 10px; background: color-mix(in srgb, var(--keypoints) 8%, var(--panel));
  color: var(--keypoints); font-weight: 700; font-size: .86rem; line-height: 1.25; }
pre { margin: 1em 0; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 48px 14px 16px; overflow: auto; position: relative; }
.code-block pre { margin: 0; border: 0; border-radius: 0; }
code { background: var(--panel); padding: .1em .35em; border-radius: 4px;
  font-size: .9em; font-family: "SF Mono", Menlo, Consolas, monospace; }
pre code { background: none; padding: 0; }
.tok-kw, .tok-pre { color: var(--syntax-keyword); font-weight: 600; }
.tok-string { color: var(--syntax-string); }
.tok-comment { color: var(--syntax-comment); font-style: italic; }
.tok-number { color: var(--syntax-number); }
.tok-builtin { color: var(--syntax-builtin); font-weight: 600; }
.tok-var { color: var(--syntax-var); }
.tok-option { color: var(--syntax-option); font-weight: 600; }
.tok-key { color: var(--syntax-key); font-weight: 600; }
.code-copy { position: absolute; top: 8px; right: 8px; display: inline-flex;
  align-items: center; justify-content: center; width: 30px; height: 30px;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
  color: var(--muted); cursor: pointer; font: inherit; font-size: .95rem;
  line-height: 1; opacity: 0; transition: opacity .15s ease, color .15s ease,
  background .15s ease, border-color .15s ease; }
pre:hover .code-copy, pre:focus-within .code-copy { opacity: 1; }
.code-copy:hover { color: var(--accent); border-color: var(--accent); }
.code-copy:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 2px; }
.code-copy.is-copied { color: var(--solution); border-color: var(--solution); opacity: 1; }
.code-copy.is-copy-error { color: var(--challenge); border-color: var(--challenge); opacity: 1; }
.copy-icon { position: relative; width: 15px; height: 15px; display: block; }
.copy-icon::before,
.copy-icon::after { content: ""; position: absolute; width: 10px; height: 10px;
  border: 1.6px solid currentColor; border-radius: 2px; background: var(--surface); }
.copy-icon::before { left: 1px; top: 1px; opacity: .62; }
.copy-icon::after { left: 4px; top: 4px; }
blockquote { margin: 1em 0; padding: .2em 1em; border-left: 4px solid var(--accent-weak); color: var(--muted); }
img { max-width: 100%; }
.callout { border: 1px solid var(--border); border-left-width: 5px; border-radius: 10px;
  margin: 1.2em 0; background: var(--surface); overflow: hidden; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 700;
  padding: 8px 16px; background: var(--panel); }
.callout-title::before { content: ""; display: none; flex: 0 0 auto; }
.callout-body { padding: 4px 16px; }
.callout-body > :first-child { margin-top: .4em; }
/* Launch buttons: bold markdown links inside callouts render as NRP pill buttons. */
.callout-body strong a { display: inline-block; background: var(--accent); color: #fff;
  font-weight: 600; padding: 9px 18px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 1px 6px rgb(1 97 239 / 30%); transition: background .15s ease, transform .1s ease; }
.callout-body strong a:hover { background: var(--accent-2); color: #fff; text-decoration: none;
  transform: translateY(-1px); }
.callout-objectives, .callout-questions { border-left-color: var(--obj); }
.callout-objectives > .callout-title,
.callout-questions > .callout-title { background: var(--accent-weak); }
.callout-challenge { border-left-color: var(--challenge); }
.callout-solution { border-left-color: var(--solution); }
.callout-important { border-left-color: var(--important); }
.callout-important > .callout-title { background: var(--important-weak); }
.callout-danger { border-left-color: var(--danger); }
.callout-danger > .callout-title { background: var(--danger-weak); }
.callout-important > .callout-title::before,
.callout-danger > .callout-title::before { display: inline-flex; align-items: center;
  justify-content: center; width: 1.1rem; height: 1.1rem; color: #fff;
  font-size: .72rem; line-height: 1; font-weight: 800; box-sizing: border-box; }
.callout-important > .callout-title::before { content: "!"; background: var(--important);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); padding-top: .16rem; }
.callout-danger > .callout-title::before { content: "!"; background: var(--danger);
  border-radius: 50%; }
.callout-keypoints { border-left-color: var(--keypoints); }
.callout-callout, .callout-discussion, .callout-prereq { border-left-color: var(--note); }
.slideshow { margin: 1.6em 0; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); box-shadow: 0 8px 24px var(--shadow); overflow: hidden; }
.slideshow:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.slideshow-chrome { display: flex; align-items: center; gap: 8px; min-height: 48px;
  padding: 8px 10px; background: var(--panel); border-bottom: 1px solid var(--border); }
.slideshow-title { flex: 1 1 auto; min-width: 0; color: var(--fg); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slideshow-status { color: var(--muted); font-size: .86rem; font-variant-numeric: tabular-nums;
  white-space: nowrap; }
.slideshow-controls { display: flex; align-items: center; gap: 4px; margin-left: 2px; }
.slide-button { display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--fg); cursor: pointer; font: inherit;
  font-size: 1rem; line-height: 1; padding: 0; }
.slide-button:hover:not(:disabled) { background: var(--surface); border-color: var(--border);
  color: var(--accent); }
.slide-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.slide-button:disabled { color: var(--muted); cursor: default; opacity: .38; }
.slideshow-track { aspect-ratio: 16 / 9; min-height: 320px; background: var(--surface);
  position: relative; overflow: hidden; }
.pdf-track { min-height: 540px; }
.slide { display: none; height: 100%; overflow: hidden; padding: 34px 42px; }
.slide.is-active { display: block; }
.pdf-slide { align-items: center; justify-content: center; padding: 0; overflow: hidden; }
.pdf-slide.is-active { display: flex; }
.pdf-page-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; }
.slide > :first-child { margin-top: 0; }
.slide > :last-child { margin-bottom: 0; }
.slide h1 { font-size: 2rem; line-height: 1.15; letter-spacing: 0; }
.slide h2 { font-size: 1.55rem; line-height: 1.2; letter-spacing: 0; }
.slide h3 { font-size: 1.25rem; line-height: 1.25; letter-spacing: 0; }
.slide pre { max-height: 55%; }
.slideshow:fullscreen,
.slideshow.is-fallback-fullscreen { width: 100vw; height: 100vh; margin: 0;
  border: 0; border-radius: 0; display: flex; flex-direction: column;
  background: var(--bg); }
.slideshow.is-fallback-fullscreen { position: fixed; inset: 0; z-index: 100; }
.slideshow:fullscreen .slideshow-track,
.slideshow.is-fallback-fullscreen .slideshow-track { flex: 1 1 auto; min-height: 0;
  aspect-ratio: auto; }
.slideshow:fullscreen .slide,
.slideshow.is-fallback-fullscreen .slide { padding: 54px 72px; font-size: 1.18rem; }
.slideshow:fullscreen .pdf-slide,
.slideshow.is-fallback-fullscreen .pdf-slide { padding: 0; font-size: 1rem; }
.slideshow:fullscreen .slide h1,
.slideshow.is-fallback-fullscreen .slide h1 { font-size: 3rem; }
.slideshow:fullscreen .slide h2,
.slideshow.is-fallback-fullscreen .slide h2 { font-size: 2.25rem; }
.schedule, .md-table { border-collapse: collapse; width: 100%; margin: 1em 0; }
.schedule th, .schedule td,
.md-table th, .md-table td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; vertical-align: top; }
.schedule thead, .md-table thead { background: var(--panel); }
.schedule tr.finish { font-weight: 600; background: var(--panel); }
.schedule tr.brk td { font-style: italic; color: var(--muted); }
.resources-note { border-left: 4px solid var(--accent); background: var(--accent-weak);
  border-radius: 8px; margin: 1.2em 0; padding: 10px 14px; }
.hint { color: var(--muted); font-size: .9rem; }
.pager { display: flex; justify-content: space-between; margin-top: 36px;
  padding-top: 16px; border-top: 1px solid var(--border); }
.site-footer { color: var(--muted); text-align: center; padding: 24px; font-size: .85rem; }
@media (max-width: 760px) {
  .site-header { padding: 10px 16px; gap: 10px; }
  .brand-logo { max-width: 38vw; }
  .site-title { font-size: .92rem; padding-left: 10px; }
  .icon-toggle { width: 30px; height: 30px; }
  .lesson-nav-inner { padding: 8px 16px; }
  .lesson-menu-list { left: auto; right: 0; max-width: calc(100vw - 32px); }
  .content { padding: 24px 18px 28px; }
  .slideshow-chrome { flex-wrap: wrap; align-items: center; }
  .slideshow-title { flex-basis: 100%; }
  .slideshow-track { aspect-ratio: 4 / 3; min-height: 360px; }
  .pdf-track { min-height: 520px; }
  .slide { padding: 22px 20px; }
  .slideshow:fullscreen .slide,
  .slideshow.is-fallback-fullscreen .slide { padding: 28px 24px; font-size: 1rem; }
  .slideshow:fullscreen .pdf-slide,
  .slideshow.is-fallback-fullscreen .pdf-slide { padding: 0; }
  .slideshow:fullscreen .slide h1,
  .slideshow.is-fallback-fullscreen .slide h1 { font-size: 2rem; }
  .slideshow:fullscreen .slide h2,
  .slideshow.is-fallback-fullscreen .slide h2 { font-size: 1.55rem; }
}

/* interactive quizzes (::: quiz) */
.quiz { border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
  margin: 22px 0; overflow: hidden; box-shadow: 0 4px 14px var(--shadow); }
.quiz-head { font-weight: 700; padding: 12px 18px; background: var(--accent-weak);
  color: var(--accent); border-bottom: 1px solid var(--border); }
.quiz-q { padding: 14px 18px 16px; border-bottom: 1px solid var(--border); }
.quiz-q:last-child { border-bottom: 0; }
.quiz-question { font-weight: 600; margin-bottom: 10px; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { text-align: left; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel); color: var(--fg); padding: 9px 12px; font: inherit;
  font-size: .95rem; cursor: pointer;
  transition: border-color .12s ease, background .12s ease; }
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.is-correct { border-color: #16a34a; background: rgb(22 163 74 / 12%);
  font-weight: 600; opacity: 1; }
.quiz-opt.is-correct::after { content: " \2713"; color: #16a34a; font-weight: 700; }
.quiz-opt.is-wrong { border-color: #dc2626; background: rgb(220 38 38 / 10%);
  opacity: .75; animation: quiz-shake .25s; }
.quiz-opt.is-wrong::after { content: " \2715"; color: #dc2626; }
.quiz-explain { margin-top: 10px; padding: 10px 12px; border-left: 3px solid #16a34a;
  background: rgb(22 163 74 / 8%); border-radius: 0 8px 8px 0; }
@keyframes quiz-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
