/* MedSeek site v3 - "Warm Clinical" light theme.
   Research-backed healthcare pattern: warm biome-white surfaces, deep teal
   anchors, trust signals in the hero, mono proof-artifacts, generous space.
   System stacks only; no webfonts, no analytics, no external requests. */

:root {
  /* surfaces */
  --paper: #F7F5F0;        /* warm paper page background */
  --surface: #FFFFFF;      /* cards */
  --surface-2: #EDF2EF;    /* tinted section fills, table headers */
  --code-bg: #10231F;      /* recessed proof artifacts (deep teal-black) */
  /* lines */
  --border: #E3E8E4;
  --border-strong: #C9D4CF;
  /* text */
  --ink: #1E2B28;          /* headings + body primary */
  --text-2: #4E5F5A;       /* secondary copy */
  --text-3: #5F716B;       /* metadata, captions */
  /* accent + semantics */
  --accent: #0F766E;       /* links, eyebrows, active nav */
  --accent-deep: #0B5A54;  /* primary button fill */
  --on-accent: #FFFFFF;    /* text on accent fills */
  --accent-tint: #E7F0ED;  /* chips, soft fills */
  --warn-bg: #FBF3E0;
  --warn-border: #D9A441;
  --warn-lead: #7A4E0D;
  --gate-red: #B42318;
  --ok: #067647;
  /* type */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: Charter, "Bitstream Charter", Georgia, Cambria, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  /* elevation */
  --shadow-card: 0 1px 2px rgba(30, 60, 52, 0.05);
  --shadow-hover: 0 12px 32px rgba(30, 60, 52, 0.10);
  --shadow-nav: 0 1px 0 var(--border);
  /* motion */
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

html { font-size: 16px; scroll-behavior: smooth; }

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

/* ---------- layout shell ---------- */
.shell {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 16px;
}
@media (min-width: 768px) { .shell { padding-inline: 24px; } }

main { display: block; padding-block: 48px 96px; }
main.with-hero { padding-top: 0; }
html, body { overflow-x: clip; }
.section { padding-block: 32px 0; }
@media (min-width: 768px) { .section { padding-block: 48px 0; } }
@media (min-width: 1024px) { .section { padding-block: 88px 0; } main { padding-block: 56px 112px; } }

.measure { max-width: 68ch; }

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; z-index: 100;
  background: var(--surface); color: var(--ink);
  padding: 8px 16px; border-radius: 8px;
  box-shadow: var(--shadow-hover);
}
.skip:focus { left: 16px; top: 16px; outline: 2px solid var(--accent); outline-offset: 2px; }

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

/* ---------- typography ---------- */
h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  line-height: 1.08; letter-spacing: -0.015em;
}
h2 { font-size: 1.75rem; line-height: 1.25; letter-spacing: -0.015em; }
h3 { font-size: 1.125rem; line-height: 1.35; }
p { margin: 0 0 1rem; }
.lede { color: var(--text-2); font-size: 1.125rem; max-width: 62ch; }
.small { font-size: 0.875rem; line-height: 1.55; color: var(--text-3); }
code, pre, .mono { font-family: var(--mono); }
code.inline {
  background: var(--accent-tint); border: 1px solid var(--border);
  border-radius: 6px; padding: 0.08em 0.35em; font-size: 0.9em; color: var(--ink);
}

.eyebrow {
  display: block;
  font-size: 0.75rem; line-height: 1; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

/* section header pattern */
.section-header { margin-bottom: 24px; }
.section-header h2 { margin-bottom: 8px; }
.section-header .lede { margin-bottom: 0; }
.centered { text-align: center; }
.centered .lede { margin-inline: auto; }

/* ---------- links ---------- */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- nav ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(247, 245, 240, 0.88);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--ink); font-weight: 600; font-size: 15px;
  text-decoration: none; flex-shrink: 0;
}
.brand svg { display: block; }
.nav-links {
  display: flex; align-items: center; gap: 4px;
  margin-left: auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none;
}
.two-col > *, .compare-grid > * { min-width: 0; }
.host-list li, .measure, .acc-body p { overflow-wrap: anywhere; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  color: var(--text-2); font-size: 0.9rem;
  padding: 8px 10px; border-radius: 8px;
  white-space: nowrap; text-decoration: none;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); }
.nav-links a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.nav-cta { margin-left: 8px; flex-shrink: 0; }
@media (max-width: 767px) { .nav-links { min-width: 0; } .nav-inner { flex-wrap: nowrap; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 8px; padding: 10px 18px;
  font: inherit; font-size: 0.95rem; font-weight: 500;
  text-decoration: none; cursor: pointer;
  transition: background-color 150ms var(--ease), border-color 150ms var(--ease),
              color 150ms var(--ease), transform 150ms var(--ease),
              box-shadow 150ms var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-primary {
  background: var(--accent-deep); color: var(--on-accent);
  border: 1px solid var(--accent-deep);
}
.btn-primary:hover {
  background: #094A45; text-decoration: none;
  box-shadow: 0 6px 18px rgba(11, 90, 84, 0.25);
}
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-sm { padding: 7px 14px; font-size: 0.85rem; border-radius: 8px; }
.btn-ghost {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.btn-ghost .arrow { transition: transform 150ms var(--ease); }
.btn-ghost:hover .arrow { transform: translateX(2px); }

/* ---------- hero ---------- */
.hero {
  text-align: center;
  padding-block: 64px 24px;
  background:
    radial-gradient(60% 55% at 50% 0%, rgba(15, 118, 110, 0.08), transparent 72%);
  /* full-bleed: escape the shell to the viewport edges at every width */
  margin-inline: calc(50% - 50vw);
  padding-inline: calc(50vw - 50%);
}
.hero h1 { max-width: 24ch; margin: 0 auto 20px; }
.hero .lede { margin: 0 auto 32px; }
.hero-actions {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  margin-bottom: 8px;
}
@media (min-width: 640px) { .hero-actions { flex-direction: row; justify-content: center; } }
.hero .small { margin-top: 4px; }
.trust-chips {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: 20px;
}

/* ---------- command bar (dark recessed proof panel) ---------- */
.command-bar {
  display: flex; align-items: center; gap: 12px;
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: var(--mono); font-size: 1rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 150ms var(--ease), transform 150ms var(--ease);
}
.command-bar:hover { box-shadow: var(--shadow-hover); }
.command-bar .prompt { color: #2DD4BF; user-select: none; }
.command-bar code {
  flex: 1; min-width: 0; overflow-wrap: anywhere;
  color: #E6F2EF; background: none; border: 0; padding: 0;
  font-size: 0.95rem;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255, 255, 255, 0.08); color: #CFE5E1;
  border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 8px;
  padding: 6px 10px; cursor: pointer;
  font: inherit; font-size: 0.8rem;
  transition: color 200ms var(--ease), border-color 200ms var(--ease), background-color 200ms var(--ease);
}
.copy-btn:hover { color: #FFFFFF; border-color: rgba(255, 255, 255, 0.35); }
.copy-btn:focus-visible { outline: 2px solid #2DD4BF; outline-offset: 2px; }
.copy-btn.copied { color: #34D399; border-color: #34D399; }
.command-bar.inline-sm { font-size: 0.9rem; padding: 10px 12px; }

/* ---------- trust chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 6px 14px; font-size: 0.85rem;
}
.chip svg { color: var(--ok); flex-shrink: 0; }

/* ---------- cards ---------- */
.cards {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin: 0;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms var(--ease), box-shadow 150ms var(--ease),
              transform 150ms var(--ease);
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card .icon {
  box-sizing: content-box;
  display: block; width: 20px; height: 20px;
  padding: 10px; border-radius: 10px;
  background: var(--accent-tint); color: var(--accent);
  margin-bottom: 16px;
}
.card h2, .card h3 { margin-bottom: 8px; }
.card p { margin: 0; color: var(--text-2); font-size: 0.95rem; }

/* ---------- eval strip ---------- */
.eval-strip {
  background: var(--surface-2);
  border-block: 1px solid var(--border);
  margin-block: 64px;
  padding-block: 56px;
}
.stats {
  display: grid; gap: 32px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  text-align: center;
}
.stat .num {
  font-family: var(--serif); font-variant-numeric: tabular-nums;
  font-size: 3rem; font-weight: 400; line-height: 1;
  color: var(--accent); display: block; margin-bottom: 8px;
}
.stat .label { font-size: 0.875rem; color: var(--text-2); }
.strip-foot {
  margin-top: 32px; text-align: center;
  font-size: 0.875rem; color: var(--text-3);
}
.strip-foot a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.strip-foot a:hover { color: var(--accent); }

/* ---------- two column ---------- */
.two-col { display: grid; gap: 32px; align-items: start; }
@media (min-width: 1024px) { .two-col { grid-template-columns: 1fr 1fr; gap: 56px; } }

/* ---------- gate diagram ---------- */
.gate-diagram {
  display: grid; gap: 16px; margin: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  box-shadow: var(--shadow-card);
}
.gate-state {
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: 8px; padding: 12px 16px;
  font-family: var(--mono); font-size: 0.9rem; color: var(--text-2);
  background: var(--paper);
}
.gate-state.blocked { border-color: var(--gate-red); background: #FDF0EE; }
.gate-state.blocked s { color: var(--gate-red); }
.gate-state.passed { border-color: var(--ok); background: #EDF7F1; }
.gate-state.passed em { color: var(--ok); font-style: normal; }
.gate-arrow { color: var(--accent); text-align: center; font-size: 1.25rem; line-height: 1; }
@media (min-width: 640px) {
  .gate-diagram { grid-template-columns: 1fr auto 1fr; align-items: center; }
}

/* ---------- mono host list ---------- */
.host-list {
  font-family: var(--mono); font-size: 0.9rem; line-height: 1.7;
  background: var(--code-bg); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 20px; margin: 0 0 1rem;
  list-style: none; color: #CFE5E1;
  box-shadow: var(--shadow-card);
}
.host-list li::before { content: "· "; color: #2DD4BF; }

/* ---------- proof artifact panels (dark recessed on light page) ---------- */
.artifact {
  background: var(--code-bg); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px; padding: 20px; margin: 0 0 1.5rem;
  overflow-x: auto;
  box-shadow: var(--shadow-card);
}
.artifact pre {
  margin: 0; background: none; padding: 0;
  font-size: 0.9rem; line-height: 1.65; color: #E6F2EF;
}
.prose-block { margin-bottom: 2rem; }

/* ---------- callouts ---------- */
.notice, .callout-warn {
  background: var(--warn-bg); color: var(--ink);
  border: 1px solid var(--warn-border); border-radius: 14px;
  padding: 18px 20px; margin: 0 0 1.5rem;
}
.notice strong:first-child, .callout-warn strong:first-child { color: var(--warn-lead); }
.callout-note {
  background: var(--surface); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 20px; margin: 0 0 1.5rem;
  box-shadow: var(--shadow-card);
}

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0; }
th, td { border-bottom: 1px solid var(--border); padding: 12px 14px; text-align: left; vertical-align: top; }
thead th {
  background: var(--surface-2); color: var(--ink);
  font-weight: 600; border-bottom: 1px solid var(--border-strong);
}
tbody tr:hover { background: #F4F8F6; }
td.mono-num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* compare specifics */
.compare-scroll td:first-child, .compare-scroll th:first-child {
  position: sticky; left: 0; background: var(--surface); z-index: 2;
  border-right: 1px solid var(--border);
}
.compare-scroll thead th:first-child { background: var(--surface-2); z-index: 3; }
.compare-scroll td:nth-child(2), .compare-scroll th:nth-child(2) {
  background: var(--accent-tint);
  border-top: 1px solid var(--accent);
}
.compare-scroll tbody tr:hover td:nth-child(2) { background: #DBEBE7; }
.compare-grid { display: grid; gap: 32px; }
@media (min-width: 1280px) {
  .compare-grid { grid-template-columns: minmax(0, 1fr) 280px; align-items: start; }
  .compare-aside { position: sticky; top: 88px; }
}

/* ---------- accordion ---------- */
details.acc {
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  transition: border-color 150ms var(--ease);
}
details.acc[open] { border-color: var(--border-strong); }
details.acc > summary {
  list-style: none; cursor: pointer;
  padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: 1.05rem; font-weight: 600; color: var(--ink);
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary .chev { color: var(--text-3); transition: transform 150ms var(--ease); flex-shrink: 0; }
details.acc[open] > summary .chev { transform: rotate(90deg); color: var(--accent); }
details.acc .acc-body { color: var(--text-2); padding: 0 20px 18px; max-width: 68ch; }

/* ---------- pills / chips ---------- */
.pill {
  display: inline-block; border-radius: 999px;
  padding: 4px 10px; font-size: 0.8rem;
  background: var(--accent-tint); color: var(--accent);
  border: 1px solid transparent;
}
.pill-neutral { background: var(--surface-2); color: var(--text-2); border-color: var(--border); }

/* ---------- install timeline ---------- */
.timeline {
  list-style: none; margin: 0 0 1.5rem; padding: 0 0 0 28px;
  border-left: 2px solid var(--accent-tint);
}
.timeline li { position: relative; margin: 0 0 16px; padding-left: 4px; }
.timeline li::before {
  content: counter(tl, decimal-leading-zero);
  counter-increment: tl;
  position: absolute; left: -28px; top: 1px;
  font-family: var(--mono); font-size: 0.8rem; color: var(--accent);
  background: var(--paper); padding-block: 2px;
}
.timeline { counter-reset: tl; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--border);
  padding-block: 28px; color: var(--text-3); font-size: 0.875rem;
  background: var(--surface);
}
.footer-inner { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 1024px) {
  .footer-inner { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 24px; }
}
.footer-inner span a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.footer-inner span a:hover { color: var(--ink); }

/* ---------- lists ---------- */
ul, ol { padding-left: 1.25rem; }
li { margin: 0.35rem 0; }
li::marker { color: var(--accent); }

/* ---------- motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* one-time hero fade-up (hero only, per spec) */
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.fade-up > * { animation: fade-up 400ms var(--ease) both; }
.fade-up > *:nth-child(2) { animation-delay: 70ms; }
.fade-up > *:nth-child(3) { animation-delay: 140ms; }
.fade-up > *:nth-child(4) { animation-delay: 210ms; }
@media (prefers-reduced-motion: reduce) { .fade-up > * { animation: none; } }

/* narrow reading column for article-style pages */
.shell.narrow { max-width: 820px; }

/* docs hub link cards */
a.doc-link { display: block; text-decoration: none; color: inherit; }
a.doc-link h3 { color: var(--ink); transition: color 150ms var(--ease); }
a.doc-link:hover h3 { color: var(--accent); }
a.doc-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- mobile burger (no JS: native details/summary) ---------- */
.nav-mobile { display: none; }
@media (max-width: 767px) {
  .nav-links { display: none; }
  .nav-mobile { display: block; margin-left: auto; }
  .nav-mobile summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 8px;
    border: 1px solid var(--border-strong); color: var(--ink);
  }
  .nav-mobile summary::-webkit-details-marker { display: none; }
  .nav-mobile summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .nav-mobile summary svg line { transition: transform 150ms var(--ease), opacity 150ms var(--ease); transform-origin: 12px 12px; }
  .nav-mobile details[open] .b1 { transform: translateY(4.5px) rotate(45deg); }
  .nav-mobile details[open] .b3 { transform: translateY(-4.5px) rotate(-45deg); }
  .nav-mobile details[open] .b2 { opacity: 0; }
  .menu-panel {
    /* anchored to the sticky nav bar (nearest positioned ancestor), so the
       panel spans the full bar width instead of the burger button */
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: var(--paper);
    border: 1px solid var(--border); border-radius: 12px;
    box-shadow: var(--shadow-hover);
    padding: 8px; z-index: 60;
  }
  .menu-panel a {
    display: block; padding: 12px 14px; border-radius: 8px;
    color: var(--text-2); font-size: 0.95rem; text-decoration: none;
  }
  .menu-panel a:hover { background: var(--surface-2); color: var(--ink); }
  .menu-panel a[aria-current="page"] {
    color: var(--ink); background: var(--accent-tint);
    border-left: 2px solid var(--accent);
  }
}
