/* ============================================================
   Capability Engineer Starter Program — editorial static site
   Design tokens first. No frameworks. System-agnostic.
   ============================================================ */

:root {
  --bg: #f7f3ea;
  --bg-alt: #f1ece0;
  --surface: #fffdf7;
  --ink: #1a1816;
  --ink-muted: #5e5852;
  --ink-subtle: #8a847d;
  --rule: #e3ddd0;
  --rule-strong: #cfc7b5;
  --accent: #115362;
  --accent-hover: #0b3e4a;
  --accent-ink: #fbf8f2;
  --accent-soft: #dfeaed;
  --mono-bg: #eee9dc;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --max: 1160px;
  --pad: clamp(20px, 4vw, 48px);
  --section-y: clamp(72px, 10vw, 120px);
  --font-display: "Fraunces", "Georgia", serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }

code, kbd, pre, samp {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

:not(pre) > code {
  background: var(--mono-bg);
  padding: 0.08em 0.4em;
  border-radius: 4px;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- typography ---------- */

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

.display {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 28px;
  font-variation-settings: "opsz" 144;
}

.display em {
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.h2 {
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 80;
}

.h3 {
  font-size: 22px;
  line-height: 1.2;
}

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 14px;
}

.lede {
  font-size: clamp(18px, 1.6vw, 21px);
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 0;
  line-height: 1.55;
}

.lede-sm {
  font-size: 17px;
  color: var(--ink-muted);
  max-width: 62ch;
  margin: 18px 0 0;
}

/* ---------- nav ---------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 160ms ease;
}
.site-nav.is-stuck { border-bottom-color: var(--rule); }

.nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 72;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0;
}

.brand-text {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-size: 17px;
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: clamp(14px, 2vw, 28px);
}

.nav-links a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 6px 2px;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-links a.is-active { color: var(--ink); }
.nav-links a.is-active::after { transform: scaleX(1); background: var(--accent); }

@media (max-width: 640px) {
  .nav-links { display: none; }
}

/* ---------- hero ---------- */

.hero {
  padding: clamp(80px, 12vw, 140px) 0 clamp(64px, 10vw, 110px);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 40%;
  width: 600px;
  height: 600px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 12%, transparent), transparent);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.6;
}
.hero .wrap { position: relative; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 40px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 140ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
  line-height: 1;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}
.btn-secondary:hover { border-color: var(--ink); }

/* ---------- sections ---------- */

.section {
  padding: var(--section-y) 0;
  border-top: 1px solid var(--rule);
}

.section-alt {
  background: var(--bg-alt);
}

.section-head {
  max-width: 64ch;
  margin-bottom: clamp(40px, 5vw, 64px);
}

/* ---------- three-col tiles (program) ---------- */

.three-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 28px 30px;
  position: relative;
  transition: border-color 160ms ease, transform 160ms ease;
}

.tile::before {
  content: "";
  position: absolute;
  top: 24px;
  left: 0;
  width: 3px;
  height: 28px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.tile:hover { border-color: var(--rule-strong); }

.tile-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 10px;
}

.tile p { margin: 0; color: var(--ink-muted); font-size: 15.5px; }

/* ---------- stack grid ---------- */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.stack-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 28px 26px;
  transition: border-color 160ms ease;
}

.stack-card:hover { border-color: var(--accent); }

.stack-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 10px;
}

.stack-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36;
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 12px;
}

.stack-body {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.55;
}

.prereq {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px dashed var(--rule);
  color: var(--ink-muted);
  font-size: 15px;
}
.prereq strong { color: var(--ink); }

/* ---------- workflow phases ---------- */

.phase-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: phase;
  display: grid;
  gap: 18px;
}

.phase {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 30px 32px 32px;
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 28px;
  align-items: start;
  counter-increment: phase;
  transition: border-color 160ms ease;
}

.phase:hover { border-color: var(--rule-strong); }

.phase-marker {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-size: 64px;
  font-weight: 500;
  color: var(--accent);
  line-height: 0.85;
  letter-spacing: -0.04em;
}

.phase-marker::before {
  content: "0" counter(phase);
}

.phase-body h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48;
  font-size: 24px;
  font-weight: 500;
  margin: 0 0 6px;
}

.phase-concept {
  color: var(--ink-muted);
  margin: 0 0 18px;
  font-size: 16px;
}

.phase-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  font-size: 14px;
}

.phase-meta dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 4px;
}

.phase-meta dd { margin: 0; color: var(--ink); }
.phase-meta dd code {
  font-size: 13px;
  padding: 2px 6px;
}

.phase-meta > div { min-width: 160px; }

@media (max-width: 580px) {
  .phase { grid-template-columns: 1fr; padding: 26px; }
  .phase-marker { font-size: 44px; }
}

/* ---------- prompts ---------- */

.prompt-list {
  display: grid;
  gap: 22px;
}

.prompt-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 28px 28px;
  transition: border-color 160ms ease;
}

.prompt-card:hover { border-color: var(--rule-strong); }

.prompt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.prompt-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-size: 20px;
  font-weight: 500;
  margin: 0;
}

.prompt-phase {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
}

.prompt-body {
  position: relative;
  background: var(--mono-bg);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.copy-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.copy-btn:hover {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.copy-btn.is-copied {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ---------- assignments ---------- */

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-pill {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 140ms ease;
}

.filter-pill:hover { color: var(--ink); border-color: var(--ink); }

.filter-pill.is-active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.assignment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.assignment {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 160ms ease, transform 160ms ease;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  appearance: none;
}

.assignment:hover {
  border-color: var(--accent);
}

.assignment.is-hidden { display: none; }

.assignment-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.assignment-num {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144;
  font-size: 40px;
  font-weight: 500;
  color: var(--ink-subtle);
  line-height: 0.9;
  letter-spacing: -0.04em;
}

.assignment-cat {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--rule-strong);
  color: var(--ink-muted);
}

.assignment-cat[data-cat="clinical"] {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.assignment-cat[data-cat="general"] {
  background: #ede7d6;
  border-color: transparent;
  color: #6b5a2f;
}

.assignment-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48;
  font-size: 22px;
  font-weight: 500;
  margin: 0;
  line-height: 1.15;
}

.assignment-pitch {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.55;
}

.assignment-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-subtle);
}

.assignment-foot .concept {
  color: var(--ink);
  font-weight: 500;
}

.assignment-details {
  display: none;
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  margin-top: 4px;
}

.assignment.is-open .assignment-details { display: block; }
.assignment.is-open { border-color: var(--accent); }

.details-block { margin-bottom: 18px; }
.details-block:last-child { margin-bottom: 0; }

.details-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin: 0 0 8px;
}

.details-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-muted);
  font-size: 14.5px;
  line-height: 1.55;
}
.details-list li { margin-bottom: 4px; }

.details-text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14.5px;
  line-height: 1.55;
}

.expand-hint {
  font-size: 12px;
  color: var(--ink-subtle);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 500;
}

.assignment.is-open .expand-hint::before { content: "Hide"; }
.assignment:not(.is-open) .expand-hint::before { content: "Open"; }

.details-cta {
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px dashed var(--rule);
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
}

.details-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.01em;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all 140ms ease;
}

.details-link-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid var(--accent);
}
.details-link-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}

.details-link-secondary {
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--rule-strong);
  font-weight: 500;
}
.details-link-secondary:hover {
  color: var(--ink);
  border-color: var(--ink);
}

/* ---------- excluded note ---------- */

.excluded-note {
  margin-top: 56px;
  padding: 28px 32px;
  background: var(--bg-alt);
  border-left: 3px solid var(--rule-strong);
  border-radius: 2px;
}
.excluded-note .h3 {
  font-size: 18px;
  margin: 0 0 10px;
  font-variation-settings: "opsz" 32;
}
.excluded-note p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 15px;
  line-height: 1.6;
}

/* ---------- start steps ---------- */

.start-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
  max-width: 720px;
}

.start-steps li {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  font-size: 15.5px;
  color: var(--ink-muted);
}
.start-steps li strong { color: var(--ink); font-weight: 600; }

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48;
  font-weight: 600;
  font-size: 15px;
}

/* ---------- footer ---------- */

.site-footer {
  padding: 56px 0 64px;
  border-top: 1px solid var(--rule);
  background: var(--bg-alt);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40;
  font-size: 18px;
  margin: 0 0 6px;
  font-weight: 500;
}

.footer-text {
  margin: 0;
  color: var(--ink-muted);
  font-size: 14px;
  max-width: 52ch;
}

.footer-links {
  display: flex;
  gap: 22px;
}
.footer-links a {
  font-size: 13px;
  color: var(--ink-muted);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.footer-links a:hover { color: var(--ink); }

/* ---------- motion ---------- */

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

/* ---------- selection ---------- */

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}
