/* EHRbase-rs landing page — design tokens + layout.
   docs/plans/w1-docs-website.md §3a (tokens) + §3b (sections).
   Self-contained: system font stack, no external assets, light/dark via
   prefers-color-scheme. Relative URLs only. */

:root {
  /* brand */
  --rs-rust: #b7410e;
  --rs-rust-600: #9a360b;
  --rs-umber: #5a2408;
  --rs-umber-050: #f6ede7;
  /* light theme */
  --rs-bg: #ffffff;
  --rs-surface: #faf7f5;
  --rs-text: #1b1613;
  --rs-muted: #6b605a;
  --rs-border: #e7ddd6;
  --rs-shadow: 0 1px 2px rgba(27, 22, 19, 0.06), 0 8px 24px rgba(27, 22, 19, 0.06);
  /* fonts */
  --rs-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --rs-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --rs-serif: Georgia, "Times New Roman", serif;
  /* layout */
  --rs-max: 1120px;
  --rs-radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --rs-bg: #14100e;
    --rs-surface: #1e1815;
    --rs-text: #f3ece8;
    --rs-muted: #b3a79f;
    --rs-border: #332822;
    --rs-rust: #e4712f;
    --rs-rust-600: #c85a1d;
    --rs-umber-050: #241812;
    --rs-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

a { color: var(--rs-rust); text-decoration: none; }
a:hover { color: var(--rs-rust-600); text-decoration: underline; }

img, svg { max-width: 100%; height: auto; }

.wrap {
  width: 100%;
  max-width: var(--rs-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--rs-bg) 82%, transparent);
  border-bottom: 1px solid var(--rs-border);
}
.nav .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--rs-text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand .tld { color: var(--rs-rust); }
.nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-links a { color: var(--rs-muted); }
.nav-links a:hover { color: var(--rs-rust); text-decoration: none; }
.nav-toggle { display: none; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.7rem 1.25rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  border: 1.5px solid transparent;
  transition: transform 0.06s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--rs-rust); color: #fff; }
.btn-primary:hover { background: var(--rs-rust-600); color: #fff; }
.btn-ghost { border-color: var(--rs-border); color: var(--rs-text); background: var(--rs-surface); }
.btn-ghost:hover { border-color: var(--rs-rust); color: var(--rs-rust); }

/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem);
  text-align: center;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 55% at 50% 0%, color-mix(in srgb, var(--rs-rust) 16%, transparent), transparent 70%),
    linear-gradient(180deg, var(--rs-umber-050), transparent 40%);
  pointer-events: none;
}
.hero > * { position: relative; }
.hero-logo { max-width: 460px; width: 80%; margin: 0 auto 1.75rem; display: block; }
.hero h1 {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.2;
  margin: 0 auto 1rem;
  max-width: 20ch;
  letter-spacing: -0.01em;
}
.hero .sub {
  color: var(--rs-muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
  max-width: 62ch;
  margin: 0 auto 2rem;
}
.hero-cta { display: flex; gap: 0.85rem; justify-content: center; flex-wrap: wrap; }
.hero .note { margin-top: 1.25rem; color: var(--rs-muted); font-size: 0.85rem; }

/* ── Section scaffolding ─────────────────────────────────────────────────── */
section { padding: clamp(3rem, 7vw, 5rem) 0; }
.section-head { text-align: center; max-width: 60ch; margin: 0 auto 2.5rem; }
.section-head h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
.section-head p { color: var(--rs-muted); margin: 0; font-size: 1.05rem; }
.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--rs-rust);
  margin-bottom: 0.5rem;
}

/* ── Conformance proof strip ─────────────────────────────────────────────── */
.proof { background: var(--rs-surface); border-block: 1px solid var(--rs-border); }
.proof-nums {
  display: flex;
  justify-content: center;
  gap: clamp(1.5rem, 6vw, 4rem);
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}
.proof-num { text-align: center; }
.proof-num .n {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1;
  color: var(--rs-rust);
  font-variant-numeric: tabular-nums;
}
.proof-num .n.zero { color: var(--rs-text); }
.proof-num .l { display: block; margin-top: 0.4rem; color: var(--rs-muted); font-size: 0.9rem; }
.proof-pills { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--rs-umber-050);
  border: 1px solid var(--rs-border);
  color: var(--rs-text);
}
.pill:hover { border-color: var(--rs-rust); text-decoration: none; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rs-rust); }

/* ── Feature grid ────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.1rem;
}
.card {
  background: var(--rs-surface);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius);
  padding: 1.5rem;
  transition: transform 0.1s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--rs-shadow); border-color: color-mix(in srgb, var(--rs-rust) 40%, var(--rs-border)); }
.card .ico {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--rs-umber-050);
  color: var(--rs-rust);
  margin-bottom: 0.9rem;
}
.card .ico svg { width: 22px; height: 22px; }
.card h3 { margin: 0 0 0.4rem; font-size: 1.08rem; }
.card p { margin: 0; color: var(--rs-muted); font-size: 0.95rem; }

/* ── Quick start ─────────────────────────────────────────────────────────── */
.quickstart { background: var(--rs-surface); border-block: 1px solid var(--rs-border); }
.code {
  max-width: 820px;
  margin: 0 auto;
  background: var(--rs-bg);
  border: 1px solid var(--rs-border);
  border-radius: var(--rs-radius);
  box-shadow: var(--rs-shadow);
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--rs-border);
  background: var(--rs-umber-050);
  font-size: 0.85rem;
  color: var(--rs-muted);
  font-weight: 600;
}
.code-head .lights { display: flex; gap: 0.35rem; }
.code-head .lights i { width: 11px; height: 11px; border-radius: 50%; background: var(--rs-border); display: inline-block; }
.code-head .lights i:first-child { background: var(--rs-rust); }
.code pre {
  margin: 0;
  padding: 1.25rem 1.35rem;
  overflow-x: auto;
  font-family: var(--rs-mono);
  font-size: 0.86rem;
  line-height: 1.7;
}
.code pre code { white-space: pre; }
.code .cmt { color: var(--rs-muted); }
.code .prompt { color: var(--rs-rust); font-weight: 700; }

/* ── Integration chips ───────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
.chip {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--rs-border);
  background: var(--rs-surface);
  color: var(--rs-muted);
  font-weight: 600;
  font-size: 0.92rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--rs-border);
  background: var(--rs-surface);
  padding: 3rem 0 2.5rem;
  font-size: 0.92rem;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand { max-width: 42ch; }
.footer-brand .brand { margin-bottom: 0.75rem; }
.footer-brand p { color: var(--rs-muted); margin: 0.35rem 0; }
.footer-links { display: flex; gap: 2.5rem; flex-wrap: wrap; }
.footer-links ul { list-style: none; margin: 0; padding: 0; }
.footer-links h4 { margin: 0 0 0.6rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--rs-text); }
.footer-links li { margin: 0.35rem 0; }
.footer-links a { color: var(--rs-muted); }
.footer-links a:hover { color: var(--rs-rust); }
.footer-note {
  margin-top: 2.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rs-border);
  color: var(--rs-muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  .nav-links { gap: 1rem; font-size: 0.9rem; }
  .nav-links .hide-sm { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; transition: none !important; }
}
