/* ============================================================
   Overturn Health — brand tokens + marketing site styles
   ============================================================ */

:root {
  /* brand */
  --paper: #f7f4ec;
  --paper-2: #efeadd;
  --card: #fcfaf5;
  --ink: #17201b;
  --ink-2: #46524b;
  --muted: #7d857f;
  --pine: #1a5c44;
  --pine-deep: #103d2c;
  --pine-wash: #e3ece6;
  --clay: #c05a2e;
  --clay-wash: #f6e7dd;
  --gold: #b98a2e;
  --hairline: rgba(23, 32, 27, 0.14);
  --hairline-soft: rgba(23, 32, 27, 0.08);

  /* type */
  --serif: "Fraunces", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* dataviz roles (reference palette, light mode) */
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --viz-muted: #898781;
  --gridline: #e1e0d9;
  --baseline: #c3c2b7;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --status-good: #0ca30c;
  --status-warning: #fab219;
  --status-serious: #ec835a;
  --status-critical: #d03b3b;
  --delta-good-text: #006300;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--pine); color: var(--paper); }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 28px; }

/* ---------- header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 64px;
}
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark .mark {
  width: 26px; height: 26px;
  border: 2px solid var(--pine);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--pine);
  font-size: 14px;
  transform: rotate(-8deg);
}
.topnav { display: flex; gap: 26px; margin-left: 8px; }
.topnav a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
}
.topnav a:hover { color: var(--pine); }
.topbar .spacer { flex: 1; }
.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  border-radius: 999px;
  padding: 11px 22px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.btn-solid {
  background: var(--pine);
  color: #fff;
  box-shadow: 0 2px 0 var(--pine-deep);
}
.btn-solid:hover { transform: translateY(-1px); box-shadow: 0 3px 0 var(--pine-deep); }
.btn-ghost {
  color: var(--pine);
  border-color: var(--pine);
  background: transparent;
}
.btn-ghost:hover { background: var(--pine-wash); }
.btn-small { font-size: 13.5px; padding: 8px 16px; }

/* ---------- hero ---------- */
.hero { padding: 84px 0 40px; position: relative; overflow: hidden; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.kicker {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 18px;
}
h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(44px, 6vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.015em;
}
h1 em {
  font-style: italic;
  color: var(--pine);
}
.hero-sub {
  margin-top: 22px;
  font-size: 18.5px;
  color: var(--ink-2);
  max-width: 52ch;
}
.hero-ctas { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-note { margin-top: 14px; font-size: 13px; color: var(--muted); }

/* denial letter visual */
.letter-stage { position: relative; min-height: 420px; }
.letter {
  position: absolute;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  box-shadow: 0 18px 40px -18px rgba(23, 32, 27, 0.35);
  padding: 26px 24px;
  width: 320px;
  font-size: 11px;
  color: var(--ink-2);
}
.letter .lh { font-weight: 700; font-size: 12px; color: var(--ink); margin-bottom: 4px; }
.letter .rule { height: 1px; background: var(--hairline); margin: 10px 0; }
.letter .bar { height: 7px; background: var(--paper-2); border-radius: 3px; margin: 7px 0; }
.letter .bar.short { width: 62%; }
.letter .bar.mid { width: 84%; }
.letter-denied {
  top: 24px; left: 0;
  transform: rotate(-4deg);
  animation: drift-in 0.9s ease both;
}
.letter-appeal {
  top: 96px; left: 120px;
  transform: rotate(2.5deg);
  animation: drift-in 0.9s 0.25s ease both;
}
@keyframes drift-in {
  from { opacity: 0; translate: 0 26px; }
  to { opacity: 1; translate: 0 0; }
}
.tag-denied {
  display: inline-block;
  color: var(--status-critical);
  border: 2px solid var(--status-critical);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.12em;
  padding: 3px 10px;
  border-radius: 4px;
  transform: rotate(-6deg);
  opacity: 0.85;
  margin-bottom: 10px;
}
.stamp {
  position: absolute;
  right: -14px;
  bottom: -18px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 30px;
  letter-spacing: 0.14em;
  color: var(--pine);
  border: 3.5px solid var(--pine);
  border-radius: 8px;
  padding: 8px 20px;
  transform: rotate(-11deg);
  background: color-mix(in srgb, var(--card) 70%, transparent);
  box-shadow: 0 8px 24px -12px rgba(16, 61, 44, 0.5);
  animation: stamp-in 0.45s 0.9s cubic-bezier(0.2, 1.6, 0.4, 1) both;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cfilter id='r'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.35' numOctaves='3'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.6 -0.25'/%3E%3CfeComposite operator='in' in2='SourceGraphic'/%3E%3C/filter%3E%3Crect width='90' height='90' fill='%23fff' filter='url(%23r)'/%3E%3C/svg%3E");
  mask-size: 90px;
}
@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-11deg) scale(1.9); }
  to { opacity: 1; transform: rotate(-11deg) scale(1); }
}

/* ---------- stat strip ---------- */
.strip {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  background: var(--paper-2);
}
.strip .wrap {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.stat {
  padding: 30px 26px;
  border-left: 1px solid var(--hairline-soft);
}
.stat:first-child { border-left: none; }
.stat .num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  line-height: 1;
  color: var(--pine-deep);
}
.stat .lbl { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); }
.stat .src { margin-top: 4px; font-size: 11px; color: var(--muted); }

/* ---------- sections ---------- */
section { padding: 88px 0; }
.sect-head { max-width: 620px; margin-bottom: 52px; }
h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.sect-head p { margin-top: 16px; font-size: 17px; color: var(--ink-2); }

/* the gap */
.gap-section { background: var(--pine-deep); color: #eef3ef; }
.gap-section .kicker { color: var(--gold); }
.gap-section h2 { color: #fff; }
.gap-section .sect-head p { color: #b9c9bf; }
.gap-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 40px;
  align-items: end;
}
.gap-num {
  font-family: var(--serif);
  font-size: clamp(64px, 8vw, 110px);
  font-weight: 600;
  line-height: 0.95;
  color: #fff;
}
.gap-num.dim { color: #5d7a6a; }
.gap-col p { margin-top: 14px; color: #b9c9bf; font-size: 15px; max-width: 30ch; }
.gap-col strong { color: #fff; }
.gap-equals {
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  color: var(--gold);
  padding-bottom: 8px;
}

/* how it works */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  counter-reset: step;
}
.step {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 26px 22px;
  position: relative;
  counter-increment: step;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px -20px rgba(23, 32, 27, 0.4);
}
.step::before {
  content: "0" counter(step);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--clay);
  display: block;
  margin-bottom: 14px;
}
.step h3 { font-size: 16.5px; margin-bottom: 8px; }
.step p { font-size: 14px; color: var(--ink-2); }
.step .hl { color: var(--pine); font-weight: 600; }
.turnaround-note {
  margin-top: 34px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 20px;
  color: var(--ink-2);
}
.turnaround-note strong { color: var(--pine); font-style: normal; }

/* criteria matrix teaser */
.matrix-section { background: var(--paper-2); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.matrix-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 56px; align-items: center; }
.matrix-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  box-shadow: 0 24px 48px -24px rgba(23, 32, 27, 0.35);
  overflow: hidden;
  font-size: 13px;
}
.matrix-card .mc-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  background: var(--paper);
}
.mc-row {
  display: grid;
  grid-template-columns: 1.2fr 1.3fr auto;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--hairline-soft);
  align-items: start;
}
.mc-row:last-child { border-bottom: none; }
.mc-crit { font-weight: 600; }
.mc-ev { color: var(--ink-2); }
.mc-ev .cite { color: var(--pine); font-weight: 600; white-space: nowrap; }
.pill {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-met { background: var(--pine-wash); color: var(--pine-deep); }
.pill-flag { background: var(--clay-wash); color: var(--clay); }

/* pricing */
.tiers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch; }
.tier {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.tier.feat {
  border: 2px solid var(--pine);
  box-shadow: 0 20px 44px -24px rgba(16, 61, 44, 0.5);
}
.tier .flag {
  position: absolute;
  top: -12px; left: 24px;
  background: var(--pine);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
}
.tier h3 { font-size: 15px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-2); }
.tier .price {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  margin: 14px 0 2px;
  color: var(--ink);
}
.tier .price small { font-size: 15px; font-family: var(--sans); font-weight: 500; color: var(--muted); }
.tier .tagline { font-size: 13.5px; color: var(--clay); font-weight: 600; margin-bottom: 16px; }
.tier ul { list-style: none; margin: 0 0 24px; flex: 1; }
.tier li {
  font-size: 14px;
  color: var(--ink-2);
  padding: 7px 0 7px 24px;
  position: relative;
  border-bottom: 1px dashed var(--hairline-soft);
}
.tier li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--pine);
  font-weight: 700;
}

/* group banner */
.tier-wide {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  background: var(--pine-deep);
  color: #fff;
  border-radius: 12px;
  padding: 28px 32px;
}
.tier-wide .tw-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  margin-bottom: 8px;
}
.tier-wide .tw-sub {
  color: #b9c9bf;
  font-size: 14.5px;
  max-width: 64ch;
}
.tier-wide .btn-solid {
  background: #fff;
  color: var(--pine-deep);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

/* region */
.region-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.payer-cards { display: grid; gap: 16px; }
.payer-card {
  background: var(--card);
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--pine);
  border-radius: 8px;
  padding: 18px 20px;
}
.payer-card h4 { font-size: 15px; }
.payer-card p { font-size: 13.5px; color: var(--ink-2); margin-top: 4px; }
.payer-card .st { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; color: var(--clay); text-transform: uppercase; }

/* compliance */
.compliance { background: var(--paper-2); border-top: 1px solid var(--hairline); }
.comp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.comp {
  padding: 22px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--card);
}
.comp .ico { font-size: 20px; margin-bottom: 12px; display: block; }
.comp h4 { font-size: 15px; margin-bottom: 6px; }
.comp p { font-size: 13.5px; color: var(--ink-2); }

/* cta band */
.cta-band { background: var(--pine-deep); color: #fff; text-align: center; padding: 96px 0; }
.cta-band h2 { color: #fff; margin-bottom: 14px; }
.cta-band p { color: #b9c9bf; font-size: 17px; max-width: 54ch; margin: 0 auto 32px; }
.cta-band .btn-solid { background: #fff; color: var(--pine-deep); box-shadow: 0 2px 0 rgba(0,0,0,0.35); }
.cta-band .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.5); }
.cta-band .btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* pilot inquiry form */
.pilot-form { max-width: 620px; margin: 0 auto; text-align: left; }
.pilot-form .pf-row { display: flex; gap: 16px; }
.pilot-form .pf-field { flex: 1; margin-bottom: 16px; }
.pilot-form label { display: block; font-family: var(--sans); font-size: 13px;
  color: #b9c9bf; margin-bottom: 6px; letter-spacing: 0.02em; }
.pilot-form .pf-opt { color: rgba(185,201,191,0.6); }
.pilot-form input, .pilot-form textarea { width: 100%; box-sizing: border-box;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.28);
  border-radius: 8px; color: #fff; padding: 11px 13px; font-size: 15px;
  font-family: var(--sans); }
.pilot-form input:focus, .pilot-form textarea:focus { outline: none;
  border-color: #fff; background: rgba(255,255,255,0.12); }
.pilot-form textarea { resize: vertical; }
.pilot-form .hero-ctas { margin-top: 22px; }
.pilot-form button.btn { cursor: pointer; font-family: var(--sans); border: none; }
.pilot-form button.btn:disabled { opacity: 0.6; cursor: wait; }
.pf-hp { position: absolute; left: -9999px; width: 1px; height: 1px;
  opacity: 0; }
.pf-status { text-align: center; margin-top: 16px; font-size: 15px;
  min-height: 1.4em; color: #b9c9bf; }
.pf-status.ok { color: #8fe0c0; }
.pf-status.err { color: #f0b9a5; }
@media (max-width: 640px) { .pilot-form .pf-row { flex-direction: column; gap: 0; } }

/* footer */
footer { padding: 44px 0 60px; border-top: 1px solid var(--hairline); }
footer .wrap { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
footer p { font-size: 13px; color: var(--muted); }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { color: var(--ink-2); font-size: 13px; text-decoration: none; }
footer a:hover { color: var(--pine); }

/* ---------- guide / article pages ---------- */
.article-hero { padding: 64px 0 8px; }
.article-hero .crumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.article-hero .crumb a { color: var(--pine); text-decoration: none; }
.article-hero h1 { font-size: clamp(34px, 4.5vw, 52px); max-width: 20ch; }
.article-hero .article-meta { margin-top: 16px; font-size: 14px; color: var(--muted); }
.article { max-width: 760px; padding-bottom: 24px; }
.article h2 { font-size: 27px; margin: 44px 0 14px; }
.article h3 { font-size: 19px; margin: 30px 0 10px; }
.article p { margin: 0 0 18px; font-size: 16.5px; color: var(--ink-2); }
.article p strong, .article li strong { color: var(--ink); }
.article ul, .article ol { margin: 0 0 18px 24px; font-size: 16.5px; color: var(--ink-2); }
.article li { margin-bottom: 9px; }
.article a { color: var(--pine); }
.callout { background: var(--pine-wash); border-left: 4px solid var(--pine);
  border-radius: 8px; padding: 16px 20px; margin: 24px 0; font-size: 15.5px;
  color: var(--ink-2); }
.callout strong { color: var(--pine-deep); }
.faq-block { margin-top: 8px; }
.faq-block h3 { margin-top: 24px; }
.guide-cta { background: var(--pine-deep); color: #fff; border-radius: 14px;
  padding: 36px 40px; margin: 48px 0 72px; }
.guide-cta h2 { color: #fff; font-size: 26px; margin-bottom: 10px; }
.guide-cta p { color: #b9c9bf; font-size: 15.5px; max-width: 60ch; margin-bottom: 22px; }
.guide-cta .btn-solid { background: #fff; color: var(--pine-deep);
  box-shadow: 0 2px 0 rgba(0,0,0,0.35); }

/* reveal on scroll */
.reveal { opacity: 0; translate: 0 24px; transition: opacity 0.7s ease, translate 0.7s ease; }
.reveal.in { opacity: 1; translate: 0 0; }

/* responsive */
@media (max-width: 960px) {
  .hero-grid, .matrix-grid, .region-grid { grid-template-columns: 1fr; }
  .letter-stage { min-height: 360px; max-width: 480px; }
  .strip .wrap, .steps, .tiers, .comp-grid { grid-template-columns: 1fr 1fr; }
  .stat { border-left: none; }
  .gap-cols { grid-template-columns: 1fr; gap: 24px; }
  .gap-equals { display: none; }
}
@media (max-width: 560px) {
  .strip .wrap, .steps, .tiers, .comp-grid { grid-template-columns: 1fr; }
  .topnav { display: none; }
  .topbar .wrap { gap: 12px; }
  .topbar .btn-ghost { display: none; }
  .letter-stage {
    transform: scale(0.52);
    transform-origin: top left;
    min-height: 150px;
    max-width: none;
  }
}
