/* The Information Machine — one shared stylesheet for every public page.
   No external deps / CDNs so the pages host as pure static files (local now, CloudFront later).

   TOKENS: the four blocks below are pasted VERBATIM from docs/brand/tokens.css (the single
   source of truth). Order matters — the :root[data-theme] overrides come AFTER the
   prefers-color-scheme block so a reader's explicit choice beats the OS preference both ways.
   The palette is a skin, not a structure: no rule below the component-layer marker may use a
   hex literal — everything styles through var(--token). */

:root {
  --paper: #F6F7F6;   /* page ground */
  --card: #FDFDFC;    /* raised surfaces */
  --ink: #182220;     /* text, wordmark */
  --muted: #56655F;   /* secondary text */
  --faint: #8A978F;   /* metadata, placeholders */
  --line: #DFE5E1;    /* borders, rules */
  --accent: #2E6E63;  /* teal — actions, links, selection */
  --accent-soft: #E4EFEB; /* teal wash — chips, selected rows */
  --signal: #A87B2E;  /* amber — semantic only (developing/pending), never decoration */
  --shadow: 0 1px 2px rgba(24, 34, 32, 0.05), 0 4px 16px rgba(24, 34, 32, 0.05);

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-reading: Charter, "Bitstream Charter", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-data: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101715;
    --card: #151E1B;
    --ink: #E6ECE9;
    --muted: #93A39C;
    --faint: #6B7B74;
    --line: #253029;
    --accent: #6FB5A8;
    --accent-soft: #1C2E29;
    --signal: #C99A4B;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  }
}

:root[data-theme="light"] {
  --paper: #F6F7F6;
  --card: #FDFDFC;
  --ink: #182220;
  --muted: #56655F;
  --faint: #8A978F;
  --line: #DFE5E1;
  --accent: #2E6E63;
  --accent-soft: #E4EFEB;
  --signal: #A87B2E;
  --shadow: 0 1px 2px rgba(24, 34, 32, 0.05), 0 4px 16px rgba(24, 34, 32, 0.05);
}

:root[data-theme="dark"] {
  --paper: #101715;
  --card: #151E1B;
  --ink: #E6ECE9;
  --muted: #93A39C;
  --faint: #6B7B74;
  --line: #253029;
  --accent: #6FB5A8;
  --accent-soft: #1C2E29;
  --signal: #C99A4B;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ===== component layer — tokens only below this line (no hex literals) ===== */

* { box-sizing: border-box; }

html { background: var(--paper); }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 36rem;
  margin: 0 auto;
  padding: 2.75rem 1.25rem 4rem;
}

a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

/* --- wordmark: pulse dot + name + channel chip ------------------------------------------ */
.mark {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 2rem;
}
.pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  flex: none;
}
.mark .name {
  font-weight: 650;
  letter-spacing: -0.01em;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.25em 0.7em;
  border-radius: 999px;
  white-space: nowrap;
}

/* --- surfaces ---------------------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.9rem clamp(1.25rem, 5vw, 2rem);
}

h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 650;
  text-wrap: balance;
  margin: 0 0 0.6rem;
}
h2 { font-size: 1.15rem; letter-spacing: -0.01em; font-weight: 650; margin: 0 0 0.5rem; }

p { margin: 0 0 1rem; max-width: 62ch; }
p:last-child { margin-bottom: 0; }

.lead { color: var(--muted); max-width: 46ch; }
.muted { color: var(--muted); font-size: 0.92rem; }
.faint { color: var(--faint); font-size: 0.85rem; }

/* --- forms ------------------------------------------------------------------------------- */
label { display: block; margin: 1.25rem 0 0.35rem; font-weight: 650; font-size: 0.92rem; }

input[type="email"],
input[type="text"],
textarea {
  font: inherit;
  width: 100%;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* email + submit on one line (the signup capture row) */
.form-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.form-row input { flex: 1 1 14rem; width: auto; }

.btn {
  font: inherit;
  font-weight: 650;
  font-size: 0.92rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  padding: 0.6rem 1.3rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--paper); }
.btn-primary:hover { filter: brightness(1.06); }
/* ghost — quiet secondary action */
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* --- list rows (signup + preferences) ----------------------------------------------------- */
.lists { display: grid; gap: 0.6rem; margin-top: 0.4rem; }
.list {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  /* rows are <label>s — undo the form-label defaults (weight/margin) so only
     .title/b render bold and the blurb stays regular */
  font-weight: 400;
  margin: 0;
}
.list input[type="checkbox"] {
  /* the native checkbox stays in the flow for a11y/mechanics; the .box draws it */
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.list .box {
  width: 15px;
  height: 15px;
  border-radius: 4px;
  border: 1.5px solid var(--faint);
  flex: none;
  align-self: center;
}
.list.on { border-color: var(--accent); background: var(--accent-soft); }
.list.on .box { background: var(--accent); border-color: var(--accent); }
.list b, .list .title { font-weight: 650; font-size: 0.92rem; }
.list span.desc, .list .desc { color: var(--muted); font-size: 0.85rem; display: block; }
.list .right { margin-left: auto; font-size: 0.78rem; color: var(--faint); white-space: nowrap; align-self: center; }
/* the quiet Member disclosure — a dashed LINK row, never a checkbox */
a.list { text-decoration: none; color: inherit; border-style: dashed; }
a.list .right { color: var(--accent); font-weight: 650; }

/* preferences rows */
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: 0; }
.row .name { font-weight: 650; font-size: 0.95rem; }
.row .sub { color: var(--muted); font-size: 0.85rem; }
.row .state { font-family: var(--font-data); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }

/* --- status note (calm: ink/muted prose; the amber dot is the attention affordance) ------- */
.note { margin-top: 1rem; min-height: 1.2rem; font-size: 0.92rem; color: var(--muted); }
.note.ok { color: var(--accent); }
.note.warn, .note.err { color: var(--ink); }
.note.warn::before, .note.err::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-radius: 50%;
  background: var(--signal);
  margin-right: 0.5em;
}

/* status icon circles (confirm / unsubscribe / billing returns) */
.icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  font-size: 1.4rem;
}
.icon-ok { background: var(--accent-soft); color: var(--accent); }
.icon-warn, .icon-err { background: transparent; border: 1px solid var(--line); color: var(--signal); }

.center { text-align: center; }
.center .lead, .center p { margin-left: auto; margin-right: auto; }
.stack > * + * { margin-top: 1rem; }

hr { border: 0; border-top: 1px solid var(--line); margin: 1.5rem 0; }

.foot {
  margin-top: 2rem;
  text-align: center;
  color: var(--faint);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
}
.foot a { color: var(--muted); }

.spinner {
  display: inline-block;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.2rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- cadence pill toggle (pricing + the preferences upgrade CTA) --------------------------- */
.cadence {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-size: 0.78rem;
  font-weight: 650;
}
.cadence button {
  font: inherit;
  border: 0;
  background: transparent;
  color: var(--faint);
  padding: 0.3em 1em;
  cursor: pointer;
}
.cadence button.active { background: var(--accent-soft); color: var(--accent); }

/* --- price card ---------------------------------------------------------------------------- */
.price-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.6rem;
  max-width: 24rem;
}
.price-num {
  font-size: 2.2rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.price-num small { font-size: 0.95rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.price-feats { margin: 1.1rem 0 1.4rem; display: grid; gap: 0.45rem; font-size: 0.9rem; color: var(--muted); }
.price-feats div::before { content: "—"; color: var(--accent); margin-right: 0.5rem; }

/* --- theme control (theme.js appends it into .foot) ---------------------------------------- */
.theme-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--font-data);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.theme-toggle button {
  font: inherit;
  border: 0;
  background: transparent;
  color: var(--faint);
  padding: 0.3em 0.85em;
  cursor: pointer;
}
.theme-toggle button.on { background: var(--accent-soft); color: var(--accent); }

/* ===== Phase E — shared site chrome (header + footer) + landing / content layout ===========
   TODO(phase-e): D1 — chrome is hand-duplicated into each page (wrapped in @chrome-header /
   @chrome-footer markers, guarded byte-identical by test_pages_chrome.py). If a second channel
   or >~10 pages arrives, switch to a minimal assemble-from-partials build step
   (see .claude/plans/public-site.md D1). Every rule below styles through var(--token) — no hex. */

/* band ground: a subtle step off --paper, derived from the tokens (works in both themes) */
.band { background: color-mix(in srgb, var(--ink) 4%, var(--paper)); }

/* --- header ------------------------------------------------------------------------------- */
header.site { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
header.site .bar { max-width: 64rem; margin: 0 auto; padding: 0.85rem 1.5rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; font-weight: 650; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
nav.top { margin-left: auto; display: flex; align-items: center; gap: 1.4rem; }
nav.top a.navlink { font-size: 0.9rem; font-weight: 550; color: var(--muted); text-decoration: none; }
nav.top a.navlink:hover { color: var(--ink); }
header.site .btn { padding: 0.5rem 1.05rem; font-size: 0.9rem; }
header.site.slim .themebtn { margin-left: auto; }
.themebtn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--faint); cursor: pointer; padding: 0; }
.themebtn:hover { color: var(--ink); border-color: var(--muted); }
.themebtn svg { width: 16px; height: 16px; }
@media (max-width: 720px) { nav.top a.navlink { display: none; } }
@media (max-width: 480px) { header.site .bar { gap: 0.6rem; padding: 0.7rem 1rem; } .brand { font-size: 0.9rem; white-space: nowrap; } nav.top { gap: 0.6rem; } }

/* ghost button — quiet secondary action used on the free tier card */
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-ghost:hover { background: var(--accent-soft); }

/* --- generic section + inner -------------------------------------------------------------- */
section { padding: 4.5rem 1.5rem; }
.inner { max-width: 64rem; margin: 0 auto; }
.eyebrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 650; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 46ch; }
section h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); letter-spacing: -0.015em; font-weight: 650; text-wrap: balance; }

/* --- hero --------------------------------------------------------------------------------- */
.hero { padding-top: 4rem; padding-bottom: 3.5rem; }
.hero .inner { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2.1rem, 5.5vw, 3.1rem); line-height: 1.08; letter-spacing: -0.025em; font-weight: 680; text-wrap: balance; margin: 0 0 0.6rem; }
@media (max-width: 820px) { .hero .inner { grid-template-columns: 1fr; gap: 2rem; } }
form.capture { margin-top: 1.6rem; display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 30rem; }
.capture input[type="email"] { flex: 1 1 15rem; width: auto; }
.microcopy { margin-top: 0.7rem; font-size: 0.82rem; color: var(--muted); max-width: 32rem; }
.microcopy b { color: var(--ink); font-weight: 600; }

/* --- sample peek (the single live/fallback Brief in the hero) ------------------------------ */
.peek { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.peek .peekbar { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.95rem; border-bottom: 1px solid var(--line); font-family: var(--font-data); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.peek .peekbody { padding: 1.1rem 1.15rem; }
.peek .metarow { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.3rem; }
.peek .metarow span { font-family: var(--font-data); font-size: 0.66rem; color: var(--faint); }
.peek .tag { font-size: 0.6rem; font-weight: 650; letter-spacing: 0.1em; text-transform: uppercase; padding: 0.15em 0.55em; border-radius: 999px; }
.peek .tag.dev { color: var(--signal); border: 1px solid var(--line); }
.peek h4 { font-size: 0.98rem; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 0.25rem; }
.peek p { font-family: var(--font-reading); font-size: 0.9rem; line-height: 1.55; color: var(--ink); margin: 0; max-width: none; }
.peek .cites { margin-top: 0.45rem; font-size: 0.72rem; color: var(--faint); }

/* --- how it works ------------------------------------------------------------------------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2rem; }
@media (max-width: 720px) { .steps { grid-template-columns: 1fr; } }
.step { padding: 1.3rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.step .n { font-family: var(--font-data); font-size: 0.72rem; font-weight: 650; color: var(--accent); }
.step h3 { margin: 0.5rem 0 0.35rem; font-size: 1.05rem; font-weight: 650; }
.step p { font-size: 0.92rem; color: var(--muted); margin: 0; }

/* --- tiers -------------------------------------------------------------------------------- */
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin: 2rem auto 0; max-width: 48rem; }
@media (max-width: 720px) { .tiers { grid-template-columns: 1fr; } }
.tier { padding: 1.6rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); display: flex; flex-direction: column; gap: 0.5rem; }
.tier.feature { border-color: var(--accent); box-shadow: var(--shadow); }
.tier .tname { font-weight: 650; font-size: 1.1rem; }
.tier .price { font-size: 1.9rem; font-weight: 680; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tier .price small { font-size: 0.85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tier-lists { list-style: none; padding: 0; margin: 0.6rem 0 1rem; display: grid; gap: 0.7rem; }
.tier-lists li { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.9rem; }
.tier-lists li b { font-weight: 650; color: var(--ink); font-size: 0.92rem; }
.tier-lists li span { color: var(--muted); }
.tier .capnote { font-size: 0.78rem; color: var(--faint); }
.tier .btn { margin-top: auto; }

/* --- faq ---------------------------------------------------------------------------------- */
.faq { max-width: 44rem; margin: 1.8rem auto 0; display: grid; gap: 0.5rem; }
details { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0.15rem 0.3rem; }
summary { cursor: pointer; padding: 0.85rem 1rem; font-weight: 600; font-size: 0.95rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--accent); font-weight: 650; }
details[open] summary::after { content: "–"; }
details p { padding: 0 1rem 1rem; font-size: 0.9rem; color: var(--muted); margin: 0; max-width: none; }

/* --- content pages (about / privacy / terms) ---------------------------------------------- */
.docwrap { max-width: 44rem; margin: 0 auto; padding: 3rem 1.5rem 4rem; display: flex; flex-direction: column; gap: 2rem; }
.doc { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 2rem clamp(1.25rem, 5vw, 2.1rem); box-shadow: var(--shadow); }
.doc h1 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); letter-spacing: -0.02em; font-weight: 680; line-height: 1.12; margin: 0 0 1rem; }
.doc h2 { font-size: 1.25rem; letter-spacing: -0.01em; font-weight: 650; margin: 1.4rem 0 0.4rem; }
.doc h3 { font-size: 0.98rem; font-weight: 650; margin: 1.3rem 0 0.3rem; }
.about p { font-family: var(--font-reading); font-size: 1.08rem; line-height: 1.65; }
.about .sig { font-family: var(--font-ui); font-size: 0.9rem; color: var(--muted); margin-top: 1.4rem; }
.privacy p, .privacy li { font-size: 0.94rem; color: var(--muted); }
.privacy strong { color: var(--ink); font-weight: 600; }
.privacy ul { margin: 0.3rem 0; padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.doc .meta { font-family: var(--font-data); font-size: 0.72rem; color: var(--faint); letter-spacing: 0.03em; }
/* an open-item placeholder rendered inline (D5 legal todos) — greppable via the adjacent
   TODO(phase-e) HTML comment; the amber-wash pill flags it as not-yet-filled on the page. */
.todo { background: var(--accent-soft); color: var(--accent); font-family: var(--font-data); font-size: 0.72rem; padding: 0.1em 0.5em; border-radius: 5px; }

/* --- footer ------------------------------------------------------------------------------- */
footer.site { border-top: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 4%, var(--paper)); }
.footin { max-width: 64rem; margin: 0 auto; padding: 3rem 1.5rem 2.5rem; display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 2rem; }
@media (max-width: 720px) { .footin { grid-template-columns: 1fr 1fr; gap: 1.6rem; } }
.footin h5 { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); font-weight: 650; margin-bottom: 0.7rem; }
.footcol a { display: block; font-size: 0.88rem; color: var(--muted); padding: 0.2rem 0; text-decoration: none; }
.footcol a:hover { color: var(--ink); }
.footbrand p { font-size: 0.85rem; color: var(--muted); margin-top: 0.6rem; max-width: 28ch; }
.footlegal { max-width: 64rem; margin: 0 auto; padding: 1.2rem 1.5rem 2.5rem; border-top: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.6rem; font-size: 0.78rem; color: var(--faint); }
.footlegal a { color: var(--faint); }
.footlegal a:hover { color: var(--muted); }
footer.site.slim { background: transparent; }
footer.site.slim .footlegal { border-top: 0; }
