/* LynCareOS Documentation Portal — Calm Care presentation stack */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

:root {
  --canvas: #f0f4f8;
  --canvas-deep: #e8eef4;
  --surface: #ffffff;
  --ink: #25303b;
  --muted: #6b7785;
  --brand-400: #6bbcfe;
  --brand-500: #4fb3fe;
  --brand-600: #1a9af2;
  --brand-700: #0d7ec4;
  --healing-500: #19b5a6;
  --healing-100: #d4f5f1;
  --apricot-500: #ff8a5b;
  --apricot-100: #ffe8dc;
  --sage-500: #46c28e;
  --sage-100: #e0f7ec;
  --lilac-500: #7c83f0;
  --lilac-100: #e8e9fc;
  --coral-500: #f4685f;
  --amber-400: #fbbf24;
  --shadow-sm: 0 2px 12px rgba(37, 48, 59, 0.06);
  --shadow: 0 8px 32px rgba(37, 48, 59, 0.08);
  --shadow-lg: 0 20px 60px rgba(37, 48, 59, 0.12);
  --radius: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --arch-a: #e07a5f;
  --arch-b: #4fb3fe;
  --arch-c: #9b7fd4;
  --arch-d: #f4685f;
  --arch-e: #46c28e;
  --arch-f: #fbbf24;
  --arch-g: #6b7785;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.font-display {
  font-family: "Plus Jakarta Sans", Inter, system-ui, sans-serif;
}

/* ── Shell ── */
.portal-shell {
  min-height: 100vh;
  overflow-x: hidden;
}

.portal-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(37, 48, 59, 0.06);
}

.portal-nav__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.portal-nav__mark {
  width: 36px;
  height: 36px;
}

.portal-nav__title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.02em;
}

.portal-nav__links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-nav__link {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  transition: color 0.15s, background 0.15s;
}

.portal-nav__link:hover,
.portal-nav__link.is-active {
  color: var(--brand-700);
  background: rgba(79, 179, 254, 0.1);
}

/* ── Hero ── */
.portal-hero {
  position: relative;
  padding: 48px 24px 32px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.portal-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(79, 179, 254, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 90% 20%, rgba(255, 138, 91, 0.1), transparent),
    radial-gradient(ellipse 50% 30% at 10% 60%, rgba(25, 181, 166, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.portal-hero > * { position: relative; z-index: 1; }

.portal-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 16px;
}

.portal-hero__eyebrow span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--sage-500);
  box-shadow: 0 0 0 3px rgba(70, 194, 142, 0.25);
}

.portal-hero h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 16px;
  max-width: 720px;
  margin-inline: auto;
}

.portal-hero h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--brand-600), var(--healing-500));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.portal-hero__lead {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--muted);
  max-width: 580px;
  margin: 0 auto 28px;
}

.portal-hero__stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(37, 48, 59, 0.05);
}

.stat-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stat-pill__dot--live { background: var(--sage-500); }
.stat-pill__dot--beta { background: var(--brand-500); }

/* ── Architecture section ── */
.arch-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.arch-section__header {
  text-align: center;
  margin-bottom: 32px;
}

.arch-section__header h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}

.arch-section__header p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  max-width: 520px;
  margin-inline: auto;
}

.arch-canvas {
  display: grid;
  grid-template-columns: 1fr min(340px, 100%);
  gap: 24px;
  align-items: start;
}

@media (max-width: 900px) {
  .arch-canvas { grid-template-columns: 1fr; }
}

.arch-diagram-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(37, 48, 59, 0.05);
  overflow: hidden;
  position: relative;
}

.arch-diagram-wrap svg {
  display: block;
  width: 100%;
  height: auto;
}

.arch-layer {
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
}

.arch-layer:hover,
.arch-layer.is-active {
  filter: brightness(1.02);
}

.arch-layer.is-dimmed { opacity: 0.45; }

.arch-layer rect,
.arch-layer path.arch-hit {
  transition: stroke-width 0.15s;
}

.arch-layer.is-active rect { stroke-width: 2.5; }

.arch-insight {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 24px;
  border: 1px solid rgba(37, 48, 59, 0.06);
  position: sticky;
  top: 80px;
}

.arch-insight__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 8px;
}

.arch-insight h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

.arch-insight p {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.arch-insight__modules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.module-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink);
  border: 1px solid rgba(37, 48, 59, 0.08);
}

.arch-insight__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Pathways ── */
.pathways-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 64px;
}

.pathways-section h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 8px;
}

.pathways-section .sub {
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 36px;
}

.pathway-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 960px) {
  .pathway-grid { grid-template-columns: 1fr; }
}

.pathway-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  border: 1px solid rgba(37, 48, 59, 0.05);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pathway-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pathway-card__visual {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.pathway-card--a .pathway-card__visual {
  background: linear-gradient(160deg, #fff5ef 0%, #ffe8dc 40%, #f0f8ff 100%);
}

.pathway-card--b .pathway-card__visual {
  background: linear-gradient(160deg, #e8f9f7 0%, #d4f5f1 40%, #f5f0ff 100%);
}

.pathway-card--c .pathway-card__visual {
  background: linear-gradient(160deg, #eef6ff 0%, #dceeff 40%, #fff8ef 100%);
}

.pathway-card__visual svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pathway-card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
}

.pathway-card--a .pathway-card__badge { color: var(--apricot-500); }
.pathway-card--b .pathway-card__badge { color: var(--healing-500); }
.pathway-card--c .pathway-card__badge { color: var(--brand-700); }

.pathway-card__body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pathway-card__body h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}

.pathway-card__body p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  flex: 1;
  line-height: 1.55;
}

.pathway-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pathway-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-700);
  margin-top: 8px;
}

.pathway-card:hover .pathway-card__cta { gap: 12px; transition: gap 0.2s; }

/* ── Audience strip ── */
.audience-strip {
  max-width: 1200px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.audience-strip__inner {
  background: var(--ink);
  color: #e8eef4;
  border-radius: var(--radius);
  padding: 32px 36px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}

.audience-strip h4 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 8px;
  color: white;
}

.audience-strip p {
  margin: 0;
  font-size: 13px;
  color: rgba(232, 238, 244, 0.75);
  line-height: 1.5;
}

.audience-strip a {
  color: var(--brand-400);
  text-decoration: none;
  font-weight: 600;
}

.audience-strip a:hover { text-decoration: underline; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover { opacity: 0.92; transform: translateY(-1px); }

.btn--sky {
  background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
  color: white;
}

.btn--apricot {
  background: var(--apricot-500);
  color: white;
}

.btn--ghost {
  background: white;
  color: var(--ink);
  border: 1px solid rgba(37, 48, 59, 0.12);
}

/* ── Pathway pages: story scroll ── */
.story-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  max-width: 1100px;
  margin: 0 auto;
  gap: 40px;
  padding: 32px 24px 80px;
}

@media (max-width: 800px) {
  .story-layout { grid-template-columns: 1fr; }
  .story-rail { display: none; }
}

.story-rail {
  position: sticky;
  top: 88px;
  height: fit-content;
}

.story-rail h4 {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.story-rail a {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 0 8px 16px;
  border-left: 2px solid transparent;
  margin-bottom: 4px;
  transition: color 0.15s, border-color 0.15s;
}

.story-rail a:hover,
.story-rail a.is-active {
  color: var(--brand-700);
  border-left-color: var(--brand-500);
}

.story-chapter {
  margin-bottom: 80px;
  scroll-margin-top: 96px;
}

.story-chapter__visual {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
  background: var(--surface);
}

.story-chapter__visual svg,
.story-chapter__visual img {
  display: block;
  width: 100%;
  height: auto;
}

.story-chapter__num {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 8px;
}

.story-chapter h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  line-height: 1.15;
}

.story-chapter__lead {
  font-size: 1.05rem;
  color: var(--muted);
  margin: 0 0 24px;
  max-width: 640px;
}

.story-points {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.story-points li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  font-size: 15px;
  padding: 16px 18px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(37, 48, 59, 0.04);
}

.story-points li::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--healing-500);
  margin-top: 6px;
  flex-shrink: 0;
}

.story-chapter__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ── Domains page ── */
.domains-hero {
  text-align: center;
  padding: 40px 24px 24px;
  max-width: 720px;
  margin: 0 auto;
}

.domains-hero h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  margin: 0 0 12px;
}

.layer-stack {
  max-width: 900px;
  margin: 0 auto 56px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.layer-block {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 20px;
  align-items: center;
  padding: 20px 24px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--brand-500);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
}

.layer-block:hover {
  box-shadow: var(--shadow);
  transform: translateX(4px);
}

.layer-block--commerce { border-left-color: var(--apricot-500); }
.layer-block--caremod { border-left-color: var(--lilac-500); }
.layer-block--coord { border-left-color: var(--healing-500); }
.layer-block--med { border-left-color: var(--brand-600); }
.layer-block--clinical { border-left-color: var(--sage-500); }
.layer-block--platform { border-left-color: var(--arch-g); }

.layer-block__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.layer-block h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.layer-block p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.archetype-grid {
  max-width: 1100px;
  margin: 0 auto 64px;
  padding: 0 24px;
}

.archetype-grid h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 8px;
}

.archetype-grid .sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 32px;
  font-size: 15px;
}

.archetype-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.archetype-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--arch-a);
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
}

.archetype-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.archetype-card[data-arch="B"] { border-top-color: var(--arch-b); }
.archetype-card[data-arch="C"] { border-top-color: var(--arch-c); }
.archetype-card[data-arch="D"] { border-top-color: var(--arch-d); }
.archetype-card[data-arch="E"] { border-top-color: var(--arch-e); }
.archetype-card[data-arch="F"] { border-top-color: var(--arch-f); }
.archetype-card[data-arch="G"] { border-top-color: var(--arch-g); }

.archetype-card__letter {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 2rem;
  font-weight: 800;
  opacity: 0.15;
  line-height: 1;
  margin-bottom: -8px;
}

.archetype-card h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.archetype-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* ── Workflows page ── */
.workflow-page {
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.workflow-page h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  text-align: center;
  margin: 0 0 12px;
}

.workflow-page .lead {
  text-align: center;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 48px;
  font-size: 15px;
}

.workflow-block {
  margin-bottom: 56px;
}

.workflow-block h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.workflow-block .wf-sub {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 20px;
}

.workflow-svg-wrap {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  overflow-x: auto;
}

.wf-step {
  cursor: pointer;
  transition: opacity 0.2s;
}

.wf-step:hover { opacity: 0.92; filter: brightness(1.03); }

.wf-step.is-active rect,
.wf-step.is-active circle {
  stroke-width: 3;
  filter: drop-shadow(0 4px 12px rgba(37, 48, 59, 0.15));
}

.wf-detail {
  margin-top: 16px;
  padding: 18px 20px;
  background: var(--canvas);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--muted);
  display: none;
}

.wf-detail.is-open { display: block; }

.wf-detail strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  margin-bottom: 6px;
}

/* ── Discover: immersive layer stack ── */
.discover-hero {
  text-align: center;
  padding: 36px 24px 16px;
  max-width: 640px;
  margin: 0 auto;
}

.discover-hero h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 10px;
}

.discover-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.discover-hint {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  margin: 0 0 24px;
  letter-spacing: 0.02em;
}

.layer-stack-visual {
  max-width: 720px;
  margin: 0 auto 64px;
  padding: 0 24px;
  perspective: 1200px;
}

.stack-slice {
  position: relative;
  margin-bottom: -12px;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), filter 0.25s, margin 0.35s;
  transform-origin: center top;
}

.stack-slice:hover {
  transform: translateY(-6px) scale(1.02);
  z-index: 10;
  margin-bottom: 4px;
}

.stack-slice.is-active {
  transform: translateY(-10px) scale(1.03);
  z-index: 11;
}

.stack-slice svg {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 8px 24px rgba(37, 48, 59, 0.1));
  border-radius: var(--radius-md);
}

.stack-slice__enter {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  color: white;
  background: rgba(37, 48, 59, 0.55);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.stack-slice:hover .stack-slice__enter,
.stack-slice.is-active .stack-slice__enter {
  opacity: 1;
}

/* Discover stage (layer + archetype) */
body.discover-open { overflow: hidden; }

.discover-stage {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
}

.discover-stage.is-open {
  opacity: 1;
  visibility: visible;
}

.discover-stage__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(37, 48, 59, 0.55);
  backdrop-filter: blur(10px);
}

.discover-stage__frame {
  position: relative;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(37, 48, 59, 0.08);
  animation: discover-rise 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes discover-rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.discover-stage__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow-sm);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}

.discover-stage__close:hover {
  background: var(--ink);
  color: white;
}

.discover-stage__visual {
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--discover-tint, var(--canvas));
}

.discover-stage__visual svg {
  display: block;
  width: 100%;
  height: auto;
}

.discover-stage__body {
  padding: 28px 32px 32px;
}

.discover-stage__eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--discover-accent, var(--brand-700));
  margin-bottom: 8px;
}

.discover-stage__body h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.discover-stage__lead {
  font-size: 15px;
  color: var(--muted);
  margin: 0 0 24px;
  line-height: 1.6;
  max-width: 640px;
}

.capability-orbit {
  min-height: 200px;
  margin-bottom: 24px;
  background: var(--canvas);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(37, 48, 59, 0.06);
}

.capability-orbit__svg {
  width: 100%;
  height: auto;
  display: block;
}

.discover-stage__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-top: 8px;
  border-top: 1px solid rgba(37, 48, 59, 0.06);
}

.discover-nav-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid rgba(37, 48, 59, 0.12);
  background: white;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s;
}

.discover-nav-btn:hover:not(:disabled) {
  border-color: var(--discover-accent, var(--brand-500));
  color: var(--discover-accent, var(--brand-700));
}

.discover-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.discover-spec-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}

.discover-spec-link:hover {
  color: var(--brand-700);
  text-decoration: underline;
}

/* Archetype constellation */
.constellation-section {
  max-width: 900px;
  margin: 0 auto 80px;
  padding: 0 24px;
}

.constellation-section h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 8px;
}

.constellation-section .sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 32px;
}

.constellation-wrap {
  position: relative;
  aspect-ratio: 1;
  max-width: 560px;
  margin: 0 auto;
}

.constellation-wrap svg.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.constellation-node {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid var(--node-color, var(--brand-500));
  background: white;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s;
  transform: translate(-50%, -50%);
}

.constellation-node:hover,
.constellation-node.is-active {
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: var(--shadow-lg);
  z-index: 5;
}

.constellation-node__letter {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--node-color);
  line-height: 1;
}

.constellation-node__hint {
  font-size: 8px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
  text-align: center;
  max-width: 64px;
  line-height: 1.2;
}

.constellation-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-600), var(--healing-500));
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 40px rgba(26, 154, 242, 0.35);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  z-index: 2;
}

/* Archetype stage extras */
.archetype-stage-hero {
  padding: 48px 32px 32px;
  text-align: center;
  background: linear-gradient(180deg, var(--discover-tint, #f5f7f9), white);
}

.archetype-stage-hero [data-arch-letter] {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--arch-color);
  opacity: 0.9;
}

.archetype-stage-hero [data-arch-name] {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin: 8px 0 12px;
}

.archetype-stage-hero [data-arch-challenge] {
  font-size: 15px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.55;
}

.discover-profile-pill {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--canvas);
  border: 1px solid rgba(37, 48, 59, 0.08);
  margin: 4px;
  text-transform: capitalize;
}

.discover-profiles-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.arch-insight__explore {
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
}

@media (max-width: 640px) {
  .discover-stage__body { padding: 20px; }
  .constellation-node { width: 56px; height: 56px; }
  .constellation-node__letter { font-size: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pathway-card:hover,
  .stack-slice:hover,
  .btn:hover { transform: none; }
  .discover-stage__frame { animation: none; }
}

/* ──────────────────────────────────────────────────────────────
   Doc Page — long-form documentation pattern
   Used by pathway-business.html and pathway-architecture.html
   ────────────────────────────────────────────────────────────── */

.doc-hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 24px;
}

.doc-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 20% 0%, rgba(79, 179, 254, 0.10), transparent),
    radial-gradient(ellipse 50% 40% at 80% 0%, rgba(255, 138, 91, 0.08), transparent);
  pointer-events: none;
  z-index: 0;
}

.doc-hero > * { position: relative; z-index: 1; }

.doc-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-700);
  background: rgba(79, 179, 254, 0.10);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.doc-hero__eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.doc-hero h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 14px;
  max-width: 820px;
}

.doc-hero__lead {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: var(--muted);
  max-width: 720px;
  margin: 0 0 22px;
  line-height: 1.55;
}

.doc-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.doc-hero__meta .stat-pill {
  background: var(--surface);
}

/* The two-column layout: sticky TOC on the left, content on the right */
.doc-page {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 56px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 32px 80px;
  align-items: start;
}

@media (max-width: 960px) {
  .doc-page {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 12px 20px 60px;
  }
}

.doc-toc {
  position: sticky;
  top: 78px;
  align-self: start;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(37, 48, 59, 0.05);
  padding: 22px 18px 20px;
  font-size: 13px;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}

@media (max-width: 960px) {
  .doc-toc {
    position: static;
    max-height: none;
  }
}

.doc-toc__title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 12px;
  padding: 0 6px;
}

.doc-toc__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.doc-toc__list a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.doc-toc__list a:hover {
  background: rgba(79, 179, 254, 0.06);
  color: var(--ink);
}

.doc-toc__list a.is-active {
  background: rgba(79, 179, 254, 0.10);
  color: var(--brand-700);
  border-left-color: var(--brand-500);
  font-weight: 600;
}

.doc-toc__list a span.num {
  flex: none;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  font-feature-settings: "tnum";
  margin-top: 2px;
}

.doc-toc__list a.is-active span.num { color: var(--brand-700); }

.doc-toc__group {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(37, 48, 59, 0.06);
}

.doc-toc__related {
  margin-top: 18px;
  padding: 14px 12px;
  background: linear-gradient(135deg, rgba(79, 179, 254, 0.06), rgba(25, 181, 166, 0.05));
  border-radius: 12px;
  font-size: 12px;
}

.doc-toc__related h5 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 6px;
}

.doc-toc__related a {
  display: block;
  color: var(--brand-700);
  text-decoration: none;
  font-weight: 600;
  padding: 4px 0;
}

.doc-toc__related a:hover { text-decoration: underline; }

/* Body content column — typography */
.doc-body {
  max-width: 760px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
}

.doc-body > section {
  scroll-margin-top: 78px;
  padding: 28px 0 20px;
  border-bottom: 1px solid rgba(37, 48, 59, 0.06);
}

.doc-body > section:last-child { border-bottom: none; }

.doc-body h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}

.doc-body h2 .doc-num {
  display: inline-block;
  font-size: 0.6em;
  font-weight: 700;
  color: var(--brand-700);
  background: rgba(79, 179, 254, 0.10);
  padding: 4px 10px;
  border-radius: 999px;
  margin-right: 12px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

.doc-body h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 28px 0 10px;
  color: var(--ink);
}

.doc-body h4 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 20px 0 6px;
  color: var(--ink);
}

.doc-body p {
  margin: 0 0 14px;
}

.doc-body p strong { color: var(--ink); }

.doc-body__lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  margin: 4px 0 22px;
  font-weight: 500;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.doc-body li {
  margin: 6px 0;
}

.doc-body li::marker { color: var(--brand-500); }

.doc-body a {
  color: var(--brand-700);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 154, 242, 0.25);
  transition: color 0.15s, border-color 0.15s;
}

.doc-body a:hover {
  color: var(--brand-600);
  border-color: var(--brand-500);
}

.doc-body code {
  background: var(--canvas-deep);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  color: var(--brand-700);
  border: 1px solid rgba(37, 48, 59, 0.06);
}

/* Figure — diagram with caption inside the body column */
.doc-figure {
  margin: 22px 0;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(37, 48, 59, 0.05);
}

.doc-figure svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }

.doc-figure figcaption {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(37, 48, 59, 0.06);
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  font-style: italic;
}

.doc-figure--full {
  margin-left: -16px;
  margin-right: -16px;
}

@media (max-width: 720px) {
  .doc-figure--full { margin: 22px 0; }
}

/* Tables */
.doc-table-wrap {
  overflow-x: auto;
  margin: 18px 0 22px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(37, 48, 59, 0.06);
  background: var(--surface);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.doc-table th,
.doc-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(37, 48, 59, 0.06);
  vertical-align: top;
}

.doc-table th {
  background: var(--canvas);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-table tbody tr:last-child td { border-bottom: none; }

.doc-table tbody tr:hover { background: rgba(79, 179, 254, 0.04); }

.doc-table .ok    { color: var(--sage-500); font-weight: 700; }
.doc-table .gate  { color: var(--apricot-500); font-weight: 700; }
.doc-table .none  { color: var(--muted); }
.doc-table td code { font-size: 12px; }

/* Callouts — context-tinted */
.doc-callout {
  display: flex;
  gap: 14px;
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--callout-bg, rgba(79, 179, 254, 0.06));
  border-left: 4px solid var(--callout-border, var(--brand-500));
}

.doc-callout__icon {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--callout-border, var(--brand-500));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 14px;
}

.doc-callout__body { flex: 1; min-width: 0; }
.doc-callout__body > *:last-child { margin-bottom: 0; }
.doc-callout__body p { margin: 0 0 6px; font-size: 14px; line-height: 1.55; }

.doc-callout__title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 13px;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.doc-callout--info     { --callout-bg: rgba(79, 179, 254, 0.06);  --callout-border: var(--brand-500); }
.doc-callout--success  { --callout-bg: rgba(70, 194, 142, 0.08);  --callout-border: var(--sage-500); }
.doc-callout--warn     { --callout-bg: rgba(251, 191, 36, 0.10);  --callout-border: var(--amber-400); }
.doc-callout--accent   { --callout-bg: rgba(255, 138, 91, 0.08);  --callout-border: var(--apricot-500); }
.doc-callout--healing  { --callout-bg: rgba(25, 181, 166, 0.07);  --callout-border: var(--healing-500); }

/* Stat row — inline metrics */
.doc-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.doc-stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(37, 48, 59, 0.05);
  border-top: 3px solid var(--stat-color, var(--brand-500));
}

.doc-stat-card__value {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
}

.doc-stat-card__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.doc-stat-card__hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Inline two-column row (text + diagram) */
.doc-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  align-items: center;
  margin: 22px 0;
}

.doc-split--diagram-first { grid-template-columns: 1fr 1fr; }
.doc-split > .doc-figure { margin: 0; }

@media (max-width: 720px) {
  .doc-split { grid-template-columns: 1fr; }
}

/* Module pill grid */
.doc-module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0 22px;
}

.doc-module-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(37, 48, 59, 0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.doc-module-card__name {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
}

.doc-module-card__hint {
  font-size: 11px;
  color: var(--muted);
}

.doc-module-card[data-status="live"]   { border-left: 3px solid var(--sage-500); }
.doc-module-card[data-status="beta"]   { border-left: 3px solid var(--brand-500); }
.doc-module-card[data-status="planned"]{ border-left: 3px solid var(--amber-400); background: rgba(251, 191, 36, 0.04); }

/* Spec-deeper-link block */
.doc-spec-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border: none;
  padding: 4px 0;
  margin-top: 4px;
}

.doc-spec-link:hover {
  color: var(--brand-700);
}

.doc-spec-link::after {
  content: "↗";
  font-size: 11px;
}

.doc-spec-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
}

.doc-spec-list a {
  background: var(--canvas);
  border: 1px solid rgba(37, 48, 59, 0.06);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-700);
  text-decoration: none;
}

.doc-spec-list a:hover {
  background: rgba(79, 179, 254, 0.10);
  border-color: var(--brand-500);
}

/* Section transition / next */
.doc-next {
  margin-top: 32px;
  padding: 22px 24px;
  background: linear-gradient(135deg, rgba(79, 179, 254, 0.07), rgba(255, 138, 91, 0.05));
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.doc-next__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.doc-next__title {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  margin: 4px 0 0;
}

/* Scroll-spy active state on TOC */
@media (prefers-reduced-motion: no-preference) {
  .doc-body > section { scroll-margin-top: 90px; }
}

/* ── Spec viewer (rendered markdown) ── */
.viewer-shell { background: var(--canvas); }

.viewer-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 32px 80px;
  align-items: start;
}

@media (max-width: 960px) {
  .viewer-layout { grid-template-columns: 1fr; padding: 16px 20px 60px; }
  .viewer-toc { position: static; }
}

.viewer-toc { position: sticky; top: 78px; max-height: calc(100vh - 92px); overflow-y: auto; }

.viewer-main {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(37, 48, 59, 0.05);
  overflow: hidden;
}

.viewer-header {
  padding: 32px 40px 20px;
  border-bottom: 1px solid rgba(37, 48, 59, 0.06);
  background: linear-gradient(180deg, rgba(79, 179, 254, 0.05), transparent);
}

.viewer-header__eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin: 0 0 8px;
}

.viewer-header h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  line-height: 1.15;
}

.viewer-header__meta {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.viewer-loading { padding: 40px; color: var(--muted); text-align: center; }

.viewer-footer {
  padding: 20px 40px 28px;
  border-top: 1px solid rgba(37, 48, 59, 0.06);
  font-size: 13px;
  color: var(--muted);
}

/* Rendered markdown prose */
.doc-prose {
  padding: 28px 40px 36px;
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  max-width: none;
}

.doc-prose > *:first-child { margin-top: 0; }

.doc-prose h1 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  margin: 2.2em 0 0.6em;
  letter-spacing: -0.02em;
  padding-top: 0.5em;
  border-top: 1px solid rgba(37, 48, 59, 0.06);
}

.doc-prose h1:first-child { border-top: none; margin-top: 0; padding-top: 0; }

.doc-prose h2 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2em 0 0.5em;
  letter-spacing: -0.015em;
  scroll-margin-top: 90px;
}

.doc-prose h3 {
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.6em 0 0.4em;
  scroll-margin-top: 90px;
}

.doc-prose h4 { font-weight: 700; margin: 1.2em 0 0.3em; }

.doc-prose p { margin: 0 0 1em; }

.doc-prose ul, .doc-prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.doc-prose li { margin: 0.35em 0; }
.doc-prose li::marker { color: var(--brand-500); }

.doc-prose a {
  color: var(--brand-700);
  text-decoration: none;
  border-bottom: 1px solid rgba(26, 154, 242, 0.25);
}

.doc-prose a:hover { border-color: var(--brand-500); }

.doc-prose code {
  background: var(--canvas-deep);
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  color: var(--brand-700);
  border: 1px solid rgba(37, 48, 59, 0.06);
}

.doc-prose pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 1.2em;
  font-size: 13px;
  line-height: 1.5;
}

.doc-prose pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.doc-prose blockquote {
  margin: 0 0 1.2em;
  padding: 14px 18px;
  border-left: 4px solid var(--brand-500);
  background: rgba(79, 179, 254, 0.06);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
}

.doc-prose blockquote p:last-child { margin-bottom: 0; }

.doc-prose hr {
  border: none;
  border-top: 1px solid rgba(37, 48, 59, 0.08);
  margin: 2em 0;
}

.doc-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 0 0 1.4em;
  display: block;
  overflow-x: auto;
}

.doc-prose th, .doc-prose td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid rgba(37, 48, 59, 0.08);
  vertical-align: top;
}

.doc-prose th {
  background: var(--canvas);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-weight: 700;
  font-size: 12px;
}

.doc-prose tr:nth-child(even) td { background: rgba(79, 179, 254, 0.03); }

.doc-prose img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

.doc-prose .mermaid {
  margin: 1.4em 0;
  padding: 20px;
  background: var(--canvas);
  border-radius: var(--radius-md);
  border: 1px solid rgba(37, 48, 59, 0.06);
  overflow-x: auto;
  text-align: center;
}

@media (max-width: 720px) {
  .viewer-header, .doc-prose, .viewer-footer { padding-left: 20px; padding-right: 20px; }
}
