/* ==========================================================================
   CareScribeAI — hand-authored pages (Knowledge Hub + articles)
   Reuses the design system's class vocabulary (nav, .hero, .sec, footer, ...)
   so assets/site.css responsive rules apply automatically.
   ========================================================================== */

:root {
  --primary: #0f2744;
  --p: #0f2744;
  --accent: #0ea5c9;
  --a: #0ea5c9;
  --accent-dark: #0284a8;
  --accent-tint: #e6f4fe;
  --at: #e6f4fe;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --bdr: #e2e8f0;
  --bg: #ffffff;
  --surface: #f8fafc;
  --surf: #f8fafc;
  --card-shadow: 0 1px 4px rgba(15, 39, 68, 0.08), 0 4px 16px rgba(15, 39, 68, 0.06);
  --r-md: 10px;
  --r-lg: 16px;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --font: Inter, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---- Nav (mirrors platform.html) ---- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 80px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-mark {
  width: 34px;
  height: 34px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo-text {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
}
.logo-text span {
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}
.nl {
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  transition: color 0.15s;
}
.nl:hover,
.nl.on {
  color: var(--accent);
}
.nav-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 9px 22px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0a1c36 55%, #071428 100%);
  padding: 72px 80px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 80% at 78% 50%, rgba(14, 165, 201, 0.14) 0%, transparent 70%);
  pointer-events: none;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 165, 201, 0.15);
  border: 1px solid rgba(14, 165, 201, 0.3);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 46px;
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  max-width: 760px;
  margin-bottom: 18px;
  letter-spacing: -1px;
}
.hero h1 span {
  color: var(--accent);
}
.hero p {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 620px;
  line-height: 1.7;
}

/* ---- Generic section ---- */
.sec {
  padding: 72px 80px;
  border-bottom: 1px solid var(--border);
}
.sec.alt {
  background: var(--surface);
}
.sec-head {
  margin-bottom: 36px;
}
.sec-head h2 {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 10px;
}
.sec-head p {
  font-size: 15px;
  color: var(--body);
  max-width: 640px;
  line-height: 1.7;
}

/* ==========================================================================
   Knowledge Hub
   ========================================================================== */
.featured {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: #fff;
}
.featured-body {
  padding: 40px;
}
.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-tint);
  color: var(--accent);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.featured-body h3 {
  font-size: 27px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.22;
  margin-bottom: 14px;
}
.featured-body p {
  font-size: 14px;
  color: var(--body);
  line-height: 1.7;
  margin-bottom: 20px;
}
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 26px;
}
.tag {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 600;
}
.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 700;
}
.featured-aside {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3a5c 100%);
  padding: 40px;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}
.featured-aside .k {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.stat-row {
  display: flex;
  gap: 28px;
}
.stat .v {
  font-size: 30px;
  font-weight: 800;
  color: #fff;
}
.stat .v span {
  color: var(--accent);
}
.stat .l {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}
.aside-note {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.6;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.topic {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 26px;
  box-shadow: var(--card-shadow);
}
.topic-ic {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--accent-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.topic h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}
.topic p {
  font-size: 13px;
  color: var(--body);
  line-height: 1.6;
}

/* ==========================================================================
   White paper / article
   ========================================================================== */
.paper-hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0a1c36 55%, #071428 100%);
  padding: 60px 80px 52px;
  position: relative;
  overflow: hidden;
}
.paper-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 50% 80% at 80% 40%, rgba(14, 165, 201, 0.14) 0%, transparent 70%);
  pointer-events: none;
}
.paper-hero-inner {
  max-width: 860px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.crumb {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 20px;
}
.crumb a {
  color: var(--accent);
}
.paper-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.paper-hero h1 {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.5px;
  margin-bottom: 14px;
}
.paper-hero .sub {
  font-size: 17px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
  margin-bottom: 28px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 14px 40px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding-top: 22px;
}
.meta .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 3px;
}
.meta .v {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}

.paper {
  max-width: 860px;
  margin: 0 auto;
  padding: 56px 80px 72px;
}
.paper section {
  margin-bottom: 44px;
  scroll-margin-top: 84px;
}
.paper h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-tint);
}
.paper h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin: 24px 0 10px;
}
.paper p {
  font-size: 15.5px;
  color: var(--body);
  line-height: 1.8;
  margin-bottom: 16px;
}
.paper ul,
.paper ol {
  margin: 0 0 16px 22px;
}
.paper li {
  font-size: 15.5px;
  color: var(--body);
  line-height: 1.75;
  margin-bottom: 8px;
}
.paper strong {
  color: var(--ink);
}
.paper .lead {
  font-size: 17px;
  color: var(--ink);
  line-height: 1.75;
}

/* Inline code + display formulas */
.paper code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.87em;
  background: var(--accent-tint);
  color: var(--accent-dark);
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.paper .formula {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 14px 18px;
  margin: 6px 0 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  overflow-x: auto;
}
.paper .formula .op {
  color: var(--muted);
}

/* Abstract block */
.abstract {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 26px 30px;
  margin-bottom: 40px;
}
.abstract .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.abstract p {
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 12px;
}
.abstract .keywords {
  font-size: 13px;
  color: var(--muted);
}

/* Table of contents */
.toc {
  /* Reset in case the element is a <nav> (avoids inheriting navbar layout). */
  position: static;
  height: auto;
  display: block;
  backdrop-filter: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 26px;
  margin-bottom: 40px;
  box-shadow: var(--card-shadow);
}
.toc .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.toc ol {
  columns: 2;
  column-gap: 40px;
  margin-left: 18px;
}
.toc li {
  margin-bottom: 8px;
  font-size: 14px;
}
.toc a {
  color: var(--body);
}
.toc a:hover {
  color: var(--accent);
}

/* Callout box */
.callout {
  background: linear-gradient(135deg, var(--primary) 0%, #1a3a5c 100%);
  border-radius: 14px;
  padding: 26px 30px;
  margin: 28px 0;
}
.callout .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.callout p {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 0;
}
.callout.amber {
  background: #fffbeb;
  border: 1px solid #fde68a;
}
.callout.amber .k {
  color: #b45309;
}
.callout.amber p {
  color: #92400e;
}

/* Tables */
.paper table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  margin: 8px 0 12px;
  font-size: 13.5px;
}
.paper thead th {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
}
.paper tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--body);
  vertical-align: top;
}
.paper tbody tr:nth-child(even) {
  background: var(--surface);
}
.paper tbody tr:last-child td {
  border-bottom: none;
}
.paper .caption {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.6;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 5px;
  padding: 2px 8px;
}
.b-pass {
  background: #dcfce7;
  color: #065f46;
}
.b-warn {
  background: #fef3c7;
  color: #92400e;
}
.b-fail {
  background: #ffe4e6;
  color: #be123c;
}

/* Score-evolution mini card */
.score-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}
.score-card .state {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}
.score-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--body);
  padding: 6px 0;
  border-bottom: 1px solid var(--surface);
}
.score-total {
  margin-top: 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
}

/* References */
.refs {
  list-style: none;
  margin-left: 0 !important;
  counter-reset: ref;
}
.refs li {
  counter-increment: ref;
  position: relative;
  padding-left: 30px;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.6;
}
.refs li::before {
  content: counter(ref) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--accent);
}
.refs a {
  color: var(--accent);
  word-break: break-word;
}

/* Footer (mirrors platform.html) */
footer {
  background: var(--primary);
  padding: 48px 80px 28px;
}
.f-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}
.f-brand {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.f-brand span {
  color: var(--accent);
}
.f-tag {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  max-width: 260px;
}
.f-col-h {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.fl {
  display: block;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  transition: color 0.15s;
}
.fl:hover {
  color: #fff;
}
.f-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
}
.f-copy,
.f-him {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
}
.f-him span {
  color: var(--accent);
}

/* ==========================================================================
   Get Started / intake landing
   ========================================================================== */
.intake-hero {
  text-align: center;
  padding-bottom: 56px;
}
.intake-hero p {
  max-width: 560px;
  margin: 0 auto;
}
.intake-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.plan-pick {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-option {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: var(--card-shadow);
}
.plan-option:hover {
  border-color: rgba(14, 165, 201, 0.45);
}
.plan-option.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 201, 0.15);
}
.plan-option-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.plan-option-name {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}
.plan-option-price {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}
.plan-option-desc {
  font-size: 13px;
  color: var(--body);
  line-height: 1.55;
}
.plan-option-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.intake-form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 32px;
  box-shadow: var(--card-shadow);
}
.intake-form-card h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.intake-form-card .sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.6;
}
.field {
  margin-bottom: 16px;
}
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--ink);
  background: #fff;
}
.field textarea {
  min-height: 88px;
  resize: vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 201, 0.12);
}
.submit-btn {
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.submit-btn:hover {
  background: var(--accent-dark);
}
.intake-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.55;
  text-align: center;
}
.intake-note a {
  color: var(--accent);
  font-weight: 600;
}
.intake-success {
  text-align: center;
  padding: 24px 8px 8px;
}
.intake-success .success-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #dcfce7;
  color: #059669;
  font-size: 26px;
  font-weight: 800;
  line-height: 52px;
}
.intake-success p {
  font-size: 15px;
  color: var(--body);
  line-height: 1.65;
}
.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 48px;
}
.trust-item {
  text-align: center;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.trust-item .t {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}
.trust-item .d {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 820px) {
  .intake-grid,
  .trust-strip {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Product demo page
   ========================================================================== */
.demo-sec {
  padding-left: clamp(20px, 3vw, 40px);
  padding-right: clamp(20px, 3vw, 40px);
}
.demo-stage {
  width: 100%;
  max-width: none;
  margin: 0;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  line-height: 0;
  background: #f7f9fb;
  border: 1px solid var(--border);
}
.demo-iframe {
  width: 100%;
  height: 720px;
  min-height: 480px;
  border: 0;
  display: block;
  overflow: hidden;
}
.demo-notes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
  width: 100%;
  max-width: none;
}
.demo-note {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.demo-note .k {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.demo-note p {
  font-size: 14px;
  color: var(--body);
  line-height: 1.65;
}
.demo-cta .sec-head {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.demo-cta .sec-head p {
  margin-left: auto;
  margin-right: auto;
}
.demo-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 8px;
}
.cta-primary,
.cta-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
}
.cta-primary {
  background: var(--accent);
  color: #fff;
}
.cta-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--border);
}

@media (max-width: 820px) {
  .demo-notes {
    grid-template-columns: 1fr !important;
  }
  .demo-iframe {
    height: 640px;
    min-height: 480px;
  }
}

@media (max-width: 1080px) {
  .demo-sec {
    padding-left: clamp(16px, 4vw, 32px) !important;
    padding-right: clamp(16px, 4vw, 32px) !important;
  }
}

@media (max-width: 820px) {
  .featured,
  .topic-grid,
  .meta-grid {
    grid-template-columns: 1fr !important;
  }
  .toc ol {
    columns: 1;
  }
  .paper {
    padding-left: 22px !important;
    padding-right: 22px !important;
  }
  .paper-hero,
  .paper-hero-inner {
    padding-left: 0;
  }
  .paper-hero {
    padding: 44px 22px !important;
  }
  .paper-hero h1 {
    font-size: 27px !important;
  }
}
