/* Riser house style: fonts, colour tokens and base typography for every page.
   Loaded first by every page, then riser.css, then riser.js. */

@font-face { font-family: 'Archivo'; font-weight: 700; font-style: normal; font-display: swap;
  src: url('fonts/archivo-700.woff2') format('woff2'); }
@font-face { font-family: 'Archivo'; font-weight: 900; font-style: normal; font-display: swap;
  src: url('fonts/archivo-900.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-weight: 500; font-style: normal; font-display: swap;
  src: url('fonts/plexmono-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 400; font-style: normal; font-display: swap;
  src: url('fonts/plexsans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-weight: 600; font-style: normal; font-display: swap;
  src: url('fonts/plexsans-600.woff2') format('woff2'); }

:root {
  --paper: #F1F3EE;
  --ink: #182420;
  --ink-soft: #445048;
  --line: #C7CFC4;
  --card: #FFFFFF;
  /* darkened from the recap artifact's #B8701E: that value only cleared 3.0-3.9:1 against paper/card,
     which fails WCAG AA (4.5:1) for normal-size link/tag text — verified via relative-luminance calc. */
  --marigold: #915818;
  --marigold-soft: #F3E2C9;
  --herb: #2F6E56;
  --herb-soft: #DEEBE4;
  --clay: #A24430;
  --clay-soft: #F3DCD4;
  /* LIGHT, ALWAYS. Set 2026-09-19 at the founders' instruction.
     These pages are read on a phone in a dhaba, printed to A4, and photographed for
     WhatsApp. Following the device's dark preference meant the same document looked
     different to each partner and printed unpredictably — and this is a repo where two
     people have to be looking at literally the same figures. The dark palette is kept
     rather than deleted, moved behind an explicit opt-in, so a toggle can be added later
     without re-deriving the colours. Nothing sets data-theme today. */
  color-scheme: light;
}
:root[data-theme="dark"] {
    --paper: #131C18; --ink: #E7EEE8; --ink-soft: #9FB0A6; --line: #34433C; --card: #1B2621;
    --marigold: #E4A34D; --marigold-soft: #3A2C16; --herb: #6FBB9C; --herb-soft: #1C332A;
    --clay: #E08468; --clay-soft: #3A211C;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body, 'IBM Plex Sans', ui-sans-serif, system-ui, sans-serif);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
main { max-width: 840px; margin: 0 auto; padding: 48px 24px 90px; }

.mono { font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.eyebrow {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--marigold); font-weight: 500;
  display: flex; align-items: center; gap: 9px;
}
.eyebrow::before { content: ""; width: 7px; height: 7px; background: var(--marigold); border-radius: 50%;
  box-shadow: 0 0 0 3px var(--marigold-soft); flex-shrink: 0; }

h1, h2, h3, h4 { font-family: var(--font-display, 'Archivo', ui-sans-serif, system-ui, sans-serif); text-wrap: balance; }
h1 { font-weight: 900; font-size: clamp(28px, 4.4vw, 40px); letter-spacing: -0.01em; margin: 14px 0 8px; }
h2 { font-weight: 700; font-size: 22px; margin: 40px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
h3 { font-weight: 700; font-size: 17px; margin: 26px 0 10px; color: var(--ink); }
h4 { font-weight: 600; font-size: 14.5px; margin: 18px 0 6px; font-family: 'IBM Plex Sans'; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft); }
p { margin: 0 0 14px; max-width: 72ch; }
.lede { color: var(--ink-soft); font-size: 16px; max-width: 62ch; margin-bottom: 6px; }

.doc-meta {
  margin: 16px 0 30px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--ink-soft);
}
.doc-meta b { color: var(--ink); font-weight: 500; }

nav.doc-nav {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 34px;
  font-family: 'IBM Plex Mono', monospace; font-size: 12.5px;
}
nav.doc-nav a { color: var(--marigold); text-decoration: none; border-bottom: 1px solid transparent; }
nav.doc-nav a:hover, nav.doc-nav a:focus-visible { border-bottom-color: var(--marigold); }
nav.doc-nav .sep { color: var(--line); }

a { color: var(--marigold); }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }

input, textarea, select {
  width: 100%; max-width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 4px;
  background: var(--card); color: var(--ink); font: inherit;
}
textarea { resize: vertical; min-height: 96px; }
input[type="date"] { max-width: 260px; }
input::placeholder, textarea::placeholder { color: var(--ink-soft); opacity: 0.78; }
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--marigold); outline-offset: 2px; border-color: var(--marigold);
}

/* Visually hidden but announced to screen readers — status text, skip link's :not(:focus) state */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 100; background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 4px; font-family: 'IBM Plex Mono', monospace; font-size: 13px;
  text-decoration: none; transition: top 0.15s ease; }
.skip-link:focus { top: 8px; }

ul, ol { padding-left: 22px; margin: 0 0 16px; }
li { margin-bottom: 6px; }
strong, b { font-weight: 600; }

code, .code { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-size: 0.88em;
  background: var(--marigold-soft); color: var(--marigold); padding: 1px 6px; border-radius: 3px; }
pre { font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; background: var(--card);
  border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; overflow-x: auto; }
pre code { background: none; color: inherit; padding: 0; }

blockquote { margin: 0 0 16px; padding: 4px 0 4px 16px; border-left: 3px solid var(--line);
  color: var(--ink-soft); font-style: italic; }

/* Tag pills for [ASSUMPTION] / [VERIFY] */
.tag { display: inline-flex; align-items: center; font-family: 'IBM Plex Mono', monospace; font-weight: 500;
  font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 3px;
  white-space: nowrap; }
.tag.assumption { background: var(--marigold-soft); color: var(--marigold); border: 1px solid var(--marigold); }
.tag.verify { background: var(--clay-soft); color: var(--clay); border: 1px solid var(--clay); }

/* Status stamps (Ready / Held / Partial) */
.stamp { display: inline-flex; align-items: center; gap: 6px; font-family: 'IBM Plex Mono', monospace;
  font-weight: 500; font-size: 11px; letter-spacing: 0.07em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 2px; transform: rotate(-1.5deg); }
.stamp.ready { background: var(--herb-soft); color: var(--herb); border: 1px solid var(--herb); }
.stamp.held { background: var(--clay-soft); color: var(--clay); border: 1px solid var(--clay); }
.stamp.partial { background: var(--marigold-soft); color: var(--marigold); border: 1px solid var(--marigold); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--card); border-bottom: 2px solid var(--ink); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }

/* Gate / checklist items (GATES.md) */
.gate-group { margin-bottom: 30px; }
.gate-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.gate-item { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line);
  border-radius: 4px; padding: 12px 16px; }
.gate-item .checkbox { flex-shrink: 0; width: 20px; height: 20px; border-radius: 4px; margin-top: 1px;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.gate-item[data-status="open"] .checkbox { border: 2px solid var(--clay); color: transparent; }
.gate-item[data-status="cleared"] .checkbox { background: var(--herb); border: 2px solid var(--herb); color: var(--paper); }
.gate-item[data-status="cleared"] .checkbox::after { content: "✓"; }
.gate-item[data-status="cleared"] p { color: var(--ink-soft); text-decoration: line-through; text-decoration-color: var(--line); }
.gate-item p { margin: 0; font-size: 14.5px; }

/* Decision log entries (DECISIONS.md) */
.decision { background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  padding: 20px 24px; margin-bottom: 18px; }
.decision-date { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--marigold); margin-bottom: 4px; }
.decision-title { font-family: 'Archivo', sans-serif; font-weight: 700; font-size: 17px; margin: 0 0 14px; }
.decision .field { margin-bottom: 10px; }
.decision .field:last-child { margin-bottom: 0; }
.decision .field-label { font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 3px; }
.decision .field p { margin: 0; font-size: 14.5px; }

/* Sources / citations list */
.sources { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--ink-soft); }
.sources li { margin-bottom: 5px; padding-left: 0; }
.sources a { word-break: break-all; }

footer.doc-footer { margin-top: 60px; padding-top: 18px; border-top: 1px dashed var(--line);
  font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--ink-soft);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.snapshot-banner { background: var(--clay-soft); border: 1px solid var(--clay); border-radius: 4px;
  padding: 14px 18px; margin-bottom: 26px; font-size: 14px; }
.snapshot-banner strong { color: var(--clay); }
.snapshot-banner a { font-weight: 600; }

.brief-hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(180px, 260px); gap: 20px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 18px 20px;
  margin: 0 0 26px;
}
.brief-hero img { display: block; width: 100%; height: auto; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0 0 22px; }
.media-card { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 12px; }
.media-card.wide { grid-column: 1 / -1; }
.media-card img {
  display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 3px;
  background: #fff;
}
.media-card.wide img { aspect-ratio: 16 / 9; object-fit: cover; }
.media-card.square img { aspect-ratio: 1 / 1; object-fit: contain; }
.media-card.logo img { max-height: 180px; object-fit: contain; padding: 12px; }
.media-caption { color: var(--ink-soft); font-size: 12.5px; margin: 9px 0 0; }
.callout-list { background: var(--card); border: 1px solid var(--line); border-radius: 4px; padding: 16px 18px; }

@media (max-width: 640px) {
  main { padding: 32px 16px 70px; }
  th, td { padding: 8px 10px; font-size: 13px; }
  .brief-hero { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; color: #000; }
  nav.doc-nav, footer.doc-footer { display: none; }
  a { color: #000; text-decoration: underline; }
  .stamp, .tag { border: 1px solid #000 !important; background: none !important; color: #000 !important; }
  main { max-width: 100%; padding: 0; }
  .decision, .gate-item, .table-wrap, pre, .brief-hero, .media-card, .callout-list {
    border: 1px solid #000; break-inside: avoid;
  }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-card.wide { grid-column: 1 / -1; }
}
