/* ==========================================================================
   Ledgerline — assets/site.css
   Hand-written. No framework, no build step, no JavaScript.

   DIRECTION  "Columnar pad": an accountant's ruled pad, updated. Paper
              surface, hairlines doing the structural work, ink type, one
              spot colour used the way a stamp is used, and the product's own
              output (statement line -> drafted invoice) as the hero artefact.
              Contract + rationale: ../DIRECTION.md

   TOKENS     Everything below comes from these. Nothing is improvised:
              colour roles, a 5-step type ramp, a 4px spacing scale,
              2 radii, 1 border, 1 shadow, 1 gradient (the pad ruling),
              1 easing family and 2 duration tiers.
   ========================================================================== */

/* ---- 1. Faces: self-hosted, latin subset, OFL ---------------------------
   Familjen Grotesk (display) / Libre Franklin (text) / Azeret Mono (data).
   Licence texts sit beside the files in assets/fonts/.                    */

@font-face {
  font-family: "Familjen Grotesk";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/familjengrotesk-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Libre Franklin";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("fonts/librefranklin-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Azeret Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("fonts/azeretmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- 2. Tokens ---------------------------------------------------------- */

:root {
  color-scheme: light;

  /* colour roles */
  --paper: #F2EEE3;
  --paper-2: #FBF9F3;
  --band: #E7E1D1;
  --rule: #D6CEBB;
  --rule-strong: #B4A98E;
  --ink: #1A1B17;
  --ink-soft: #4A463A;
  --spot: #A83812;          /* interactive + attention text, 5.59:1 on paper */
  /* the logo mark's third rule is the asset colour #E4572A (favicon.svg and
     the inline brand SVG); it is deliberately not a layout token */
  --spot-wash: rgba(228, 87, 42, .17);
  --settled: #17603D;       /* state, always beside a word */
  --settled-wash: #E4EDE5;
  --open-wash: #F7DFD2;
  --filed-wash: #E9E4D7;

  /* type */
  --font-display: "Familjen Grotesk", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
  --font-data: "Azeret Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --type-sm: .875rem;
  --type-body: 1.0625rem;
  --type-lead: clamp(1.125rem, .5vw + 1rem, 1.375rem);
  --type-h2: clamp(1.625rem, 1vw + 1.35rem, 2.25rem);
  --type-h1: clamp(2.25rem, 4vw + 1.1rem, 3.75rem);

  /* space, 4px base */
  --space-1: .25rem;
  --space-2: .5rem;
  --space-3: .75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --gutter: 1.25rem;
  --measure: 62ch;
  --band-pad: clamp(var(--space-7), 7vw, var(--space-9));

  /* form */
  --radius: 2px;
  --radius-pill: 999px;
  --border: 1px solid var(--rule);
  --shadow-sheet: 0 1px 0 var(--rule), 0 18px 40px -34px rgba(26, 27, 23, .6);
  --ruling: repeating-linear-gradient(to bottom,
      transparent 0 26px, var(--rule) 26px 27px);

  /* motion: one easing family, two tiers */
  --dur-1: 120ms;
  --dur-2: 620ms;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --focus: 2px solid var(--spot);
}

@media (min-width: 60rem) {
  :root { --gutter: 2.5rem; }
}

/* ---- 3. Base ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--type-body);
  line-height: 1.55;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.015em;
  line-height: 1.08;
  text-wrap: balance;
}

h1 { font-size: var(--type-h1); max-width: 22ch; }
h2 { font-size: var(--type-h2); line-height: 1.14; max-width: 34ch; }
h3 { font-size: var(--type-lead); line-height: 1.2; letter-spacing: -.01em; }

p { margin: 0 0 var(--space-4); }
p:last-child { margin-bottom: 0; }

ul { margin: 0; padding: 0; }

a { color: inherit; }

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

figure { margin: 0; }

::selection { background: var(--spot-wash); color: var(--ink); }

/* ---- 4. Structure ------------------------------------------------------- */

.wrap {
  width: min(100% - 2 * var(--gutter), 68rem);
  margin-inline: auto;
}

.section { padding-block: var(--band-pad); }
main > .section + .section { border-top: var(--border); }
.section--band { background: var(--band); }

.section__lede {
  margin-top: var(--space-5);
  max-width: var(--measure);
  font-size: var(--type-lead);
  color: var(--ink-soft);
}

.note { font-size: var(--type-sm); color: var(--ink-soft); }

[id] { scroll-margin-top: 5rem; }

.skip-link {
  position: absolute;
  top: 0;
  left: -9999px;
  z-index: 40;
  padding: var(--space-3) var(--space-4);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---- 5. Links, buttons, controls ---------------------------------------- */

.link {
  color: var(--spot);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.link:hover { text-decoration-thickness: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-5);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: var(--type-sm);
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--dur-1) var(--ease),
              border-color var(--dur-1) var(--ease),
              color var(--dur-1) var(--ease);
}
.btn:hover { background: var(--spot); border-color: var(--spot); }

.btn--quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn--quiet:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }

:focus-visible { outline: var(--focus); outline-offset: 3px; }

/* ---- 6. Masthead -------------------------------------------------------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--paper);
  border-bottom: var(--border);
}

.site-head__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-5);
  padding-block: var(--space-3);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--type-body);
  font-weight: 700;
  letter-spacing: -.02em;
  text-decoration: none;
}
.brand svg { display: block; width: 1.5rem; height: 1.5rem; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--type-sm);
}
.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-block: var(--space-1);
}
.site-nav a:hover { color: var(--spot); text-decoration: underline; text-underline-offset: .18em; }

.site-head__cta { display: flex; }

@media (min-width: 52rem) {
  .site-head__cta { margin-inline-start: auto; }
}

/* ---- 7. Hero + the artefact -------------------------------------------- */

.hero { padding-block: var(--band-pad); }
.hero__intro { max-width: 44rem; }
.hero__lede {
  margin-top: var(--space-5);
  max-width: var(--measure);
  font-size: var(--type-lead);
  color: var(--ink-soft);
}
.hero__acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.hero__note { margin-top: var(--space-4); max-width: var(--measure); }

.sheet {
  margin-top: var(--space-7);
  background: var(--paper-2);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sheet);
}

.sheet__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-4) var(--space-5);
  border-bottom: var(--border);
  background-color: var(--paper-2);
  background-image: var(--ruling);
  background-repeat: repeat;
}
.sheet__title {
  margin: 0;
  font-family: var(--font-data);
  font-size: var(--type-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.sheet__meta {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--type-sm);
  color: var(--ink-soft);
}

.sheet__body { padding: var(--space-2) var(--space-5) var(--space-5); }

.recon { list-style: none; }

.recon__row {
  display: grid;
  gap: var(--space-3);
  padding-block: var(--space-4);
}
.recon__row + .recon__row { border-top: var(--border); }

.st {
  margin: 0;
  font-family: var(--font-data);
  font-size: var(--type-sm);
  line-height: 1.5;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: .02em;
  overflow-wrap: anywhere;
}
.st__amt { color: var(--ink); font-weight: 500; }

.draft {
  position: relative;
  isolation: isolate;
  margin: 0;
  padding: var(--space-3);
  display: grid;
  gap: var(--space-1);
}
.draft__line {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--type-body);
  font-weight: 600;
  line-height: 1.25;
}
.draft__amt {
  font-family: var(--font-data);
  font-size: var(--type-sm);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.draft__why {
  margin: 0;
  font-size: var(--type-sm);
  line-height: 1.45;
  color: var(--ink-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-family: var(--font-data);
  font-size: var(--type-sm);
  line-height: 1.4;
}
.chip--settled { background: var(--settled-wash); color: var(--settled); }
.chip--open { background: var(--open-wash); color: var(--spot); }
.chip--filed { background: var(--filed-wash); color: var(--ink-soft); }

/* the reconciliation sweep: one orchestrated moment, derived from the
   product's own output. The wash draws along each matched line, staggered,
   then rests. Decorative only — nothing on this page depends on it, and it
   is removed entirely under prefers-reduced-motion. */
.recon__row--matched .draft::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius);
  background: var(--spot-wash);
  transform-origin: left center;
  animation: reconcile var(--dur-2) var(--ease) both;
}
.recon__row--matched:nth-of-type(2) .draft::before { animation-delay: 160ms; }

@keyframes reconcile {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.sheet__sum {
  margin: var(--space-4) 0 0;
  padding-top: var(--space-4);
  border-top: var(--border);
  font-family: var(--font-data);
  font-size: var(--type-sm);
  line-height: 1.5;
  color: var(--ink-soft);
}

@media (min-width: 45rem) {
  .recon__row { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--space-5); }
}

@media (max-width: 30rem) {
  .sheet__head { padding-inline: var(--space-3); }
  .sheet__body { padding-inline: var(--space-3); }
}

/* ---- 8. How it works ---------------------------------------------------- */

.passes { margin-top: var(--space-6); }

.pass {
  display: grid;
  gap: var(--space-2);
  padding-block: var(--space-5);
  border-top: var(--border);
}
.pass p { max-width: var(--measure); }

.pass--lead {
  gap: var(--space-3);
  padding-block: var(--space-6);
}
.pass--lead h3 { font-size: var(--type-h2); }
.pass--lead p { font-size: var(--type-lead); }
.pass--lead .pass__why { font-size: var(--type-body); }

.pass__why { color: var(--ink-soft); }

@media (min-width: 52rem) {
  .pass { grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: var(--space-6); }
}

.limits {
  margin-top: var(--space-7);
  padding: var(--space-5);
  border: var(--border);
  border-radius: var(--radius);
  background: var(--paper-2);
}
.limits h3 { margin-bottom: var(--space-4); }
.limits ul { display: grid; gap: var(--space-3); list-style: none; }
.limits li {
  position: relative;
  padding-left: var(--space-5);
  max-width: var(--measure);
  font-size: var(--type-sm);
  color: var(--ink-soft);
}
.limits li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .7em;
  width: 8px;
  height: 2px;
  background: var(--spot);
}

/* ---- 9. Rates ----------------------------------------------------------- */

.rates { margin-top: var(--space-6); list-style: none; }

.rate {
  display: grid;
  gap: var(--space-4);
  padding-block: var(--space-6);
  border-top: var(--border);
}

.rate__body {
  display: grid;
  gap: var(--space-4);
  align-content: start;
}

.rate__head { display: grid; gap: var(--space-3); align-content: start; }
.rate__flag {
  margin: 0;
  font-family: var(--font-data);
  font-size: var(--type-sm);
  color: var(--spot);
}
.rate__price {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--type-sm);
  color: var(--ink-soft);
}
.rate__fig {
  font-family: var(--font-display);
  font-size: var(--type-h2);
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--ink);
}
.rate__for { margin: 0; color: var(--ink-soft); max-width: 34ch; }
.rate__inc {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-4);
  list-style: none;
  font-size: var(--type-sm);
  max-width: 42ch;
}
.rate__inc li { padding-left: var(--space-4); position: relative; }
.rate__inc li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 2px;
  background: var(--rule-strong);
}
.rate__foot { display: grid; gap: var(--space-3); justify-items: start; }

@media (min-width: 56rem) {
  .rate { grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: var(--space-6); }
  .rate--pick {
    background: var(--paper-2);
    padding-inline: var(--space-5);
    margin-inline: calc(-1 * var(--space-5));
  }
}

/* ---- 10. Questions ----------------------------------------------------- */

.faq { margin-top: var(--space-6); }

.faq__item { border-top: var(--border); }
.faq__item:last-child { border-bottom: var(--border); }

.faq__item summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  cursor: pointer;
  list-style: none;
  font-family: var(--font-display);
  font-size: var(--type-lead);
  font-weight: 600;
  letter-spacing: -.01em;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after {
  content: "+";
  font-family: var(--font-data);
  font-size: var(--type-sm);
  color: var(--spot);
}
.faq__item summary:hover { color: var(--spot); }
.faq__item[open] summary::after { content: "\2013"; }

.faq__body { padding-bottom: var(--space-5); max-width: var(--measure); }

/* ---- 11. What we can see ---------------------------------------------- */

.data__body { margin-top: var(--space-5); max-width: var(--measure); }
.data__lists { display: grid; gap: var(--space-5); margin-top: var(--space-6); }
.data__lists h3 { margin-bottom: var(--space-3); }
.data__lists ul { display: grid; gap: var(--space-3); list-style: none; font-size: var(--type-sm); }
.data__lists li { padding-left: var(--space-4); position: relative; color: var(--ink-soft); }
.data__lists li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: 6px;
  height: 2px;
  background: var(--rule-strong);
}

@media (min-width: 45rem) {
  .data__lists { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
}

/* ---- 12. Footer -------------------------------------------------------- */

.site-foot { border-top: var(--border); padding-block: var(--band-pad) var(--space-6); }

.site-foot__inner {
  display: grid;
  gap: var(--space-6);
}
.site-foot__brand p { max-width: 34ch; }
.site-foot__nav h3 {
  margin-bottom: var(--space-3);
  font-size: var(--type-sm);
  letter-spacing: 0;
}
.site-foot__nav ul { display: grid; gap: var(--space-2); list-style: none; font-size: var(--type-sm); }
.site-foot__nav a { color: var(--ink-soft); text-decoration: none; }
.site-foot__nav a:hover { color: var(--spot); text-decoration: underline; text-underline-offset: .18em; }

.site-foot__legal {
  margin-top: var(--space-8);
  padding-top: var(--space-4);
  border-top: var(--border);
  display: grid;
  gap: var(--space-2);
  font-size: var(--type-sm);
  color: var(--ink-soft);
}
.site-foot__legal p { margin: 0; }

@media (min-width: 52rem) {
  .site-foot__inner { grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr)); gap: var(--space-7); }
}

/* ---- 13. Motion, gated -------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
