/* Evident RCM — Design tokens & base styles */

:root {
  /* Colors — Direction A (Calm Modern, warm accent) */
  --navy-900: #0a1c31;
  --navy-800: #0f2744;
  --navy-700: #1a365d;
  --navy-600: #2a4a73;
  --navy-500: #47678f;
  --navy-400: #7a93b3;
  --navy-200: #c7d3e0;
  --navy-100: #e6ecf3;
  --navy-50: #f3f6fa;

  --bg: #ffffff;
  --bg-alt: #f5f6f8;
  --bg-card: #ffffff;
  --ink: var(--navy-800);
  --ink-mute: #5a6b7f;

  --accent: #E8A87C;           /* warm peach — default */
  --accent-deep: #c98359;
  --accent-soft: #f7e1cf;

  --rule: rgba(15, 39, 68, 0.10);
  --rule-strong: rgba(15, 39, 68, 0.18);

  /* Type */
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-serif: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-display: var(--font-sans);
  --font-body: var(--font-sans);

  /* Density */
  --pad-section: clamp(80px, 10vw, 160px);
  --pad-container: clamp(20px, 4vw, 48px);
  --gap-lg: clamp(40px, 6vw, 96px);
  --gap-md: 32px;
  --gap-sm: 16px;

  /* Max widths */
  --container: 1360px;
  --container-narrow: 980px;
  --container-text: 720px;

  /* Type scale */
  --fs-display: clamp(48px, 7vw, 96px);
  --fs-h1: clamp(40px, 5.5vw, 72px);
  --fs-h2: clamp(32px, 4vw, 52px);
  --fs-h3: clamp(22px, 2.2vw, 28px);
  --fs-body: clamp(16px, 1.1vw, 18px);
  --fs-lg: clamp(18px, 1.4vw, 22px);
  --fs-xl: clamp(22px, 1.8vw, 28px);
  --fs-small: 14px;
  --fs-micro: 12px;

  --radius: 4px;
  --radius-lg: 8px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Direction B — Editorial */
[data-direction="b"] {
  --font-display: 'Fraunces', 'Source Serif 4', Georgia, serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --accent: #b8704a;
  --accent-deep: #8f5332;
  --accent-soft: #ecd8c7;
  --bg: #fbfaf6;
  --bg-alt: #f4f0e6;
}

/* Accent color variants */
[data-accent="sage"]   { --accent: #4A9B8E; --accent-deep: #347066; --accent-soft: #d6ebe7; }
[data-accent="sky"]    { --accent: #6b98c4; --accent-deep: #48739e; --accent-soft: #d5e3f0; }
[data-accent="gold"]   { --accent: #c79a3a; --accent-deep: #9a7427; --accent-soft: #efe1bd; }
[data-accent="warm"]   { --accent: #E8A87C; --accent-deep: #c98359; --accent-soft: #f7e1cf; }

/* Dark mode */
[data-theme="dark"] {
  --bg: #0a1624;
  --bg-alt: #0f1f34;
  --bg-card: #152a45;
  --ink: #eaf0f7;
  --ink-mute: #99aec6;
  --rule: rgba(255,255,255,0.08);
  --rule-strong: rgba(255,255,255,0.15);
  --navy-50: #152a45;
  --navy-100: #1a3251;
  --navy-200: #2a4a73;
}

/* Density */
[data-density="compact"] {
  --pad-section: clamp(56px, 7vw, 110px);
  --gap-lg: clamp(28px, 4vw, 64px);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'cv11';
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { margin: 0; font-weight: 500; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }

/* Layout helpers */
.container { max-width: var(--container); margin: 0 auto; padding-left: var(--pad-container); padding-right: var(--pad-container); }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding-left: var(--pad-container); padding-right: var(--pad-container); }
.section { padding-top: var(--pad-section); padding-bottom: var(--pad-section); }

/* Type */
.display { font-family: var(--font-display); font-size: var(--fs-display); letter-spacing: -0.035em; line-height: 0.98; font-weight: 500; }
[data-direction="b"] .display { font-weight: 400; letter-spacing: -0.025em; }
.h1 { font-family: var(--font-display); font-size: var(--fs-h1); letter-spacing: -0.03em; line-height: 1.02; font-weight: 500; }
[data-direction="b"] .h1 { font-weight: 400; letter-spacing: -0.02em; }
.h2 { font-family: var(--font-display); font-size: var(--fs-h2); letter-spacing: -0.025em; line-height: 1.05; font-weight: 500; }
[data-direction="b"] .h2 { font-weight: 400; letter-spacing: -0.02em; }
.h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 500; letter-spacing: -0.015em; }
.lede { font-size: var(--fs-xl); line-height: 1.45; color: var(--ink-mute); max-width: 42ch; font-weight: 400; letter-spacing: -0.01em; }
[data-direction="b"] .lede { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.005em; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  font-weight: 500;
}
.mono { font-family: var(--font-mono); }
.serif-it { font-family: var(--font-serif); font-style: italic; font-weight: 400; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  background: var(--navy-800);
  color: #fff;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: transform .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--navy-900); transform: translateY(-1px); box-shadow: 0 10px 28px -14px rgba(15,39,68,0.4); }
.btn .arrow { transition: transform .3s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }
.btn.btn-accent { background: var(--accent); color: var(--navy-900); }
.btn.btn-accent:hover { background: var(--accent-deep); color: #fff; }
.btn.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule-strong);
  padding: 13px 21px;
}
.btn.btn-ghost:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.btn-light {
  background: #fff;
  color: var(--navy-800);
}
.btn.btn-light:hover { background: var(--accent); color: var(--navy-900); }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
  transition: border-color .3s var(--ease), color .3s var(--ease);
}
.link-arrow:hover { color: var(--accent-deep); border-bottom-color: var(--accent); }
.link-arrow .arrow { transition: transform .3s var(--ease); }
.link-arrow:hover .arrow { transform: translateX(3px); }

/* Rules */
.rule { height: 1px; background: var(--rule); width: 100%; border: 0; margin: 0; }

/* Photo placeholder — striped, monospace label */
.photo-ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      var(--navy-100) 0, var(--navy-100) 2px,
      var(--navy-50) 2px, var(--navy-50) 12px);
  color: var(--navy-700);
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.photo-ph::after {
  content: attr(data-caption);
  position: absolute; inset: auto 0 0 0;
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--navy-800);
  background: linear-gradient(to top, rgba(255,255,255,0.95), rgba(255,255,255,0));
  backdrop-filter: blur(4px);
}
.photo-ph::before {
  content: attr(data-label);
  position: absolute; top: 14px; left: 14px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--navy-800);
  background: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Reveal on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.delay-1 { transition-delay: 0.08s; }
.reveal.delay-2 { transition-delay: 0.16s; }
.reveal.delay-3 { transition-delay: 0.24s; }
.reveal.delay-4 { transition-delay: 0.32s; }

/* Tweaks panel (design-time only) */
.tweaks {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  background: #fff;
  color: var(--navy-900);
  border: 1px solid var(--rule-strong);
  border-radius: 12px;
  box-shadow: 0 20px 60px -20px rgba(10,28,49,0.3);
  padding: 18px;
  z-index: 1000;
  font-family: var(--font-sans);
  font-size: 13px;
  max-height: 78vh;
  overflow: auto;
}
.tweaks h4 { font-family: var(--font-sans); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #8a97a8; margin: 0 0 8px; font-weight: 600; }
.tweaks h4:not(:first-child) { margin-top: 18px; }
.tweaks .title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.tweaks .title strong { font-size: 13px; font-weight: 600; }
.tweak-row { display: flex; gap: 6px; flex-wrap: wrap; }
.tweak-row button {
  flex: 1 1 auto;
  padding: 8px 10px;
  border: 1px solid var(--rule-strong);
  background: #fff;
  border-radius: 6px;
  font-size: 12px;
  color: var(--navy-800);
  transition: all .2s var(--ease);
  min-width: 0;
}
.tweak-row button:hover { border-color: var(--navy-800); }
.tweak-row button.active { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.swatch-row { display: flex; gap: 8px; }
.swatch {
  width: 100%; height: 28px;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .2s var(--ease);
}
.swatch:hover { transform: scale(1.05); }
.swatch.active { border-color: var(--navy-800); }

/* Focus mode — hide photos */
[data-photos="off"] .photo-ph { display: none; }
[data-photos="off"] .hero-photo { display: none; }
[data-photos="off"] .founder-photo { display: none; }
[data-photos="off"] .hero {
  background: var(--navy-800);
  color: #fff;
}
[data-photos="off"] .hero .hero-body { color: #fff; }

/* Selection */
::selection { background: var(--accent); color: var(--navy-900); }

/* Noise */
@media (max-width: 720px) {
  .tweaks { display: none; }
}

/* Page header (inner pages) */
.page-header {
  padding-top: clamp(140px, 14vw, 200px);
  padding-bottom: clamp(60px, 7vw, 110px);
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.page-header .eyebrow-row {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 28px;
}
.page-header .eyebrow-row .dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--accent);
}

/* Breadcrumb offset — pages that have breadcrumbs use this instead of padding-top */
.page-header.with-crumbs {
  padding-top: clamp(32px, 4vw, 56px);
}

/* Inner-page content sections */
.prose {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink);
}
.prose p { margin-bottom: 1.3em; color: var(--ink); }
.prose p + p { margin-top: 0; }
.prose h2 {
  font-family: var(--font-display);
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 2.2em 0 0.7em;
  color: var(--ink);
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.015em;
  margin: 1.8em 0 0.5em;
  color: var(--ink);
}
.prose ul { padding-left: 0; list-style: none; margin: 1em 0 1.3em; }
.prose ul li {
  position: relative; padding-left: 24px; margin-bottom: 10px;
  color: var(--ink); line-height: 1.6;
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: 12px;
  width: 10px; height: 1px; background: var(--accent);
}
.prose strong { color: var(--ink); font-weight: 600; }
.prose blockquote {
  margin: 2em 0;
  padding: 0 0 0 24px;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 22px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.prose .pull-stat {
  margin: 2.4em 0;
  padding: 28px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex; align-items: baseline; gap: 20px; flex-wrap: wrap;
}
.prose .pull-stat .n {
  font-family: var(--font-display);
  font-size: clamp(44px, 5vw, 64px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--accent-deep);
}
.prose .pull-stat .lbl {
  flex: 1; min-width: 220px;
  font-size: 15px; color: var(--ink-mute);
  line-height: 1.5;
}

/* TOC sidebar (education) */
.toc {
  position: sticky; top: 120px;
  font-size: 13px;
  padding-left: 20px;
  border-left: 1px solid var(--rule);
}
.toc .eyebrow { margin-bottom: 14px; }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.toc a {
  color: var(--ink-mute);
  transition: color .2s var(--ease);
  display: block; line-height: 1.4;
}
.toc a:hover, .toc a.active { color: var(--ink); }
.toc a.active { color: var(--accent-deep); }

/* Shared article layout */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 72px;
  align-items: start;
}
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .toc { position: static; border-left: 0; padding-left: 0; border-top: 1px solid var(--rule); padding-top: 24px; order: -1; }
}

/* Spot illustration block */
.spot {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-alt);
  position: relative;
}
.spot img { width: 100%; height: 100%; object-fit: cover; }

