:root {
  color-scheme: light dark;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --text: #15181d;
  --text-2: #3d4450;
  --muted: #646d7a;
  --border: #dadee4;
  --line: #b4bbc5;
  --accent: #1d5fd1;
  --accent-soft: #e4ecfb;
  --sky: #2b74b3;      /* soft sky blue for links inside body text */
  --sky-hover: #1c5a8f;

  /* State dots. Always shown next to their text label, never alone. */
  --st-idea: #8a93a0;
  --st-exploring: #2f6fdf;
  --st-decided: #7a4fd6;
  --st-building: #c47a12;
  --st-done: #22884a;

  --radius: 10px;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1015;
    --surface: #151a21;
    --surface-2: #1d232c;
    --text: #e7eaef;
    --text-2: #c2c8d1;
    --muted: #949eab;
    --border: #2a313b;
    --line: #3f4855;
    --accent: #6ea2ff;
    --accent-soft: #1a2945;
    --sky: #9fd0f0;
    --sky-hover: #62aee0;

    --st-idea: #8d96a3;
    --st-exploring: #5f95f5;
    --st-decided: #a585f0;
    --st-building: #e3a23f;
    --st-done: #4cc27a;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 var(--sans); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.88em; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: 1.15rem; margin-bottom: 14px; }
h3 { font-size: 1rem; }
section { margin: 44px 0; }
.muted { color: var(--muted); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.wrap { padding-bottom: 64px; }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
nav[aria-label="Main"] { display: flex; gap: 4px; flex-wrap: wrap; }
nav[aria-label="Main"] a { color: var(--text-2); padding: 6px 10px; border-radius: 6px; font-size: 0.94rem; }
nav[aria-label="Main"] a:hover { background: var(--surface-2); text-decoration: none; }
nav[aria-label="Main"] a[aria-current="page"] { color: var(--text); background: var(--surface-2); font-weight: 600; }

/* Page intro */
.hero { margin-top: 44px; max-width: 720px; }
.lede { color: var(--text-2); font-size: 1.1rem; margin: 10px 0 0; }
.lede b { color: var(--text); font-weight: 600; }
.lede a { color: var(--sky); }
.lede a:hover { color: var(--sky-hover); text-decoration: none; }

.hero-link { margin: 14px 0 0; font-weight: 600; }
.section-note { margin: -6px 0 14px; color: var(--muted); }
.narrow { max-width: 760px; }

/* Small labels */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 0.78rem; font-weight: 400; white-space: nowrap;
}
.pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--st-idea)); }
.status-idea, .svc-idea { --dot: var(--st-idea); }
.status-exploring, .svc-planned { --dot: var(--st-exploring); }
.status-decided { --dot: var(--st-decided); }
.status-building, .svc-building { --dot: var(--st-building); }
.status-done, .svc-live { --dot: var(--st-done); }
.chip {
  font: 0.78rem var(--mono); padding: 2px 8px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.num { font: 600 0.8rem var(--mono); color: var(--muted); }

/* Plan map: a left-to-right tree. Each list draws its own spine halfway
   into its left padding; each item draws a stub from the spine to its node. */
.tree-scroll { overflow-x: auto; padding-bottom: 4px; }
.tree { --gap: 32px; display: flex; align-items: center; width: max-content; min-width: 100%; }
.tree-list { list-style: none; margin: 0; padding: 0 0 0 var(--gap); position: relative; }
.tree-list::before {
  content: ""; position: absolute; left: 0; top: 50%;
  width: calc(var(--gap) / 2); border-top: 2px solid var(--line);
}
.tree-list > li { position: relative; padding: 3px 0; }
.tree-list > li::before {
  content: ""; position: absolute; left: calc(var(--gap) / -2); top: 50%;
  width: calc(var(--gap) / 2); border-top: 2px solid var(--line);
}
.tree-list > li::after {
  content: ""; position: absolute; left: calc(var(--gap) / -2); top: 0; bottom: 0;
  border-left: 2px solid var(--line);
}
.tree-list > li:first-child::after { top: 50%; }
.tree-list > li:last-child::after { bottom: 50%; }
.tree-list > li:only-child::after { display: none; }
.tree-list > li.tree-branch { display: flex; align-items: center; padding: 8px 0; }

.tree-root {
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--text); color: var(--surface); font-weight: 700;
}
.tree-cat {
  width: 220px; flex-shrink: 0; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.92rem;
}
.tree-cat small { display: block; margin-top: 2px; font-weight: 400; font-size: 0.78rem; color: var(--muted); }
.tree-now { border: 2px solid var(--accent); }
.tree-cat small.tree-date { margin-top: 6px; font-size: 0.76rem; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.tree-leaf {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 0.88rem; white-space: nowrap;
}
.tree-leaf:hover { border-color: var(--accent); text-decoration: none; }
.tree-leaf .pill { padding: 0 8px; font-size: 0.72rem; }

.now-tag {
  margin-left: 8px; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent);
}

/* Developer and reviewer sections at the bottom of the plan page */
.profile-card {
  display: flex; gap: 16px; align-items: flex-start; max-width: 640px;
  padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.profile-avatar {
  flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--text); color: var(--surface); font-weight: 700;
}
.profile-card p { margin: 0; }
.profile-name span { margin-left: 6px; color: var(--muted); font-size: 0.9rem; }
.profile-bio { margin-top: 4px !important; color: var(--text-2); }
.profile-links { margin-top: 8px !important; font-weight: 600; }
/* The text takes the room left by the button, and the button drops below it on narrow screens. */
.reviewer-box {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  max-width: 640px; padding: 18px;
  background: var(--accent-soft); border: 1px solid var(--accent); border-radius: var(--radius);
}
.reviewer-box > div { flex: 1 1 320px; }
.reviewer-box p { margin: 0; }
.reviewer-box h3 { margin: 14px 0 6px; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-2); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 0.8rem; padding: 2px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.button {
  flex-shrink: 0; padding: 10px 18px; border-radius: 8px;
  background: var(--accent); color: var(--surface); font-weight: 600;
}
.button:hover { text-decoration: none; filter: brightness(1.08); }

.principles { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.principles .card { border-top: 4px solid var(--accent); }

/* Point page */
.crumbs { margin-top: 28px; font-size: 0.88rem; color: var(--muted); }
.point-head { margin-top: 12px; max-width: 760px; }
.point-head h1 { margin-top: 10px; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.point-body { max-width: 760px; }
.point-body section { margin: 32px 0; }
.list { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.decision {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 10px;
}
.decision-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.badge {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 1px 8px; border-radius: 4px; border: 1px dashed var(--muted); color: var(--muted);
}
.decided .badge { border-style: solid; border-color: var(--st-done); color: var(--text); }
.options { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.options li { font-size: 0.85rem; padding: 3px 10px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); }
.map-day { font-weight: 400; color: var(--muted); }

/* Parts list on a point page */
.parts-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.parts-table th, .parts-table td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.parts-table thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.parts-table .num-col { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.parts-table tfoot td { border-bottom: 0; font-weight: 600; }
.part-name { display: block; font-weight: 600; }
.part-detail { display: block; font-size: 0.85rem; color: var(--muted); }
.parts-sub { margin: 18px 0 6px; font-size: 1rem; }
.parts-note { margin: 6px 0 0; font-size: 0.85rem; color: var(--muted); }
.leaning { margin: 10px 0 0; font-size: 0.92rem; }
.why { margin: 4px 0 0; font-size: 0.88rem; color: var(--muted); }

.relations { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding-top: 24px; border-top: 1px solid var(--border); }
.relations-one { grid-template-columns: 1fr; }
.relations h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 8px; }
.rels { display: flex; flex-wrap: wrap; gap: 6px; }
.rel {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
  color: var(--text); font-size: 0.88rem;
}
.rel:hover { border-color: var(--accent); text-decoration: none; }
.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 760px; margin-top: 40px; font-size: 0.93rem; }

/* How it works: drones on top, an optional shared ground station below.
   .fleet-drones and .fleet-links share columns so each arrow sits under its drone. */
.fleet { display: flex; flex-direction: column; }
.fleet-drones, .fleet-links { display: grid; grid-template-columns: 2.4fr 1fr 1fr; gap: 12px; }
.fleet-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text); margin-bottom: 10px; }
.fleet-label span { margin-left: 6px; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); }
.drone { border-radius: var(--radius); padding: 14px; }
.drone-main { border: 1px solid var(--border); background: var(--surface-2); }
/* Equal columns + stretch: the two boxes in a row are always the same size,
   with the software footer along the bottom. */
.drone-inner { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: stretch; }
.drone-inner > .arr, .ground-inner > .arr { align-self: center; }
.drone-inner > .big, .ground-inner > .big { display: flex; flex-direction: column; }
.drone-inner > .big .sw, .ground-inner > .big .sw { margin-top: auto; }
.drone-inner > .big .list, .ground-inner > .big .list { margin-bottom: 14px; }
.drone-ghost {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: 2px dashed var(--line); color: var(--muted);
}
.drone-ghost .fleet-label { margin: 8px 0 2px; }
.drone-ghost p { margin: 0; font-size: 0.88rem; }
.fleet-links .arr-v { justify-content: center; padding-left: 0; }
/* Under drone 1: one arrow under the Pico, one under the Pi 5 (same columns as .drone-inner). */
.fleet-links .link-main { display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); padding: 0 15px; }
.fleet-links .link-main > .arr:last-child { grid-column: 3; }
.ground { border: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius); padding: 14px; }
.ground-inner { display: grid; grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr); align-items: stretch; }

.big { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.big-ours { border: 2px solid var(--accent); }
.big h3 { font-size: 1.05rem; }
.big-sub { margin: 2px 0 10px; color: var(--muted); font-size: 0.88rem; }
.big .list { font-size: 0.92rem; }

/* Arrows: a shaft drawn with CSS, heads as border triangles. "two" = both ends. */
.arr { display: flex; align-items: center; justify-content: center; gap: 4px; color: var(--muted); font-size: 0.78rem; text-align: center; }
.arr .shaft { position: relative; background: var(--accent); }
.arr .shaft::before, .arr .shaft::after { content: ""; position: absolute; border: 6px solid transparent; }
.arr-h { flex-direction: column; padding: 0 10px; }
.arr-h .shaft { width: 100%; height: 2px; }
.arr-h .shaft::after { right: -6px; top: -5px; border-left-color: var(--accent); border-right-width: 0; }
.arr-h.two .shaft::before { left: -6px; top: -5px; border-right-color: var(--accent); border-left-width: 0; }
.arr-v { flex-direction: row; gap: 10px; padding: 8px 0; justify-content: flex-start; padding-left: 40px; text-align: left; }
.arr-v .shaft { width: 2px; height: 48px; }
.arr-v .shaft::after { bottom: -6px; left: -5px; border-top-color: var(--accent); border-bottom-width: 0; }
.arr-v.two .shaft::before { top: -6px; left: -5px; border-bottom-color: var(--accent); border-top-width: 0; }
/* Dashed = optional link. */
.arr-v.dashed .shaft { background: repeating-linear-gradient(to bottom, var(--accent) 0 6px, transparent 6px 11px); }

/* Software footer inside each diagram box */
.sw { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 2px solid var(--line); }
.sw-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
.sw-chip code { font-size: 0.78rem; font-weight: 600; color: var(--text); white-space: nowrap; }
a.sw-chip:hover { border-color: var(--accent); text-decoration: none; }
.point-head h1 code { font-size: 0.9em; }
.sw-chip .pill { padding: 0 8px; font-size: 0.7rem; }
/* Software banners under the diagram: one wide clickable row per program. */
.section-lede { margin: -6px 0 14px; color: var(--muted); font-size: 0.93rem; }
.sw-banners { display: grid; gap: 10px; }
.sw-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; row-gap: 4px; align-items: center;
  padding: 14px 18px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--accent); border-radius: var(--radius); color: var(--text);
}
.sw-banner:hover { border-color: var(--accent); text-decoration: none; }
.sw-banner-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sw-banner-head code { font-size: 0.95rem; font-weight: 700; }
.sw-banner-head .pill { padding: 0 8px; font-size: 0.7rem; }
.sw-banner-text { grid-column: 1; color: var(--text-2); font-size: 0.93rem; }
.sw-banner-where { grid-column: 1; color: var(--muted); font-size: 0.82rem; }
.sw-banner-go { grid-column: 2; grid-row: 1 / span 3; color: var(--accent); font-size: 1.2rem; }

/* Why page */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.compare { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.compare th, .compare td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.compare tbody th { font-weight: 600; white-space: nowrap; }
.compare td { color: var(--text-2); }
.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }
.callout {
  margin: 14px 0 0; padding: 12px 16px; max-width: 760px;
  border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0;
}
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card p { margin: 6px 0 0; color: var(--text-2); font-size: 0.93rem; }
.use .use-why { color: var(--muted); font-size: 0.88rem; margin-bottom: 10px; }
/* Goal page: the uses lead the page, so they get more weight. */
.uses-top h2 { font-size: 1.4rem; }
.uses { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.uses .card { padding: 20px; border-top: 4px solid var(--accent); }
.uses .card h3 { font-size: 1.2rem; }
.uses .use-why { font-size: 0.95rem; color: var(--text-2); font-weight: 600; }
.use .list { font-size: 0.93rem; }

/* Narrow screens */
@media (max-width: 860px) {
  /* Diagram: stack everything; side-by-side arrows turn vertical. The other
     drones move to the top so drone 1's arrows lead straight to the ground. */
  .fleet { display: grid; grid-template-columns: 1fr 1fr; column-gap: 12px; }
  .fleet-drones, .fleet-links { display: contents; }
  .drone-ghost { grid-row: 1; margin-bottom: 12px; }
  .drone-main { grid-row: 2; grid-column: 1 / -1; }
  .fleet-links > .arr { display: none; }
  .fleet-links .link-main { grid-row: 3; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; padding: 0; }
  .ground { grid-column: 1 / -1; }
  .fleet-links .link-main > .arr:last-child { grid-column: 2; }
  .drone-inner, .ground-inner { display: flex; flex-direction: column; align-items: stretch; }
  .fleet .arr-h { flex-direction: row; gap: 10px; padding: 8px 0; justify-content: center; }
  .fleet .arr-h .shaft { width: 2px; height: 40px; }
  .fleet .arr-h .shaft::after { right: auto; top: auto; bottom: -6px; left: -5px; border: 6px solid transparent; border-top-color: var(--accent); border-bottom-width: 0; }
  .fleet .arr-h.two .shaft::before { left: -5px; top: -6px; border: 6px solid transparent; border-bottom-color: var(--accent); border-top-width: 0; }
  .relations { grid-template-columns: 1fr; }
}
/* The plan map becomes an indented top-down tree. */
@media (max-width: 720px) {
  .tree { --gap: 24px; flex-direction: column; align-items: flex-start; width: auto; }
  .tree-list::before { display: none; }
  .tree-list > li.tree-branch { display: block; padding: 6px 0 0; }
  .tree-list > li.tree-branch::before { top: 24px; }
  .tree-list > li:first-child::after { top: 0; }
  .tree > .tree-list > li:last-child::after { bottom: auto; height: 24px; }
  .tree-cat { display: inline-block; width: auto; }
  .tree-leaf { white-space: normal; border-radius: 14px; }
}
@media (max-width: 640px) {
  /* Comparison table: one stacked block per row, each answer labelled. */
  .compare thead { display: none; }
  .compare tbody tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--border); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare tbody th { grid-column: 1 / -1; white-space: normal; padding-bottom: 2px; }
  .compare th, .compare td { border-bottom: 0; }
  .compare td { padding-top: 4px; }
  .compare td::before { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
  .compare td:nth-of-type(1)::before { content: "GPS"; }
  .compare td:nth-of-type(2)::before { content: "Camera + AI"; }
  .site-header { position: static; }
  .bar { padding-top: 8px; padding-bottom: 8px; }
}

/* Console page: finds the local console app, or explains it. */
.console-open { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
.console-note { margin: 12px 0 0; font-size: 0.88rem; }
.cs-looking { --dot: var(--st-exploring); }
.cs-found { --dot: var(--st-done); }
.cs-missing { --dot: var(--st-idea); }
.cards .card h3 + .list { margin-top: 8px; }
