/* AccountantAgent — palette derived from ledger stationery, not a palette generator:
   pale sage ledger-pad paper, navy fountain-pen ink, one rubber-stamp red. */
:root {
  --paper: #eef2ea;
  --paper-white: #fbfaf6;
  --rule: #c9d6c2;
  --ink: #1c2b3a;
  --ink-soft: #4b5a63;
  --stamp: #b23a2e;

  --display: "Fraunces", ui-serif, Georgia, serif;
  --body: "Source Sans 3", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.05rem;
  line-height: 1.55;
}

a { color: inherit; }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--stamp);
  outline-offset: 2px;
}

img, svg { display: block; max-width: 100%; }

.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Top bar ── */
.topbar {
  background: var(--ink);
  color: var(--paper-white);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.wordmark {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  font-size: 0.98rem;
}
.wordmark span { color: #9db08f; }
nav.topnav { display: flex; gap: 1.25rem; font-family: var(--mono); font-size: 0.88rem; }
nav.topnav a { text-decoration: none; color: #cbd3d8; }
nav.topnav a:hover, nav.topnav a[aria-current="page"] { color: var(--paper-white); }

/* ── Hero ── */
.hero {
  padding: 4.5rem 0 3rem;
  border-bottom: 1px solid var(--rule);
}
.kicker {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 1rem;
}
.hero h1 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.3rem, 5vw, 3.4rem);
  line-height: 1.08;
  max-width: 18ch;
  margin: 0 0 1.1rem;
}
.hero .sub {
  max-width: 42ch;
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin: 0 0 1.9rem;
}

/* the one CTA button, styled like a rubber stamp — no filled+outline pair */
.stamp-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--stamp);
  background: transparent;
  border: 2px solid var(--stamp);
  border-radius: 3px;
  padding: 0.65rem 1.3rem;
  text-decoration: none;
  transform: rotate(-1deg);
  transition: background-color 120ms ease, color 120ms ease;
}
.stamp-btn:hover { background: var(--stamp); color: var(--paper-white); }
@media (prefers-reduced-motion: reduce) {
  .stamp-btn { transition: none; }
}

.limit-line {
  margin-top: 1.6rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
  border-left: 2px solid var(--rule);
  padding-left: 0.8rem;
}

/* ── Trial balance strip (signature element) ── */
.trial-balance {
  background: var(--paper-white);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1.4rem 1.6rem 1.1rem;
  margin: 2.6rem 0 0;
  font-family: var(--mono);
  font-size: 0.92rem;
}
.trial-balance .tb-title {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.9rem;
}
.tb-row {
  display: grid;
  grid-template-columns: 6rem 1fr 3.5rem;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-top: 1px dotted var(--rule);
}
.tb-row:first-of-type { border-top: none; }
.tb-row .side { text-align: right; color: var(--ink-soft); }
.tb-total {
  display: grid;
  grid-template-columns: 6rem 1fr 3.5rem;
  gap: 0.75rem;
  padding-top: 0.6rem;
  margin-top: 0.4rem;
  border-top: 2px solid var(--ink);
  font-weight: 600;
}
.tb-total .side { text-align: right; }
.tb-check { color: var(--stamp); }

/* ── Mode sections (asymmetric, alternating) ── */
.modes { padding: 3.5rem 0; }
.mode-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 1.2rem 2rem;
  padding: 2rem 0;
  border-top: 1px solid var(--rule);
}
.mode-row:last-child { border-bottom: 1px solid var(--rule); }
.mode-num {
  font-family: var(--display);
  font-size: 2.4rem;
  color: var(--rule);
  line-height: 1;
}
.mode-row h2 { margin: 0 0 0.5rem; font-family: var(--display); font-size: 1.5rem; }
.mode-row p { margin: 0; max-width: 54ch; color: var(--ink-soft); }
.mode-row .example {
  margin-top: 0.9rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--paper-white);
  border: 1px solid var(--rule);
  padding: 0.7rem 0.9rem;
  max-width: 40rem;
  color: var(--ink);
  white-space: pre-wrap;
}

.runtime-strip {
  padding: 3rem 0;
}

.section-title {
  font-family: var(--display);
  font-size: 1.8rem;
  margin: 0 0 0.5rem;
}
.section-lede { color: var(--ink-soft); max-width: 52ch; margin: 0 0 2rem; }

.prose { padding: 3rem 0; max-width: 46rem; }
.prose h1 { font-family: var(--display); font-size: 2rem; margin-bottom: 1rem; }
.prose h2 { font-family: var(--display); font-size: 1.25rem; margin-top: 2rem; }
.prose p { color: var(--ink-soft); }
.prose a { color: var(--stamp); }

.placeholder {
  border: 1px dashed var(--stamp);
  background: #fbeceb;
  color: var(--stamp);
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.88rem;
}

.footnote { font-size: 0.85rem; color: var(--ink-soft); margin-top: 1.2rem; }

footer {
  background: var(--ink);
  color: #cbd3d8;
  margin-top: 3rem;
}
footer .wrap {
  padding: 2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
}
footer nav { display: flex; gap: 1.1rem; font-family: var(--mono); }
footer a { text-decoration: none; }
footer a:hover { color: var(--paper-white); }

/* ── Stats strip (real figures, ledger-column style — no icon cards) ── */
.stats-strip {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.stat {
  flex: 1 1 9rem;
  padding: 1.1rem 1.3rem;
  border-left: 1px solid var(--rule);
}
.stat:first-child { border-left: none; }
.stat .n {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1.7rem;
  color: var(--stamp);
  display: block;
}
.stat .label {
  font-size: 0.82rem;
  color: var(--ink-soft);
  display: block;
  margin-top: 0.15rem;
}

/* ── Diagrams (inline SVG, fixed pixel size, horizontal scroll on mobile
   rather than shrunk-to-illegible text) ── */
.diagram-scroll {
  margin: 1.2rem 0 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
}
.diagram-scroll svg { color: var(--ink); display: block; }
.diagram-scroll figcaption {
  margin-top: 0.6rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.diagram-scroll text { font-family: var(--mono); }

/* ── Audit phase stepper (HTML/CSS, wraps naturally on mobile — an SVG
   7-up row can't stay legible at phone width, this can) ── */
.phase-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 1.2rem 0 0.6rem;
  border-top: 1px dotted var(--rule);
  border-bottom: 1px dotted var(--rule);
}
.phase {
  flex: 1 1 7.5rem;
  padding: 0.7rem 0.8rem;
  border-left: 1px dotted var(--rule);
}
.phase:first-child { border-left: none; }
.phase .idx {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--stamp);
  display: block;
}
.phase .name {
  font-size: 0.85rem;
  color: var(--ink);
  line-height: 1.3;
}

/* ── Where it runs (ERP integration status) ── */
.run-status { margin-top: 1.4rem; }
.run-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
  flex-wrap: wrap;
}
.run-row:last-child { border-bottom: 1px solid var(--rule); }
.run-row h3 { margin: 0 0 0.2rem; font-size: 1.02rem; font-weight: 600; }
.run-row p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; max-width: 42ch; }
.run-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--stamp);
  color: var(--stamp);
  border-radius: 3px;
  padding: 0.2rem 0.55rem;
  white-space: nowrap;
  align-self: center;
}
.run-badge.muted { border-color: var(--ink-soft); color: var(--ink-soft); }
.install-block {
  margin-top: 1.2rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  background: var(--paper-white);
  border: 1px solid var(--rule);
  padding: 0.9rem 1.1rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.7;
}
.install-block .prompt { color: var(--ink-soft); }

/* ── Security section (ledger columns, not icon cards) ── */
.security-grid {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1.4rem;
  border-top: 1px solid var(--rule);
}
.security-item {
  flex: 1 1 14rem;
  padding: 1.1rem 1.3rem 1.1rem 0;
  border-bottom: 1px solid var(--rule);
}
.security-item h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.security-item p { margin: 0; color: var(--ink-soft); font-size: 0.92rem; }

.access-line {
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px dotted var(--rule);
}
.access-line p { color: var(--ink-soft); max-width: 46ch; margin: 0 0 1rem; }

@media (max-width: 640px) {
  .mode-row { grid-template-columns: 1fr; }
  .mode-num { font-size: 1.6rem; }
  .tb-row, .tb-total { grid-template-columns: 4.2rem 1fr 3rem; font-size: 0.82rem; }
}
