/* SSDC: buildless, self-hosted editorial design. No remote assets or fonts. */
:root {
  color-scheme: light dark;
  --paper: #f6f6f0;
  --paper: light-dark(#f6f6f0, #151d19);
  --surface: #fff;
  --surface: light-dark(#fff, #1c2821);
  --ink: #202d27;
  --ink: light-dark(#202d27, #e3e9e1);
  --muted: #526158;
  --muted: light-dark(#526158, #acbbae);
  --accent: #24553f;
  --accent: light-dark(#24553f, #a0d7b2);
  --rule: #c8d0c6;
  --rule: light-dark(#c8d0c6, #45594a);
  --soft: #eaf0e7;
  --soft: light-dark(#eaf0e7, #213025);
  --selection: light-dark(#d9e5d3, #3a5b44);
  --selection-ink: light-dark(#172a1d, #f3f7ef);
  --backdrop: light-dark(#182b2138, #050b0899);
  --shadow: light-dark(#142b2029, #0006);
  --sans: Arial, Helvetica, sans-serif;
}
:root:has(#theme-light:checked) { color-scheme: light; }
:root:has(#theme-dark:checked) { color-scheme: dark; }
* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 1.5rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.125rem/1.75 Georgia, "Times New Roman", serif;
  overflow-wrap: break-word;
}
body { min-height: 100vh; display: flex; flex-direction: column; }
a, a:visited { color: var(--accent); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
::selection { background: var(--selection); color: var(--selection-ink); }
.site-header, .site-footer { padding-inline: max(1.5rem, calc((100% - 1120px) / 2)); }
.site-header { display: grid; grid-template-columns: 1fr auto; column-gap: 1.5rem; align-items: start; padding-block: 2rem 1rem; border-bottom: 1px solid var(--rule); }
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  font: 700 1.2rem/1.4 var(--sans);
  letter-spacing: .06em;
  text-decoration: none;
  margin-bottom: 1.35rem;
}
.brand:visited { color: var(--ink); }
.brand::before { content: ""; width: .7rem; height: .7rem; background: var(--accent); flex: 0 0 auto; }
.site-header > .brand { align-self: center; }
.appearance-control { display: flex; gap: .2rem; border: 0; padding: 0; margin: -.5rem 0 .85rem; min-width: 0; font: .75rem/1.5 var(--sans); }
.appearance-control legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.appearance-control label { display: flex; gap: .4rem; align-items: center; min-height: 44px; padding: .4rem .55rem; border: 1px solid transparent; cursor: pointer; }
.appearance-control input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.appearance-control label:has(:checked) { background: var(--soft); border-color: var(--accent); }
.appearance-control label:hover { background: var(--soft); }
.appearance-control label:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.appearance-control input:focus-visible { outline: none; }
.site-nav { grid-column: 1 / -1; }
.site-nav, .site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem 1.35rem;
  font: .8125rem/1.5 var(--sans);
}
.site-nav a, .site-footer nav a { padding-block: .65rem; text-decoration: none; }
.site-nav a { color: var(--muted); border-bottom: 2px solid transparent; }
.site-nav a:hover, .site-footer nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 700; }
main { width: min(760px, calc(100% - 3rem)); margin: 0 auto; padding: 4.5rem 0 6rem; flex: 1; }
.book-section { padding: 0; min-width: 0; }
.eyebrow, small, .updated { font: .75rem/1.6 var(--sans); color: var(--muted); }
.eyebrow { letter-spacing: .15em; text-transform: uppercase; font-weight: 700; margin-bottom: 1.35rem; display: flex; align-items: center; gap: .8rem; }
.eyebrow::before { content: ""; width: 2rem; height: 1px; background: var(--accent); }
h1, h2, h3, h4 { color: var(--ink); text-wrap: pretty; }
h1 { font: 700 clamp(2.2rem, 5.1vw, 3.65rem)/1.09 var(--sans); letter-spacing: -.045em; margin: 0 0 2rem; }
h2 { font: 700 clamp(1.5rem, 3.2vw, 2rem)/1.22 var(--sans); letter-spacing: -.025em; margin: 3rem 0 1.1rem; }
h3 { font-size: 1.4rem; line-height: 1.35; margin: 1.8rem 0 .8rem; letter-spacing: -.015em; }
h4 { font-size: 1.125rem; line-height: 1.4; margin: 1.5rem 0 .6rem; }
p { margin: 0 0 1.25rem; }
h1 + p, h2 + p { margin-top: 0; }
strong { font-weight: 700; }
li { margin-bottom: .55em; }
ul, ol { padding-left: 1.4em; margin-block: 1.2rem 1.7rem; }
li::marker { color: var(--accent); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3.5rem 0; }
hr + h2 { margin-top: 0; }
blockquote { margin: 2rem 0; border-left: 3px solid var(--accent); padding: .2rem 0 .2rem 1.5rem; }
blockquote p { margin: .3rem 0; }
.dek { font-size: 1.3rem; line-height: 1.55; }
.link-line { font: .875rem/1.6 var(--sans); margin-top: 1.8rem; }
.link-line a { display: inline-block; margin: 0 1rem .65rem 0; padding-block: .25rem; }
.toc { margin: 2.5rem 0 3rem; padding: 1.7rem 2rem; border: 1px solid var(--rule); border-top: 3px solid var(--accent); background: var(--soft); }
.toc > strong { display: block; font: 700 .6875rem/1.5 var(--sans); letter-spacing: .12em; }
.toc ol { columns: 2; column-gap: 2.5rem; padding: 0; margin: 1rem 0 0; list-style: none; font: .8125rem/1.6 var(--sans); }
.toc li { break-inside: avoid; margin: 0 0 .5rem; }
.toc a { display: inline-block; padding-block: .3rem; text-decoration: none; }
.toc a:hover { text-decoration: underline; }
/* A linked arrival stays visible; this reflects the URL, never scroll tracking. */
main :is(h1, h2, h3, h4, .faq-section, .faq-item)[id] { scroll-margin-block-start: 2rem; }
main :is(h1, h2, h3, h4):target,
.faq-section:target > h2,
.founder-note:target > h2,
.faq-item:target > summary { background: var(--soft); box-shadow: -.6rem 0 0 var(--accent); }
.reading-note { border-block: 1px solid var(--rule); padding: 1rem 0; margin-block: 1.8rem; color: var(--muted); font-size: 1rem; }
.site-footer { border-top: 1px solid var(--rule); padding-block: 1.6rem 2rem; background: var(--soft); }
.site-footer nav { gap: .2rem 1.4rem; }
.site-footer nav a[aria-current="page"] { font-weight: 700; text-decoration: underline; }
.site-footer p { margin: 1.5rem 0 0; color: var(--muted); font: .75rem/1.6 var(--sans); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 1rem; }
th, td { text-align: left; border-bottom: 1px solid var(--rule); padding: .7rem .8rem .7rem 0; vertical-align: top; }
th { border-bottom: 2px solid var(--accent); }
.skip-link { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { width: auto; height: auto; clip-path: none; top: .5rem; left: .5rem; padding: .7rem 1rem; background: var(--surface); z-index: 100; font: 1rem/1.5 var(--sans); }
.wrap-anywhere { overflow-wrap: anywhere; word-break: break-word; }
.closing-title { font-size: clamp(1.8rem, 4vw, 2.7rem); }
.closing-subtitle { font: 700 clamp(1.3rem, 3vw, 1.8rem)/1.3 var(--sans); }
#page-library { min-height: 14rem; }
#page-build-with-us > h2:first-of-type { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.ssdc-about-capabilities { columns: 2; column-gap: 2.5rem; }
.ssdc-about-capabilities li { break-inside: avoid; }
.ssdc-roadmap-phases li { margin-bottom: .8em; }
.founder-note { margin-top: 3.5rem; padding-top: 3rem; border-top: 1px solid var(--rule); scroll-margin-block-start: 2rem; }
.founder-note > h2 { margin-top: 0; }

/* Native reading notes: no JavaScript, tracking, or automatic remote fetches. */
.ssdc-popover { display: inline; white-space: normal; }
.ssdc-pop-trigger { display: inline; border: 0; border-bottom: 1px dotted var(--accent); padding: 0; margin: 0; border-radius: 0; background: none; color: inherit; font: inherit; text-align: inherit; vertical-align: baseline; cursor: pointer; }
.ssdc-pop-trigger:hover { border-bottom-style: solid; color: var(--accent); }
.ssdc-pop-panel[popover] {
  position: fixed; inset: 0; margin: auto; z-index: 500;
  width: min(480px, calc(100vw - 2rem)); max-height: 78vh; max-height: 78dvh;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 1.5rem 1.7rem; border: 1px solid var(--rule); border-top: 3px solid var(--accent);
  background: var(--surface); color: var(--ink); box-shadow: 0 1rem 4rem var(--shadow);
  font: 400 .9375rem/1.6 var(--sans); text-align: left; letter-spacing: normal; text-transform: none;
}
.ssdc-pop-panel[popover]::backdrop { background: var(--backdrop); }
.ssdc-pop-eyebrow { display: block; color: var(--muted); font-size: .625rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; margin-bottom: .5rem; }
.ssdc-pop-title { display: block; font: 700 1.3rem/1.3 Georgia, "Times New Roman", serif; margin-bottom: .8rem; }
.ssdc-pop-definition { display: block; margin-bottom: 1rem; }
.ssdc-pop-sources { display: block; margin-top: 1rem; }
.ssdc-pop-source { display: block; border-top: 1px solid var(--rule); padding-top: .9rem; margin-bottom: .9rem; }
.ssdc-pop-source a { font-weight: 700; overflow-wrap: anywhere; }
.ssdc-source-description { display: block; color: var(--muted); margin-top: .4rem; font-size: .875rem; }
.ssdc-pop-note { display: block; border-top: 1px solid var(--rule); padding-top: .8rem; margin-top: 1rem; color: var(--muted); font-size: .8125rem; }
.ssdc-pop-close { display: block; width: fit-content; min-height: 44px; margin: 0 0 1rem auto; padding: .5rem .8rem; border: 1px solid var(--rule); background: var(--paper); color: var(--ink); font: .8125rem/1.4 var(--sans); cursor: pointer; }
.ssdc-pop-close:hover { background: var(--soft); }
/* Older browsers expose the supplementary notes in the document instead. */
@supports not selector(:popover-open) {
  .ssdc-pop-panel[popover] { display: block; position: static; width: auto; max-height: none; margin: 1rem 0; box-shadow: none; }
  .ssdc-pop-close { display: none; }
  .ssdc-pop-trigger { border-bottom: 0; cursor: text; }
}

/* Keep original diagrams intact, with keyboard-accessible horizontal panning. */
.ssdc-figure { --figure-width: 1080px; --diagram-mobile-width: 700px; width: min(var(--figure-width), calc(100vw - 3rem)); max-width: none; position: relative; left: 50%; transform: translateX(-50%); margin: 2.7rem 0 3rem; }
.ssdc-figure--stack { --figure-width: 650px; --diagram-mobile-width: 510px; }
.ssdc-figure--matrix { --diagram-mobile-width: 900px; }
.ssdc-figure--wide { --figure-width: 1120px; --diagram-mobile-width: 870px; }
.ssdc-figure--network { --figure-width: 1030px; --diagram-mobile-width: 760px; }
.ssdc-figure--roadmap { --figure-width: 1160px; --diagram-mobile-width: 1000px; }
.ssdc-figure-media { color-scheme: light; max-width: 100%; overflow-x: auto; overflow-y: hidden; border: 1px solid var(--rule); background: #fff; overscroll-behavior-x: contain; }
.ssdc-figure-media > a { display: block; width: 100%; text-decoration: none; }
.ssdc-figure-media > a:focus-visible { outline-offset: -4px; }
.ssdc-figure img { display: block; height: auto; width: 100%; max-width: none; }
.ssdc-figure figcaption { padding-top: .8rem; font: .8125rem/1.6 var(--sans); color: var(--muted); }
.ssdc-figure-view { display: inline-block; margin-left: .6em; padding-block: .25rem; }
.ssdc-figure-pan-hint { display: none; }

/* FAQ: native disclosures retain keyboard controls with scripts disabled. */
.faq-introduction p:last-child { margin-bottom: 0; }
.faq-section { margin-top: 3.5rem; }
.faq-section > h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3vw, 1.85rem); }
.faq-item { border-top: 1px solid var(--rule); margin: 0; }
.faq-item:last-of-type { border-bottom: 1px solid var(--rule); }
.faq-item summary { display: flex; align-items: baseline; gap: 1rem; cursor: pointer; padding: 1.25rem .4rem; list-style: none; line-height: 1.5; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::marker { content: ""; }
.faq-item summary:hover { background: var(--soft); }
.faq-number { flex: 0 0 1.8rem; color: var(--muted); font: .75rem/1.5 var(--sans); font-variant-numeric: tabular-nums; }
.faq-question { flex: 1; font: 700 1rem/1.5 var(--sans); }
.faq-indicator { flex: 0 0 1.4rem; font: 1.4rem/1 var(--sans); text-align: center; align-self: center; color: var(--accent); }
.faq-indicator::before { content: "+"; }
.faq-item[open] .faq-indicator::before { content: "−"; }
.faq-item[open] summary { background: var(--soft); }
.faq-answer { padding: 1.2rem 2.8rem 1.4rem; font-size: 1.0625rem; }
.faq-answer > :last-child { margin-bottom: 0; }
.faq-bottom-line { border-top: 2px solid var(--accent); margin-top: 4rem; padding-top: .5rem; }
.faq-return { margin-top: 2rem; font: .8125rem/1.6 var(--sans); }

/* The existing contents stays alongside the text and stops at the footer.
   Intro, contents and body keep their original document/reading order. */
@media screen and (min-width: 1280px) {
  main:has(.reading-layout) { width: min(1120px, calc(100% - 4rem)); }
  .reading-layout { display: grid; grid-template-columns: minmax(0, 760px) 240px; grid-template-rows: auto 1fr; grid-template-areas: "intro contents" "body contents"; gap: 0 3rem; justify-content: center; align-items: start; }
  .reading-intro { grid-area: intro; min-width: 0; }
  .reading-body { grid-area: body; min-width: 0; }
  .reading-layout > .toc { grid-area: contents; position: sticky; top: 1.5rem; max-height: calc(100vh - 3rem); max-height: calc(100dvh - 3rem); overflow: auto; margin: 0; padding: 1.3rem; scrollbar-width: thin; }
  .reading-layout > .toc ol { columns: 1; }
  .reading-layout .ssdc-figure { left: auto; transform: none; width: 100%; }
  .reading-layout .ssdc-figure-media > a { width: max(100%, var(--diagram-mobile-width)); }
  .reading-layout .ssdc-figure-pan-hint { display: inline; }
}
@media (max-width: 720px) {
  .site-header { grid-template-columns: 1fr; padding-top: 1.4rem; }
  .brand { font-size: 1rem; margin-bottom: .9rem; }
  .appearance-control { justify-self: start; margin: 0 0 .65rem; }
  .site-nav { gap: 0 1.1rem; }
  .site-nav a { padding-block: .65rem; }
  main { padding-top: 2.8rem; padding-bottom: 4rem; }
  .toc { padding: 1.3rem; }
  .toc ol { columns: 1; }
  .ssdc-about-capabilities { columns: 1; }
  .ssdc-figure-media > a { width: max(100%, var(--diagram-mobile-width)); }
  .ssdc-figure-pan-hint { display: inline; }
}
@media (max-width: 400px) {
  body { font-size: 1.0625rem; }
  .site-header, .site-footer { padding-inline: 1.25rem; }
  main { width: calc(100% - 2.5rem); }
  .site-nav { gap: 0 1rem; font-size: .75rem; }
  .site-nav a { padding-block: .6rem; }
  .ssdc-figure { width: calc(100vw - 2.5rem); }
  .faq-item summary { gap: .6rem; }
  .faq-number { flex-basis: 1.25rem; }
  .faq-answer { padding: 1rem .4rem 1.3rem; }
  .ssdc-pop-panel[popover] { padding: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .brand::before { background: CanvasText; }
  .ssdc-pop-trigger { border-bottom-color: LinkText; }
  .site-nav a[aria-current="page"] { border-bottom-color: LinkText; }
  .appearance-control label:has(:checked) { border-color: Highlight; }
}
@media print {
  :root { color-scheme: light !important; }
  body { display: block; background: white; color: black; font-size: 11pt; }
  .site-header, .site-footer nav, .toc, .skip-link { display: none; }
  main { width: auto; max-width: none; margin: 0; padding: 0; }
  h1 { font-size: 26pt; }
  h2 { font-size: 18pt; }
  h1, h2, h3, h4 { break-after: avoid; color: black; }
  a, a:visited { color: black; }
  .ssdc-pop-panel[popover] { display: none !important; }
  .ssdc-pop-trigger { border: 0; }
  .ssdc-figure { left: auto; transform: none; width: 100%; break-inside: avoid; }
  .ssdc-figure-media { overflow: visible; }
  .ssdc-figure-media > a { width: 100%; }
  .ssdc-figure-view, .ssdc-figure-pan-hint { display: none; }
  .faq-item::details-content { content-visibility: visible; display: block; }
  .faq-answer { display: block !important; padding: .7rem 0 1rem; }
  .faq-indicator { display: none; }
  .site-footer { padding: 1rem 0 0; background: none; }
}
