@font-face { font-family: "Archivo"; src: url(fonts/archivo-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Archivo"; src: url(fonts/archivo-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-2: #eaeef5;
  --region: #e9edf4;
  --cloud: #eef0fb;
  --device: #ecf5f3;
  --ink: #0f172a;
  --ink-2: #434c66;
  --ink-3: #5b647c;
  --line: #cbd3e2;
  --gisk: #1d4ed8;
  --gisk-soft: #dbe6fd;
  --on-gisk: #ffffff;
  --push: #c8143f;
  --pull: #0b7a70;
  --ext: #6d28d9;
  --infer: #9a5508;
  --planned: #646d82;
  --focus: #1d4ed8;
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b101b;
    --surface: #131a29;
    --surface-2: #1a2336;
    --region: #10172a;
    --cloud: #151a34;
    --device: #10201f;
    --ink: #e7ebf3;
    --ink-2: #a9b2c6;
    --ink-3: #8a94ab;
    --line: #2a3551;
    --gisk: #6aa5ff;
    --gisk-soft: #172a4f;
    --on-gisk: #0b101b;
    --push: #fb7185;
    --pull: #2dd4bf;
    --ext: #b79cff;
    --infer: #fbbf24;
    --planned: #8790a6;
    --focus: #8ab8ff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; }
a { color: var(--gisk); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
@media (max-width: 600px) { .wrap { padding-inline: 16px; } }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0;
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; }
h2 { font-weight: 700; font-size: clamp(26px, 3.2vw, 36px); line-height: 1.12; letter-spacing: -0.01em; }
h3 { font-weight: 600; font-size: 19px; line-height: 1.3; }
p { margin: 0; }
.prose { max-width: 66ch; display: grid; gap: 14px; color: var(--ink-2); font-size: 17px; }
.prose strong { color: var(--ink); font-weight: 600; }
.mono { font-family: var(--font-mono); font-size: 0.9em; }

/* ---------- hero ---------- */
.hero { padding-block: 56px 40px; display: grid; gap: 22px; }
.byline { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.byline b { font-family: var(--font-display); font-weight: 600; font-size: 17px; color: var(--ink); }
.byline span { color: var(--ink-3); font-size: 15px; }
.hero h1 { font-weight: 700; font-size: clamp(34px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.025em; max-width: 18ch; }
.hero h1 em { font-style: normal; color: var(--gisk); }
.lede { max-width: 62ch; font-size: 19px; color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; font: 500 15px var(--font-body);
  text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--surface);
}
.btn.primary { background: var(--gisk); border-color: var(--gisk); color: var(--on-gisk); }
.btn:hover { border-color: var(--ink-3); }
.btn.primary:hover { filter: brightness(1.08); }

.facts {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.facts div { padding: 16px 18px 16px 0; display: grid; gap: 2px; }
.facts b { font-family: var(--font-display); font-weight: 700; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.facts span { font-size: 13.5px; color: var(--ink-3); }

/* grid children default to min-width:auto; without this a wide scroller (the map)
   props open its ancestors and the whole page scrolls sideways on phones */
section.block > *, #trace-zone > *, figure.map, .decisions > *, .decision > *, .morning > *, .below > *, .two > * { min-width: 0; }

/* ---------- sections ---------- */
section.block { padding-block: 64px 8px; display: grid; gap: 18px; }
section.block > header { display: grid; gap: 8px; }
.section-intro { max-width: 68ch; color: var(--ink-2); font-size: 17px; }

/* morning */
.morning { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 8px; }
@media (max-width: 900px) { .morning { grid-template-columns: 1fr; } }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: s; }
.steps li { position: relative; padding: 0 0 22px 46px; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font: 500 13px var(--font-mono); color: var(--gisk);
  border: 1.5px solid var(--gisk); background: var(--surface);
}
.steps li::after { content: ""; position: absolute; left: 14px; top: 30px; bottom: 4px; width: 1.5px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps h3 { font-size: 16.5px; margin-bottom: 2px; }
.steps p { color: var(--ink-2); font-size: 15.5px; }
.memo-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; display: grid; gap: 10px;
}
.memo-card pre { margin: 0; font: 13.5px/1.55 var(--font-mono); white-space: pre-wrap; color: var(--ink); }
.memo-card .cap { font-size: 13px; color: var(--ink-3); }
.shot { margin: 0; display: grid; gap: 8px; }
.shot img { border-radius: 14px; border: 1px solid var(--line); }
.shot figcaption { font-size: 13px; color: var(--ink-3); }

/* ---------- map ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; justify-content: space-between; }
.group { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.group-label { font: 11px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); margin-right: 2px; }
.chipbtn {
  font: 13px var(--font-body); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px;
}
.chipbtn:hover { border-color: var(--ink-3); }
.chipbtn[aria-pressed="false"] { color: var(--ink-3); background: transparent; }
.chipbtn[aria-pressed="false"] .sw { opacity: 0.3; }
.trace-btn[aria-pressed="true"] { background: var(--gisk); border-color: var(--gisk); color: var(--on-gisk); }
.chipbtn[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.sw { width: 18px; height: 0; border-top: 2.5px solid currentColor; display: inline-block; }
.sw.push { color: var(--push); } .sw.pull { color: var(--pull); } .sw.ext { color: var(--ext); border-top-style: dotted; border-top-width: 3px; }
.sw.infer { color: var(--infer); } .sw.planned { color: var(--planned); border-top-style: dashed; }

.tracebar {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; min-height: 62px;
}
.tracebar .step { font: 12px var(--font-mono); color: var(--gisk); white-space: nowrap; }
.tracebar p { color: var(--ink); font-size: 15px; }
.tracebar[data-idle="true"] .step { color: var(--ink-3); }
.tracebar[data-idle="true"] p { color: var(--ink-2); }
.tracebar .nav { display: flex; gap: 6px; }
@media (max-width: 640px) { .tracebar { grid-template-columns: 1fr; gap: 8px; } }

figure.map { margin: 0; display: grid; gap: 10px; }
.scroller { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
svg#map { display: block; width: 100%; min-width: min(960px, 100%); height: auto; }
@media (max-width: 960px) { svg#map { min-width: 960px; } }
.scroll-hint { display: none; font-size: 13px; color: var(--ink-3); }
@media (max-width: 960px) { .scroll-hint { display: block; } }
figcaption.map-cap { font-size: 14px; color: var(--ink-3); max-width: 90ch; }

#map text { font-family: var(--font-body); fill: var(--ink); }
#map .region rect { fill: var(--region); stroke: var(--line); stroke-width: 1; }
#map .region.cloud rect { fill: var(--cloud); }
#map .region.device rect { fill: var(--device); }
#map .region.outside rect { fill: var(--cloud); stroke-dasharray: 4 4; }
#map .person circle, #map .person path { fill: none; stroke: var(--gisk); stroke-width: 2; }
#map .region text { font: 11.5px var(--font-mono); letter-spacing: 0.06em; fill: var(--ink-3); text-transform: uppercase; }
#map .node { cursor: pointer; transition: opacity 0.25s; }
#map .node > rect.box { fill: var(--surface); stroke: var(--line); stroke-width: 1.2; transition: stroke 0.2s, stroke-width 0.2s; }
#map .node.planned > rect.box { stroke-dasharray: 5 4; stroke: var(--planned); }
#map .node.hub > rect.box { fill: var(--gisk-soft); stroke: var(--gisk); stroke-width: 1.6; }
#map .node.bar > rect.box { stroke: var(--infer); stroke-width: 1.6; }
#map .node:hover > rect.box { stroke: var(--ink-3); }
#map .node:focus { outline: none; }
#map .node.selected > rect.box,
#map .node.hub.selected > rect.box,
#map .node.bar.selected > rect.box { stroke: var(--gisk); stroke-width: 2.6; }
#map .node:focus-visible > rect.box,
#map .node.hub:focus-visible > rect.box,
#map .node.bar:focus-visible > rect.box { stroke: var(--focus); stroke-width: 3.2; }
#map .node .name { font-family: var(--font-display); font-weight: 600; font-size: 15px; }
#map .node.hub .name { font-weight: 700; font-size: 22px; fill: var(--gisk); }
#map .node .sub { font-size: 12px; fill: var(--ink-2); }
#map .node .meta { font: 10.5px var(--font-mono); fill: var(--ink-3); }
#map .chip rect { fill: none; stroke-width: 1; }
#map .chip text { font: 10px var(--font-mono); }
#map .chip.infer rect { stroke: var(--infer); } #map .chip.infer text { fill: var(--infer); }
#map .chip.planned rect { stroke: var(--planned); stroke-dasharray: 3 2; } #map .chip.planned text { fill: var(--planned); }
#map .chip.ext rect { stroke: var(--ext); } #map .chip.ext text { fill: var(--ext); }
#map .chip.none rect { stroke: var(--line); } #map .chip.none text { fill: var(--ink-3); }
#map .inner rect { fill: var(--surface); stroke: var(--line); stroke-width: 1; transition: stroke 0.2s, fill 0.2s; }
#map .inner text { font-size: 12px; fill: var(--ink); }
#map .inner text.k { font: 10.5px var(--font-mono); fill: var(--ink-3); }
#map .inner.bus rect { stroke: var(--push); }
#map .inner.loop rect { stroke: var(--gisk); stroke-width: 1.6; }
#map .inner.loop text { font-weight: 600; }
#map .edge { transition: opacity 0.25s; }
#map .edge path.line { fill: none; stroke-width: 2.2; }
#map .edge.push path.line { stroke: var(--push); }
#map .edge.pull path.line { stroke: var(--pull); }
#map .edge.ext path.line { stroke: var(--ext); stroke-dasharray: 2 4; stroke-linecap: round; stroke-width: 2.6; }
#map .edge.infer path.line { stroke: var(--infer); }
#map .edge.planned path.line { stroke: var(--planned); stroke-dasharray: 6 5; }
#map .edge.client path.line { stroke: var(--gisk); }
#map .edge text { font: 11px var(--font-mono); fill: var(--ink-2); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }
#map marker path { stroke: none; }
#map .m-push { fill: var(--push); } #map .m-pull { fill: var(--pull); } #map .m-ext { fill: var(--ext); }
#map .m-infer { fill: var(--infer); } #map .m-planned { fill: var(--planned); } #map .m-client { fill: var(--gisk); }
#map .legend text { font-size: 12px; fill: var(--ink-2); }
#map .legend .lt { font: 11px var(--font-mono); letter-spacing: 0.06em; fill: var(--ink-3); text-transform: uppercase; }

#map.hide-push .edge.push, #map.hide-pull .edge.pull, #map.hide-ext .edge.ext,
#map.hide-infer .edge.infer, #map.hide-planned .edge.planned { opacity: 0.06; }
#map.tracing .node, #map.tracing .edge { opacity: 0.18; }
#map.tracing .node.on, #map.tracing .edge.on { opacity: 1; }
#map.tracing .edge.on path.line { stroke-width: 3.2; stroke-dasharray: 8 6; animation: flow 0.9s linear infinite; }
#map.tracing .inner.on rect { stroke: var(--gisk); stroke-width: 2.2; fill: var(--gisk-soft); }
@keyframes flow { to { stroke-dashoffset: -28; } }
@media (prefers-reduced-motion: reduce) {
  #map.tracing .edge.on path.line { animation: none; }
  #map .node, #map .edge, #map .node > rect.box { transition: none; }
}

.below { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 900px) { .below { grid-template-columns: 1fr; } }
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; }
.detail .label { font: 11.5px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.detail h3 { font-size: 26px; font-weight: 700; margin: 6px 0 4px; }
.detail .role { margin: 0 0 14px; color: var(--ink-2); }
.detail dl { display: grid; grid-template-columns: 8.5em 1fr; gap: 8px 16px; margin: 0; }
.detail dt { font: 12px var(--font-mono); color: var(--ink-3); padding-top: 3px; }
.detail dd { margin: 0; font-size: 15px; }
@media (max-width: 520px) { .detail dl { grid-template-columns: 1fr; gap: 2px; } .detail dd { margin-bottom: 8px; } }
.detail ul { margin: 14px 0 0; padding-left: 18px; font-size: 15px; display: grid; gap: 4px; }
.pill {
  display: inline-block; font: 11.5px var(--font-mono); letter-spacing: 0.03em; border: 1px solid var(--line);
  border-radius: 999px; padding: 1px 9px; color: var(--ink-2); white-space: nowrap;
}
.pill.live { color: var(--pull); border-color: var(--pull); }
.pill.beta { color: var(--ext); border-color: var(--ext); }
.pill.built { color: var(--planned); border-color: var(--planned); border-style: dashed; }
.howto { display: grid; gap: 10px; color: var(--ink-2); font-size: 15.5px; }

/* pieces */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 0 40px; border-top: 1px solid var(--line); }
.app { padding-block: 20px; border-bottom: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.app .head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.app h3 { font-size: 20px; }
.app h3 button { all: unset; cursor: pointer; border-bottom: 1px dotted var(--ink-3); }
.app h3 button:hover { color: var(--gisk); }
.app h3 button:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.app p { color: var(--ink-2); max-width: 64ch; }

/* decisions */
.decisions { display: grid; gap: 28px; }
.decision { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 40px; padding-top: 22px; border-top: 1px solid var(--line); }
@media (max-width: 860px) { .decision { grid-template-columns: 1fr; } }
.decision h3 { font-size: 21px; }
.decision .why { display: grid; gap: 10px; color: var(--ink-2); }
.decision .tradeoff { font-size: 15px; color: var(--ink-2); border-left: 3px solid var(--line); padding-left: 14px; }
.decision .tradeoff b { color: var(--ink); font-weight: 600; }
figure.hands { margin: 6px 0 0; grid-column: 1 / -1; }
figure.hands svg { display: block; width: 100%; min-width: 760px; height: auto; }
figure.hands figcaption { font-size: 14px; color: var(--ink-3); margin-top: 8px; }
#hands text { font-family: var(--font-body); fill: var(--ink); font-size: 12.5px; }
#hands .grp { fill: var(--surface-2); stroke: var(--line); }
#hands .ttl { font: 11px var(--font-mono); letter-spacing: 0.06em; text-transform: uppercase; fill: var(--ink-3); }
#hands .chipr { fill: var(--surface); stroke: var(--line); }
#hands .chipr.trusted { stroke: var(--pull); }
#hands .chipr.ask { stroke: var(--push); }
#hands .note { font: 11px var(--font-mono); fill: var(--ink-3); }
#hands .loopbox { fill: var(--gisk-soft); stroke: var(--gisk); stroke-width: 1.6; }
#hands .loopname { font-family: var(--font-display); font-weight: 700; font-size: 17px; fill: var(--gisk); }
#hands .gate { fill: var(--surface); stroke: var(--ink-3); stroke-width: 1.2; }
#hands .arr { stroke: var(--ink-3); stroke-width: 1.5; fill: none; }
#hands .arr.sub { stroke: var(--gisk); }
#hands marker path { fill: var(--ink-3); }
#hands .subag { font-weight: 600; fill: var(--gisk); }

/* data leaves home */
.leaves { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 0 36px; border-top: 1px solid var(--line); }
.leaves div { padding-block: 16px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.leaves h3 { font-size: 16.5px; }
.leaves p { font-size: 15px; color: var(--ink-2); }

/* status / name */
.two { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; gap: 24px; } }
.names { display: grid; gap: 8px; }
.names div { display: grid; grid-template-columns: 6.5em 1fr; gap: 12px; font-size: 15px; }
.names b { font-family: var(--font-display); font-weight: 600; }
.names span { color: var(--ink-2); }

footer.site { margin-top: 72px; padding-block: 28px 48px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); display: grid; gap: 6px; }

@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f2f4f8; --region: #f2f4f8; --cloud: #f3f3fb; --device: #f1f7f5;
    --ink: #000; --ink-2: #333; --ink-3: #555; --line: #bbb; --gisk: #1d4ed8; --gisk-soft: #e3ebfd; --push: #c8143f; --pull: #0b7a70;
    --ext: #6d28d9; --infer: #9a5508; --planned: #555; }
  .controls, .tracebar, .actions, .scroll-hint { display: none !important; }
  .scroller { overflow: visible; border: none; }
  svg#map, figure.hands svg { min-width: 0 !important; width: 100%; }
  svg { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  section.block { break-inside: avoid-page; }
}
