/* Quill Health — landing.
   Identity: clinical-document heritage (serif wordmark) meets a calm, modern
   healthcare SaaS interface (system sans). One confident accent — clinical teal —
   plus a verdict palette (affirm / conditional / review) that recurs as the
   product's signature. Deliberately restrained: the proof card is the hero. */

:root {
  --ink: #0d1b2a;          /* deep ink-navy — primary text & brand */
  --ink-2: #33475b;        /* secondary text */
  --muted: #6b7a8d;        /* tertiary */
  --line: #e3e8ee;         /* hairlines */
  --line-2: #eef2f6;
  --paper: #ffffff;        /* surfaces */
  --bg: #f5f8fb;           /* page */
  --bg-2: #eef3f8;

  --teal: #0e8f88;         /* primary accent / CTA */
  --teal-ink: #0a6f6a;     /* hover */
  --teal-wash: #e6f4f2;

  --affirm: #0e9f6e;
  --affirm-wash: #e5f6ee;
  --conditional: #b7791f;
  --conditional-wash: #fbf1de;
  --review: #cf3b30;
  --review-wash: #fce9e7;

  --shadow-sm: 0 1px 2px rgba(13, 27, 42, .06), 0 1px 3px rgba(13, 27, 42, .04);
  --shadow-md: 0 8px 24px rgba(13, 27, 42, .08), 0 2px 6px rgba(13, 27, 42, .05);
  --shadow-lg: 0 24px 60px rgba(13, 27, 42, .14);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 12px;
  --maxw: 1140px;
}

* { box-sizing: border-box; }
/* The hidden attribute must always win — author display rules (.modal-scrim grid,
   #auth-form label block, etc.) otherwise override the UA [hidden] rule, which would
   render modals on load and show register-only fields in login mode. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.skip {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip:focus { left: 0; }

a { color: var(--teal-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; color: var(--teal-ink); }

/* --- nav --- */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(245, 248, 251, .82);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.nib {
  display: grid; place-items: center; width: 34px; height: 34px;
  color: #fff; background: linear-gradient(150deg, var(--ink), var(--teal-ink));
  border-radius: 9px; box-shadow: var(--shadow-sm);
}
.wordmark {
  font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: .01em;
}
.wordmark .dot { color: var(--teal); margin: 0 1px; }
.wordmark .health { color: var(--ink-2); font-weight: 500; }
.wordmark.small { font-size: 18px; }

.nav-links { display: flex; gap: 24px; margin-left: auto; }
.nav-links a { color: var(--ink-2); font-size: 15px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-cta { display: flex; gap: 10px; }
.nav-toggle { display: none; }

/* --- buttons --- */
.btn {
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  border-radius: 9px; padding: 9px 16px; border: 1px solid transparent;
  transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.solid { background: var(--teal); color: #fff; box-shadow: var(--shadow-sm); }
.btn.solid:hover { background: var(--teal-ink); text-decoration: none; }
.btn.ghost { background: var(--paper); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--muted); text-decoration: none; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 10px; }
.btn.full { width: 100%; }
.btn.on-dark { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn.on-dark:hover { background: rgba(255,255,255,.1); }
.linkbtn {
  background: none; border: none; color: var(--teal-ink); font: inherit;
  font-weight: 600; cursor: pointer; padding: 0; text-decoration: underline;
}

/* --- hero --- */
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em; font-size: 12.5px;
  font-weight: 700; color: var(--teal-ink); margin: 0 0 14px;
}
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) clamp(16px, 4vw, 40px);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 64px);
  align-items: center;
}
.hero-copy h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(34px, 5vw, 54px); line-height: 1.08; letter-spacing: -.01em;
  margin: 0 0 20px;
}
.lede { font-size: clamp(16px, 1.6vw, 18.5px); color: var(--ink-2); margin: 0 0 28px; max-width: 34em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }
.hero-note { margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* signature proof card */
.proof {
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.proof-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  font-size: 13px; color: var(--muted); background: var(--bg-2);
}
.proof-body { padding: 18px 18px 8px; }
.pline {
  font-size: 14.5px; margin: 0 0 12px; color: var(--ink);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pline mark { background: var(--affirm-wash); color: #0a6f4c; padding: 1px 5px; border-radius: 4px; }
.pline mark.bad { background: var(--review-wash); color: #a3251c; }
.pline.flagged { color: var(--review); }
.chip {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; font-weight: 600; color: var(--teal-ink);
  background: var(--teal-wash); border: 1px solid #cfe8e5;
  padding: 1px 7px; border-radius: 20px;
}
.chip-x {
  font-size: 12px; font-weight: 600; color: #a3251c;
  background: var(--review-wash); border: 1px solid #f3cfca;
  padding: 1px 8px; border-radius: 20px;
}
.proof-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-top: 1px solid var(--line-2);
  font-size: 12.5px; color: var(--muted); background: var(--bg-2);
}
.verdict-pill {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; font-weight: 700; padding: 4px 11px; border-radius: 20px;
}
.verdict-pill.affirm { color: #0a6f4c; background: var(--affirm-wash); }
.verdict-pill .tick { width: 8px; height: 8px; border-radius: 50%; background: var(--affirm); }

/* --- trust strip --- */
.trust {
  max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(16px,4vw,40px) 12px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.trust div {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.trust b { display: block; font-family: var(--serif); font-size: 30px; color: var(--teal-ink); }
.trust span { font-size: 13.5px; color: var(--muted); }

/* --- sections --- */
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(48px,7vw,88px) clamp(16px,4vw,40px); }
.section.alt { max-width: none; background: var(--paper); border-block: 1px solid var(--line); }
.section.alt > * { max-width: var(--maxw); margin-inline: auto; }
.section-head { max-width: 42em; margin-bottom: 40px; }
.section-head h2 {
  font-family: var(--serif); font-weight: 600; font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.14; margin: 0 0 12px; letter-spacing: -.01em;
}
.section-sub { font-size: 17px; color: var(--ink-2); margin: 0; }

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; box-shadow: var(--shadow-sm); position: relative;
  transition: box-shadow .18s ease, transform .18s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-k {
  font-family: ui-monospace, monospace; font-size: 13px; font-weight: 700;
  color: var(--teal); letter-spacing: .05em;
}
.card h3 { font-size: 19px; margin: 10px 0 8px; }
.card p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* --- flow --- */
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4,1fr); gap: 18px; counter-reset: step; }
.flow li {
  position: relative; padding: 22px; background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.flow-n { color: var(--teal); font-weight: 800; font-size: 18px; }
.flow b { display: block; margin: 6px 0 6px; font-size: 17px; }
.flow p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* --- pricing --- */
.plans { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.plans-loading { color: var(--muted); grid-column: 1 / -1; }
.plan {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 22px; display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}
.plan.featured { border-color: var(--teal); box-shadow: 0 12px 32px rgba(14,143,136,.16); position: relative; }
.plan.featured::before {
  content: "Most common"; position: absolute; top: -11px; left: 22px;
  background: var(--teal); color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; letter-spacing: .03em;
}
.plan-name { font-size: 15px; font-weight: 700; color: var(--ink); min-height: 42px; }
.plan-price { font-family: var(--serif); font-size: 34px; margin: 12px 0 2px; }
.plan-price small { font-size: 15px; color: var(--muted); font-family: var(--sans); }
.plan-blurb { font-size: 13.5px; color: var(--muted); margin: 8px 0 18px; flex: 1; }
.plan .btn { margin-top: auto; }
.plans-foot { margin-top: 22px; color: var(--muted); font-size: 14px; text-align: center; }

/* --- cta band --- */
.cta-band {
  background: linear-gradient(150deg, var(--ink), #0a3f47 70%, var(--teal-ink));
  color: #fff; text-align: center; padding: clamp(48px,7vw,84px) 20px;
}
.cta-band h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(26px,3.4vw,36px); margin: 0 0 10px; }
.cta-band p { color: rgba(255,255,255,.8); margin: 0 0 26px; font-size: 17px; }

/* --- footer --- */
.foot {
  max-width: var(--maxw); margin: 0 auto; padding: 48px clamp(16px,4vw,40px);
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; border-top: 1px solid var(--line);
}
.foot-brand p { color: var(--muted); font-size: 14px; max-width: 34em; margin: 12px 0 0; }
.foot-links { display: flex; gap: 48px; }
.foot-links h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin: 0 0 12px; }
.foot-links a, .foot-links span { display: block; color: var(--ink-2); font-size: 14px; margin-bottom: 8px; }
.foot-legal { grid-column: 1 / -1; color: var(--muted); font-size: 13px; margin: 20px 0 0; border-top: 1px solid var(--line-2); padding-top: 18px; }

/* --- auth modal --- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(13,27,42,.5);
  display: grid; place-items: center; z-index: 60; padding: 20px;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--paper); border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 420px; padding: 32px; position: relative;
}
.modal-x { position: absolute; top: 14px; right: 16px; background: none; border: none; font-size: 26px; line-height: 1; color: var(--muted); cursor: pointer; }
.modal h2 { font-family: var(--serif); font-weight: 600; font-size: 26px; margin: 0 0 6px; }
.modal-sub { color: var(--muted); font-size: 14.5px; margin: 0 0 22px; }
#auth-form label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 14px; }
#auth-form input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px; font: inherit;
  border: 1px solid var(--line); border-radius: 9px; background: var(--bg);
}
#auth-form input:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); background: #fff; }
.auth-error { background: var(--review-wash); color: #a3251c; padding: 10px 12px; border-radius: 8px; font-size: 14px; margin: 0 0 14px; }
.auth-switch { text-align: center; margin: 18px 0 0; font-size: 14px; color: var(--muted); }

/* --- focus visibility (a11y) --- */
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

/* --- responsive --- */
@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; }
  .proof { max-width: 480px; }
  .cards, .plans { grid-template-columns: repeat(2, 1fr); }
  .flow { grid-template-columns: repeat(2, 1fr); }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line); padding: 16px 24px; gap: 16px;
  }
  .nav-toggle {
    display: flex; flex-direction: column; gap: 5px; margin-left: auto;
    background: none; border: none; cursor: pointer; padding: 6px;
  }
  .nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }
  .nav-cta { display: none; }
}
@media (max-width: 560px) {
  .cards, .plans, .flow, .trust, .foot { grid-template-columns: 1fr; }
  .foot-links { flex-direction: column; gap: 24px; }
  .hero-copy h1 { font-size: 32px; }
}
