/* ============================================================================
   SageAgenda - site styles

   PALETTE PROVENANCE. These are not "retro-inspired" colors. They were sampled
   from a real screenshot of Lotus Agenda 2.0 running under DOSEMU2 (Tavis
   Ormandy, lock.cmpxchg8b.com/img/agenda-view.png) on 2026-09-06. Pixel counts
   over the 950x535 screen area:

     #C0C0C0  silver  79.5%  the field
     #000080  navy    14.2%  header bars, item text, the F-key strip
     #000000  black    0.8%
     #800000  maroon   0.6%  the selection highlight
     #FFFFFF  white    0.4%  text on navy and on maroon

   These are the Windows-console values for the 16 text-mode colors, NOT the
   VGA DAC values (#AAAAAA/#0000AA/#AA0000) a 1990 monitor was actually fed.
   That is because the sampled screenshot came from DOSEMU2 in terminal mode,
   which renders text as terminal escapes, so the colors are the terminal's
   palette, not the video card's. Measured 2026-09-11 against DOSBox Staging,
   whose VGA emulation gives the DAC values: the screens under /screens/ use
   those, and they are the period-accurate ones. The site chrome keeps the
   console values as its brand palette - a design choice, not a measurement
   error - so the two sets deliberately differ. Re-sample before changing any
   of the four brand hexes.

   TYPOGRAPHY. Geist, Vercel's typeface, with a real system fallback stack.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');

:root {
  /* --- Agenda, measured --- */
  /* The four that are WIRED. #000000 was 0.8% of the sample and is deliberately not
     declared - the recreation puts navy where the original had black, so a token for it
     would be documentation with no referent. */
  --agenda-navy:   #000080;
  --agenda-silver: #c0c0c0;
  --agenda-maroon: #800000;
  --agenda-white:  #ffffff;

  /* --- light surface --- */
  --bg:        #ffffff;
  --bg-subtle: #fafafa;
  --panel:     #ffffff;
  --ink:       #0a0a0a;
  --ink-2:     #4b4b4b;
  --ink-3:     #8f8f8f;
  --line:      #ebebeb;
  --line-2:    #d4d4d4;

  --accent:    #000080;
  --accent-2:  #1a1ab8;
  --hi:        #800000;

  --ok-fg: #04643a; --ok-bg: #e9f7f0;
  --wm-fg: #7a5c00; --wm-bg: #fdf6e3;
  --nu-fg: #5c5c5c; --nu-bg: #f2f2f2;

  --sans: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r: 8px;
  --maxw: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a; --bg-subtle: #111111; --panel: #141414;
    --ink: #ededed; --ink-2: #a1a1a1; --ink-3: #707070;
    --line: #232323; --line-2: #343434;
    --accent: #7c7cff; --accent-2: #a0a0ff; --hi: #ff6b6b;
    --ok-fg: #4ade80; --ok-bg: #0c2718;
    --wm-fg: #fbbf24; --wm-bg: #2a2008;
    --nu-fg: #a1a1a1; --nu-bg: #1c1c1c;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0a0a; --bg-subtle: #111111; --panel: #141414;
  --ink: #ededed; --ink-2: #a1a1a1; --ink-3: #707070;
  --line: #232323; --line-2: #343434;
  --accent: #7c7cff; --accent-2: #a0a0ff; --hi: #ff6b6b;
  --ok-fg: #4ade80; --ok-bg: #0c2718;
  --wm-fg: #fbbf24; --wm-bg: #2a2008;
  --nu-fg: #a1a1a1; --nu-bg: #1c1c1c;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 15px; line-height: 1.6;
  font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

a { color: inherit; text-decoration: none; }
p a, li a, td a { color: var(--accent); }
p a:hover, li a:hover, td a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- nav: clean sans, no letterspaced mono ---------- */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-in {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 60px;
  display: flex; align-items: center; gap: 30px;
}
.brand {
  font-weight: 600; font-size: 15.5px; letter-spacing: -.017em;
  display: inline-flex; align-items: center; gap: 9px; white-space: nowrap;
}
.brand .mk {
  width: 17px; height: 17px; border-radius: 3.5px;
  background: var(--agenda-navy); position: relative; flex: none;
}
.brand .mk::after {
  content: ""; position: absolute; inset: 4px 3.5px auto 3.5px; height: 2px;
  background: var(--agenda-white);
  box-shadow: 0 4px 0 var(--agenda-white), 0 8px 0 var(--agenda-silver);
}
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  font-size: 14px; font-weight: 400; color: var(--ink-2);
  padding: 6px 11px; border-radius: 6px; transition: color .12s, background .12s;
  /* Never break a label mid-phrase. Without this the bar appears to fit at widths where it is
     really folding "The idea" and "Join the waitlist" onto two lines each, which reads as broken
     and also hides the real overflow from any measurement of it. */
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink); background: var(--bg-subtle); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.nav-links .cta {
  background: var(--ink); color: var(--bg); font-weight: 500; margin-left: 8px;
}
.nav-links .cta:hover { background: var(--ink); color: var(--bg); opacity: .85; }
/* On /waitlist/ the CTA is also the current page, and `.nav-links a[aria-current="page"]`
   above scores (0,2,1) against `.nav-links .cta`'s (0,2,0) - so it wins on `color` and
   repaints the label to var(--ink) while the button's own `background: var(--ink)` stands.
   Label and background then resolve to the same token and the button reads as a solid
   block, in BOTH themes. Confirmed by rendering, not only by tracing the cascade. */
.nav-links .cta[aria-current="page"] { color: var(--bg); }

/* The nav OVERFLOWED at phone widths, and had before this breakpoint existed. Measured at a
   400px viewport: 698px of content, so Downloads, About, Progress and the CTA sat off the right
   edge with no way to reach them — `.nav-links` had neither `flex-wrap` nor `overflow-x`, so it
   was clipped rather than scrollable.

   It WRAPS rather than scrolling: nothing ends up hidden, it needs no JS, and it does not depend
   on a reader discovering that a bar scrolls sideways. `height` becomes `min-height` because a
   fixed 60px clips the second row instead of growing for it — wrapping alone would have looked
   like a fix and still hidden the links.

   Scoped to a media query so the desktop header is byte-identical: above this width the row
   never wraps, so none of it applies.

   920, and the number is measured rather than guessed. The bar's true single-row width is 885px
   — brand 118 + 30 gap + 689 of labels + 48 padding — once `white-space: nowrap` stops the
   labels folding onto two lines each. The first attempt used 860, which LOOKED right because at
   861 nothing was clipped; what was really happening is that "The idea" and "Join the waitlist"
   were each wrapping inside themselves, so the bar folded rather than fitted and left a 25px
   band that still overflowed. 920 clears 885 with room for one more nav item. */
@media (max-width: 920px) {
  .nav-in {
    height: auto; min-height: 60px; flex-wrap: wrap;
    row-gap: 4px; padding-top: 9px; padding-bottom: 9px;
  }
  .nav-links { flex-wrap: wrap; row-gap: 4px; }
}

/* ---------- type ---------- */
h1, h2, h3 { letter-spacing: -.032em; font-weight: 600; margin: 0; }
h1 { font-size: clamp(38px, 6vw, 62px); line-height: 1.05; letter-spacing: -.042em; }
h2 { font-size: clamp(25px, 3.2vw, 33px); line-height: 1.18; margin-bottom: 12px; }
h3 { font-size: 18px; line-height: 1.35; letter-spacing: -.02em; margin-bottom: 7px; }
.eyebrow {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--accent); margin: 0 0 16px; letter-spacing: 0;
}
.lede { font-size: clamp(17px, 2vw, 20px); line-height: 1.5; color: var(--ink-2); margin: 18px 0 0; }
p { margin: 0 0 16px; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
code, kbd { font-family: var(--mono); font-size: .89em; }
p code, li code, td code {
  background: var(--bg-subtle); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px;
}

section { padding: 68px 0; border-top: 1px solid var(--line); }
section:first-of-type { border-top: 0; }
.sec-head { margin-bottom: 30px; }
.sec-head p { color: var(--ink-2); max-width: 66ch; margin: 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px;
  border-radius: var(--r); font-size: 14.5px; font-weight: 500; border: 1px solid transparent;
  cursor: pointer; transition: opacity .12s, background .12s;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { opacity: .86; }
.btn-ghost { border-color: var(--line-2); color: var(--ink); background: var(--panel); }
.btn-ghost:hover { background: var(--bg-subtle); }
.btn-row { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(196px, 1fr)); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; transition: border-color .12s;
  display: flex; flex-direction: column;
}
a.card:hover { border-color: var(--line-2); }
.card h3 { margin-bottom: 6px; }
.card p { color: var(--ink-2); font-size: 14px; margin: 0; }
.card .go { margin-top: auto; padding-top: 14px; font-size: 13.5px; color: var(--accent); font-weight: 500; }

/* ---------- the hero's jump-nav (any page with `subnav` in its front matter) ----------
   This lived in the sources page's own <style> block until /screens/ grew a subnav and
   rendered it as bare text: the markup comes from the shared hero partial, so the rule
   belongs in the shared stylesheet. */
.subnav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 26px; }
.subnav a {
  font-size: 13.5px; color: var(--ink-2); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 12px; background: var(--panel);
}
.subnav a:hover { border-color: var(--line-2); color: var(--ink); }

/* ---------- screens of the running original (the shot shortcode) ---------- */
.shot { margin: 26px 0; }
.shot img {
  display: block; width: 100%; height: auto; max-width: 720px; margin: 0 auto;
  border-radius: var(--r); border: 1px solid var(--line-2);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 12px 34px -12px rgba(0,0,0,.22);
}
/* Shared by the screen shortcode and the diagram shortcode - identical, so one rule. */
.shot figcaption, .diagram figcaption {
  font-family: var(--mono); font-size: 11.5px; color: var(--ink-3);
  margin-top: 10px; text-align: center; max-width: 720px; margin-left: auto; margin-right: auto;
}
.grid .shot { margin: 0; }

/* A scanned artifact (the artifact shortcode) is somebody else's artwork shown small
   under fair use, so it is capped far below the 720px a screen render gets. The cap is
   part of the rights posture documented in docs/decisions/2026-09-12-image-rights.md,
   not a layout preference - do not raise it to make the picture nicer. */
.artifact-shot img { max-width: 340px; }

/* ---------- diagrams (the diagram shortcode) ----------
   The SVGs under assets/diagrams/ are inlined into the page and carry class names
   only, so every colour comes from the tokens above and the drawing follows the
   theme. Below 640px the figure scrolls sideways like a table does, rather than
   shrinking its labels past legibility. */
.diagram { margin: 26px 0; overflow-x: auto; }
.diagram svg {
  display: block; width: 100%; min-width: 640px; max-width: 800px; height: auto;
  margin: 0 auto; font-family: var(--sans);
}
.d-panel { fill: var(--panel); stroke: var(--line-2); }
.d-t  { fill: var(--ink);   font-size: 12.5px; }
.d-t2 { fill: var(--ink-2); font-size: 11.5px; }
.d-t3 { fill: var(--ink-3); font-size: 11px; }
.d-h  { fill: var(--ink);   font-size: 13px; font-weight: 600; }
.d-eyebrow { fill: var(--accent); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.d-mono { fill: var(--ink-2); font-family: var(--mono); font-size: 11.5px; }
.d-acc { fill: var(--accent); font-weight: 500; }
.d-line { stroke: var(--line-2); fill: none; }
.d-link { stroke: var(--accent); fill: none; stroke-width: 1.25; }
.d-dot, .d-arr-acc { fill: var(--accent); }
.d-inh { stroke: var(--ink-3); fill: none; stroke-dasharray: 3 3; }
.d-arr { fill: var(--ink-3); }
.d-ex { stroke: var(--hi); fill: none; stroke-width: 2; }
.d-badge { fill: var(--accent); }
.d-badge-t { fill: var(--bg); font-family: var(--mono); font-size: 10.5px; font-weight: 600; text-anchor: middle; }
.d-cursor { fill: var(--hi); }
.d-cursor-row { fill: var(--hi); opacity: .1; }

/* ---------- tables ---------- */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 14px; }
th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--ink-3);
  padding: 11px 16px; border-bottom: 1px solid var(--line); background: var(--bg-subtle);
}
td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td .d { display: block; color: var(--ink-2); font-size: 13px; margin-top: 4px; line-height: 1.5; }
td.rt { width: 92px; white-space: nowrap; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 500;
  padding: 2.5px 7px; border-radius: 5px;
}
/* Badge colours reuse the three existing token pairs rather than adding new ones,
   so there is nothing extra to define in the two dark-theme blocks above. Read
   bytes is the good outcome (ok); partially-blocked and gone-but-snapshotted are
   the warn outcomes (wm); deliberately-skipped and never-opened are quiet (nu). */
.t-raw       { color: var(--ok-fg); background: var(--ok-bg); }
.t-sum       { color: var(--wm-fg); background: var(--wm-bg); }
.t-challenge { color: var(--wm-fg); background: var(--wm-bg); }
.t-dead      { color: var(--wm-fg); background: var(--wm-bg); }
.t-na        { color: var(--nu-fg); background: var(--nu-bg); }
.t-list      { color: var(--nu-fg); background: var(--nu-bg); }

.legend {
  display: flex; flex-wrap: wrap; gap: 10px 24px; margin-bottom: 18px;
  padding: 14px 16px; background: var(--bg-subtle); border: 1px solid var(--line);
  border-radius: var(--r); font-size: 13.5px; color: var(--ink-2);
}

/* ---------- misc ---------- */
.note {
  border-left: 2px solid var(--accent); background: var(--bg-subtle);
  padding: 14px 18px; border-radius: 0 var(--r) var(--r) 0; margin: 22px 0;
}
.note p:last-child { margin-bottom: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 32px; margin-top: 34px; }
.stat .n { font-size: 27px; font-weight: 600; letter-spacing: -.03em; }
.stat .l { font-size: 13px; color: var(--ink-3); margin-top: 1px; }

footer.foot { border-top: 1px solid var(--line); padding: 40px 0 60px; margin-top: 20px; }
.foot-in { display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; }
.foot a { color: var(--ink-2); font-size: 14px; }
.foot a:hover { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 18px; }
.foot .small { color: var(--ink-3); max-width: 54ch; }

form.wl { max-width: 420px; margin-top: 26px; }
form.wl label { display: block; font-size: 13.5px; font-weight: 500; margin-bottom: 7px; }
form.wl input {
  width: 100%; height: 42px; padding: 0 13px; font-family: var(--sans); font-size: 15px;
  color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-2); border-radius: var(--r);
}
form.wl input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
form.wl .hint { font-size: 13px; color: var(--ink-3); margin-top: 10px; }

@media (max-width: 700px) {
  .nav-in { gap: 14px; }
  .nav-links a { padding: 6px 8px; font-size: 13.5px; }
  section { padding: 48px 0; }
}
