/* ============================================================
   Cadence — landing page styles
   Palette (the whole brand lives in these six tokens):
     --ink      deep ink blue-black   (ground of hero/trust/footer)
     --ink-2    raised panel on ink
     --paper    cool paper white      (never cream)
     --graphite secondary text
     --hairline ledger rules
     --signal   verification green — ONLY for checks, matched ticks,
                and the primary CTA. Nothing decorative.
     --flag     disputed amber — only for flagged events.
   ============================================================ */

:root {
  --ink: #0B1524;
  --ink-2: #111F33;
  --paper: #F7F7F2;
  --paper-dim: #EFEFE8;
  --graphite: #5A616B;
  --metal: #8A919B;
  --hairline: #E0E1D9;
  --hairline-dark: rgba(247, 247, 242, 0.14);
  --signal: #0FA878;
  --signal-deep: #0C8C64;
  --flag: #C9761B;

  --font-display: "Space Grotesk", "Avenir Next", "Helvetica Neue", sans-serif;
  --font-body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SF Mono", Menlo, monospace;

  --shell-max: 1120px;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

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

img, canvas { max-width: 100%; display: block; }

/* ---------- type roles ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 6.2vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; line-height: 1.3; }

.mono-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--graphite);
}
.mono-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

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

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 6px; text-decoration: none;
  transition: top 120ms ease;
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: 2px;
}
.section-dark :focus-visible, .hero :focus-visible, .final-band :focus-visible,
.site-header :focus-visible { outline-color: #3FD9A9; }

.shell { max-width: var(--shell-max); margin: 0 auto; padding: 0 24px; }
.shell-narrow { max-width: 820px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  padding: 14px 26px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--signal); color: var(--ink); }
.btn-primary:hover { background: #12BD88; }

.btn-ghost {
  background: transparent; color: var(--paper);
  border-color: var(--hairline-dark);
}
.btn-ghost:hover { border-color: rgba(247, 247, 242, 0.4); }

.btn-outline {
  background: transparent; color: inherit;
  border-color: currentColor;
}
.btn-sm { padding: 9px 18px; font-size: 0.9rem; }
.btn-block { width: 100%; }

.text-link {
  background: none; border: none; cursor: pointer;
  font: inherit; color: inherit; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 21, 36, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline-dark);
}
.header-row {
  display: flex; align-items: center; gap: 28px;
  height: 64px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.25rem;
  letter-spacing: 0.01em; color: var(--paper); text-decoration: none;
}
.wordmark-tick { width: 18px; height: 18px; color: var(--signal); }
.site-nav { display: flex; gap: 24px; margin-left: auto; }
.site-nav a {
  color: rgba(247, 247, 242, 0.78); text-decoration: none;
  font-size: 0.92rem; font-weight: 500;
}
.site-nav a:hover { color: var(--paper); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .header-row { justify-content: space-between; gap: 12px; }
}
@media (max-width: 420px) {
  .shell { padding: 0 16px; }
  .btn-sm { padding: 8px 12px; font-size: 0.8rem; }
  .wordmark { font-size: 1.1rem; }
}

/* ---------- hero ---------- */
.hero {
  background: var(--ink); color: var(--paper);
  padding: clamp(56px, 9vw, 110px) 0 clamp(48px, 7vw, 88px);
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--metal); margin-bottom: 22px;
}
.hero h1 { max-width: 15ch; }
.hero-sub {
  margin-top: 22px; max-width: 58ch;
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: rgba(247, 247, 242, 0.78);
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

/* ---------- signature: reconciliation pulse ---------- */
.pulse-panel {
  margin-top: clamp(44px, 6vw, 72px);
  background: var(--ink-2);
  border: 1px solid var(--hairline-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.pulse-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; padding: 14px 20px;
  border-bottom: 1px solid var(--hairline-dark);
}
.pulse-head .mono-label { color: var(--metal); }
.pulse-counter { font-size: 1.35rem; color: var(--paper); display: inline-flex; align-items: baseline; gap: 10px; }
#verified-counter { color: var(--signal); }
.pulse-counter-label {
  font-size: 0.68rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--metal); font-weight: 500;
}
.pulse-stage { position: relative; height: clamp(200px, 30vw, 280px); }
#pulse-canvas { width: 100%; height: 100%; }
.lane-label { position: absolute; left: 20px; color: var(--metal); }
.lane-label-top { top: 14%; }
.lane-label-bottom { bottom: 14%; }
.lane-label-out { left: auto; right: 20px; top: 50%; transform: translateY(-140%); color: var(--signal); }
.pulse-legend {
  display: flex; gap: 24px; padding: 12px 20px;
  border-top: 1px solid var(--hairline-dark); color: var(--metal);
}
.pulse-legend span { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-signal { background: var(--signal); }
.dot-flag { background: var(--flag); }

@media (max-width: 560px) {
  .lane-label-out { display: none; }
  .pulse-counter { font-size: 1.1rem; }
}

/* ---------- sections & ledger rows ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section h2 { margin-bottom: clamp(28px, 4vw, 44px); }

.ledger-row {
  display: flex; align-items: center; gap: 18px;
  margin-bottom: 22px;
}
.ledger-row hr {
  flex: 1; border: none; border-top: 1px solid var(--hairline);
}
.ledger-row-dark hr { border-top-color: var(--hairline-dark); }
.ledger-row-dark .mono-label { color: var(--metal); }

/* ---------- problem cards ---------- */
.card-grid-3 {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.pain-card {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: #FFFFFF; padding: 26px 24px 28px;
}
.pain-index { display: block; color: var(--graphite); font-size: 0.8rem; margin-bottom: 18px; }
.pain-card h3 { margin-bottom: 10px; }
.pain-card p { color: var(--graphite); font-size: 0.98rem; }

@media (max-width: 860px) { .card-grid-3 { grid-template-columns: 1fr; } }

/* ---------- how it works ---------- */
.how-grid {
  display: grid; grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(32px, 5vw, 64px); align-items: start;
}
.steps { list-style: none; display: grid; gap: 34px; }
.steps li { display: flex; gap: 20px; }
.step-num {
  flex: none; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--ink); display: grid; place-items: center;
  font-size: 1rem;
}
.steps h3 { margin-bottom: 8px; }
.steps p { color: var(--graphite); max-width: 52ch; }

/* mock statement card */
.vws-mock {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: #FFFFFF; overflow: hidden;
  box-shadow: 0 1px 2px rgba(11, 21, 36, 0.05), 0 12px 32px -18px rgba(11, 21, 36, 0.25);
}
.vws-mock-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 20px; border-bottom: 1px solid var(--hairline);
  background: var(--paper);
}
.vws-mock-rows { padding: 6px 20px; }
.vws-mock-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 13px 0; border-bottom: 1px dashed var(--hairline);
}
.vws-mock-row dt { color: var(--graphite); font-size: 0.95rem; }
.vws-mock-row dd { font-size: 1.02rem; display: inline-flex; align-items: center; gap: 8px; }
.vws-mock-row .check { width: 15px; height: 15px; color: var(--signal); }
.vws-mock-total { border-bottom: none; }
.vws-mock-total dt { color: var(--ink); font-weight: 600; }
.vws-mock-total dd { font-size: 1.15rem; }
.vws-mock-sigs {
  display: flex; gap: 20px; padding: 12px 20px;
  border-top: 1px solid var(--hairline); color: #0A7050;
}
.vws-mock-link {
  display: block; width: 100%; text-align: left;
  padding: 14px 20px; border: none; border-top: 1px solid var(--hairline);
  background: var(--paper); color: var(--ink);
  font: 600 0.92rem var(--font-body); cursor: pointer;
}
.vws-mock-link:hover { background: var(--paper-dim); }

@media (max-width: 860px) { .how-grid { grid-template-columns: 1fr; } }

/* ---------- value split ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.split-col {
  border: 1px solid var(--hairline); border-radius: var(--radius);
  background: #FFFFFF; padding: 30px 28px 34px;
}
.split-tag { display: block; margin-bottom: 16px; }
.split-col h3 { font-size: 1.45rem; margin-bottom: 20px; max-width: 20ch; }
.tick-list { list-style: none; display: grid; gap: 14px; }
.tick-list li {
  position: relative; padding-left: 30px; color: var(--graphite); font-size: 0.99rem;
}
.tick-list li::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 16px; height: 16px;
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2.5 8.5l3.7 3.7L13.5 3.8' fill='none' stroke='%230C8C64' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- rate strip ---------- */
.rate-strip {
  background: var(--ink); color: var(--paper);
  padding: clamp(40px, 6vw, 64px) 0;
}
.rate-chips {
  list-style: none; display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center;
}
.rate-chips li {
  border: 1px solid var(--hairline-dark); border-radius: 999px;
  padding: 10px 20px; font-size: 1.02rem; color: var(--paper);
  white-space: nowrap;
}
.rate-chips li span {
  font-family: var(--font-body); font-weight: 400;
  color: var(--metal); font-size: 0.9rem;
}
.rate-caption {
  text-align: center; margin-top: 26px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.05rem, 2vw, 1.3rem); color: rgba(247, 247, 242, 0.85);
}

/* ---------- trust (dark) ---------- */
.section-dark { background: var(--ink); color: var(--paper); }
.trust-lede {
  max-width: 52ch; color: rgba(247, 247, 242, 0.75);
  font-size: 1.08rem; margin: -14px 0 44px;
}
.trust-grid {
  list-style: none;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border-top: 1px solid var(--hairline-dark);
  border-left: 1px solid var(--hairline-dark);
}
.trust-grid li {
  padding: 30px 28px;
  border-right: 1px solid var(--hairline-dark);
  border-bottom: 1px solid var(--hairline-dark);
}
.trust-grid h3 { margin-bottom: 10px; }
.trust-grid p { color: rgba(247, 247, 242, 0.72); font-size: 0.98rem; max-width: 44ch; }
@media (max-width: 760px) { .trust-grid { grid-template-columns: 1fr; } }

/* ---------- design partners ---------- */
.partners-body {
  font-size: 1.12rem; color: var(--graphite);
  max-width: 58ch; margin: -8px 0 32px;
}
.partners-ctas { display: grid; gap: 20px; justify-items: start; }
.partners-operator { color: var(--graphite); font-size: 1rem; }
.partners-operator .text-link { color: var(--ink); }

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 4px;
  font-family: var(--font-display); font-weight: 500; font-size: 1.08rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-marker { position: relative; flex: none; width: 14px; height: 14px; }
.faq-marker::before, .faq-marker::after {
  content: ""; position: absolute; background: var(--graphite);
  transition: transform 160ms ease;
}
.faq-marker::before { left: 0; top: 6px; width: 14px; height: 2px; }
.faq-marker::after { left: 6px; top: 0; width: 2px; height: 14px; }
.faq details[open] .faq-marker::after { transform: scaleY(0); }
.faq details p {
  padding: 0 4px 22px; color: var(--graphite); max-width: 62ch;
}

/* ---------- final band ---------- */
.final-band {
  background: var(--ink); color: var(--paper);
  padding: clamp(72px, 10vw, 120px) 0;
  text-align: left;
}
.final-band h2 { max-width: 22ch; margin-bottom: 34px; }
.final-actions { display: grid; gap: 18px; justify-items: start; }
.email-capture { display: flex; gap: 10px; flex-wrap: wrap; }
.email-capture input {
  min-width: 260px; padding: 13px 16px;
  border: 1px solid var(--hairline-dark); border-radius: 8px;
  background: var(--ink-2); color: var(--paper);
  font: 1rem var(--font-body);
}
.email-capture input::placeholder { color: var(--metal); }
.email-capture .btn-outline { color: var(--paper); }
.form-note { min-height: 1em; }
.final-band .form-note { color: var(--metal); text-transform: none; letter-spacing: 0.04em; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink); color: var(--paper);
  border-top: 1px solid var(--hairline-dark);
  padding: 40px 0;
}
.footer-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; flex-wrap: wrap;
}
.wordmark-footer { font-size: 1.1rem; }
.footer-tag { color: var(--metal); font-size: 0.92rem; margin-top: 6px; }
.footer-links { display: grid; gap: 8px; justify-items: end; }
.footer-links a { color: rgba(247, 247, 242, 0.78); text-decoration: none; font-size: 0.92rem; }
.footer-links a:hover { color: var(--paper); text-decoration: underline; }
.footer-links .mono-label { color: var(--metal); }
@media (max-width: 560px) { .footer-links { justify-items: start; } }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(11, 21, 36, 0.66);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
.modal-card {
  position: relative; width: 100%; max-width: 620px;
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: var(--paper); color: var(--ink);
  border-radius: 14px; border: 1px solid var(--hairline);
  box-shadow: 0 24px 64px -12px rgba(11, 21, 36, 0.5);
}
.modal-card-sm { max-width: 440px; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--hairline); background: #FFFFFF;
  font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--graphite);
}
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 32px 32px 28px; }
.modal-body > .mono-label { display: block; margin-bottom: 10px; }
.modal-body h2 { font-size: 1.5rem; margin-bottom: 8px; }
.modal-sub { color: var(--graphite); font-size: 0.98rem; margin-bottom: 22px; }
#lead-form { margin-top: 18px; }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: 0.9rem; }
.label-opt { font-weight: 400; color: var(--graphite); }
.field input, .field select, .field textarea {
  padding: 11px 13px; border: 1px solid #C9CBC1; border-radius: 7px;
  background: #FFFFFF; font: 1rem var(--font-body); color: var(--ink);
  width: 100%;
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--signal); outline-offset: 1px; border-color: var(--signal);
}
.field-hint { min-height: 1em; text-transform: none; letter-spacing: 0.02em; color: var(--flag); }
.field input[aria-invalid="true"] { border-color: #B3400F; }
.form-error { color: #A33A0C; font-size: 0.92rem; margin: 14px 0 0; }
#lead-form .btn-block, #sample-form .btn-block { margin-top: 20px; }
#lead-form .form-note { margin-top: 12px; text-align: center; }

.modal-success { text-align: center; padding-top: 44px; padding-bottom: 40px; }
.success-check { width: 56px; height: 56px; color: var(--signal); margin: 0 auto 18px; }
.modal-success h2 { margin-bottom: 10px; }
.modal-success p { color: var(--graphite); max-width: 40ch; margin: 0 auto 24px; }

@media (max-width: 560px) {
  .field-grid { grid-template-columns: 1fr; }
  .modal-body { padding: 26px 20px 24px; }
  .hero-ctas .btn { width: 100%; }
  .email-capture { width: 100%; }
  .email-capture input { min-width: 0; flex: 1; }
}

body.modal-open { overflow: hidden; }
