/* ==========================================================================
   Pennypoke, editorial paper-and-ink aesthetic
   Palette: warm brass + deep ink + cream paper
   Type: Fraunces (display, serif) + Inter (body, geometric sans)
   ========================================================================== */

/* Google Fonts loaded via parallel <link rel="stylesheet"> in each HTML
   head, not via @import here. @import would force a 4-hop critical
   render chain (HTML to style.css to fonts.googleapis to fonts.gstatic)
   and adds ~2.7s LCP on slow 4G. */

/* ---- Tokens ----------------------------------------------------------- */
:root {
  /* Surfaces */
  --paper:        #f6f0e4;   /* cream paper */
  --paper-deep:   #efe6d4;   /* slightly darker cream for inset */
  --paper-edge:   #e4d8bf;   /* paper shadow edge */
  --ink:          #1b1712;   /* near-black warm */
  --ink-soft:     #3d332a;   /* softer body ink */
  --ink-muted:    #6b5f50;   /* metadata, secondary */
  --ink-ghost:    #9b8c79;   /* tertiary */

  /* Brand */
  --brass:        #b8873a;   /* primary accent, money */
  --brass-deep:   #7A5719;   /* pressed / hover; 5.85:1 on paper + 5.38:1 on paper-deep, axe-verified */
  --brass-soft:   #d9b67a;   /* surface tint */
  --copper:       #a84e26;   /* secondary warm accent */

  /* States */
  --success:      #4a6b3a;   /* olive green, not clinical */
  --success-tint: #e6ead8;
  --warning:      #a7751c;
  --danger:       #8c2f1f;
  --danger-tint:  #f1d9d4;

  /* Lines + shadow */
  --rule:         #d8c9ad;
  --rule-soft:    #e7ddc6;
  --shadow-sm:    0 1px 0 rgba(27,23,18,.04), 0 1px 2px rgba(27,23,18,.06);
  --shadow-md:    0 1px 0 rgba(27,23,18,.05), 0 8px 24px -12px rgba(27,23,18,.18);
  --shadow-lg:    0 2px 0 rgba(27,23,18,.06), 0 24px 48px -20px rgba(27,23,18,.22);

  /* Type */
  --font-display: 'Fraunces', ui-serif, Georgia, 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Scale (fluid where it matters) */
  --fs-display:   clamp(2.5rem, 5.5vw + 1rem, 4.75rem);  /* hero */
  --fs-h1:        clamp(2rem, 3vw + 1rem, 3rem);
  --fs-h2:        clamp(1.5rem, 1.2vw + 1rem, 2rem);
  --fs-h3:        1.25rem;
  --fs-body:      1.0625rem;  /* 17px base body */
  --fs-lead:      1.1875rem;  /* 19px subline */
  --fs-small:     0.9375rem;  /* 15px */
  --fs-micro:     0.8125rem;  /* 13px */

  /* Spacing, 8pt grid */
  --s-1:  4px;
  --s-2:  8px;
  --s-3:  12px;
  --s-4:  16px;
  --s-5:  24px;
  --s-6:  32px;
  --s-7:  48px;
  --s-8:  64px;
  --s-9:  96px;
  --s-10: 128px;

  /* Radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Layout */
  --max:      1200px;
  --max-text: 640px;

  /* Motion */
  --ease:     cubic-bezier(.2, .7, .2, 1);
  --dur:      180ms;
}

/* ---- Reset ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--ink-soft);
  background: var(--paper);
  /* subtle paper grain using layered gradients, not images */
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(184,135,58,.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(168,78,38,.05), transparent 60%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Decorative chapter-ghost text and the horizontal ledger rail can extrude
     a sub-pixel beyond the viewport at narrow widths. Clip on the root so the
     page never gains a stray horizontal scrollbar. Vertical scroll unaffected. */
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.08;
  font-variation-settings: "opsz" 48;
}
p { color: var(--ink-soft); }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--rule); transition: text-decoration-color var(--dur) var(--ease), color var(--dur) var(--ease); }
a:hover { text-decoration-color: var(--brass); color: var(--brass-deep); }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 2px; }

::selection { background: var(--brass-soft); color: var(--ink); }

/* Screen-reader-only utility, used for invisible labels on inputs that have
   placeholder copy but need a programmatically-determinable name (WCAG 4.1.2). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---- Layout primitives ------------------------------------------------ */
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--s-5); }
.wrap-text { max-width: var(--max-text); margin: 0 auto; padding: 0 var(--s-5); }
.rule { height: 1px; background: var(--rule); border: 0; margin: 0; }

/* ---- Header ----------------------------------------------------------- */
.site-header {
  padding: var(--s-5) 0;
  position: sticky; top: 0; z-index: 20;
  background: rgba(246, 240, 228, 0.82);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--rule); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; }
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: var(--s-2);
}
.brand:hover { color: var(--ink); text-decoration: none; }
.brand .mark {
  width: 26px; height: 26px;
  display: inline-block;
  background: var(--brass);
  border-radius: 50%;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 0 rgba(0,0,0,.08);
}
.brand .mark::after {
  content: "P";
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}
.brand em { font-style: normal; color: var(--brass-deep); }

.site-nav { display: flex; gap: var(--s-5); align-items: center; }
.site-nav a { font-size: var(--fs-small); color: var(--ink-muted); text-decoration: none; }
.site-nav a:hover { color: var(--ink); text-decoration: none; }
.nav-cta {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper) !important;
  font-weight: 500;
  font-size: var(--fs-small);
}
.nav-cta:hover { background: var(--brass-deep); }

/* ---- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--s-2);
  min-height: 48px;
  padding: 12px 22px;
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.005em;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(0,0,0,.2), 0 8px 20px -10px rgba(27,23,18,.5);
}
.btn-primary:hover { background: var(--brass-deep); color: var(--paper); text-decoration: none; transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { fill: currentColor; }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
.btn-ghost:hover { border-color: var(--ink); text-decoration: none; }

.btn:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---- Hero ------------------------------------------------------------- */
.hero {
  padding: clamp(16px, 3vw, 40px) 0 clamp(48px, 10vw, 128px);
  position: relative;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(var(--s-6), 5vw, var(--s-9));
  align-items: start;
}
/* Anchor the preview near the top of the right column so the receipt sits
   at headline height, not floating mid-column. A small top offset aligns
   the card with the eyebrow + first H1 line. */
.hero-grid > .hero-preview {
  margin-top: clamp(8px, 2vw, 28px);
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  margin-bottom: var(--s-4);
}
.hero-eyebrow::before {
  content: ""; width: 24px; height: 1px; background: var(--brass);
}
.hero h1 {
  font-size: var(--fs-display);
  font-variation-settings: "opsz" 96;
  margin-bottom: var(--s-5);
  max-width: 13ch;
}
.hero h1 .ital { font-style: italic; color: var(--brass-deep); font-weight: 500; }
.hero .lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  max-width: 38ch;
  margin-bottom: var(--s-6);
  line-height: 1.5;
}
.hero-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.hero-note { font-size: var(--fs-micro); color: var(--ink-muted); margin-top: var(--s-4); }
.hero-note strong { color: var(--ink-soft); font-weight: 500; }

/* chat mock */
.chat-mock {
  background: #fff;
  border-radius: var(--r-lg);
  padding: var(--s-5);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--paper-edge);
  position: relative;
  transform: rotate(0.6deg);
  max-width: 420px;
  justify-self: end;
  width: 100%;
}
.chat-mock::before {
  content: "";
  position: absolute; inset: -18px -18px auto auto;
  width: 72px; height: 72px;
  background: radial-gradient(circle at 30% 30%, #e6c483, var(--brass) 60%, var(--brass-deep));
  border-radius: 50%;
  box-shadow: 0 8px 24px -8px rgba(184,135,58,.5), inset 0 2px 4px rgba(255,255,255,.3);
  z-index: -1;
}
.chat-head {
  display: flex; align-items: center; gap: var(--s-3);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: var(--s-4);
}
.chat-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brass);
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-weight: 700; font-size: 15px; color: var(--ink);
}
.chat-name { font-weight: 600; color: var(--ink); font-size: var(--fs-small); }
.chat-status { font-size: var(--fs-micro); color: var(--ink-muted); }
.chat-msgs { display: flex; flex-direction: column; gap: var(--s-3); }
.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.4;
  animation: msg-in 0.5s var(--ease) both;
}
.msg-user {
  align-self: flex-end;
  background: var(--ink);
  color: var(--paper);
  border-bottom-right-radius: 4px;
  animation-delay: 0.1s;
}
.msg-bot {
  align-self: flex-start;
  background: var(--paper-deep);
  color: var(--ink);
  border-bottom-left-radius: 4px;
  animation-delay: 0.35s;
}
.msg-bot .tag {
  display: inline-block;
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  padding: 2px 6px;
  background: rgba(184,135,58,.15);
  border-radius: 4px;
}
.msg-bot .amt { font-family: var(--font-mono); color: var(--brass-deep); font-weight: 600; }
@keyframes msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---- Section rhythm --------------------------------------------------- */
.section { padding: clamp(56px, 8vw, 112px) 0; }
.section-head { margin-bottom: var(--s-7); }
.section-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--brass-deep);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-3);
  display: block;
}
.section-title {
  font-size: var(--fs-h1);
  max-width: 18ch;
  margin-bottom: var(--s-4);
  font-variation-settings: "opsz" 72;
}
.section-title .ital { font-style: italic; color: var(--brass-deep); font-weight: 500; }
.section-lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.5;
}

/* ---- How it works ----------------------------------------------------- */
.how {
  background: var(--paper-deep);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
}
.how-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: clamp(var(--s-6), 5vw, var(--s-8));
  align-items: start;
}
.how-steps { counter-reset: step; position: relative; list-style: none; padding: 0; }
.how-steps > li::marker { content: ""; }
.how-steps::before {
  content: ""; position: absolute;
  left: 20px; top: 12px; bottom: 12px;
  width: 1px; background: var(--rule);
}
.step {
  position: relative;
  padding-left: 64px;
  padding-bottom: var(--s-6);
  counter-increment: step;
}
.step:last-child { padding-bottom: 0; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0; top: -2px;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.step h3 {
  font-size: 1.375rem;
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: var(--s-2);
  font-variation-settings: "opsz" 36;
}
.step p { color: var(--ink-soft); line-height: 1.55; }
.step code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--paper);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
  border: 1px solid var(--rule-soft);
}

/* ---- Why (compare panel) ---------------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s-4);
}
.compare {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  position: relative;
}
.compare h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: var(--s-4);
  color: var(--ink);
  display: flex; align-items: center; gap: var(--s-2);
}
.compare.bad h3 { color: var(--ink-muted); text-decoration: line-through; text-decoration-color: var(--ink-muted); text-decoration-thickness: 1px; }
.compare.bad { background: transparent; border-style: dashed; }
.compare.good { background: #fff; border-color: var(--paper-edge); box-shadow: var(--shadow-md); }
.compare ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: var(--s-3); }
.compare li {
  font-size: var(--fs-small);
  color: var(--ink-soft);
  padding-left: 22px;
  position: relative;
  line-height: 1.5;
}
.compare.bad li::before {
  content: "×"; position: absolute; left: 0; top: -1px;
  color: var(--ink-ghost); font-size: 18px; font-weight: 500;
}
.compare.good li::before {
  content: ""; position: absolute; left: 2px; top: 8px;
  width: 10px; height: 6px;
  border-left: 2px solid var(--brass-deep);
  border-bottom: 2px solid var(--brass-deep);
  transform: rotate(-45deg);
}

/* ---- Trust strip (full bleed inset) ----------------------------------- */
.trust {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(56px, 8vw, 96px) 0;
}
.trust .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: clamp(var(--s-5), 5vw, var(--s-8));
  align-items: center;
}
.trust .section-eyebrow { color: var(--brass-soft); }
.trust h2 {
  color: var(--paper);
  font-size: var(--fs-h1);
  font-variation-settings: "opsz" 72;
  max-width: 14ch;
}
.trust h2 .ital { font-style: italic; color: var(--brass-soft); font-weight: 500; }
.trust p { color: #d9cfb8; font-size: var(--fs-lead); line-height: 1.55; max-width: 52ch; }
.trust p + p { margin-top: var(--s-4); }
.trust a { color: var(--brass-soft); text-decoration-color: var(--brass-deep); }
.trust a:hover { color: var(--paper); text-decoration-color: var(--paper); }
.trust .kicker {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--brass-soft);
  display: inline-block;
  margin-top: var(--s-5);
  padding: 4px 10px;
  border: 1px solid rgba(217,182,122,.25);
  border-radius: 999px;
}

/* ---- Pricing ---------------------------------------------------------- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-4);
  align-items: stretch;
}
.plan {
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.plan.featured {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
}
.plan-tag {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brass-deep);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}
.plan h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  color: inherit;
  margin-bottom: var(--s-2);
  font-variation-settings: "opsz" 36;
}
.plan .plan-desc { font-size: var(--fs-small); color: var(--ink-muted); margin-bottom: var(--s-3); }
.plan.featured .plan-desc { color: #c9b995; }
.plan .plan-moat {
  font-size: var(--fs-small);
  color: var(--brass-deep);
  font-weight: 500;
  line-height: 1.5;
  margin: 0 0 var(--s-5);
  padding-left: var(--s-3);
  border-left: 2px solid var(--brass-deep);
}
.plan.featured .plan-moat { color: var(--brass-soft); border-left-color: var(--brass-soft); }
.plan .price {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 96;
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  color: inherit;
  margin-bottom: var(--s-5);
  letter-spacing: -0.02em;
}
.plan .price sup { font-size: 1.125rem; vertical-align: super; font-weight: 500; color: var(--brass-deep); }
.plan.featured .price sup { color: var(--brass-soft); }
.plan .price small {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--ink-muted);
  letter-spacing: 0;
}
.plan.featured .price small { color: #c9b995; }
.plan ul {
  list-style: none; padding: 0;
  display: flex; flex-direction: column; gap: var(--s-2);
  flex: 1;
  border-top: 1px solid var(--rule-soft);
  padding-top: var(--s-5);
  margin-bottom: var(--s-5);
}
.plan.featured ul { border-top-color: rgba(217,182,122,.2); }
.plan li {
  font-size: var(--fs-small);
  line-height: 1.5;
  padding-left: 22px;
  position: relative;
  color: var(--ink-soft);
}
.plan.featured li { color: #e4dcc6; }
.plan li::before {
  content: ""; position: absolute; left: 2px; top: 7px;
  width: 10px; height: 6px;
  border-left: 2px solid var(--brass-deep);
  border-bottom: 2px solid var(--brass-deep);
  transform: rotate(-45deg);
}
.plan.featured li::before { border-color: var(--brass-soft); }
.plan .btn { width: 100%; margin-top: auto; }
.plan.featured .btn-primary { background: var(--brass); color: var(--ink); }
.plan.featured .btn-primary:hover { background: var(--brass-soft); color: var(--ink); }
.plan-fine { font-size: var(--fs-micro); color: var(--ink-muted); margin-top: var(--s-3); text-align: center; line-height: 1.5; }
.plan.featured .plan-fine { color: var(--brass-soft); }

/* ---- FAQ (prose list) ------------------------------------------------- */
.faq-list { display: flex; flex-direction: column; }
.faq-item {
  padding: var(--s-5) 0;
  border-top: 1px solid var(--rule);
}
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item summary {
  list-style: none;
  display: flex; justify-content: space-between; gap: var(--s-4);
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-muted);
  transition: transform var(--dur) var(--ease);
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .a { margin-top: var(--s-3); color: var(--ink-soft); max-width: 60ch; line-height: 1.6; }
.faq-item .a a { color: var(--brass-deep); text-decoration-color: var(--brass-soft); }

/* ---- Footer ----------------------------------------------------------- */
.site-footer {
  padding: var(--s-7) 0 var(--s-6);
  border-top: 1px solid var(--rule);
  margin-top: var(--s-7);
  font-size: var(--fs-small);
  color: var(--ink-muted);
}
.site-footer .wrap {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--s-4);
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  /* row-gap bumped to s-5 (24px) so wrapped links satisfy WCAG 2.2 SC 2.5.8
     target-spacing exception (each link is 23.3px tall, needs >=24px clear
     space on each side to use the spacing exception). */
  gap: var(--s-5);
  max-width: 100%;
}
.site-footer a {
  color: var(--ink-muted);
  text-decoration: none;
  transition: color .18s ease;
}
.site-footer a:hover { color: var(--ink); }
.site-footer a:focus-visible {
  outline: 2px solid var(--brass-deep);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ==========================================================================
   app.html, success + upload
   ========================================================================== */
.app-main { padding: var(--s-7) 0 var(--s-8); }

.success-card {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-7) var(--s-6) var(--s-6);
  text-align: center;
  box-shadow: var(--shadow-md);
}
.success-mark {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: var(--success-tint);
  display: grid; place-items: center;
  margin: 0 auto var(--s-5);
  animation: pop 0.4s var(--ease) both;
}
.success-mark svg { width: 32px; height: 32px; stroke: var(--success); fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
@keyframes pop {
  from { opacity: 0; transform: scale(.7); }
  to   { opacity: 1; transform: scale(1); }
}
.success-card h1 {
  font-size: 1.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: var(--s-3);
  font-variation-settings: "opsz" 48;
}
.success-card .sub {
  color: var(--ink-muted);
  font-size: var(--fs-body);
  margin-bottom: var(--s-6);
  line-height: 1.55;
}
.success-card .close-note {
  font-size: var(--fs-micro);
  color: var(--ink-ghost);
  margin-top: var(--s-5);
}

/* Setup card */
.setup-card {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--shadow-sm);
}
.setup-card h1 {
  font-size: 1.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  margin-bottom: var(--s-2);
  font-variation-settings: "opsz" 48;
}
.setup-card .sub { color: var(--ink-muted); font-size: var(--fs-small); margin-bottom: var(--s-5); }
.form-field { display: flex; flex-direction: column; gap: var(--s-2); margin-bottom: var(--s-4); }
.form-field label {
  font-size: var(--fs-small);
  font-weight: 500;
  color: var(--ink);
}
.form-field input[type="text"],
.form-field input[type="url"] {
  padding: 12px 14px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  color: var(--ink);
  min-height: 48px;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.form-field input:focus {
  outline: 0;
  border-color: var(--brass-deep);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(184,135,58,.15);
}
.form-help { font-size: var(--fs-micro); color: var(--ink-muted); }

/* Upload */
.app-header-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: var(--s-5);
  flex-wrap: wrap;
  gap: var(--s-3);
}
.app-header-row h1 {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 500;
  color: var(--ink);
  font-variation-settings: "opsz" 48;
}
.usage-pill {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--ink-muted);
  padding: 4px 10px;
  background: var(--paper-deep);
  border: 1px solid var(--rule-soft);
  border-radius: 999px;
}
.upload-zone {
  border: 2px dashed var(--rule);
  background: var(--paper-deep);
  border-radius: var(--r-lg);
  padding: clamp(40px, 8vw, 72px) var(--s-5);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.upload-zone:hover { border-color: var(--brass); background: #fff; }
.upload-zone.dragging { border-color: var(--brass-deep); background: #fff; transform: scale(1.005); }
.upload-zone input { display: none; }
.upload-icon {
  width: 48px; height: 48px;
  margin: 0 auto var(--s-4);
  color: var(--brass-deep);
}
.upload-zone p.label {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: var(--s-2);
  font-variation-settings: "opsz" 36;
}
.upload-zone p.hint { font-size: var(--fs-small); color: var(--ink-muted); }

.processing {
  text-align: center;
  padding: var(--s-8) var(--s-5);
}
.processing .dot-pulse {
  display: inline-flex; gap: 6px; margin-bottom: var(--s-4);
}
.processing .dot-pulse span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brass);
  animation: dot 1.2s ease-in-out infinite;
}
.processing .dot-pulse span:nth-child(2) { animation-delay: 0.15s; }
.processing .dot-pulse span:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.processing p { color: var(--ink-muted); font-size: var(--fs-small); }

.preview-card {
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  margin-top: var(--s-5);
  box-shadow: var(--shadow-sm);
}
.preview-card h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: var(--s-4);
  font-variation-settings: "opsz" 36;
}
.preview-card table {
  width: 100%;
  border-collapse: collapse;
}
.preview-card td {
  padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--fs-small);
  color: var(--ink);
  vertical-align: top;
}
.preview-card tr:last-child td { border-bottom: 0; }
.preview-card td:first-child {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--ink-muted);
  width: 120px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 12px;
}
.preview-card .status-line {
  display: flex; align-items: center; gap: var(--s-2);
  margin-top: var(--s-5);
  padding: var(--s-3) var(--s-4);
  background: var(--success-tint);
  color: var(--success);
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  font-weight: 500;
}
.preview-card .status-line svg { width: 16px; height: 16px; }
.preview-card .btn { margin-top: var(--s-5); }

.limit-card {
  max-width: 520px; margin: var(--s-5) auto 0;
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.limit-card h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: var(--s-3); font-weight: 500; font-variation-settings: "opsz" 36; }
.limit-card p { color: var(--ink-muted); margin-bottom: var(--s-5); }

.status { margin-top: var(--s-3); font-size: var(--fs-small); }
.status.ok { color: var(--success); }
.status.err { color: var(--danger); padding: var(--s-2) var(--s-3); background: var(--danger-tint); border-radius: var(--r-sm); }

/* ==========================================================================
   Long-form pages (privacy, terms)
   ========================================================================== */
.doc {
  max-width: 680px;
  margin: var(--s-7) auto;
  padding: 0 var(--s-5) var(--s-8);
}
.doc-header {
  padding-bottom: var(--s-5);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--s-6);
}
.doc h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: var(--s-2);
  font-variation-settings: "opsz" 72;
}
.doc .meta { font-family: var(--font-mono); font-size: var(--fs-micro); color: var(--ink-muted); letter-spacing: 0.04em; text-transform: uppercase; }
.doc .intro {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  margin-bottom: var(--s-6);
  line-height: 1.6;
}
.doc h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: var(--s-7);
  margin-bottom: var(--s-3);
  font-variation-settings: "opsz" 36;
  display: flex; align-items: baseline; gap: var(--s-3);
}
.doc h2 .num {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--brass-deep);
  font-weight: 500;
  min-width: 2.5ch;
}
.doc h3 {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--ink);
  margin-top: var(--s-5);
  margin-bottom: var(--s-2);
  font-variation-settings: "opsz" 24;
}
.doc p {
  margin-bottom: var(--s-4);
  color: var(--ink-soft);
  max-width: 65ch;
}
.doc p strong { color: var(--ink); font-weight: 600; }
.doc ul, .doc ol {
  margin-bottom: var(--s-5);
  padding-left: var(--s-5);
  color: var(--ink-soft);
  max-width: 65ch;
}
.doc li { margin-bottom: var(--s-2); line-height: 1.6; }
.doc li strong { color: var(--ink); }
.doc a { color: var(--brass-deep); text-decoration-color: var(--brass-soft); }
.doc a:hover { color: var(--ink); }
.doc table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--s-5);
  font-size: var(--fs-small);
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  overflow: hidden;
}
.doc table th {
  background: var(--paper-deep);
  text-align: left;
  padding: var(--s-3) var(--s-4);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  border-bottom: 1px solid var(--rule);
}
.doc table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--rule-soft);
  color: var(--ink-soft);
  vertical-align: top;
}
.doc table tr:last-child td { border-bottom: 0; }
.doc .callout {
  background: var(--paper-deep);
  border-left: 3px solid var(--brass);
  padding: var(--s-4) var(--s-5);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin: var(--s-5) 0;
  max-width: 65ch;
}
.doc .callout p { margin-bottom: 0; color: var(--ink); }

/* ==========================================================================
   Bot section grid (overrides .hero-grid layout for the secondary product)
   ========================================================================== */
.bot-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(var(--s-5), 4vw, var(--s-7));
}

/* ==========================================================================
   Premium polish: motion, focus, plan-card lift
   ========================================================================== */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Unified focus ring — keyboard nav stays sharp without bleeding into mouse clicks */
:focus-visible {
  outline: 2px solid var(--brass-deep);
  outline-offset: 3px;
  border-radius: 4px;
}
.btn:focus-visible {
  outline-offset: 4px;
}

/* Plan cards: subtle lift on hover, only for non-featured (featured already pops) */
.plan {
  transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease;
}
.plan:not(.featured):hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brass-soft);
}
@media (prefers-reduced-motion: reduce) {
  .plan { transition: none; }
  .plan:not(.featured):hover { transform: none; }
}

/* CTA buttons: tactile press feedback */
.btn {
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .btn { transition: background-color .15s ease, color .15s ease; }
  .btn:active { transform: none; }
}

/* FAQ: smoother open, marker rotation */
.faq-item summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 28px;
  transition: color .18s ease;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--brass-deep);
  transition: transform .25s cubic-bezier(.2,.8,.2,1);
}
.faq-item[open] summary::after {
  transform: translateY(-50%) rotate(45deg);
}

/* ==========================================================================
   Hero email capture (opt-in, privacy-friendly)
   ========================================================================== */
.hero-email {
  margin-top: var(--s-4);
  max-width: 380px;
}
.hero-email-label {
  display: block;
  font-size: var(--fs-small);
  color: var(--ink-muted);
  margin-bottom: var(--s-2);
  line-height: 1.4;
}
.hero-email-row {
  display: flex;
  gap: var(--s-2);
  align-items: stretch;
}
.hero-email-row input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  font: 500 15px/1.2 var(--font-body, 'Inter', system-ui, sans-serif);
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--paper-edge);
  border-radius: 999px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hero-email-row input[type="email"]:focus-visible {
  border-color: var(--brass-deep);
  box-shadow: 0 0 0 3px rgba(184, 135, 58, 0.18);
}
.hero-email-row .btn { flex: 0 0 auto; padding-inline: var(--s-4); }
.hero-email-success {
  margin-top: var(--s-3);
  padding: 12px 14px;
  font-size: var(--fs-small);
  color: var(--success);
  background: var(--success-tint);
  border: 1px solid var(--success);
  border-radius: var(--r-md);
  font-weight: 500;
}

/* ==========================================================================
   Pricing 4-column variant + soft plan tag
   ========================================================================== */
.pricing-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.plan-tag-soft {
  background: var(--paper-deep);
  color: var(--brass-deep);
  border: 1px solid var(--paper-edge);
}
/* Secondary nav link: visually de-emphasised but must keep >=4.5:1 contrast.
   Using --ink-ghost (#9b8c79) directly would fail (2.88:1). We keep --ink-muted
   and lean only on font-weight + a small letter-spacing tell to read as "less
   prominent" without dropping legibility. */
.nav-link-secondary { font-weight: 400; }
.nav-link-secondary:hover { color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .pricing-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .hero-grid, .bot-grid { grid-template-columns: 1fr; }
  .chat-mock { justify-self: stretch; max-width: 100%; transform: none; }
  .how-grid { grid-template-columns: 1fr; }
  .trust .wrap { grid-template-columns: 1fr; }
  .pricing-grid:not(.pricing-grid-4) { grid-template-columns: 1fr; }
  .pricing-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan.featured { transform: none; }
  .why-grid { grid-template-columns: 1fr; }
  .hero-email-row { flex-direction: column; }
  .hero-email-row .btn { width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  .pricing-grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .site-nav a.nav-link { display: none; }
  .wrap { padding: 0 var(--s-4); }
  .section { padding: 56px 0; }
  .hero { padding: 32px 0 56px; }
  .step { padding-left: 56px; }
  .step::before { width: 36px; height: 36px; }
  .how-steps::before { left: 18px; }
  .doc table { font-size: var(--fs-micro); }
  .doc table th, .doc table td { padding: var(--s-2) var(--s-3); }
}

/* ==========================================================================
   Launch banner + waitlist notify forms
   ========================================================================== */
.launch-banner {
  background: var(--brass-deep);
  color: var(--paper);
  text-align: center;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 500;
}
.launch-banner a { color: var(--paper); text-decoration: underline; }
.launch-banner a:hover { color: #fff; }
.launch-banner a:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; border-radius: 2px; }

.notify-form {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.notify-form input[type="email"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  font-size: 15px;
  font-family: var(--font-body);
  min-width: 0;
  color: var(--ink);
}
.plan.featured .notify-form input[type="email"] {
  background: rgba(255,255,255,.12);
  border-color: rgba(217,182,122,.3);
  color: var(--paper);
}
.plan.featured .notify-form input[type="email"]::placeholder {
  color: rgba(255,255,255,.5);
}
.notify-form button {
  white-space: nowrap;
  padding: 10px 18px;
}
.notify-ok {
  color: var(--brass);
  font-weight: 500;
  font-size: var(--fs-micro);
  margin-top: 8px;
}
.plan.featured .notify-ok {
  color: var(--brass-soft);
}

/* Motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .msg { animation: none !important; opacity: 1 !important; transform: none !important; }
}

/* ==========================================================================
   Kinetic chapter heads (ledger-page editorial moves)
   ----------------------------------------------------------------------
   The marketing site's visual signature: every major section opens with
   a giant mono chapter number paired with a ghost-weight version of the
   section title bleeding off the canvas. Reads like a chapter card in
   an old printed accountant's manual.
   ========================================================================== */
.chapter {
  position: relative;
  margin-bottom: var(--s-7);
  padding-top: var(--s-6);
  isolation: isolate;
}
.chapter-num {
  font-family: var(--font-mono);
  font-size: clamp(96px, 14vw, 220px);
  font-weight: 500;
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--brass);
  opacity: 0.18;
  margin-bottom: -0.35em;
  display: block;
  user-select: none;
  pointer-events: none;
  transition: opacity 600ms var(--ease), transform 600ms var(--ease);
  transform: translateY(8px);
}
.chapter.in-view .chapter-num {
  opacity: 0.28;
  transform: translateY(0);
}
.chapter-ghost {
  position: absolute;
  left: -2vw;
  right: -2vw;
  bottom: -0.18em;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(120px, 22vw, 360px);
  line-height: 0.9;
  letter-spacing: -0.03em;
  color: var(--ink);
  opacity: 0.04;
  z-index: -1;
  white-space: nowrap;
  overflow: hidden;
  user-select: none;
  pointer-events: none;
  font-variation-settings: "opsz" 144;
}
.chapter-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  color: var(--brass-deep);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: inline-flex; align-items: center; gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.chapter-eyebrow::before {
  content: ""; width: 32px; height: 1px; background: var(--brass);
  display: inline-block;
}
.chapter h2 {
  font-size: var(--fs-h1);
  max-width: 22ch;
  font-variation-settings: "opsz" 96;
  margin-bottom: var(--s-4);
}
.chapter h2 .ital { font-style: italic; color: var(--brass-deep); font-weight: 500; }
.chapter .chapter-lead {
  font-size: var(--fs-lead);
  color: var(--ink-soft);
  max-width: 56ch;
  line-height: 1.5;
}

/* ==========================================================================
   Hand-drawn margin doodles (Pennypoke's reserved moat per portfolio matrix)
   ----------------------------------------------------------------------
   Stroked SVGs that "draw on" via stroke-dashoffset when scrolled into
   view. Live in the page margins next to relevant content. Wobbly hand
   line in --ink-soft, never filled, never tinted purple.
   ========================================================================== */
.doodle {
  width: 88px;
  height: 88px;
  display: block;
  color: var(--ink-soft);
  flex: 0 0 auto;
}
.doodle path,
.doodle line,
.doodle circle,
.doodle polyline,
.doodle polygon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: var(--doodle-len, 600);
  stroke-dashoffset: var(--doodle-len, 600);
  transition: stroke-dashoffset 2400ms var(--ease);
}
.doodle.drawn path,
.doodle.drawn line,
.doodle.drawn circle,
.doodle.drawn polyline,
.doodle.drawn polygon {
  stroke-dashoffset: 0;
}
.doodle--brass { color: var(--brass-deep); }
.doodle--small { width: 56px; height: 56px; }
.doodle--inline { display: inline-block; vertical-align: middle; margin-right: var(--s-3); }
@media (prefers-reduced-motion: reduce) {
  .doodle path,
  .doodle line,
  .doodle circle,
  .doodle polyline,
  .doodle polygon {
    stroke-dashoffset: 0 !important;
    transition: none !important;
  }
}

/* Step rows: doodle sits in right margin as a hand-drawn ornament. The
   absolute-positioned numbered circle on the left is unchanged. */
.step { padding-right: 96px; position: relative; }
.step .step-body { display: contents; }
.step > .doodle {
  position: absolute;
  right: 8px; top: -4px;
  width: 72px; height: 72px;
  pointer-events: none;
}
@media (max-width: 720px) {
  .step { padding-right: 0; }
  .step > .doodle {
    position: static;
    width: 56px; height: 56px;
    margin-bottom: var(--s-3);
  }
}

/* ==========================================================================
   Counter ramp (numeric values count from 0 when entering viewport)
   ========================================================================== */
.counter {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  transition: color 400ms var(--ease);
}
.counter.settled {
  animation: counter-flash 600ms var(--ease) both;
}
@keyframes counter-flash {
  0% { color: inherit; }
  40% { color: var(--brass); }
  100% { color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  .counter.settled { animation: none; }
}

/* ==========================================================================
   Ledger-pages horizontal scroller
   ----------------------------------------------------------------------
   Three index-card-style "pages" each showing a real expense scenario
   (trip, apartment, dinner). Scroll-snap horizontal on mobile; flat
   3-column grid on desktop. Each card is ledger-paper texture with a
   hand-drawn margin doodle in the top-right corner.
   ========================================================================== */
.ledger-section {
  background: var(--paper);
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  overflow: hidden;
}
.ledger-rail {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: var(--s-5);
}
.ledger-card {
  background: #fff;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
  scroll-snap-align: start;
  /* faint horizontal rule lines, real ledger paper */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 27px,
    var(--rule-soft) 27px,
    var(--rule-soft) 28px
  );
  background-position: 0 64px;
  transition: transform 250ms var(--ease), box-shadow 250ms var(--ease);
}
.ledger-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.ledger-card .doodle {
  position: absolute;
  top: var(--s-4); right: var(--s-4);
  width: 48px; height: 48px;
  color: var(--brass-deep);
  opacity: 0.7;
}
.ledger-card-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ledger-card-title {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.05;
  color: var(--ink);
  font-variation-settings: "opsz" 36;
  max-width: 14ch;
  margin-bottom: var(--s-2);
}
.ledger-card-rows {
  list-style: none;
  padding: 0;
  margin: var(--s-2) 0 var(--s-3);
  display: flex; flex-direction: column;
}
.ledger-card-rows li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-3);
  padding: 7px 0;
  border-bottom: 1px solid var(--rule-soft);
  font-size: var(--fs-small);
}
.ledger-card-rows li:last-child { border-bottom: 0; }
.ledger-card-rows .label {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink);
  font-weight: 500;
  font-variation-settings: "opsz" 24;
  flex: 1; min-width: 0;
}
.ledger-card-rows .amt {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
}
.ledger-card-foot {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
}
.ledger-card-foot .total-label {
  text-transform: uppercase; letter-spacing: 0.1em; color: var(--brass-deep);
}
.ledger-card-foot .total-amt {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--brass-deep);
  font-variation-settings: "opsz" 36;
}
@media (max-width: 900px) {
  .ledger-rail {
    grid-auto-flow: column;
    grid-template-columns: none;
    grid-auto-columns: minmax(78vw, 320px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 var(--s-5) var(--s-2);
    margin: 0 calc(var(--s-5) * -1);
    /* hide scrollbar but keep functional */
    scrollbar-width: thin;
  }
  .ledger-card { scroll-snap-align: center; }
}

/* ==========================================================================
   Reveal-on-scroll (single intersection observer trigger)
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 700ms var(--ease), transform 700ms var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ==========================================================================
   Hero web-app preview: book-open + ink-write entrance
   ----------------------------------------------------------------------
   The preview is the soul of the hero. On load it unfolds like a fresh
   ledger page being opened from a book, then each row hand-writes onto
   the page left-to-right (a clip-path inset wipe stands in for ink).

   - Outer card: rotateX(-72deg) + scaleY(.5) + blur, settles at 0/1.
   - Children: 7 rows stagger via :nth-child, each ~520ms wipe.
   - Total runtime ~2.0s, lands flat and readable.
   - prefers-reduced-motion: instant, no animation.

   The inline-style block kept the original visuals when the preview
   was static. The styles now live here so the @keyframes can hook in.
   ========================================================================== */
.hero-preview {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--paper-edge);
  border-radius: 28px;
  padding: clamp(16px, 3vw, 28px);
  box-shadow: 0 24px 48px rgba(42, 38, 34, 0.08), 0 4px 16px rgba(42, 38, 34, 0.04);
  max-width: 380px;
  margin-inline: auto;
  /* Faint ledger-paper rule lines, like a real account book opened flat */
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 33px,
    rgba(184, 135, 58, 0.06) 33px,
    rgba(184, 135, 58, 0.06) 34px
  );
  background-position: 0 28px;

  transform-origin: top center;
  perspective: 1400px;
  animation: book-open 2600ms cubic-bezier(.22,.7,.18,1) both;
  animation-delay: 360ms;
}
@keyframes book-open {
  0% {
    opacity: 0;
    transform: perspective(1400px) rotateX(-78deg) translateY(-32px) scaleY(.42);
    filter: blur(6px);
    box-shadow: 0 0 0 rgba(0,0,0,0);
  }
  55% {
    opacity: 1;
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: perspective(1400px) rotateX(0) translateY(0) scaleY(1);
    filter: blur(0);
    box-shadow: 0 24px 48px rgba(42, 38, 34, 0.08), 0 4px 16px rgba(42, 38, 34, 0.04);
  }
}
.hero-preview > * {
  animation: ink-write 1500ms cubic-bezier(.2,.7,.2,1) both;
}
.hero-preview > *:nth-child(1) { animation-delay: 2200ms; }
.hero-preview > *:nth-child(2) { animation-delay: 2600ms; }
.hero-preview > *:nth-child(3) { animation-delay: 2950ms; }
.hero-preview > *:nth-child(4) { animation-delay: 3300ms; }
.hero-preview > *:nth-child(5) { animation-delay: 3750ms; }
.hero-preview > *:nth-child(6) { animation-delay: 4150ms; }
.hero-preview > *:nth-child(7) { animation-delay: 4700ms; }
@keyframes ink-write {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateX(-6px);
    filter: blur(1.5px);
  }
  35% { opacity: 1; }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
    filter: blur(0);
  }
}
/* Within-row counter wipe: each list-item row's children also stagger so the
   amount writes after the description (right after the row's own wipe). */
.hero-preview ul li > * {
  animation: ink-write 600ms cubic-bezier(.2,.7,.2,1) both;
}
.hero-preview ul li:nth-of-type(1) > *:nth-child(1) { animation-delay: 4250ms; }
.hero-preview ul li:nth-of-type(1) > *:nth-child(2) { animation-delay: 4550ms; }
.hero-preview ul li:nth-of-type(2) > *:nth-child(1) { animation-delay: 4550ms; }
.hero-preview ul li:nth-of-type(2) > *:nth-child(2) { animation-delay: 4850ms; }

@media (prefers-reduced-motion: reduce) {
  .hero-preview,
  .hero-preview > *,
  .hero-preview ul li > * {
    animation: none;
    opacity: 1;
    clip-path: none;
    transform: none;
    filter: none;
  }
}
