/* ledger.css — HWR design system "The Ledger" (guide V2, direction 2a)
   Dark hero band, light body. TDM house colors. Mono for facts. */

:root {
  --ink: #0a0d10;
  --paper: #fafaf9;
  --white: #ffffff;
  --line: #ececea;
  --muted: #6b7280;
  --muted-dark: #9ca3af;
  --green: #1ab84a;
  --green-bright: #24d45a;
  --green-dim: #0f7d31;
  --maxw: 1140px;
  --radius-sm: 6px;
  --radius-card: 10px;
  --shadow-light: 0 2px 10px rgba(10, 13, 16, .05);
  --shadow-hero: 0 12px 40px rgba(0, 0, 0, .4);
  --sans: 'IBM Plex Sans', sans-serif;
  --mono: 'IBM Plex Mono', monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dim); text-decoration: none; }
a:hover { color: #0a5f25; }
::selection { background: var(--green-dim); color: var(--paper); }
/* height:auto is the required partner to max-width. Without it an <img> that
   carries width/height attributes keeps the attribute height while max-width
   shrinks its width, so it renders stretched. Nothing caught this before
   because every earlier image set its own height: .lg-video__frame img and
   .links-hero img both do, and both still win on specificity. */
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: clamp(34px, 5vw, 54px); line-height: 1.06; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: clamp(26px, 3.5vw, 34px); letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }

/* Layout */
.lg-wrap { max-width: var(--maxw); margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.lg-section { padding-top: 72px; padding-bottom: 72px; border-top: 1px solid var(--line); }
.lg-section--white { background: var(--white); }

/* Dark band (nav + hero, letter section) */
.lg-dark { background: var(--ink); color: var(--paper); }
.lg-dark p { color: var(--muted-dark); }

/* Nav */
.lg-nav-bar {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  position: sticky; top: 0; z-index: 10;
  background: var(--ink);
}
.lg-nav {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; gap: 24px;
}
.lg-nav__brand { font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--paper); }
.lg-nav__brand:hover { color: var(--paper); }
.lg-nav__links { display: flex; gap: 26px; align-items: center; font-size: 14px; font-weight: 500; margin: 0 0 0 auto; padding: 0; list-style: none; }
.lg-nav__links a { color: var(--muted-dark); }
.lg-nav__links a:hover { color: var(--paper); }
.lg-nav__cta { background: var(--green); color: var(--ink); padding: 10px 18px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; white-space: nowrap; }
.lg-nav__cta:hover { background: var(--green-bright); color: var(--ink); }

/* Kicker + captions */
.lg-kicker {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--green-dim);
}
.lg-dark .lg-kicker { color: var(--green-bright); }
.lg-caption { font-family: var(--mono); font-size: 12px; color: var(--muted); }

/* Buttons */
.lg-btn {
  display: inline-block; font-weight: 600; font-size: 16px;
  padding: 14px 24px; border-radius: var(--radius-sm); text-align: center;
}
.lg-btn--primary { background: var(--green-dim); color: var(--white); }
.lg-btn--primary:hover { background: #0a5f25; color: var(--white); }
.lg-dark .lg-btn--primary { background: var(--green); color: var(--ink); }
.lg-dark .lg-btn--primary:hover { background: var(--green-bright); color: var(--ink); }
.lg-btn--ghost { border: 1.5px solid var(--ink); color: var(--ink); }
.lg-btn--ghost:hover { background: var(--ink); color: var(--paper); }
.lg-dark .lg-btn--ghost { border-color: rgba(255, 255, 255, .3); color: var(--paper); }
.lg-dark .lg-btn--ghost:hover { border-color: var(--paper); background: transparent; color: var(--paper); }
.lg-actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* Cards */
.lg-card {
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 30px;
  box-shadow: var(--shadow-light); color: var(--ink);
}
a.lg-card:hover { border-color: var(--muted-dark); color: var(--ink); }
.lg-card--roomy { padding: 44px; }

/* Proof card (screenshot + mono caption row) */
.lg-proof {
  background: var(--white); border-radius: var(--radius-card); padding: 16px;
  display: flex; flex-direction: column; gap: 12px; color: var(--ink);
}
.lg-dark .lg-proof { box-shadow: var(--shadow-hero); }
.lg-proof__meta {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: 12px; color: var(--muted); gap: 12px;
}
.lg-proof__status { color: var(--green-dim); font-weight: 600; }
.lg-proof img { border-radius: var(--radius-sm); width: 100%; }

/* Video card (16:9, click-to-load facade, no third-party JS) */
.lg-video {
  background: var(--white); border-radius: var(--radius-card); padding: 16px;
  display: flex; flex-direction: column; gap: 12px; color: var(--ink);
}
.lg-dark .lg-video { box-shadow: var(--shadow-hero); }
.lg-video__frame {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm); overflow: hidden; background: var(--ink);
}
.lg-video__frame img, .lg-video__frame iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover;
}
.lg-video__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 48px; border-radius: 12px; background: rgba(10, 13, 16, .78);
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.lg-video__play::after {
  content: ''; margin-left: 3px;
  border-style: solid; border-width: 10px 0 10px 17px;
  border-color: transparent transparent transparent var(--paper);
}
.lg-video__frame:hover .lg-video__play { background: var(--green-dim); }
.lg-video__meta {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; color: var(--muted);
}
.lg-video__meta strong { color: var(--green-dim); font-weight: 600; }

/* Stats */
.lg-outcomes { border-top: 3px solid var(--green-dim); border-bottom: 1px solid var(--line); }
.lg-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px;
  padding-top: 48px; padding-bottom: 48px;
}
.lg-stat { display: flex; flex-direction: column; gap: 6px; text-align: center; }
.lg-stat + .lg-stat { border-left: 1px solid var(--line); }
.lg-stat__num { font-family: var(--mono); font-size: 52px; font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; }
.lg-stat__num--green { color: var(--green-dim); }
.lg-stat__label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* Numbered list */
.lg-numlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.lg-numlist li { display: flex; gap: 12px; }
.lg-numlist__num { font-family: var(--mono); color: var(--green-dim); font-weight: 600; flex-shrink: 0; }

/* Grids */
.lg-grid { display: grid; gap: 20px; }
.lg-grid--2 { grid-template-columns: 1fr 1fr; }
.lg-grid--3 { grid-template-columns: repeat(3, 1fr); }
.lg-grid--split { grid-template-columns: 1.1fr .9fr; gap: 56px; align-items: center; }
.lg-grid--aside { grid-template-columns: 1.2fr .8fr; gap: 56px; align-items: start; }
.lg-sticky { position: sticky; top: 84px; }

/* Hero */
.lg-hero { padding-top: 88px; padding-bottom: 88px; }
.lg-hero__lead { font-size: 17px; max-width: 520px; text-wrap: pretty; }

/* Letter band */
.lg-letter { padding-top: 80px; padding-bottom: 80px; gap: 56px; }

/* Email capture */
.lg-capture { display: flex; flex-direction: column; gap: 10px; }
.lg-fineprint { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lg-dark .lg-fineprint { color: var(--muted-dark); }

/* Prose (privacy, long-form) */
.lg-prose { max-width: 760px; }
.lg-prose h2 { margin-top: 2.2em; margin-bottom: .6em; }
.lg-prose p, .lg-prose ul { margin-bottom: 1.1em; color: #374151; }

/* Footer */
.lg-footer { border-top: 1px solid var(--line); }
.lg-footer__inner {
  max-width: var(--maxw); margin: 0 auto; padding: 44px 32px;
  display: flex; justify-content: space-between; gap: 24px 40px; flex-wrap: wrap;
}
.lg-footer__brand { font-weight: 700; font-size: 15px; color: var(--ink); }
.lg-footer__col { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.lg-footer__col a { color: var(--muted); }
.lg-footer__col a:hover { color: var(--ink); }
.lg-footer__copy {
  max-width: var(--maxw); margin: 0 auto; padding: 0 32px 36px;
  font-family: var(--mono); font-size: 12px; color: var(--muted-dark);
}

/* File comparison (same file, free vs paid)
   Two file cards side by side. The whole argument for the Filled-In Vault is
   that the free kit hands you a form and the paid one hands you a filled form,
   so the fastest way to make that land is to show one file in both states. */
.lg-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.lg-file {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  background: var(--white); overflow: hidden; display: flex; flex-direction: column;
}
.lg-file--paid { border-color: var(--green-dim); box-shadow: var(--shadow-light); }
.lg-file__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: var(--paper); font-family: var(--mono); font-size: 12px;
}
.lg-file--paid .lg-file__head { background: rgba(15, 125, 49, .06); border-bottom-color: var(--green-dim); }
.lg-file__name { color: var(--ink); font-weight: 600; }
.lg-file__tag { color: var(--muted); }
.lg-file--paid .lg-file__tag { color: var(--green-dim); font-weight: 600; }
/* pre, so the sample keeps the shape of the real file. Scrolls on its own
   rather than pushing the page sideways. */
.lg-file__body {
  margin: 0; padding: 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere;
}
.lg-file__todo { color: var(--muted-dark); }

/* Audit table (Demo Site Loop)
   The 10-point PASS/FAIL result IS the product, so the sales page shows a real
   one instead of describing it. Built as rows and not a <table> so the reason
   column can drop to its own line on a phone instead of squeezing to nothing. */
.lg-audit { display: flex; flex-direction: column; }
.lg-audit__row {
  display: grid; grid-template-columns: 26px 52px 1fr; gap: 12px; align-items: baseline;
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 12.5px; line-height: 1.55;
}
.lg-audit__row:first-child { border-top: 0; }
.lg-audit__row--fail { background: rgba(180, 35, 24, .04); }
.lg-audit__n { color: var(--muted); }
.lg-audit__v { font-weight: 600; }
.lg-audit__v--pass { color: var(--green-dim); }
.lg-audit__v--fail { color: #b42318; }
.lg-audit__why { color: var(--muted); overflow-wrap: anywhere; }

/* Responsive
   Note: inline style attributes beat media queries. Any layout or spacing value
   that has to change on mobile must live here as a class, not on the element. */
@media (max-width: 860px) {
  .lg-compare { grid-template-columns: 1fr; gap: 12px; }
  .lg-grid--2, .lg-grid--3, .lg-grid--split, .lg-grid--aside { grid-template-columns: 1fr; gap: 32px; }
  .lg-stats { grid-template-columns: repeat(3, 1fr); }
  .lg-stat__num { font-size: 32px; }
  .lg-section { padding-top: 56px; padding-bottom: 56px; }
  .lg-hero { padding-top: 56px; padding-bottom: 56px; }
  .lg-letter { padding-top: 56px; padding-bottom: 56px; gap: 32px; }
  .lg-sticky { position: static; }

  /* Nav goes two rows: brand + CTA on top, links centered underneath. */
  .lg-nav { flex-wrap: wrap; row-gap: 14px; }
  .lg-nav__links { order: 3; flex: 1 1 100%; margin-left: 0; justify-content: center; gap: 22px; font-size: 13px; }
  .lg-nav__cta { margin-left: auto; }
}

@media (max-width: 600px) {
  .lg-wrap { padding-left: 20px; padding-right: 20px; }
  .lg-nav { padding: 14px 20px; }
  .lg-nav__brand { font-size: 15px; }
  .lg-nav__links { gap: 18px; }
  .lg-nav__cta { padding: 9px 15px; font-size: 13px; }

  h1 { font-size: clamp(30px, 8vw, 34px); }
  .lg-section { padding-top: 44px; padding-bottom: 44px; }
  .lg-hero { padding-top: 44px; padding-bottom: 44px; }
  .lg-letter { padding-top: 48px; padding-bottom: 48px; gap: 28px; }

  /* Card copy on phones.
     Two things were wrong here. The sheet had no type rules in either media
     query at all, so body copy rendered 17px/1.65 on a 320px phone exactly as
     on a 27" monitor, and h1 was the only thing that scaled. And most card
     paragraphs carry an INLINE font-size (14px or 15px), which beats any
     selector in here, so the usual fix does nothing. Hence !important: it is
     the only thing that reaches an inline style.

     The real fix is moving those inline sizes into classes. That is a sweep
     across ~26 declarations in index.php and build-first.php, worth doing on
     its own, and this is the floor until then. Do not add new inline
     font-sizes to card copy.

     Padding drops to 18px so the measure gets wider, not just bigger: at 22px
     a phone had roughly 306px of usable width inside a card, which is about 40
     characters per line, under the 45 to 75 legibility band. */
  .lg-card p:not(.lg-caption):not(.lg-fineprint):not(.lg-kicker) {
    font-size: 16px !important;
    line-height: 1.6;
  }
  .lg-card { padding: 18px; }
  .lg-card--roomy { padding: 22px; }
  .lg-proof { padding: 12px; }
  .lg-proof__meta { flex-wrap: wrap; gap: 4px 12px; }
  .lg-video { padding: 12px; }
  .lg-video__meta { flex-wrap: wrap; gap: 4px 12px; }
  .lg-video__play { width: 56px; height: 40px; }

  .lg-stats { grid-template-columns: 1fr; gap: 0; padding-top: 24px; padding-bottom: 24px; }
  .lg-stat { padding: 16px 0; }
  .lg-stat + .lg-stat { border-left: 0; border-top: 1px solid var(--line); }
  .lg-stat__num { font-size: 32px; }

  .lg-actions { flex-direction: column; align-items: stretch; }

  /* Number and verdict on one line, the reason underneath at full width. */
  .lg-audit__row { grid-template-columns: 26px 1fr; gap: 4px 10px; padding: 9px 12px; font-size: 12px; }
  .lg-audit__why { grid-column: 1 / -1; }

  .lg-footer__inner { padding: 36px 20px; }
  .lg-footer__copy { padding: 0 20px 28px; }
}
