/* Layout: navy band carries name + a single-line-diagram map of the site; light content bands below. Same brand tokens as The Real Pipeline. */
:root {
  --bg: #EEF1F5; --surface: #FFFFFF; --ink: #0E1B2E; --muted: #56647A; --line: #D9DFE7;
  --brand: #14284B; --brand-ink: #FFFFFF; --brand-muted: #B7C3D6; --accent: #1E9E6A; --accent-ink: #157A51; --gold: #D9A21B;
  --f-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --f-body: "Lato", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A111D; --surface: #101A2A; --ink: #E7EDF5; --muted: #A0ADBF; --line: #22314A;
    --brand: #152744; --brand-ink: #E7EDF5; --brand-muted: #9FB0C8; --accent: #2BA36F; --accent-ink: #4CC28E; --gold: #D4A43A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A111D; --surface: #101A2A; --ink: #E7EDF5; --muted: #A0ADBF; --line: #22314A;
  --brand: #152744; --brand-ink: #E7EDF5; --brand-muted: #9FB0C8; --accent: #2BA36F; --accent-ink: #4CC28E; --gold: #D4A43A;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 17px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
img { max-width: 100%; }

.wrap, .top-in, .foot-in {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Top bar */
.top { background: var(--brand); color: var(--brand-ink); padding-top: env(safe-area-inset-top, 0px); }
.top-in { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { font-family: var(--f-display); color: var(--brand-ink); text-decoration: none; font-size: 18px; display: inline-flex; align-items: center; gap: 10px; }
.brand:hover { color: var(--brand-ink); }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(217,162,27,.25); }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.mainnav a { color: var(--brand-muted); text-decoration: none; font-weight: 700; font-size: 15px; padding-block: 4px; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: var(--brand-ink); }
.mainnav a[aria-current="page"] { color: var(--brand-ink); border-bottom-color: var(--accent); }

/* Hero (home only) */
.hero { background: var(--brand); color: var(--brand-ink); padding-block: 48px 64px; }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.hero h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(44px, 8vw, 84px); line-height: .98; letter-spacing: -0.01em; margin: 0 0 22px; text-wrap: balance; }
.hero .lede { font-size: clamp(19px, 2.2vw, 23px); line-height: 1.45; margin: 0 0 14px; max-width: 34ch; }
.hero .lede-2 { color: var(--brand-muted); margin: 0; max-width: 46ch; }
.hero a { color: var(--brand-ink); text-decoration-color: var(--accent); text-decoration-thickness: 2px; }

/* Single-line diagram of the site */
.sld { --pin: 14px; position: relative; padding: 4px 0 4px 0; }
.sld a { text-decoration: none; }
.sld-node { display: flex; align-items: flex-start; gap: 14px; color: var(--brand-ink); position: relative; z-index: 1; }
.sld-node .pin { flex: none; width: var(--pin); height: var(--pin); margin-top: 6px; border-radius: 50%; border: 3px solid var(--accent); background: var(--brand); transition: background .15s; }
.sld-node.root .pin { background: var(--gold); border-color: var(--gold); }
.sld-node:hover .pin, .sld-node:focus-visible .pin { background: var(--accent); }
.sld-label { font-family: var(--f-display); font-size: 20px; line-height: 1.25; }
.sld-label small { display: block; font-family: var(--f-body); font-size: 14px; color: var(--brand-muted); font-weight: 400; margin-top: 2px; }
.sld-node:hover .sld-label { color: var(--brand-ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 4px; }
.sld-bus { position: absolute; left: calc(var(--pin) / 2 - 1.5px); top: 18px; bottom: 34px; width: 3px; background: var(--accent); border-radius: 2px; }
.sld-branches { display: grid; gap: 26px; margin-top: 26px; padding-left: 34px; position: relative; }
.sld-branch { display: grid; gap: 18px; position: relative; }
.sld-branch::before { content: ""; position: absolute; left: -27px; top: 14px; width: 24px; height: 3px; background: var(--accent); }
.sld-node.leaf { margin-left: 34px; }
.sld-node.leaf::before { content: ""; position: absolute; left: -26px; top: -22px; width: 3px; height: 35px; background: var(--accent); }
.sld-node.leaf::after { content: ""; position: absolute; left: -26px; top: 11px; width: 26px; height: 3px; background: var(--accent); }

/* Breadcrumb as a line with nodes */
.trail { padding-block: 22px 0; }
.trail ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; font-size: 15px; }
.trail li { display: flex; align-items: center; }
.trail li + li::before { content: ""; width: 26px; height: 2px; background: var(--accent); margin: 0 8px; }
.trail .node { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; }
.trail .node::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--accent); background: var(--bg); }
.trail a.node:hover { color: var(--accent-ink); }
.trail .cur { font-weight: 700; }
.trail .cur::before { background: var(--accent); }

/* Content bands */
.band { padding-block: 44px 8px; }
.pagehead h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(36px, 6vw, 56px); line-height: 1.02; margin: 0 0 16px; text-wrap: balance; }
.pagehead .lede { font-size: 20px; line-height: 1.5; max-width: 52ch; margin: 0 0 22px; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.btn { display: inline-block; background: var(--accent); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none; padding: 11px 18px; border-radius: 6px; border: 2px solid var(--accent); white-space: nowrap; }
.btn:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.btn.ghost { background: transparent; color: var(--accent-ink); }
.btn.ghost:hover { background: var(--surface); color: var(--accent-ink); }

.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.prose { max-width: 64ch; min-width: 0; }
.prose h2, .signup h2, .door h2, .project h2 { font-family: var(--f-display); font-weight: 400; font-size: 24px; line-height: 1.2; margin: 0 0 10px; }
.prose h2:not(:first-child) { margin-top: 30px; }
.prose p { margin: 0 0 14px; }

.facts { margin: 0; display: grid; gap: 0; border-top: 3px solid var(--brand); }
.facts > div { padding-block: 12px; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.facts dt { font-size: 14px; color: var(--muted); font-weight: 700; }
.facts dd { margin: 0; }

.doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding-bottom: 56px; }
.door { display: grid; gap: 4px; align-content: start; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: 4px; padding: 22px 24px; color: var(--ink); text-decoration: none; }
.door:hover { border-color: var(--accent); color: var(--ink); }
.door p { margin: 0 0 12px; color: var(--muted); }
.door .go { font-weight: 700; color: var(--accent-ink); }

.signup { background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--gold); border-radius: 4px; padding: 22px; min-width: 0; }
.signup p { margin: 0 0 12px; }
.signup iframe { display: block; border: 0; background: transparent; max-width: 100%; margin-bottom: 8px; }
.small { font-size: 14px; color: var(--muted); }

.projects { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.project { display: flex; flex-wrap: wrap; gap: 18px 32px; align-items: center; justify-content: space-between; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 4px; padding: 24px; color: var(--ink); text-decoration: none; }
.project:hover { border-color: var(--accent); color: var(--ink); }
.project-text { flex: 1 1 420px; min-width: 0; }
.project p { margin: 0 0 8px; max-width: 64ch; }
.project .meta { color: var(--muted); font-size: 14px; margin: 0; }
.note { color: var(--muted); margin: 22px 0 56px; }

/* Footer */
.foot { border-top: 1px solid var(--line); margin-top: 24px; padding-bottom: env(safe-area-inset-bottom, 0px); }
.foot-in { padding-block: 24px 36px; font-size: 14px; color: var(--muted); display: grid; gap: 4px; }
.foot p { margin: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 6px !important; }
.foot-links a { font-weight: 700; }

@media (max-width: 820px) {
  .hero-in, .cols { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .doors { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-block: 36px 48px; }
  body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Shipping log */
.section-h { font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.15; margin: 0 0 18px; }
.log { display: grid; gap: 0; border-left: 3px solid var(--accent); margin-left: 6px; }
.entry { position: relative; padding: 4px 0 28px 28px; }
.entry::before { content: ""; position: absolute; left: -11px; top: 9px; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--accent); background: var(--bg); }
.entry .date { margin: 0 0 2px; font-size: 14px; font-weight: 700; color: var(--muted); }
.entry h2, .entry h3 { font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.2; margin: 0 0 8px; }
.entry h2 a, .entry h3 a { color: var(--ink); text-decoration: none; }
.entry h2 a:hover, .entry h3 a:hover { color: var(--accent-ink); text-decoration: underline; }
.entry p { margin: 0 0 12px; max-width: 64ch; }
.entry .entry-links { display: flex; flex-wrap: wrap; gap: 10px; }
.entry:target h2 a, .entry:target h3 a { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; }
.log-more { margin: 4px 0 0; font-weight: 700; }
.lede-2 a { font-weight: 700; }
.door .actions { margin-top: 6px; }
.door p.actions { color: inherit; }
.door .btn.ghost { color: var(--accent-ink); }

/* Three doors, book page */
.doors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mainnav { gap: 4px 18px; }
.book { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 48px; align-items: center; padding-bottom: 40px; }
.cover { position: relative; aspect-ratio: 2 / 3; max-width: 320px; width: 100%; box-shadow: 0 10px 30px rgba(14,27,46,.25); border-radius: 3px; overflow: hidden; background: var(--brand); }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-fallback { display: none; position: absolute; inset: 0; flex-direction: column; justify-content: space-between; padding: 28px; color: var(--brand-ink); border-left: 10px solid var(--gold); }
.cover-fallback span { font-family: var(--f-display); font-size: 44px; line-height: 1; }
.cover-fallback small { font-size: 16px; color: var(--brand-muted); }
.cover.nocover .cover-fallback { display: flex; }
.book-text h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(40px, 7vw, 64px); line-height: 1; margin: 0 0 14px; }
.book-text .lede { font-size: 22px; line-height: 1.4; margin: 0 0 18px; }
.book-text p { max-width: 52ch; }
@media (max-width: 820px) { .doors { grid-template-columns: minmax(0, 1fr); } .book { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
