/* =========================================================================
   ClinicPulse — shared design tokens
   Source of truth: .claude/skills/clinicpulse/templates/report.html :root.
   Landing, methodology page and PDF must match — same palette, same fonts.
   Aesthetic: white + ink + vibrant blue (McKinsey-inspired).
   Pair rule: Fraunces (display only) + IBM Plex Sans (everything else).
   ========================================================================= */

:root {
  /* Neutrals — true whites + Zinc cool-grey scale */
  --bg:            #ffffff;
  --surface:       #fafafa;  /* Zinc-50 */
  --surface-2:     #f4f4f5;  /* Zinc-100 */
  --ink:           #09090b;  /* Zinc-950 */
  --ink-2:         #18181b;  /* Zinc-900 */
  --ink-3:         #52525b;  /* Zinc-600 */
  --ink-4:         #a1a1aa;  /* Zinc-400 */
  --border:        #e4e4e7;  /* Zinc-200 */
  --border-strong: #d4d4d8;  /* Zinc-300 */

  /* Blue — single signature accent (not navy-dark) */
  --accent:        #2563eb;  /* Blue-600 */
  --accent-2:      #1d4ed8;  /* Blue-700 */
  --accent-3:      #1e40af;  /* Blue-800 */
  --accent-wash:   #eff6ff;  /* Blue-50 */
  --accent-soft:   #dbeafe;  /* Blue-100 */

  /* Severity — only as dots/icons, never as fills */
  --severity-high: #dc2626;  /* Red-600 — critical */
  --severity-med:  #ea580c;  /* Orange-600 — warning */
  --severity-low:  #52525b;  /* Zinc-600 — info */
  --severity-good: #16a34a;  /* Green-600 — rare positive */

  /* Typography */
  --font-display: "Fraunces", Georgia, serif;
  --font-sans:    "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;

  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* Spacing scale */
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  16px;
  --space-lg:  24px;
  --space-xl:  40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* Prose measure — tables and rich content may stretch wider */
  --prose-width: 68ch;

  /* Layout */
  --container-max: 1180px;
  --container-pad: 24px;
}

/* =============== RESET & BASE =============== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "liga" 1, "kern" 1;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* =============== TYPOGRAPHY =============== */
.eyebrow,
.section-eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 72;
}

h1 { font-size: clamp(40px, 5.4vw, 56px); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.15; }
h3 { font-size: 20px; line-height: 1.25; }
h4 { font-size: 16px; line-height: 1.3; }

p, li {
  font-family: var(--font-sans);
  color: var(--ink-2);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
a:hover {
  border-bottom-color: var(--accent);
}

strong { font-weight: 600; color: var(--ink); }

/* =============== CONTAINER =============== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

/* =============== BUTTONS =============== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-bottom: 1px solid transparent; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost:hover {
  background: var(--accent-wash);
  color: var(--accent-2);
}

.btn-lg {
  padding: 18px 40px;
  font-size: 16px;
}

.btn-block {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* =============== SECTIONS =============== */
section {
  padding: var(--space-3xl) 0;
}
@media (max-width: 768px) {
  section { padding: 64px 0; }
}

.section-eyebrow { display: inline-block; margin-bottom: 12px; }

.section-title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.4vw, 38px);
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-sub {
  font-family: var(--font-sans);
  font-size: 17px;
  color: var(--ink-3);
  max-width: var(--prose-width);
  line-height: 1.6;
}

/* =============== TABLES (McKinsey hairline) =============== */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

thead th {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  text-align: left;
  padding: 12px 14px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink-2);
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 1px solid var(--ink); }

/* Numeric columns right-align — opt-in via class */
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* =============== UTILS =============== */
.prose { max-width: var(--prose-width); }
.prose p + p { margin-top: 1em; }

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-xl) 0;
}

/* =============== ACCESSIBILITY =============== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
