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

   Identity: an accountant's columnar pad, updated. Warm paper, ruled
   hairlines doing the structural work (depth by structure, not by shadow),
   ink type, and one spot colour used the way a bookkeeper uses red ink —
   to mark the thing that needs you and the thing you can act on.

   Deliberate limits, counted:
     · gradients: ONE (the pad's own ruling, `repeating-linear-gradient`,
       drawn only behind the hero). No coloured glow, no glassmorphism,
       no backdrop-filter anywhere.
     · border-radius values: TWO (--radius 2px, --radius-pill 999px).
     · shadow styles: ONE token (--shadow), used on two surfaces.
     · monospace: figures, bank references, dates, filenames and the three
       status labels, and nothing else. It never sets a paragraph.
     · typefaces: three, self-hosted, outside the default pool, with the
       source named — Familjen Grotesk (mid-century European business
       stationery), Libre Franklin (Franklin Gothic's government/print
       lineage), Azeret Mono (figures only).
     · all-caps letter-spaced micro-labels: none. Section headings are
       sentence case; the only small labels are sentence case too.
   ========================================================================== */

/* ---- self-hosted faces (SIL OFL 1.1; licences in ./fonts/) ---- */
@font-face {
  font-family: 'Familjen Grotesk';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('./fonts/familjen-grotesk-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/libre-franklin-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Azeret Mono';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/azeret-mono-latin.woff2') format('woff2');
}

/* ---- tokens ---- */
:root {
  /* surface */
  --paper:  #f7f3ea;
  --sheet:  #fffdf8;
  --band:   #efe8d9;
  --panel:  #191713;

  /* ink */
  --ink:    #191713;   /* 16.2:1 on paper */
  --ink-2:  #4f4a41;   /*  7.9:1 on paper */
  --ink-3:  #6a6354;   /*  5.4:1 on paper, 4.9:1 on band — small text only */

  /* structure — hairlines only; depth comes from rules, not shadow */
  --rule:   #e3dbcb;
  --rule-2: #c8bba0;

  /* spot colour. Two jobs, named: (1) interactive elements, (2) the
     "needs you" state. It is never used as decoration. */
  --spot:      #bc3f24;   /*  4.9:1 on paper */
  --spot-ink:  #9a3218;   /*  6.7:1 on paper */
  --spot-wash: #f7e5de;

  /* status — every one of these ships with a word, never colour alone */
  --settled:    #22694a;  --settled-bg: #e3efe5;  /* 5.6:1 */
  --open:       #815610;  --open-bg:    #f7edd4;  /* 5.5:1 */
  --filed:      #665f50;  --filed-bg:   #ece6d8;  /* 5.1:1 */

  /* the highlighter wash over figures Ledgerline matched by itself */
  --marker: rgba(233, 199, 108, .55);

  /* type */
  --f-display: 'Familjen Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --f-body:    'Libre Franklin', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --f-mono:    'Azeret Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ramp — declared once, never improvised */
  --t-h1:     clamp(1.95rem, 1.15rem + 3.3vw, 3.35rem);
  --t-h2:     clamp(1.5rem, 1.05rem + 1.9vw, 2.35rem);
  --t-body:   1.0625rem;
  --t-lead:   clamp(1.05rem, 1rem + .4vw, 1.25rem);
  --t-figure: 1.35rem;
  --t-sm:     .875rem;
  --t-mono:   .8rem;

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

  --measure: 62ch;
  --radius: 2px;
  --radius-pill: 999px;
  --shadow: 0 18px 36px -28px rgba(25, 23, 19, .55), 0 1px 0 var(--rule);
  --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;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}
h1, h2, h3, p, ul, ol, dl, dd, dt, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: var(--spot-ink); }
summary { cursor: pointer; }
strong { font-weight: 600; }

/* ---- visible keyboard focus, everywhere ---- */
:focus-visible {
  outline: 2px solid var(--spot);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.start :focus-visible { outline-color: var(--paper); }

/* ---- primitives ---- */
.wrap { width: min(100% - 2rem, 1140px); margin-inline: auto; }
@media (min-width: 480px) { .wrap { width: min(100% - 2.5rem, 1140px); } }

.mono {
  font-family: var(--f-mono);
  font-size: var(--t-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.h2 {
  font: 600 var(--t-h2)/1.1 var(--f-display);
  letter-spacing: -.02em;
  max-width: 24ch;
  text-wrap: balance;
}
.h3 {
  font: 600 1.0625rem/1.35 var(--f-body);
  letter-spacing: -.005em;
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: var(--measure);
  margin-top: var(--s4);
}
.lead--tight { max-width: 52ch; }
.micro {
  font-size: var(--t-sm);
  color: var(--ink-3);
  max-width: 50ch;
  margin-top: var(--s4);
}
.micro--onDark { color: #b6af9f; }
.figure {
  font: 600 var(--t-figure)/1.05 var(--f-display);
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}

.skip {
  position: absolute; left: var(--s4); top: -4rem;
  z-index: 60;
  background: var(--ink); color: var(--paper);
  padding: var(--s2) var(--s4);
  border-radius: var(--radius);
  text-decoration: none;
  transition: top .12s var(--ease);
}
.skip:focus { top: var(--s3); }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: .62rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 .95rem/1 var(--f-body);
  letter-spacing: .005em;
  text-decoration: none;
  transition: background-color .12s var(--ease), border-color .12s var(--ease), color .12s var(--ease);
}
.btn--sm { padding: .48rem .8rem; font-size: var(--t-sm); }
.btn--lg { padding: .9rem 1.4rem; font-size: 1rem; }
.btn--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--solid:hover { background: #332e26; border-color: #332e26; }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn--ghost:hover { border-color: var(--ink); background: rgba(25, 23, 19, .05); }
.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, .4); }
.btn--outline:hover { border-color: var(--paper); background: rgba(247, 243, 234, .1); }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--paper);
  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: .5rem;
  color: var(--ink); text-decoration: none;
  font: 600 1.02rem/1 var(--f-display); letter-spacing: -.01em;
}
.brand__mark { flex: none; }
.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: .3;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .5) 40%, transparent 84%);
          mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .5) 40%, transparent 84%);
}
.hero__grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  padding: clamp(2.5rem, 5.5vw, 4.5rem) 0 clamp(2.75rem, 5vw, 4.25rem);
  align-items: start;
}
.hero__h1 {
  font: 600 var(--t-h1)/1.05 var(--f-display);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s6); }

.stats {
  display: flex; flex-wrap: wrap; gap: var(--s5) var(--s6);
  margin-top: var(--s7); padding-top: var(--s5);
  border-top: 1px solid var(--rule-2);
}
.stats__cell { min-width: 8rem; display: flex; flex-direction: column; }
.stats__cell dt { font-size: var(--t-sm); color: var(--ink-3); max-width: 20ch; line-height: 1.4; margin-bottom: .35rem; flex: 1 1 auto; }
.stats__cell dd { margin: 0; }
.stats__cell dd .unit { font-family: var(--f-body); font-weight: 400; font-size: .82rem; color: var(--ink-3); letter-spacing: .01em; }

/* ---- the reconciliation artefact (a document, so it may be a sheet) ---- */
.recon { display: grid; gap: var(--s3); }
.recon figcaption { font-size: .8rem; line-height: 1.5; color: var(--ink-2); max-width: 52ch; }
.sheet {
  background: var(--sheet);
  border: 1px solid var(--rule-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--s4) var(--s4) var(--s3);
}
.sheet__label {
  font-size: .78rem; color: var(--ink-3);
  padding-bottom: var(--s3); border-bottom: 1px solid var(--rule); margin-bottom: var(--s3);
}
.raw__row, .out__row {
  display: grid; align-items: center; gap: var(--s2) 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: 3.6rem minmax(0, 1fr) auto; }
.raw__date { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }
.raw__desc {
  font-family: var(--f-mono); font-size: .74rem; line-height: 1.35; color: var(--ink-2);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.raw__amt { font-family: var(--f-mono); font-size: .78rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--ink); }
.raw__amt--out { color: var(--ink-3); }

.recon__mid { display: flex; align-items: center; gap: var(--s3); margin: var(--s1) 0; color: var(--ink-3); }
.recon__mid::before, .recon__mid::after { content: ""; height: 1px; background: var(--rule-2); flex: 1; }
.recon__mid span { font-family: var(--f-mono); font-size: .7rem; white-space: nowrap; }

.out__row { grid-template-columns: minmax(0, 1fr) auto auto; }
.out__who { display: grid; gap: .12rem; min-width: 0; }
.out__who b { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.out__who em { font-family: var(--f-mono); font-style: normal; font-size: .72rem; color: var(--ink-2); }
.out__amt {
  position: relative; isolation: isolate;
  display: inline-block;
  font-family: var(--f-mono); font-size: var(--t-mono); font-weight: 500; font-variant-numeric: tabular-nums;
  padding: .1rem .3rem;
}
/* the one orchestrated moment: the highlighter draws along the figures
   Ledgerline matched by itself, then stops. Derived from the product —
   it is literally the moment a statement line is matched to a client,
   staggered ~180ms apart. Nothing loops. */
.hl {
  position: absolute; z-index: -1; left: -1px; right: -1px; top: 50%; height: 1.4em;
  transform: translateY(-50%) scaleX(1); transform-origin: left center;
  background: var(--marker); border-radius: var(--radius);
  animation: sweep .62s var(--ease) both;
}
@keyframes sweep {
  from { transform: translateY(-50%) scaleX(0); }
  to   { transform: translateY(-50%) scaleX(1); }
}
.out__row:nth-of-type(1) .hl { animation-delay: .12s; }
.out__row:nth-of-type(2) .hl { animation-delay: .30s; }

.chip {
  display: inline-flex; align-items: center; gap: .34rem;
  padding: .2rem .5rem .22rem; border-radius: var(--radius-pill);
  font-family: var(--f-mono); font-size: .68rem; font-weight: 500; white-space: nowrap;
}
.chip i { width: .38rem; height: .38rem; border-radius: 50%; background: currentColor; flex: none; }
.chip--settled { color: var(--settled); background: var(--settled-bg); }
.chip--open    { color: var(--open);    background: var(--open-bg); }
.chip--filed   { color: var(--filed);   background: var(--filed-bg); }

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

/* ---- problem: heading in a narrow column, evidence beside it ---- */
.split {
  display: grid; grid-template-columns: minmax(0, 21rem) minmax(0, 1fr);
  gap: var(--s5) clamp(1.5rem, 5vw, 4.5rem); align-items: start;
}
.points { border-top: 1px solid var(--rule-2); }
.points li { padding: var(--s5) 0; border-bottom: 1px solid var(--rule-2); }
.points p { margin-top: var(--s2); color: var(--ink-2); font-size: .98rem; max-width: 62ch; }

/* ---- how it works: ruled rows, the middle one ranked larger ---- */
.steps { margin-top: var(--s7); border-top: 1px solid var(--rule-2); }
.step {
  display: grid; grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
  gap: var(--s2) clamp(1.25rem, 4vw, 3rem);
  padding: var(--s5) 0; border-bottom: 1px solid var(--rule);
  align-items: start;
}
.step p { color: var(--ink-2); max-width: 66ch; font-size: .98rem; }
.step--big { padding-block: var(--s6); }
.step--big .h3 { font-size: 1.3rem; }
.step--big p { max-width: 62ch; }

.worked {
  margin-top: var(--s7);
  display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: var(--s2) clamp(1.25rem, 4vw, 3rem); align-items: start;
  border-top: 1px solid var(--rule-2);
  padding-top: var(--s5);
}
.worked__label { font-weight: 600; font-size: .82rem; color: var(--spot-ink); }
.worked p:not(.worked__label) { color: var(--ink-2); max-width: 72ch; font-size: .98rem; }

.folder { margin-top: var(--s8); }
.folder > h3 { margin-bottom: var(--s4); }
.filelist li { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); padding: .55rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.filelist li:first-child { border-top: 1px solid var(--rule-2); }
.fname { font-family: var(--f-mono); font-weight: 500; font-size: .82rem; flex: 0 0 auto; min-width: 21ch; }
.fmeta { font-size: var(--t-sm); color: var(--ink-3); }
.folder-note { font-size: var(--t-sm); color: var(--ink-2); margin-top: var(--s3); max-width: 62ch; }

/* ---- where it stops: prose, not a feature list ---- */
.limits { margin-top: var(--s6); max-width: 78ch; }
.limits > li { padding: var(--s5) 0; border-top: 1px solid var(--rule-2); }
.limits > li:last-child { border-bottom: 1px solid var(--rule-2); }
.limits p { margin-top: var(--s2); color: var(--ink-2); max-width: 74ch; font-size: .98rem; }

/* ---- what happens to your statement ---- */
.data { margin-top: var(--s6); border-top: 1px solid var(--rule-2); }
.data > li {
  display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr);
  gap: var(--s2) clamp(1.25rem, 5vw, 4rem);
  padding: var(--s5) 0; border-bottom: 1px solid var(--rule-2);
}
.data__key { font: 600 .95rem/1.4 var(--f-display); color: var(--spot-ink); letter-spacing: -.005em; }
.data p { color: var(--ink-2); max-width: 74ch; font-size: .98rem; }

/* ---- pricing: a ruled rate card, read as rows, not as boxes ---- */
.rates { margin-top: var(--s7); border-top: 1px solid var(--rule-2); }
.rate {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.1fr) 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);
  padding-inline: var(--s5);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--rule-2), var(--shadow);
}
.rate__head { display: flex; flex-direction: column; gap: .4rem; align-items: flex-start; }
.rate__flag {
  color: var(--spot-ink); background: var(--spot-wash);
  padding: .22rem .5rem; border-radius: var(--radius-pill); font-size: .72rem;
}
.rate__price { display: flex; align-items: baseline; gap: .45rem; flex-wrap: wrap; margin-top: .3rem; }
.rate__price .mono { font-size: var(--t-figure); color: var(--ink); }
.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.05rem; font-size: .93rem; color: var(--ink-2); }
.rate__list li::before { content: ""; position: absolute; left: 0; top: .62em; width: .4rem; height: 1px; background: var(--rule-2); }
.rate > .btn { justify-self: end; white-space: nowrap; }

/* ---- faq ---- */
.faq { max-width: 74ch; }
.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(--spot); font-family: var(--f-mono); font-size: 1.15rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details > p { padding: 0 0 var(--s5); color: var(--ink-2); max-width: 66ch; }

/* ---- closer ---- */
.start { background: var(--panel); color: var(--paper); }
.start__inner { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.h2--onDark { color: var(--paper); }
.lead--onDark { color: #b6af9f; }

/* ---- footer ---- */
.foot { padding: var(--s7) 0 var(--s6); }
.foot__grid {
  display: grid; grid-template-columns: minmax(0, 1.7fr) repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 5vw, 4rem); padding-bottom: var(--s6); border-bottom: 1px solid var(--rule);
}
.foot__brand .brand { margin-bottom: var(--s3); }
.foot__brand p { color: var(--ink-3); font-size: .9rem; max-width: 34ch; }
.foot__h { font-weight: 600; font-size: .85rem; color: var(--ink); 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(--spot-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: 1040px) {
  .rate { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .rate > .btn { grid-column: 1 / -1; justify-self: start; margin-top: var(--s3); }
  .rate--pick { padding-inline: var(--s4); }
}
@media (max-width: 900px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); padding-top: 2.5rem; }
  .nav { display: none; }
  .topbar__cta { margin-left: auto; }
  .split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .rate { grid-template-columns: minmax(0, 1fr); }
  .rate--pick { padding-inline: var(--s4); }
  .limits { max-width: none; }
  .step,
  .worked,
  .data > li { grid-template-columns: minmax(0, 1fr); }
  .foot__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot__brand { grid-column: 1 / -1; }
  .raw__desc { white-space: normal; overflow-wrap: anywhere; }
  .out__row { grid-template-columns: minmax(0, 1fr) auto; row-gap: .4rem; }
  .out__row .chip { grid-column: 2; }
}
@media (max-width: 430px) {
  .stats { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .stats__cell { min-width: 0; }
  .sheet { padding: var(--s3); }
  .raw__row { grid-template-columns: 3.1rem minmax(0, 1fr); }
  .raw__amt { grid-column: 2; justify-self: end; }
  .actions .btn { width: 100%; }
  .fname { 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); }
}
