/* ============================================================================
   CuraPatient · CuraClaims — Design System
   "Instrument-grade authority": ink on warm paper, one amber signal accent,
   editorial serif headlines, evidence-UI as hero.
   See ../../../design-system/MASTER.md and ../../../brand/BRAND.md
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..600&family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ----------------------------------------------------------------- Tokens */
:root {
  /* Surfaces — ink on warm paper */
  --ink:          #181511;
  --ink-soft:     #3a342b;
  --ink-muted:    #5c5446;
  --paper:        #f6f2ea;
  --paper-deep:   #eee8db;
  --surface:      #fcfaf4;
  --line:         #e4dccb;
  --line-strong:  #d2c7b0;

  /* Inverted (engine / evidence / agent moments) */
  --ink-panel:    #122340;
  --ink-panel-2:  #16294a;
  --paper-on-dark:#d7e2ef;
  --muted-on-dark:#8fa7c4;
  --line-on-dark: #2a4263;

  /* Orange accent — workbench aesthetic */
  --amber:        #d97706;   /* graphic accent + large display text */
  --amber-deep:   #b45309;   /* small orange TEXT on light + button hover */
  --amber-cta:    #d97706;   /* primary button bg, white text */
  --amber-bright: #d97706;   /* orange on dark backgrounds */
  --amber-tint:   rgba(217,119,6,.10);

  /* Data semantics — evidence/metric contexts ONLY, never general UI */
  --verdict:      #1a6b52;   /* paid / recovered / match / confirmed */
  --verdict-tint: rgba(26,107,82,.10);
  --maroon:       #8a2a1f;   /* lost / structural / denied / at-risk */
  --maroon-tint:  rgba(138,42,31,.09);
  --slate:        #36506e;   /* neutral data */

  --ring: var(--amber);

  /* Type */
  --font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans:  'IBM Plex Sans', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* Layout */
  --maxw:        1180px;
  --maxw-narrow: 760px;
  --pad-inline:  clamp(1.25rem, 5vw, 3rem);
  --section-y:   clamp(4rem, 9vw, 8rem);

  /* Radius / shadow (hairline-first, soft warm shadows) */
  --r-sm: 5px;  --r: 9px;  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(24,21,17,.05);
  --shadow:    0 8px 30px -12px rgba(24,21,17,.18);
  --shadow-lg: 0 30px 60px -22px rgba(24,21,17,.30);

  --ease: cubic-bezier(.2,.7,.3,1);
}

/* --------------------------------------------------------------- Reset/base */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
::selection { background: var(--amber); color: #fff; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: 3px;
}

/* --------------------------------------------------------------- Typography */
h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 420; line-height: 1.08; letter-spacing: -.015em; color: var(--ink); }
h1, .display {
  font-size: clamp(2.6rem, 1.4rem + 4.6vw, 4.6rem);
  line-height: 1.0;
  letter-spacing: -.025em;
}
h2 { font-size: clamp(2rem, 1.2rem + 2.6vw, 3rem); }
h3 { font-size: clamp(1.35rem, 1.05rem + 1.2vw, 1.85rem); }
h4 { font-size: 1.2rem; letter-spacing: -.01em; }
p  { color: var(--ink-soft); }
strong { font-weight: 600; color: var(--ink); }

.lede, .lead {
  font-size: clamp(1.15rem, 1rem + .7vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink-soft);
}
.fine { font-size: .82rem; color: var(--ink-muted); line-height: 1.5; }
.muted { color: var(--ink-muted); }
.serif { font-family: var(--font-serif); }
.mono  { font-family: var(--font-mono); }
.accent { color: var(--amber-deep); }
.verdict { color: var(--verdict); }
.maroon  { color: var(--maroon); }
.tnum  { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.center { text-align: center; }
.balance { text-wrap: balance; }

/* Eyebrow / section label — the "01 · SECTION" instrument label */
.eyebrow {
  font-family: var(--font-mono);
  font-size: .73rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--amber-deep);
  display: inline-flex;
  align-items: baseline;
  gap: .6em;
}
.eyebrow__num { color: var(--ink-muted); }
.section--dark .eyebrow { color: var(--amber-bright); }
.section--dark .eyebrow__num { color: var(--muted-on-dark); }

/* Amber rule under a headline */
.rule { width: 64px; height: 3px; background: var(--amber); border: 0; margin: 1.4rem 0; }
.rule--center { margin-inline: auto; }
.hairline { height: 1px; background: var(--line); border: 0; }

/* ------------------------------------------------------------------ Layout */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--pad-inline); }
.container--narrow { max-width: var(--maxw-narrow); }
.section { padding-block: var(--section-y); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--paper-deep { background: var(--paper-deep); }
.section--dark { background: var(--ink-panel); color: var(--paper-on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: #fff; }
.section--dark p { color: var(--paper-on-dark); }
.section--dark .muted { color: var(--muted-on-dark); }
.section--dark .hairline { background: var(--line-on-dark); }

.stack > * + * { margin-top: var(--stack-gap, 1.1rem); }
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.split { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }

/* -------------------------------------------------------------------- Nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand__mark { width: 26px; height: 26px; flex: none; }
.brand__name { font-family: var(--font-serif); font-size: 1.18rem; letter-spacing: -.01em; }
.brand__name b { font-weight: 560; }
.brand__name .sub { color: var(--ink-muted); }
.brand__reg { font-size: .55em; vertical-align: super; color: var(--ink-muted); }
.nav__links { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2rem); list-style: none; }
.nav__links a { font-size: .94rem; color: var(--ink-soft); transition: color .18s var(--ease); }
.nav__links a:hover { color: var(--amber-deep); }
.nav__links a[aria-current="page"] { color: var(--ink); border-bottom: 2px solid var(--amber); padding-bottom: 2px; }
.nav__right { display: flex; align-items: center; gap: 1rem; }
.nav__cta-mobile { display: none; }
.nav__toggle { display: none; background: none; border: 0; padding: .4rem; color: var(--ink); }

/* ----------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .72rem 1.25rem; border-radius: var(--r-sm);
  font-size: .95rem; font-weight: 500; line-height: 1;
  border: 1px solid transparent; transition: all .18s var(--ease); white-space: nowrap;
}
.btn svg { width: 1.05em; height: 1.05em; }
.btn--primary { background: var(--amber-cta); color: #fff; border-color: var(--amber-cta); }
.btn--primary:hover { background: var(--amber-deep); border-color: var(--amber-deep); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.btn--quiet { padding-inline: 0; color: var(--ink); border: 0; border-bottom: 1px solid var(--amber); border-radius: 0; padding-bottom: 2px; }
.btn--quiet:hover { color: var(--amber-deep); gap: .8rem; }
.section--dark .btn--ghost, .cta-band .btn--ghost { color: #fff; border-color: var(--line-on-dark); }
.section--dark .btn--ghost:hover, .cta-band .btn--ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

/* ------------------------------------------------------------------- Hero */
.hero { padding-block: clamp(3.5rem, 7vw, 6.5rem) clamp(3rem, 6vw, 5rem); }
.hero__promise { font-family: var(--font-serif); font-size: clamp(2.7rem, 1.2rem + 5.6vw, 5rem); line-height: .98; letter-spacing: -.03em; }

/* ------------------------------------------------------------ Determination
   The signature "cited determination" evidence card. */
.determination {
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden;
}
.determination__head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); align-items: flex-end; }
.determination__label { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); display: block; margin-bottom: .25rem; }
.determination__value { font-family: var(--font-serif); font-size: 2.1rem; line-height: 1; letter-spacing: -.02em; }
.determination__variance { color: var(--maroon); }
.determination__title { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); padding: .9rem 1.5rem .2rem; }
.pillars { list-style: none; padding: .3rem .75rem .75rem; margin: 0; }
.pillar { display: grid; grid-template-columns: 18px 1fr auto; gap: .75rem; align-items: center; padding: .62rem .75rem; border-radius: var(--r-sm); }
.pillar + .pillar { border-top: 1px solid var(--line); }
.pillar__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--verdict); margin-inline: auto; }
.pillar__dot--cited { background: var(--slate); }
.pillar__dot--go { background: var(--amber); }
.pillar__text { font-size: .9rem; color: var(--ink-soft); }
.pillar__text b { color: var(--ink); font-weight: 600; }
.pillar__tag { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--verdict); }
.pillar__tag--cited { color: var(--slate); }
.pillar__tag--go { color: var(--amber-deep); }
.determination__foot { background: var(--ink-panel); color: var(--paper-on-dark); padding: 1rem 1.5rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; }
.determination__foot b { color: #fff; }
.determination__foot .pct { color: var(--amber-bright); font-family: var(--font-mono); font-weight: 600; }
.chip-human { display: inline-flex; align-items: center; gap: .45rem; font-size: .8rem; font-family: var(--font-mono); letter-spacing: .04em; padding: .35rem .7rem; border: 1px solid var(--amber); border-radius: 100px; color: var(--amber-bright); }

/* --------------------------------------------------------------- Stats/metric */
.stats { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stats--4 { grid-template-columns: repeat(4, 1fr); }
.stats--3 { grid-template-columns: repeat(3, 1fr); }
.stat { background: var(--surface); padding: 1.5rem 1.4rem; }
.section--dark .stats { background: var(--line-on-dark); border-color: var(--line-on-dark); }
.section--dark .stat { background: var(--ink-panel-2); }
.stat__num { font-family: var(--font-serif); font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.8rem); line-height: 1; letter-spacing: -.02em; }
.stat__num .unit { font-size: .5em; color: var(--ink-muted); letter-spacing: 0; }
.section--dark .stat__num .unit { color: var(--muted-on-dark); }
.stat__label { font-size: .9rem; color: var(--ink-soft); margin-top: .55rem; }
.section--dark .stat__label { color: var(--paper-on-dark); }
.stat__src { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); margin-top: .5rem; }

/* ------------------------------------------------------------------ Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.6rem; transition: border-color .2s var(--ease), transform .2s var(--ease); }
.card__kicker { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--amber-deep); }
.card h3 { margin-top: .4rem; }
.card p { margin-top: .6rem; font-size: .96rem; }

/* Audience doors */
.door { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.7rem; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
.door:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow); }
.door__title { font-family: var(--font-serif); font-size: 1.35rem; }
.door__desc { font-size: .95rem; color: var(--ink-soft); margin-top: .5rem; flex: 1; }
.door__line { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin-top: 1rem; }
.door__link { color: var(--amber-deep); font-weight: 500; margin-top: 1.1rem; display: inline-flex; align-items: center; gap: .4rem; }
.door:hover .door__link { gap: .7rem; }

/* ------------------------------------------------------------- Agents/pipeline */
.agents { display: grid; gap: 1px; background: var(--line-on-dark); border: 1px solid var(--line-on-dark); border-radius: var(--r); overflow: hidden; }
.agent { background: var(--ink-panel-2); padding: 1.15rem 1.3rem; display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; }
.agent__name { font-family: var(--font-mono); font-size: .82rem; letter-spacing: .04em; color: var(--amber-bright); }
.agent__role { font-size: .85rem; color: var(--muted-on-dark); }
.agent__bar { width: 120px; height: 6px; border-radius: 100px; background: var(--line-on-dark); overflow: hidden; }
.agent__bar > span { display: block; height: 100%; background: var(--amber); }
.agent__score { font-family: var(--font-mono); font-size: .82rem; color: var(--paper-on-dark); min-width: 2.6em; text-align: right; }

/* Closed-loop pipeline / flow */
.flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.section--dark .flow { background: var(--line-on-dark); border-color: var(--line-on-dark); }
.flow__step { background: var(--surface); padding: 1.3rem 1.1rem; }
.section--dark .flow__step { background: var(--ink-panel-2); }
.flow__n { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .1em; color: var(--amber-deep); }
.section--dark .flow__n { color: var(--amber-bright); }
.flow__name { font-family: var(--font-serif); font-size: 1.12rem; margin-top: .45rem; line-height: 1.15; }
.flow__desc { font-size: .84rem; color: var(--ink-soft); margin-top: .45rem; }
.section--dark .flow__desc { color: var(--paper-on-dark); }
@media (max-width: 860px) { .flow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .flow { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------- Distribution */
.relationships { display: flex; flex-wrap: wrap; gap: .6rem; }
.rel { display: inline-flex; flex-direction: column; gap: .15rem; border: 1px solid var(--line); border-radius: var(--r-sm); padding: .7rem 1rem; background: var(--surface); }
.rel__name { font-family: var(--font-serif); font-size: 1.05rem; }
.rel__meta { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-muted); }

/* ------------------------------------------------------------- Trust wall */
.trust-wall { display: flex; flex-wrap: wrap; gap: .65rem; }
.badge { display: inline-flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .06em; padding: .5rem .85rem; border: 1px solid var(--line-strong); border-radius: 100px; color: var(--ink-soft); background: var(--surface); }
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--verdict); }
.section--dark .badge { border-color: var(--line-on-dark); color: var(--paper-on-dark); background: var(--ink-panel-2); }

/* --------------------------------------------------------------- Pullquote */
.pull { font-family: var(--font-serif); font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.4rem); line-height: 1.22; letter-spacing: -.015em; }
.pull cite { display: block; font-family: var(--font-mono); font-size: .78rem; font-style: normal; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-muted); margin-top: 1.2rem; }
.section--dark .pull cite { color: var(--muted-on-dark); }

/* ----------------------------------------------------------------- Compare */
.compare { width: 100%; border-collapse: collapse; font-size: .95rem; }
.compare th, .compare td { text-align: left; padding: .9rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); font-weight: 500; }
.compare td.legacy { color: var(--ink-muted); }
.compare td.us { color: var(--ink); font-weight: 500; }
.compare td.us::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); margin-right: .55rem; vertical-align: middle; }

/* ------------------------------------------------------------------ CTA band */
.cta-band { background: var(--ink-panel); color: #fff; border-radius: var(--r-lg); padding: clamp(2.5rem, 5vw, 4rem); text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: var(--paper-on-dark); }

/* ------------------------------------------------------------------- Footer */
.footer { background: var(--ink-panel); color: var(--paper-on-dark); padding-block: clamp(3rem, 6vw, 4.5rem) 2rem; }
.footer__grid { display: grid; grid-template-columns: 1.5fr repeat(3, 1fr); gap: 2rem; }
.footer h5 { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted-on-dark); font-weight: 500; margin-bottom: 1rem; }
.footer ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer a { color: var(--paper-on-dark); font-size: .92rem; transition: color .18s var(--ease); }
.footer a:hover { color: var(--amber-bright); }
.footer__brand .brand__name { color: #fff; }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--line-on-dark); font-size: .82rem; color: var(--muted-on-dark); }

/* ----------------------------------------------------------- Reveal (motion) */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* --------------------------------------------------------------- Responsive */
@media (max-width: 940px) {
  .split { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats--4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav__links { display: none; }
  .nav__links.open { display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; align-items: flex-start; gap: 1rem; padding: 1.25rem var(--pad-inline) 1.75rem; background: var(--paper); border-bottom: 1px solid var(--line); }
  .nav__toggle { display: inline-flex; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .stats--3 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; }
  .determination__value { font-size: 1.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
