@font-face {
  font-family: SourceSans;
  src: url("lessons/chapter-01/source-sans-3.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: light dark;
  --paper: #fafcff;
  --surface: #fff;
  --ink: #172635;
  --muted: #4a6072;
  --accent: #3657d6;
  --accent-wash: #e9efff;
  --line: #d6e1ed;
  --wash: #edf3fa;
  --folio: #dce7f2;
  --positive: #087d79;
  --positive-wash: #e5f3f0;
  --code-paper: #203447;
  --code-ink: #f1f6fc;
  --action-paper: var(--accent-wash);
  --action-ink: var(--ink);
  --action-line: var(--positive);
  --sans: SourceSans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: var(--sans);
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-synthesis: style;
}
* { box-sizing: border-box; }
body { margin: 0; border-top: 4px solid var(--accent); }
::selection { background: var(--accent-wash); color: var(--ink); }
a { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: .055em; }
a:hover { text-decoration-thickness: .1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.skip-link { position: absolute; top: -6rem; left: 1rem; padding: .9rem 1.2rem; background: var(--surface); z-index: 10; }
.skip-link:focus { top: .7rem; }
.site-header { max-width: 1440px; margin: auto; padding: 1.25rem 3rem; display: flex; align-items: center; gap: 2rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .8rem; min-height: 44px; color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; color: var(--accent); flex: none; }
.brand-name { font: 500 1.5rem/1 var(--serif); letter-spacing: -.035em; }
.header-link { display: inline-flex; align-items: center; min-height: 44px; border-left: 1px solid var(--line); padding: .6rem 0 .6rem 2rem; color: var(--ink); text-decoration: none; font-size: .75rem; }
.header-map { margin-left: auto; display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .5rem .85rem; border: 1px solid var(--accent); border-radius: 3px; font: 500 .75rem/1.4 var(--sans); color: var(--accent); text-decoration: none; white-space: nowrap; }
.header-map:hover, .page-map .header-map { background: var(--accent-wash); }
.external-arrow { display: inline-block; width: .9em; height: .9em; vertical-align: -.05em; flex: none; }
.header-link .external-arrow { color: var(--accent); margin-left: .5rem; }
.mobile-contents { display: none; }
.book-layout { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: clamp(2rem, 4vw, 4rem); max-width: 1440px; padding: 4.5rem 2rem 2rem; margin: auto; }
.book-sidebar { align-self: start; position: sticky; top: 2rem; max-height: calc(100dvh - 4rem); overflow-y: auto; padding-inline: .7rem; margin-inline: -.7rem; scrollbar-width: thin; }
.sidebar-title { font: 500 1.6rem/1.2 var(--serif); letter-spacing: -.02em; margin: 0 0 2rem; }
.book-sidebar ol, .mobile-contents ol { list-style: none; padding: 0; margin: 0; }
.book-sidebar li { margin: 0 0 .45rem; }
.book-sidebar a, .mobile-contents nav a { display: grid; grid-template-columns: 1.5rem 1fr; gap: .6rem; padding: .8rem .7rem; margin-left: -.7rem; border-left: 2px solid transparent; text-decoration: none; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.nav-number { font: .66rem/1.85 var(--mono); color: var(--muted); }
.book-sidebar a, .mobile-contents nav a { grid-template-columns: 1.5rem minmax(0, 1fr) auto; }
.lesson-done { color: var(--accent); font: 600 .85rem/1.5 var(--sans); margin-left: .4em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.book-sidebar a:hover, .mobile-contents nav a:hover { background: var(--wash); color: var(--ink); }
.book-sidebar a[aria-current], .mobile-contents a[aria-current] { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
a[aria-current] .nav-number { color: var(--accent); }
main { min-width: 0; max-width: none; }
.chapter-header { position: relative; padding: 0 0 1.6rem; border-bottom: 1px solid var(--ink); }
.chapter-meta { display: flex; align-items: center; gap: .8rem; margin: 0 0 1.8rem; font-size: .65rem; letter-spacing: .02em; line-height: 1.6; color: var(--accent); }
.reading-time { color: var(--muted); letter-spacing: .025em; text-transform: none; }
.meta-separator { color: var(--folio); }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; text-wrap: balance; }
h1, h2 { font-weight: 650; }
h1 { margin: 0; font-size: clamp(2.7rem, 4.9vw, 4.25rem); line-height: 1.02; letter-spacing: -.045em; }
h2 { font-size: 1.9rem; line-height: 1.15; margin: 2.8rem 0 1rem; letter-spacing: -.025em; }
h3 { font-size: 1.45rem; line-height: 1.2; margin: 2rem 0 1rem; }
h2, h3, :target { scroll-margin-top: 2rem; }
.page-contents { margin-bottom: 2.8rem; border-bottom: 1px solid var(--line); font-size: .75rem; }
summary { cursor: pointer; }
.page-contents summary { padding: .9rem 0; min-height: 44px; color: var(--muted); }
.page-contents summary::marker { color: var(--accent); font-size: .7em; }
.page-contents ul { margin: 0 0 1.2rem; padding-left: 1.1rem; line-height: 1.9; }
.page-contents a { color: var(--muted); text-decoration: none; }
.page-contents a:hover { color: var(--accent); text-decoration: underline; }
.prose { font: 400 1.17rem/1.7 var(--sans); font-optical-sizing: auto; overflow-wrap: break-word; }
.prose > :not(.chapter-video):not(.lesson-lab):not(.metadata-map) { max-width: 760px; }
.prose p, .prose ul, .prose ol { margin: 1.25rem 0; }
.prose > p:first-child { font-size: 1.45rem; line-height: 1.45; color: var(--ink); letter-spacing: -.012em; }
.prose li { padding-left: .15rem; }
.prose strong { font-weight: 600; }
.prose a { text-decoration-color: color-mix(in srgb, var(--accent), transparent 40%); }
.prose a:hover { text-decoration-color: var(--accent); }
.prose blockquote { margin-inline: 0; border-left: 2px solid var(--accent); padding-left: 1.5rem; }
.prose .key-principle { position: relative; margin-block: 2.5rem; padding: .4rem 1.5rem; font-size: 1.65rem; line-height: 1.32; letter-spacing: -.02em; }
.key-principle p { margin: .35rem 0; }
.key-principle strong { font-weight: 500; }
.worked-example { margin: 2rem 0; padding: 1.5rem 1.6rem; background: var(--wash); border: 0; border-radius: 10px; box-shadow: none; }
.worked-example figcaption { margin-bottom: 1.2rem; font: 600 .72rem/1.55 var(--sans); color: var(--accent); letter-spacing: .015em; }
.worked-example p { font-size: 1.15rem; line-height: 1.6; }
.worked-example > :last-child { margin-bottom: 0; }
.worked-example .table-scroll { margin-block: 1.1rem; }
.definition-box { margin: 1.25rem 0; padding: 1.1rem 1.3rem; background: var(--wash); border: 1px solid var(--line); break-inside: avoid; }
.definition-box p { margin: .75rem 0; font-size: 1.15rem; line-height: 1.6; }
.definition-box > p:first-child { margin-top: 0; font: 600 .85rem/1.5 var(--sans); }
.definition-box > :last-child { margin-bottom: 0; }
.reader-action { display: flex; align-items: flex-start; gap: 1rem; margin: 2rem 0; padding: 1.2rem 1.4rem; border-left: 4px solid var(--action-line); background: var(--action-paper); color: var(--action-ink); break-inside: avoid; }
.reader-action-icon { color: var(--accent); flex: none; width: 1.4rem; height: 1.4rem; margin-top: .15rem; }
.reader-action > div { min-width: 0; }
.prose .reader-action p { margin: .65rem 0 0; font-size: 1.1rem; line-height: 1.55; }
.prose .reader-action .reader-action-title { color: var(--accent); margin: 0; font: 600 .85rem/1.5 var(--sans); }
.prose .reader-action a { color: var(--accent); text-decoration-color: currentColor; }
.prose .reader-action ol { margin: .8rem 0; padding-left: 1.4rem; font-size: 1.1rem; line-height: 1.55; }
.reader-action-answer { margin-top: 1rem; padding-top: .7rem; border-top: 1px solid var(--line); }
.reader-action-answer summary { cursor: pointer; color: var(--accent); font: 600 .8rem/1.5 var(--sans); }
.table-scroll { max-width: 100%; overflow-x: auto; margin-block: 1.6rem; }
table { width: 100%; border-collapse: collapse; font: .8rem/1.65 var(--sans); font-variant-numeric: tabular-nums; }
th, td { padding: .8rem .7rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--wash); color: var(--ink); }
td { color: var(--ink); }
tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.worked-example th, .worked-example td { padding-inline: .5rem; }
.incident-timeline th:last-child, .incident-timeline td:last-child { white-space: normal; }
.incident-timeline th:first-child, .incident-timeline td:first-child { white-space: nowrap; font-family: var(--mono); color: var(--accent); font-size: .75rem; }
.query-result th, .query-result td { padding-inline: .5rem; }
code, pre { font-family: var(--mono); }
code { font-size: .72em; padding: .12em .25em; background: var(--wash); border-radius: 2px; }
table code { font-size: .9em; overflow-wrap: anywhere; }
.metadata-record { margin: 1.2rem 0; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font: .8rem/1.55 var(--sans); font-variant-numeric: tabular-nums; break-inside: avoid; }
.metadata-record figcaption { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .25rem 1rem; margin: 0; padding: .65rem .85rem; border-bottom: 1px solid var(--line); color: var(--ink); font: .75rem/1.55 var(--sans); letter-spacing: 0; }
.metadata-record .record-kind { font-weight: 600; }
.metadata-record .record-source { min-width: 0; color: var(--muted); font-size: .7rem; }
.metadata-record dl { margin: 0; }
.metadata-record dl > div { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); gap: .25rem 1rem; padding: .5rem .85rem .5rem .65rem; border-left: 3px solid transparent; }
.metadata-record dl > div + div { border-top: 1px solid var(--line); }
.metadata-record dt, .metadata-record dd { min-width: 0; margin: 0; }
.metadata-record dt { color: var(--muted); font-size: .74rem; }
.metadata-record code { padding: 0; background: none; color: inherit; font-size: 1em; white-space: normal; overflow-wrap: anywhere; }
.metadata-record dl > .record-focus { border-left-color: var(--accent); background: var(--accent-wash); font-weight: 600; }
.metadata-record .record-focus dt { color: var(--ink); }
.prose .evidence-reading, .prose .evidence-limit { margin: .8rem 0 1.2rem; font-size: 1.08rem; line-height: 1.55; }
.evidence-reading > strong:first-child, .evidence-limit > strong:first-child { display: block; margin-bottom: .2rem; font: 600 .72rem/1.55 var(--sans); }
pre { font-size: .78rem; line-height: 1.8; padding: 1.2rem; overflow-x: auto; background: var(--code-paper); color: var(--code-ink); }
pre code { padding: 0; background: none; font-size: 1em; color: inherit; }
.code-example { margin: 1.5rem 0; background: var(--code-paper); border-radius: 3px; overflow: hidden; }
.code-label { font: .6rem/1.5 var(--mono); letter-spacing: .15em; color: #b9c9d9; padding: .75rem 1.2rem .65rem; border-bottom: 1px solid #3c536a; }
.code-example pre { margin: 0; }
.further-detail { margin-block: 0; border-bottom: 1px solid var(--line); }
.further-detail:first-of-type { border-top: 1px solid var(--line); margin-top: 2.5rem; }
.further-detail summary { min-height: 48px; padding: 1.1rem 0; font: 500 .8rem/1.6 var(--sans); color: var(--muted); }
.further-detail summary::marker { color: var(--accent); }
.further-detail[open] { padding-bottom: 1rem; }
.further-detail[open] summary { color: var(--accent); }
.further-detail p { font-size: 1.1rem; }
.chapter-media { margin-block: 2rem; border-block: 1px solid var(--line); }
.chapter-media > summary { min-height: 44px; padding: .7rem 0; color: var(--accent); cursor: pointer; }
.chapter-video { margin: .6rem 0 1.2rem; }
.chapter-video figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .8rem; color: var(--accent); font: 600 .8rem/1.5 var(--sans); }
.chapter-video-duration { color: var(--muted); font-weight: 400; }
.chapter-video video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border-radius: 6px; background: #172635; }
.prose .chapter-video-note { margin: .8rem 0; color: var(--muted); font: .75rem/1.6 var(--sans); }
.prose .chapter-video-links { display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 0; font: .75rem/1.6 var(--sans); }
.chapter-video-links span { color: var(--muted); }
.lineage-diagram { margin: 2rem 0; break-inside: avoid; }
.lineage-diagram figcaption { font: .7rem/1.5 var(--sans); color: var(--muted); margin-bottom: 1rem; }
.prose .lineage-diagram ol { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem; margin: 0; padding: 0; list-style: none; }
.prose .metadata-architecture ol { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prose .lineage-diagram li { position: relative; padding: .85rem .65rem; border: 1px solid var(--line); background: var(--surface); font: .76rem/1.55 var(--sans); }
.lineage-diagram li:last-child { border-top: 2px solid var(--accent); }
.flow-role { display: block; color: var(--muted); font-size: .65rem; margin-bottom: .55rem; }
.lineage-diagram code { padding: 0; background: none; overflow-wrap: anywhere; font-size: .9em; }
.flow-arrow { position: absolute; right: -1.2rem; top: 50%; transform: translateY(-50%); color: var(--accent); }
.pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 3.5rem; padding-top: 1.6rem; border-top: 1px solid var(--ink); }
.pagination a { text-decoration: none; color: var(--ink); }
.pagination-next { grid-column: 2; text-align: right; }
.pagination-label { display: block; font: .6rem/1.6 var(--sans); color: var(--muted); letter-spacing: .12em; margin-bottom: .7rem; }
.pagination-title { font: 500 1.35rem/1.2 var(--serif); letter-spacing: -.02em; }
.pagination-arrow { display: inline-block; font-family: var(--sans); font-size: 1rem; margin-left: .6rem; color: var(--accent); }
.lesson-completion { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1.2rem; padding: .7rem 1rem; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; }
.lesson-completion label { display: inline-flex; align-items: center; gap: .7rem; min-height: 44px; cursor: pointer; font: 500 .9rem/1.5 var(--sans); }
.lesson-completion input { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--accent); flex: none; }
#lesson-save-status { color: var(--muted); font: .75rem/1.5 var(--sans); }
.pagination a:hover .pagination-title { color: var(--accent); }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--muted); }
.page-footer a { text-decoration: none; color: var(--muted); }
.page-introduction .chapter-header { padding-right: 0; }
.page-introduction h1 { font-size: clamp(3.8rem, 7vw, 6.2rem); max-width: 600px; }
.page-introduction .prose > p:first-child { font-size: 1.9rem; line-height: 1.3; max-width: 600px; }
.page-introduction .prose > ol { list-style: none; counter-reset: contents; padding: 0; border-top: 1px solid var(--line); }
.page-introduction .prose > ol > li { position: relative; counter-increment: contents; margin: 0; padding: 1.5rem 0 1.5rem 3rem; border-bottom: 1px solid var(--line); font-size: 1.08rem; }
.page-introduction .prose > ol > li::before { content: "0" counter(contents); position: absolute; left: 0; top: 1.6rem; color: var(--accent); font: .8rem/1.6 var(--mono); }
.page-introduction .prose > ol > li a { font-size: 1.4rem; font-weight: 500; }
img { max-width: 100%; height: auto; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
@media (max-width: 1100px) {
  .site-header { gap: 1rem; }
  .header-map { margin-left: auto; }
}
@media (max-width: 1200px) {
  .book-sidebar { display: none; }
  .book-layout { display: block; padding: 2rem 1.4rem; }
  .mobile-contents { display: block; border-bottom: 1px solid var(--line); padding-inline: 1.4rem; }
  .mobile-contents > summary { font-size: .8rem; color: var(--muted); padding: .85rem 0; min-height: 44px; }
  .mobile-contents > summary::marker { color: var(--accent); }
  .mobile-contents nav { padding-bottom: 1rem; }
  .mobile-contents nav a { margin-left: 0; min-height: 44px; }
}
@media (max-width: 800px) {
  .site-header { padding: 1rem 1.4rem; gap: 1rem; }
  .brand-mark { width: 25px; height: 25px; }
  .brand-name { font-size: 1.35rem; }
  .header-link, .book-sidebar { display: none; }
  .header-map { margin-left: auto; padding-inline: .65rem; }
  .chapter-header { padding-bottom: 1.35rem; }
  .chapter-meta { margin-bottom: 1.5rem; font-size: .6rem; gap: .65rem; }
  h1 { font-size: clamp(2.45rem, 7vw, 3.5rem); }
  h2 { font-size: 1.75rem; margin-top: 2.3rem; }
  .page-contents { margin-bottom: 2rem; }
  .worked-example { padding: 1.1rem .85rem; margin-block: 1.8rem; }
  .worked-example p { font-size: 1.1rem; }
  .reader-action { gap: .75rem; padding: 1rem; }
  .prose .key-principle { padding-left: 1.1rem; font-size: 1.5rem; }
  th, td { padding: .7rem .45rem; }
  table { font-size: .75rem; }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .73rem; padding: 1rem; }
  .code-label { padding-inline: 1rem; }
  .pagination { gap: 1rem; }
  .pagination-title { font-size: 1.15rem; }
  .page-footer { font-size: .75rem; }
}
@media (max-width: 700px) {
  .prose { font-size: 1.12rem; }
}
@media (max-width: 480px) {
  .site-header { gap: .5rem; padding-inline: 1rem; }
  .brand-mark { display: none; }
  .brand-name { font-size: 1.2rem; }
  .header-map { font-size: .7rem; padding-inline: .5rem; }
}
@media (max-width: 600px) {
  .metadata-record figcaption { display: block; }
  .metadata-record .record-source { display: block; margin-top: .15rem; }
  .metadata-record dl > div { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
  .prose .lineage-diagram ol { grid-template-columns: 1fr; gap: 1.5rem; }
  .prose .lineage-diagram li { padding: .8rem 1rem; }
  .flow-role { margin-bottom: .2rem; }
  .flow-arrow { top: auto; right: auto; bottom: -1.4rem; left: 50%; transform: translateX(-50%) rotate(90deg); }
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #172635; --surface: #203447; --ink: #f1f6fc; --muted: #b9c9d9; --accent: #a6bbff; --accent-wash: #263e65; --line: #3c536a; --wash: #203447; --folio: #3c536a; --positive: #8ddbd3; --positive-wash: #1e3d43; --code-paper: #12202d; --code-ink: #f1f6fc; }
}
@media print {
  .chapter-media { display: none; }
  :root { --paper: white; --surface: white; --ink: black; --muted: #444; --accent: #333; --line: #bbb; --wash: #f4f4f4; --folio: #ddd; --positive: #333; --positive-wash: #f4f4f4; --code-paper: #f4f4f4; --code-ink: black; color-scheme: light; }
  :root { --action-paper: white; --action-ink: black; --action-line: #555; }
  body { border: 0; }
  .site-header, .mobile-contents, .book-sidebar, .page-contents, .pagination, .page-footer, .skip-link, .reading-time, .meta-separator { display: none; }
  .book-layout { display: block; padding: 0; }
  main { max-width: none; }
  .chapter-header { padding-bottom: 1rem; }
  .chapter-meta { margin-bottom: 1rem; }
  h1 { font-size: 30pt; }
  .prose, .prose > p:first-child, .worked-example p, .definition-box p { font-size: 11pt; line-height: 1.45; }
  h2 { font-size: 18pt; }
  h2, h3, figcaption { break-after: avoid; }
  .prose .key-principle { font-size: 15pt; }
  .worked-example { box-shadow: none; padding: .75rem; }
  .reader-action { padding: .75rem; border: 1px solid var(--action-line); border-left-width: 4px; }
  .prose .reader-action p { font-size: 11pt; line-height: 1.45; }
  .prose .reader-action .reader-action-title { font-size: 10pt; }
  .metadata-record { font-size: 9pt; }
  .metadata-record figcaption, .metadata-record dt { font-size: 8.5pt; }
  .metadata-record dl > div { grid-template-columns: minmax(0, .85fr) minmax(0, 1.4fr); padding-block: .35rem; }
  .metadata-record dl > .record-focus { border-left-color: black; }
  .prose .evidence-reading, .prose .evidence-limit { font-size: 11pt; line-height: 1.45; }
  .code-example { border: 1px solid var(--line); }
  .code-label { color: #444; border-color: var(--line); }
  pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 9pt; }
  .table-scroll { overflow: visible; }
  table { font-size: 9pt; }
  th, td { padding: .4rem; }
  .further-detail::details-content { content-visibility: visible; display: block; }
  .further-detail > :not(summary) { display: block; }
  .further-detail summary { list-style: none; break-after: avoid; }
  .further-detail summary::-webkit-details-marker { display: none; }
  .further-detail p { font-size: 11pt; }
  a { text-decoration: underline; }
  @page { margin: 18mm; }
}
