/* Saldo — homepage styles. Source of truth: project/HomeD.dc.html + HANDOFF.md.
   No gradients, no shadows, no rounded corners (the status dot is the one circle). */

:root {
  --paper: #F4EFE4;
  --plate: #FBF8F1;
  --band: #EFE8D9;
  --ink: #1B241E;
  --leaf: #2E6B3B;
  --clay: #C4633A;
  --rule: #D7CFBC;
  --caption: #5A615B;
  --body: #3C443E;
  --grid: #E6DECC;      /* chart gridlines */
  --faded: #6B7069;     /* secondary clause text */
  --sidebar-rule: #4A5A50;
  --sidebar-icon: #8F988F;
  --clay-wash: rgba(196, 99, 58, .18);

  --serif: "Newsreader", Georgia, serif;
  --mono: "Chivo Mono", ui-monospace, Menlo, monospace;
  --gutter: 40px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
}
h1, h2, h3, p { margin: 0; }
svg { display: block; }
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--clay); }
a:focus-visible, .btn:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums lining-nums; }
.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 {
  position: absolute; left: 8px; top: -60px; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 14px;
  font: 500 12px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
}
.skip:focus { top: 8px; color: var(--paper); }

/* ---------- Shell ---------- */
.page {
  max-width: 1360px;
  margin: 0 auto;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}
.rule-b { border-bottom: 1px solid var(--rule); }
.rule-r { border-right: 1px solid var(--rule); }

/* ---------- Shared type ---------- */
.eyebrow { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--leaf); }
.label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--caption); }
.h2 { font-size: clamp(36px, 4vw, 58px); font-weight: 400; letter-spacing: -0.03em; line-height: 1.02; }
.lede { font-size: 19px; line-height: 1.5; color: var(--body); max-width: 520px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 54px; padding: 0 28px; /* 52px + 1px borders, as rendered in the design */
  border: 1px solid var(--ink); background: var(--ink); color: var(--paper);
  font: 500 13px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--leaf); border-color: var(--leaf); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: transparent; color: var(--clay); border-color: var(--clay); }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }

/* ---------- Nav ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 20px var(--gutter);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-word { font-size: 30px; font-weight: 500; letter-spacing: -0.02em; font-variation-settings: 'opsz' 72; }
.site-nav { display: flex; gap: 32px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }

/* ---------- Hero ---------- */
.hero {
  padding: 80px var(--gutter) 56px;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 40px; align-items: end;
}
.hero-l { display: flex; flex-direction: column; gap: 24px; }
.hero-r { display: flex; flex-direction: column; gap: 24px; max-width: 560px; }
.hero h1 {
  font-size: clamp(60px, 8.2vw, 132px); line-height: .92; font-weight: 400;
  letter-spacing: -0.04em; font-variation-settings: 'opsz' 72; text-wrap: balance;
}
.hero-copy { font-size: 23px; line-height: 1.4; color: var(--body); }
.status { font-size: 12px; color: var(--caption); }

/* ---------- The Number ---------- */
.number {
  border-top: 1px solid var(--ink);
  padding: 40px var(--gutter) 48px;
  display: flex; flex-direction: column; gap: 20px;
}
.number-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--caption);
}
.number-fig { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }
.hero-num {
  font-size: clamp(64px, 11.2vw, 164px); line-height: .95; letter-spacing: -0.05em;
  white-space: nowrap; color: var(--ink);
}
.dbl-hero { width: 100%; height: 20px; margin-top: 10px; }
.number-foot {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 24px; padding-top: 8px;
}
.number-foot > p { font-size: 20px; line-height: 1.4; color: var(--body); max-width: 560px; }
.context {
  display: grid; grid-template-columns: auto 1fr; gap: 8px 20px;
  font-size: 13px; color: var(--caption); align-content: start;
}
.context .fig { color: var(--ink); font-size: 22px; }

/* ---------- Split sections (chart, reading) ---------- */
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); }
.split-text {
  padding: 72px var(--gutter);
  display: flex; flex-direction: column; gap: 24px; justify-content: center;
}
.chart-col {
  padding: 72px var(--gutter);
  display: flex; flex-direction: column; gap: 16px; justify-content: center;
}
.chart-meta {
  display: flex; justify-content: space-between;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--caption);
}
.chart { width: 100%; height: auto; }
.chart-totals {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 16px; font-size: 13px; border-top: 1px solid var(--ink); padding-top: 14px;
}
.tot { display: flex; flex-direction: column; gap: 4px; }
.tot-k { color: var(--caption); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.tot-v { font-size: 22px; letter-spacing: -0.02em; }

/* ---------- Inside Saldo ---------- */
.inside {
  padding: 72px var(--gutter);
  display: flex; flex-direction: column; gap: 32px;
  background: var(--band);
}
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; }
.inside .h2 { max-width: 800px; }

.plate { background: var(--plate); border: 1px solid var(--rule); padding: 8px; }
.plate-lg { padding: 12px; }

/* overview app */
.app {
  width: 100%; border: 1px solid var(--rule); background: var(--paper);
  display: grid; grid-template-columns: 56px minmax(0, 1fr); overflow: hidden;
  font-size: 13px; line-height: 1.4;
}
.app-side {
  background: var(--ink); display: flex; flex-direction: column; align-items: center;
  gap: 18px; padding: 16px 0;
}
.app-side-rule { width: 20px; height: 1px; background: var(--sidebar-rule); }
.app-main { display: flex; flex-direction: column; min-width: 0; }
.app-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 24px; border-bottom: 1px solid var(--rule);
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--caption);
}
.app-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.app-total {
  padding: 28px 24px 24px; border-right: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--caption); }
.app-total-v { font-size: clamp(34px, 4.6vw, 64px); line-height: 1; letter-spacing: -0.04em; white-space: nowrap; }
.dbl-app { width: 100%; max-width: 440px; height: 12px; }
.app-total-note { font-size: 11px; color: var(--caption); margin-top: 6px; }
.app-status { padding: 28px 24px 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.live { display: flex; align-items: center; gap: 10px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--leaf); display: inline-block; }
.live-t { font-size: 17px; font-weight: 500; }
.small { font-size: 11px; color: var(--caption); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--ink); padding: 7px 12px; }
.chip-quiet { border-color: var(--rule); color: var(--caption); }
.app-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 12px; }
.row-sb { display: flex; justify-content: space-between; align-items: baseline; }
.tiles {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 1px; background: var(--rule); border: 1px solid var(--rule);
}
.tile { background: var(--plate); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-n { font-size: 14px; }
.tile-v { font-size: 20px; letter-spacing: -0.02em; }

/* three small screens */
.screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 24px; }
.screen { display: flex; flex-direction: column; gap: 12px; }
.mini {
  border: 1px solid var(--rule); background: var(--paper); font-size: 12px; line-height: 1.4;
  display: flex; flex-direction: column; overflow: hidden;
}
.mini-bar {
  padding: 10px 14px; border-bottom: 1px solid var(--rule);
  font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--caption);
  display: flex; justify-content: space-between;
}
.search { padding: 10px 14px; display: flex; gap: 6px; }
.field { border: 1px solid var(--rule); padding: 6px 8px; font-size: 10px; color: var(--caption); }
.field-grow { flex: 1; }
.cards { padding: 0 14px 12px; display: flex; flex-direction: column; gap: 10px; }
.card { background: var(--plate); border: 1px solid var(--rule); padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.card-name { font-size: 14px; font-weight: 500; }
.card-tag { font-size: 10px; }
.lines { display: grid; grid-template-columns: 1fr auto auto; gap: 4px 12px; font-size: 11px; color: var(--body); }
.subtotal { display: flex; justify-content: space-between; border-top: 1px solid var(--ink); padding-top: 5px; font-size: 12px; }
.screen-cap { font-size: 17px; line-height: 1.45; color: var(--body); }
.screen-cap strong { font-weight: 500; color: var(--ink); }

.evidence { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.excerpt { background: var(--plate); border: 1px solid var(--rule); padding: 10px 12px; font-size: 12px; line-height: 1.5; color: var(--body); }
.excerpt-src { font-size: 10px; color: var(--caption); display: block; margin-bottom: 4px; }
.excerpt strong { font-weight: 600; color: var(--ink); }
.hl { background: var(--clay-wash); color: var(--ink); }
.ledger { display: grid; grid-template-columns: 1fr auto auto; gap: 5px 12px; font-size: 11px; color: var(--body); }
.ledger-h { color: var(--caption); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.settle { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.settle-row { display: flex; justify-content: space-between; width: 100%; border-top: 1px solid var(--ink); padding-top: 6px; font-size: 13px; }
.dbl-sm { width: 100%; height: 8px; }
.actions { display: flex; gap: 6px; }
.act { font-size: 10px; letter-spacing: .06em; text-transform: uppercase; padding: 7px 10px; }
.act-primary { background: var(--ink); color: var(--paper); }
.act-quiet { border: 1px solid var(--rule); color: var(--caption); }

.monitor { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--rule); border: 1px solid var(--rule); }
.stat { background: var(--plate); padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.stat-k { font-size: 10px; color: var(--caption); text-transform: uppercase; letter-spacing: .06em; }
.stat-v { font-size: 18px; letter-spacing: -0.02em; }
.stat-n { font-size: 10px; color: var(--caption); }
.bars-wrap { display: flex; flex-direction: column; gap: 6px; }
.bars { width: 100%; height: auto; }
.log { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--body); border-top: 1px solid var(--rule); padding-top: 8px; }
.log > div { display: flex; justify-content: space-between; }
.footnote { font-size: 11px; color: var(--caption); }

/* ---------- Six leaks ---------- */
.leaks { padding: 72px var(--gutter) 56px; display: flex; flex-direction: column; gap: 40px; }
.leak-list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.leak {
  display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.6fr) auto;
  gap: 24px; padding: 20px 0; border-top: 1px solid var(--rule); align-items: baseline;
}
.leak:first-child { border-top-color: var(--ink); }
.leak:last-child { border-bottom: 1px solid var(--ink); }
.leak-n { font-size: 13px; color: var(--clay); }
.leak h3 { font-size: 25px; font-weight: 500; line-height: 1.2; }
.leak p { font-size: 17px; color: var(--body); }
.leak-src { font-size: 12px; color: var(--caption); text-align: right; }

/* ---------- The reading ---------- */
.reading-stage {
  padding: 88px var(--gutter) 72px;
  display: flex; align-items: center; justify-content: center; background: var(--band);
}
.contract {
  position: relative; width: 100%; max-width: 560px; background: var(--plate);
  padding: 44px 44px 40px; border: 1px solid var(--rule);
}
.contract-src { margin: 0 0 18px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--caption); }
.clause { font-size: 16px; line-height: 1.55; }
.clause + .clause { margin-top: 14px; }
.clause strong { font-weight: 600; }
.clause-faded { color: var(--faded); }
.marks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.note { position: absolute; right: -12px; top: -62px; max-width: 270px; transform: rotate(-2deg); }
.note p { font-size: 20px; line-height: 1.25; font-style: italic; color: var(--clay); }
.note .mono { font-style: normal; font-size: 17px; }

/* ---------- How it works ---------- */
.how { padding: 72px var(--gutter) 64px; display: flex; flex-direction: column; gap: 48px; }
.how .h2 { max-width: 760px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); border-top: 1px solid var(--ink); }
.step { padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.step:first-child { padding-left: 0; }
.step:last-child { padding-right: 0; }
.step-n { font-size: 13px; color: var(--clay); }
.step h3 { font-size: 28px; font-weight: 500; line-height: 1.15; }
.step p { font-size: 17px; line-height: 1.5; color: var(--body); }

/* ---------- Facts ---------- */
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  margin: 0;
}
.fact { padding: 28px var(--gutter); display: flex; flex-direction: column; gap: 6px; }
.fact dt { color: var(--caption); }
.fact dd { margin: 0; }

/* ---------- CTA ---------- */
.cta {
  padding: 96px var(--gutter);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr));
  gap: 40px; align-items: center;
}
.cta h2 { font-size: clamp(40px, 5vw, 76px); font-weight: 400; letter-spacing: -0.035em; line-height: .98; text-wrap: balance; }
.cta-r { display: flex; flex-direction: column; gap: 24px; max-width: 520px; }

/* ---------- Footer ---------- */
.site-footer {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px; padding: 28px var(--gutter);
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--caption);
}
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 24px; }

/* ---------- Motion ---------- */
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { from { stroke-dashoffset: 2400; } to { stroke-dashoffset: 0; } }
@keyframes grow { from { stroke-dashoffset: 1400; } to { stroke-dashoffset: 0; } }

/* Chart and contract marks wait until scrolled into view (main.js adds .in-view).
   Without JS, .js is absent and everything shows its end state. */
/* The dashed "contracted" curve draws in through a mask (.curve inside <mask>),
   so it keeps its dashes once drawn. */
.js .curve { stroke-dasharray: 1400; stroke-dashoffset: 1400; }
.js .area { opacity: 0; }
.js .ink  { stroke-dasharray: 2400; stroke-dashoffset: 2400; }
.js .ink2 { stroke-dasharray: 900;  stroke-dashoffset: 900; }

.js .in-view .curve { animation: grow 2.2s ease-out .3s forwards; }
.js .in-view .area  { animation: appear 1.4s ease-out .9s forwards; }
.js .in-view .ink   { animation: draw 2.2s ease-out .2s forwards; }
.js .in-view .ink2  { animation: draw 1.2s ease-out 1.4s forwards; }

@media (prefers-reduced-motion: reduce) {
  .js .curve, .js .ink, .js .ink2 { stroke-dasharray: none; stroke-dashoffset: 0; animation: none; }
  .js .area { opacity: 1; animation: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .leak { grid-template-columns: 40px minmax(0, 1fr); gap: 8px 16px; }
  .leak p, .leak-src { grid-column: 2; text-align: left; }
  .step, .step:first-child, .step:last-child { padding: 32px 0; border-right: 0; }
  .step + .step { border-top: 1px solid var(--rule); }
}
@media (max-width: 600px) {
  .hero-num { font-size: 11.2vw; }
  .app-top { grid-template-columns: minmax(0, 1fr); }
  .app-total { border-right: 0; border-bottom: 1px solid var(--rule); }
  .app-total-v { font-size: 6.4vw; }
  .note { position: static; transform: none; max-width: none; margin-top: 20px; }
  .marks { display: none; } /* the circle and arrow only land correctly on the desktop layout */
  .reading-stage { padding-top: 72px; }
}

/* ---------- Colour utilities (last, so they win over component colours) ---------- */
.c-clay { color: var(--clay); }
.c-leaf { color: var(--leaf); }
.c-ink { color: var(--ink); }
.c-cap { color: var(--caption); }
