/* ============================================================
   Ledgerline — single-page site
   Plain CSS. No framework, no build step.

   Direction: an accountant's columnar pad, updated. Warm paper,
   ruled hairlines doing the structural work, ink type, one spot
   colour used like a stamp, and mono reserved for figures.
   ============================================================ */

/* ---------- tokens ---------- */
:root {
  /* surface */
  --paper:      #f7f3ea;
  --sheet:      #fffdf7;
  --band:       #efe8d9;
  --ink-panel:  #1a1814;

  /* ink */
  --ink:        #1a1814;
  --ink-2:      #4f4a41;
  --ink-3:      #6e6757;

  /* structure (hairlines, never shadows) */
  --rule:       #e2dacb;
  --rule-2:     #c6b99d;

  /* spot colour: interactive + attention */
  --stamp:      #c0442a;
  --stamp-ink:  #97331f;
  --stamp-wash: #f6e3dc;

  /* status (always with a word label) */
  --settled:      #22694a;
  --settled-bg:   #e2efe4;
  --split:        #2f4a8c;
  --split-bg:     #e5e9f4;
  --open:         #8a5e12;
  --open-bg:      #f6ecd2;
  --marker:       rgba(233, 199, 108, .5);

  /* type */
  --f-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --f-body:    'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-mono:    'DM Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --t-h1:   clamp(2.05rem, 1.15rem + 3.55vw, 3.4rem);
  --t-h2:   clamp(1.55rem, 1.02rem + 2.3vw, 2.5rem);
  --t-h3:   1.0625rem;
  --t-body: 1.0625rem;
  --t-lead: clamp(1.06rem, 1rem + .45vw, 1.28rem);
  --t-sm:   .875rem;
  --t-mono: .85rem;

  /* rhythm */
  --s1: .25rem;  --s2: .5rem;   --s3: .75rem;  --s4: 1rem;
  --s5: 1.5rem;  --s6: 2rem;    --s7: 3rem;    --s8: 4rem;   --s9: 6rem;

  --measure: 62ch;
  --radius: 3px;
  --radius-lg: 5px;
  --radius-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--t-body)/1.62 var(--f-body);
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--stamp-ink); }
details > summary { cursor: pointer; }

:focus-visible {
  outline: 2px solid var(--stamp);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- primitives ---------- */
.wrap { width: min(100% - 2.5rem, 1180px); margin-inline: auto; }

.mono {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}

.h2 {
  font: 400 var(--t-h2)/1.08 var(--f-display);
  letter-spacing: -.015em;
  max-width: 24ch;
  text-wrap: balance;
}
.h3 {
  font: 600 var(--t-h3)/1.35 var(--f-body);
  letter-spacing: -.005em;
}
.lead {
  font: 300 var(--t-lead)/1.5 var(--f-body);
  color: var(--ink-2);
  max-width: var(--measure);
  margin-top: var(--s4);
}
.lead--tight { max-width: 48ch; }
.micro {
  font-size: var(--t-sm);
  color: var(--ink-3);
  max-width: 46ch;
  margin-top: var(--s4);
}
.micro--centre { margin-inline: auto; text-align: center; max-width: 54ch; }
.micro--onDark { color: #b9b2a3; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: var(--s2) var(--s4); z-index: 50;
}
.skip:focus { left: var(--s4); top: var(--s4); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s2);
  padding: .7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 .95rem/1 var(--f-body);
  letter-spacing: .01em;
  text-decoration: none;
  transition: background-color .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
}
.btn--sm { padding: .5rem .85rem; font-size: .875rem; }
.btn--lg { padding: .95rem 1.5rem; font-size: 1rem; }

.btn--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--solid:hover { background: #322e26; border-color: #322e26; }

.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn--ghost:hover { border-color: var(--ink); background: rgba(26, 24, 20, .045); }

.btn--light { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn--light:hover { background: #fff; border-color: #fff; }

.btn--outline { background: transparent; color: var(--paper); border-color: rgba(247, 243, 234, .38); }
.btn--outline:hover { border-color: var(--paper); background: rgba(247, 243, 234, .09); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar__inner {
  display: flex; align-items: center; gap: var(--s5);
  min-height: 62px;
}
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.brand__mark { color: var(--ink); flex: none; }
.brand__word { font-size: 1.02rem; letter-spacing: -.01em; }

.nav { margin-left: auto; display: flex; gap: var(--s5); }
.nav a {
  color: var(--ink-2); text-decoration: none; font-size: .92rem;
  padding: .35rem 0;
}
.nav a:hover { color: var(--ink); box-shadow: inset 0 -1px 0 var(--rule-2); }
.topbar__cta { margin-left: var(--s2); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--rule); }
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(to bottom, transparent 0 33px, var(--rule) 33px 34px);
  opacity: .22;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.45) 38%, transparent 82%);
          mask-image: linear-gradient(to bottom, #000 0, rgba(0,0,0,.45) 38%, transparent 82%);
}
.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2.25rem, 5.5vw, 5rem);
  padding: clamp(2.75rem, 6vw, 5rem) 0 clamp(3rem, 5.5vw, 4.5rem);
  align-items: start;
}
.hero__h1 {
  font: 400 var(--t-h1)/1.02 var(--f-display);
  letter-spacing: -.025em;
}
.hero__h1 span { display: block; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }

.stats {
  display: flex; flex-wrap: wrap; gap: var(--s6);
  margin-top: var(--s7); padding-top: var(--s5);
  border-top: 1px solid var(--rule-2);
}
.stats__cell { min-width: 8.5rem; }
.stats__cell dt {
  font-size: var(--t-sm); color: var(--ink-3); max-width: 19ch;
  line-height: 1.4; margin-bottom: .4rem;
}
.stats__cell dd {
  margin: 0;
  font: 400 1.75rem/1 var(--f-display);
  letter-spacing: -.02em;
  font-variant-numeric: lining-nums tabular-nums;
}
.stats__cell dd .unit {
  font: 400 .82rem/1 var(--f-body);
  color: var(--ink-3);
  letter-spacing: .02em;
  margin-left: .22em;
}

/* ---------- the reconciliation artefact ---------- */
.recon { display: grid; gap: var(--s3); }
.recon figcaption {
  font-size: .8rem; line-height: 1.5; color: var(--ink-2);
  max-width: 46ch; padding-left: .1rem;
}

.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 0 var(--rule), 0 14px 30px -20px rgba(26, 24, 20, .55);
  padding: var(--s4) var(--s4) var(--s3);
}
.sheet__label {
  font: 500 var(--t-mono)/1 var(--f-mono);
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s2);
}

.raw__row, .out__row {
  display: grid; align-items: center; gap: var(--s3);
  padding: .5rem 0;
  border-bottom: 1px solid var(--rule);
}
.raw__row:last-child, .out__row:last-child { border-bottom: 0; }

.raw__row { grid-template-columns: 4.1rem minmax(0, 1fr) auto; }
.raw__date { font: 400 var(--t-mono)/1 var(--f-mono); color: var(--ink-3); }
.raw__desc {
  font: 400 var(--t-mono)/1.35 var(--f-mono);
  color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.raw__amt { font: 500 var(--t-mono)/1 var(--f-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.raw__amt--out { color: var(--ink-3); }

.recon__mid {
  display: flex; align-items: center; gap: var(--s3);
  color: var(--ink-3);
}
.recon__mid::before, .recon__mid::after {
  content: ""; height: 1px; background: var(--rule-2); flex: 1;
}
.recon__mid span {
  font: 500 var(--t-mono)/1 var(--f-mono);
  text-transform: uppercase; letter-spacing: .09em;
  white-space: nowrap;
}

.out__row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: .15rem; }
.out__who { display: grid; gap: .15rem; min-width: 0; }
.out__who b { font-weight: 500; font-size: .95rem; }
.out__who em {
  font: 400 .76rem/1.35 var(--f-mono); font-style: normal;
  color: var(--ink-2);
}
.out__amt {
  position: relative; isolation: isolate;      /* own stacking context so the marker sits behind the text, above the card */
  display: inline-block;
  font: 500 .82rem/1 var(--f-mono); font-variant-numeric: tabular-nums;
  padding: .1rem .25rem;
}
.out__amt--quiet { color: var(--ink-3); }
.hl {
  position: absolute; z-index: -1;
  left: -1px; right: -1px; top: 50%; height: 1.35em;
  transform: translateY(-50%) scaleX(1);
  transform-origin: left center;
  background: var(--marker);
  border-radius: 2px;
  animation: sweep .62s var(--ease) both;
}
@keyframes sweep {
  from { transform: translateY(-50%) scaleX(0); }
  to   { transform: translateY(-50%) scaleX(1); }
}
.out__row:nth-child(1) .hl { animation-delay: .12s; }
.out__row:nth-child(2) .hl { animation-delay: .28s; }

.chip {
  display: inline-flex; align-items: center; gap: .38rem;
  padding: .22rem .5rem .24rem;
  border-radius: var(--radius-pill);
  font: 500 .72rem/1 var(--f-mono);
  letter-spacing: .01em;
  white-space: nowrap;
}
.chip i { width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; flex: none; }
.chip--settled { color: var(--settled); background: var(--settled-bg); }
.chip--split   { color: var(--split);   background: var(--split-bg); }
.chip--filed   { color: var(--ink-3);   background: #efe9dc; }
.chip--open    { color: var(--open);    background: var(--open-bg); }

/* ---------- section shells ---------- */
.section { padding: clamp(3.25rem, 7vw, 6rem) 0; border-bottom: 1px solid var(--rule); }
.band {
  padding: clamp(3.75rem, 7.5vw, 6.75rem) 0;
  background: var(--band);
  border-bottom: 1px solid var(--rule);
}
[id] { scroll-margin-top: 84px; }

/* ---------- problem: two-column ruled list ---------- */
.duo {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(2rem, 6vw, 5rem);
  margin-top: var(--s7);
}
.duo__item {
  padding: var(--s5) 0;
  border-top: 1px solid var(--rule-2);
}
.duo__item p { margin-top: var(--s2); color: var(--ink-2); }
.duo__item .mono { color: var(--ink); }

/* ---------- steps ---------- */
.steps { margin-top: var(--s7); border-top: 1px solid var(--rule-2); }
.step {
  display: grid; grid-template-columns: 4rem minmax(0, 1fr);
  gap: var(--s5);
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--rule);
}
.step__no { color: var(--stamp); padding-top: .3rem; letter-spacing: .06em; }
.step__body {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: var(--s2) clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}
.step__body p { color: var(--ink-2); max-width: 68ch; }
.step__body .mono { color: var(--ink); }

.worked {
  margin-top: var(--s7);
  display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: var(--s2) clamp(1.5rem, 4vw, 3rem);
  align-items: start;
  border: 1px solid var(--rule-2);
  border-left: 3px solid var(--stamp);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--sheet);
  padding: var(--s5);
}
.worked__label { color: var(--stamp-ink); text-transform: uppercase; letter-spacing: .1em; }
.worked__label + p { color: var(--ink-2); max-width: 74ch; }

/* ---------- features ---------- */
.feats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 clamp(1.5rem, 4vw, 3.25rem);
  margin-top: var(--s7);
  border-bottom: 1px solid var(--rule-2);
}
.feat { padding: var(--s5) 0; border-top: 1px solid var(--rule-2); }
.feat p { margin-top: var(--s2); color: var(--ink-2); font-size: .96rem; }

/* ---------- limits ---------- */
.limits__head { max-width: 54ch; }
.limits__list { margin-top: var(--s6); border-top: 1px solid var(--rule-2); }
.limits__list li {
  display: grid; grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--s2) clamp(1.5rem, 5vw, 4rem);
  padding: var(--s5) 0;
  border-bottom: 1px solid var(--rule-2);
}
.limits__list .h3 { color: var(--stamp-ink); }
.limits__list p { color: var(--ink-2); max-width: 80ch; }

/* ---------- pricing ---------- */
.rates { margin-top: var(--s7); border-top: 1px solid var(--rule-2); }
.rate {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, 1.25fr) auto;
  gap: var(--s3) clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
  padding: var(--s6) 0;
  border-bottom: 1px solid var(--rule-2);
}
.rate--pick {
  background: var(--sheet);
  margin: 0 calc(-1 * var(--s5));
  padding-inline: var(--s5);
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 0 1px var(--rule-2), 0 16px 32px -26px rgba(26, 24, 20, .6);
}
.rate__head { display: flex; flex-direction: column; gap: .35rem; align-items: flex-start; }
.rate__flag {
  color: var(--stamp-ink);
  background: var(--stamp-wash);
  text-transform: uppercase; letter-spacing: .09em;
  padding: .22rem .5rem; border-radius: var(--radius-pill);
  font-size: .72rem;
}
.rate__price { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.rate__price .mono { font-size: 1.4rem; color: var(--ink); letter-spacing: -.01em; }
.rate__price em { font-style: normal; font-size: var(--t-sm); color: var(--ink-3); }
.rate__for { color: var(--ink-2); font-size: .96rem; max-width: 34ch; }
.rate__list { display: grid; gap: .45rem; }
.rate__list li {
  position: relative; padding-left: 1.15rem;
  font-size: .93rem; color: var(--ink-2);
}
.rate__list li::before {
  content: ""; position: absolute; left: 0; top: .62em;
  width: .45rem; height: 1px; background: var(--rule-2);
}
.rate > .btn { justify-self: end; white-space: nowrap; }

/* ---------- faq ---------- */
.faq { max-width: 76ch; }
.faq .h2 { margin-bottom: var(--s5); }
.faq details { border-top: 1px solid var(--rule-2); }
.faq details:last-of-type { border-bottom: 1px solid var(--rule-2); }
.faq summary {
  list-style: none;
  display: flex; align-items: baseline; gap: var(--s4);
  padding: var(--s4) 0;
  font-weight: 500; font-size: 1.02rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; margin-left: auto; color: var(--stamp);
  font-family: var(--f-mono); font-size: 1.1rem; line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details > p {
  padding: 0 0 var(--s5);
  color: var(--ink-2);
  max-width: 68ch;
}

/* ---------- start ---------- */
.start { background: var(--ink-panel); color: var(--paper); }
.start__inner { padding: clamp(3.25rem, 7vw, 5.5rem) 0; }
.h2--onDark { color: var(--paper); max-width: 24ch; }
.lead--onDark { color: #b9b2a3; }

/* ---------- footer ---------- */
.foot { padding: var(--s7) 0 var(--s6); background: var(--paper); }
.foot__grid {
  display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 5vw, 4rem);
  padding-bottom: var(--s6);
  border-bottom: 1px solid var(--rule);
}
.foot__brand p { margin-top: var(--s2); color: var(--ink-3); font-size: .9rem; max-width: 34ch; }
.foot__h {
  font: 500 var(--t-mono)/1 var(--f-mono);
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-3); margin-bottom: var(--s3);
}
.foot__col ul { display: grid; gap: .5rem; }
.foot__col a { color: var(--ink-2); text-decoration: none; font-size: .92rem; }
.foot__col a:hover { color: var(--stamp-ink); box-shadow: inset 0 -1px 0 currentColor; }
.foot__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2);
  padding-top: var(--s4);
}
.foot__legal p { font-size: .8rem; color: var(--ink-3); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rate { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); }
  .rate > .btn { grid-column: 1 / -1; justify-self: start; margin-top: var(--s3); }
}
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); padding-top: 2.75rem; }
  .nav { display: none; }
  .topbar__cta { margin-left: auto; }
}
@media (max-width: 700px) {
  .duo { grid-template-columns: minmax(0, 1fr); }
  .feats { grid-template-columns: minmax(0, 1fr); }
  .rate { grid-template-columns: minmax(0, 1fr); }
  .rate--pick { margin-inline: 0; }
  .limits__list li { grid-template-columns: minmax(0, 1fr); }
  .step__body { grid-template-columns: minmax(0, 1fr); }
  .worked { grid-template-columns: minmax(0, 1fr); }
  .foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot__brand { grid-column: 1 / -1; }
  .step { grid-template-columns: 1fr; gap: var(--s2); }
  .step__no { padding-top: 0; }
  .raw__desc { white-space: normal; overflow-wrap: anywhere; }
}
@media (max-width: 430px) {
  .stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .stats__cell { min-width: 0; }
}

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hl { animation: none; transform: translateY(-50%) scaleX(1); }
}
