/* The public site (everything under templates/base.html) on the Ledger tokens: DESIGN-SYSTEM.md §7.
 * The home page follows design/ledger/site-home.dc.html rule for rule; its colours map to tokens as
 * design/ledger/README.md says. Colours only through var(); the values live in tokens.css. The app
 * (/app) and the staff console keep styles.css. */

/* Base -------------------------------------------------------------------------------------------- */

* { box-sizing: border-box; }
body { margin: 0; background: var(--surface); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
/* The spec's container: 1200 of content with 32 either side. */
.wrap { box-sizing: content-box; max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.sub, .muted { color: var(--dim); }
.small { font-size: 12.5px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.h2 { font-size: 34px; line-height: 1.15; font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.self-start { align-self: flex-start; }

/* Buttons: 44 high, 36 in the header (§7). btn-secondary and btn-outline are the plain white button. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.btn-primary:hover { background: var(--accent-hover); color: var(--surface); }
.btn.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn:disabled { opacity: .6; cursor: progress; }

/* Header and footer --------------------------------------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.site-header .wrap { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; font-size: 19px; letter-spacing: -0.02em; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.nav { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.nav a { font-size: 14.5px; font-weight: 500; color: var(--ink-3); }
.nav a.login { font-size: 14px; color: var(--dim); }
.nav a[aria-current="page"] { color: var(--accent); }

.site-footer { margin-top: 72px; border-top: 1px solid var(--line); background: var(--ground); }
.site-footer .wrap { padding-top: 32px; padding-bottom: 32px; display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-brand { display: flex; flex-direction: column; gap: 6px; }
.foot-brand b { font-size: 16px; }
.foot-brand .sub { font-size: 13px; }
.foot-cols { display: flex; gap: 48px; flex-wrap: wrap; }
.foot-col { display: flex; flex-direction: column; gap: 6px; }
.foot-col a { font-size: 14px; color: var(--ink-3); }

/* Home: hero with the demo -------------------------------------------------------------------------- */

.hero { padding: 64px 0 56px; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.hero-copy { display: flex; flex-direction: column; gap: 22px; padding-top: 12px; }
.hero h1 { font-size: 54px; line-height: 1.05; font-weight: 700; }
.lede { font-size: 18px; color: var(--ink-3); max-width: 32em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

.demo-box { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.demo-box .hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.demo-box .hd b { font-size: 14px; }
.demo-box .hd .sub { font-size: 12px; }
.demo-box textarea { display: block; width: 100%; border: 0; padding: 16px; font: 14px/1.6 var(--sans); color: var(--ink-2); resize: none; background: var(--surface); min-height: 230px; }
.demo-box textarea:focus-visible { outline-offset: -2px; }
.demo-box .ft { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--surface-2); }
.demo-box .ft .sub { font-size: 12.5px; }
.result { padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.result b { font-weight: 600; }
.result .sub { font-size: 12px; }
.result .q { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.result .cite { margin-top: 4px; }
.result-empty { padding: 12px 16px; border-top: 1px solid var(--line-soft); font-size: 13.5px; color: var(--dim); }

/* Home: the rules strip */
.rule-strip { display: flex; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ground); }
.rule-strip span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 12px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; color: var(--ink); border-right: 1px solid var(--line); }
.rule-strip span:last-child { border-right: 0; }
.rule-strip i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* Home: sections */
.section { padding-top: 80px; }
.split { display: grid; gap: 56px; align-items: center; }
.split-board { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.split-even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.copy { display: flex; flex-direction: column; gap: 14px; }
.copy p { font-size: 16px; color: var(--ink-3); }
.section-head { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.section-head.row { flex-direction: row; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.section-head.row > div { display: flex; flex-direction: column; gap: 8px; }

/* Home: the product, drawn in HTML (an invented example) */
.frame { background: var(--ground); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.frame .bar { height: 34px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; padding: 0 12px; }
.frame .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.frame .bar span { margin-left: 8px; font-size: 11.5px; color: var(--dim); font-family: var(--mono); }
.mini { display: flex; font-size: 11.5px; }
.mini .rail { width: 36px; background: var(--rail); display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.mini .rail i { width: 18px; height: 18px; border-radius: 5px; background: var(--rail-on); }
.mini .rail i.on { background: var(--accent); }
.mini .body { flex: 1; min-width: 0; padding: 12px; }
.mini-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.mini-head b { font-size: 13px; }
.mini-head .sub { font-size: 10.5px; }
.seg { display: flex; gap: 6px; margin-bottom: 10px; }
.seg span { flex: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; display: flex; flex-direction: column; gap: 1px; }
.seg span b { font-family: var(--mono); font-size: 14px; font-weight: 500; }
.seg span small { font-size: 10px; color: var(--dim); }
.seg span.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tbl { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.tbl th { text-align: left; font-size: 9.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); font-weight: 500; padding: 6px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.tbl td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl .sub { font-size: 10px; }
.chip { display: inline-flex; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 500; }
.c-contacted { background: var(--accent-soft); color: var(--accent-hover); }
.c-replied { background: var(--ok-soft); color: var(--ok); }
.c-int { background: var(--warn-soft); color: var(--warn); }
.src { border: 1px solid var(--accent-line); color: var(--accent-hover); font-family: var(--mono); font-size: 9px; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px; border-radius: 3px; }
.ev { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ev.start { justify-content: flex-start; }
.ev i { display: block; width: 40px; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.ev i b { display: block; height: 100%; background: var(--accent); }
.frame-note { margin-top: 8px; font-size: 10px; }

/* Home: evidence */
.evidence-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; }
.evidence-card .head { display: flex; justify-content: space-between; align-items: baseline; }
.evidence-card .head b { font-size: 16px; }
.quote { margin: 0; background: var(--ground); border-radius: 6px; padding: 14px 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.evidence-card .quote { margin: -6px 0 0 28px; }
.cite { display: block; margin-top: 8px; font-family: var(--mono); font-size: 10.5px; font-style: normal; letter-spacing: .05em; text-transform: uppercase; color: var(--dim); }
.req { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 500; }
.req .m { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-top: 2px; }
.req .m.n { background: var(--sunken); color: var(--faint); }
.req .sub { font-weight: 400; }

/* Home: compare. Scrolls sideways in its own box on a narrow screen. */
.cmp-scroll { overflow-x: auto; }
.cmp { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 14.5px; }
.cmp th, .cmp td { box-sizing: content-box; } /* the spec's 190px first column is its content width */
.cmp th { text-align: left; padding: 14px 16px; border-bottom: 2px solid var(--line); font-weight: 600; vertical-align: bottom; }
.cmp th.us { color: var(--accent); border-bottom-color: var(--accent); }
.cmp td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-3); }
.cmp td:first-child { color: var(--ink); font-weight: 500; width: 190px; }
.cmp td.us { color: var(--ink); background: var(--accent-soft); }
.cmp tr:last-child td { border-bottom: 0; }

/* Home: where the candidates come from */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.flow .st { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.flow .st.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.flow .st h3 { font-size: 17px; font-weight: 600; }
.flow .st p { font-size: 14.5px; color: var(--ink-3); }

/* Home: being straight with you */
.honest { padding: 36px 44px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 48px; }
.honest h2 { font-size: 28px; line-height: 1.2; font-weight: 600; }
.honest .copy p { font-size: 15.5px; }
.fact { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); font-size: 15px; }
.fact:last-child { border-bottom: 0; }
.fact b { font-weight: 600; }
.fact span { color: var(--ink-3); }

/* Home: the call to action with the one price line (§7) */
.cta { background: var(--accent); border-radius: 10px; padding: 48px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 40px; align-items: center; }
.cta h2 { font-size: 30px; line-height: 1.2; font-weight: 600; color: var(--surface); }
.cta p { margin-top: 10px; font-size: 16px; color: var(--accent-soft); }
.cta .actions { margin-top: 22px; }
.cta .btn.on-accent { background: var(--surface); color: var(--accent); border-color: var(--surface); }
.cta .btn.ghost { background: transparent; color: var(--surface); border-color: var(--accent-line); }
.cta .btn.ghost:hover { color: var(--surface); }
.price-line { border-left: 1px solid var(--accent-line); padding-left: 40px; color: var(--surface); }
.price-line .label { font-family: var(--mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-line); }
.price-line .from { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.price-line .from span { font-size: 16px; font-weight: 500; color: var(--accent-soft); }
.price-line p { font-size: 15px; line-height: 1.5; }

/* Pages without a spec of their own, on the §7 rules ---------------------------------------------- */

/* Forms: log in, invitation, password reset, talk to us, the paused account */
.form-card { max-width: 460px; margin: 64px auto 0; padding: 36px; display: flex; flex-direction: column; gap: 20px; }
.form-card.wide { max-width: 560px; }
.form-card h1 { font-size: 28px; line-height: 1.2; font-weight: 600; }
.form-card form, .stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 6px; }
.input-field { display: flex; flex-direction: column; gap: 6px; }
.input-field label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.input-field input, .input-field select, .input-field textarea { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font: 15px var(--sans); color: var(--ink); }
.input-field textarea { padding: 10px 12px; line-height: 1.55; resize: vertical; }
.input-field .hint { font-size: 13px; color: var(--dim); }
.honeypot { position: absolute; left: -10000px; }
.alert { padding: 12px 14px; border-radius: 6px; font-size: 14px; line-height: 1.5; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); }
.fine-print { font-size: 13.5px; line-height: 1.55; color: var(--dim); border-top: 1px solid var(--line-soft); padding-top: 14px; }
.form-foot { font-size: 14px; color: var(--ink-3); }
.signed-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--ink-3); border-top: 1px solid var(--line-soft); padding-top: 16px; }

/* Pricing */
.pricing-head { padding: 64px 0 40px; text-align: center; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.pricing-head h1 { font-size: 54px; line-height: 1.05; font-weight: 700; }
.pricing-head p { font-size: 18px; color: var(--ink-3); max-width: 40em; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.plan { padding: 28px 24px; display: flex; flex-direction: column; gap: 18px; position: relative; }
.plan-featured { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.plan-badge { position: absolute; top: -11px; left: 24px; padding: 2px 8px; border-radius: 4px; background: var(--accent); color: var(--surface); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; }
.plan-name { font-size: 22px; font-weight: 600; }
.price { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.price b { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.price span { font-size: 14.5px; color: var(--dim); white-space: nowrap; }
.plan-allowance { font-family: var(--mono); font-size: 12.5px; line-height: 1.5; color: var(--dim); }
.plan ul { margin: 0; padding: 18px 0 0; list-style: none; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; gap: 10px; }
.plan li { font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.plan li.lead { color: var(--ink); font-weight: 500; }
.rules { margin-top: 80px; }
.rules h2 { margin-bottom: 24px; }
.rule { padding: 24px; display: flex; flex-direction: column; gap: 10px; }
.rule .eyebrow { color: var(--accent); }
.rule p { font-size: 15px; color: var(--ink-3); }
.wide-note { margin-top: 40px; padding: 32px; display: flex; gap: 48px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.wide-note strong { font-size: 19px; font-weight: 600; }
.wide-note p { font-size: 15px; color: var(--ink-3); max-width: 48em; margin-top: 8px; }

/* The demo page */
.demo-banner { background: var(--warn-soft); border-bottom: 1px solid var(--warn-line); }
.demo-banner .wrap { padding-top: 14px; padding-bottom: 14px; display: flex; gap: 12px; align-items: center; font-size: 14.5px; line-height: 1.5; color: var(--warn); }
.demo-banner svg { flex: none; }
.demo { padding-top: 40px; }
.demo .wrap { display: grid; grid-template-columns: 452px minmax(0, 1fr); gap: 28px; align-items: start; }
.demo-form { display: flex; flex-direction: column; gap: 18px; }
.demo-form h1 { font-size: 34px; line-height: 1.15; font-weight: 600; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); }
.field textarea { width: 100%; min-height: 380px; padding: 16px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font: 14px/1.6 var(--sans); color: var(--ink-2); resize: vertical; }
.results { display: flex; flex-direction: column; }
.results-head { padding: 16px 20px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.results-head strong { font-size: 16px; font-weight: 600; }
.results-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.results-body .candidate { border: 1px solid var(--line-soft); border-radius: 6px; }
.results-note { font-size: 13.5px; line-height: 1.55; color: var(--ink-3); padding: 12px 16px; background: var(--ground); border-radius: 6px; }
.results-empty { padding: 56px 32px; text-align: center; color: var(--dim); font-size: 15px; line-height: 1.6; }
.results-foot { padding: 20px; border-top: 1px solid var(--line-soft); background: var(--ground); border-radius: 0 0 8px 8px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.results-foot strong { font-size: 16px; font-weight: 600; display: block; }
.results-foot span { font-size: 14px; color: var(--ink-3); }
.source { display: inline-flex; align-items: center; padding: 1px 6px; border: 1px solid var(--line-strong); border-radius: 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); white-space: nowrap; }
.source-rfai { border-color: var(--accent-line); color: var(--accent-hover); }
.source-demo { border-color: var(--warn-line); color: var(--warn); }

/* One candidate on the demo page: their own words, verbatim (templates/_candidate.html) */
.candidate { padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.candidate-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.candidate-name { font-size: 18px; font-weight: 600; }
.candidate-sub { font-size: 14.5px; color: var(--ink-3); }
.candidate .quote { display: flex; flex-direction: column; gap: 8px; }
.candidate .cite { margin-top: 0; }
.consent { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; color: var(--ok); }
.consent-stale { color: var(--late); }

/* Privacy and terms */
.legal { max-width: 760px; display: flex; flex-direction: column; gap: 14px; }
.legal h1 { font-size: 34px; line-height: 1.15; font-weight: 600; margin-top: 8px; }
.legal h2 { font-size: 21px; margin-top: 18px; }
.legal h3 { font-size: 17px; margin-top: 10px; }
.legal p, .legal li { font-size: 15.5px; line-height: 1.7; color: var(--ink-2); }
.legal ul { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
.legal hr { border: none; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.legal .table-scroll { overflow-x: auto; }
.legal table { border-collapse: collapse; font-size: 14.5px; min-width: 520px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-soft); }
.legal th { font-family: var(--mono); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--dim); font-weight: 500; }

/* 900 wide must work (DESIGN-SYSTEM.md §3, §7): one column, nothing wider than the screen. ---------- */

@media (max-width: 900px) {
  .site-header .wrap { height: auto; min-height: 64px; padding-top: 12px; padding-bottom: 12px; }
  .hero .wrap, .split, .split-board, .split-even, .honest, .cta, .demo .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .rule-strip { flex-wrap: wrap; }
  .rule-strip span { flex: 1 1 30%; border-right: 0; }
  .honest { padding: 28px 24px; }
  .price-line { border-left: 0; padding-left: 0; border-top: 1px solid var(--accent-line); padding-top: 24px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
