:root {
  color-scheme: light;
  --cp-bg: #f7f4ef;
  --cp-bg-elevated: #fcfbf8;
  --cp-surface: #ffffff;
  --cp-surface-soft: #f5f5f5;
  --cp-border: #dedede;
  --cp-border-strong: #919191;
  --cp-text: #242424;
  --cp-text-muted: #5c5c5c;
  --cp-text-soft: #6f6f6f;
  --cp-accent: #b11f4b;
  --cp-accent-hover: #9a1a41;
  --cp-accent-soft: rgba(177, 31, 75, 0.08);
  --cp-accent-fg: #ffffff;
  --cp-success: #16a34a;
  --cp-danger: #dc2626;
  --cp-warning: #f59e0b;
  --cp-link: #0078d4;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.12);
  --cp-overlay: rgba(255, 255, 255, 0.8);
  --cp-panel: rgba(255, 255, 255, 0.86);
  --cp-panel-strong: rgba(255, 255, 255, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.55);
  --cp-highlight: rgba(177, 31, 75, 0.12);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --cp-bg: #3d3b3a;
  --cp-bg-elevated: #343231;
  --cp-surface: #292929;
  --cp-surface-soft: #2e2e2e;
  --cp-border: #474747;
  --cp-border-strong: #5f5f5f;
  --cp-text: #dedede;
  --cp-text-muted: #919191;
  --cp-text-soft: #b0b0b0;
  --cp-accent: #fd8ea1;
  --cp-accent-hover: #fb7b91;
  --cp-accent-soft: rgba(253, 142, 161, 0.14);
  --cp-accent-fg: #1a1a1a;
  --cp-success: #4ade80;
  --cp-danger: #f87171;
  --cp-warning: #fbbf24;
  --cp-link: #4da6ff;
  --cp-shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
  --cp-overlay: rgba(41, 41, 41, 0.88);
  --cp-panel: rgba(41, 41, 41, 0.72);
  --cp-panel-strong: rgba(41, 41, 41, 0.96);
  --cp-sheen: rgba(255, 255, 255, 0.04);
  --cp-highlight: rgba(253, 142, 161, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 92px; }
body {
  margin: 0;
  background: var(--cp-bg);
  color: var(--cp-text);
  font-family: "Segoe UI", Aptos, Calibri, -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.6;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { color: inherit; }
em {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

.site-nav {
  position: fixed;
  z-index: 20;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(1168px, calc(100% - 32px));
  height: 64px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: var(--cp-panel-strong);
  border: 1px solid var(--cp-border);
  border-radius: 16px;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--cp-text) 14%, transparent);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; }
.brand-mark {
  width: 40px;
  height: 40px;
  background: var(--cp-text) url("assets/nd-mark-dark.png") center / 74% auto no-repeat;
  border-radius: 50%;
}
html[data-theme="dark"] .brand-mark {
  background-color: var(--cp-text);
  background-image: url("assets/nd-mark-light.png");
}
.brand-copy { display: flex; gap: 8px; align-items: baseline; white-space: nowrap; }
.brand-copy strong { font-size: 17px; letter-spacing: -0.03em; }
.brand-copy span { font-size: 13px; color: var(--cp-text-muted); }
.site-nav nav { display: flex; gap: 28px; font-size: 13px; font-weight: 600; }
.site-nav nav a:hover { color: var(--cp-accent); }
.nav-actions { justify-self: end; display: flex; gap: 8px; align-items: center; }
.language-picker select {
  max-width: 118px;
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--cp-border);
  border-radius: 999px;
  background: var(--cp-surface);
  color: var(--cp-text);
  cursor: pointer;
  font-size: 12px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.theme-toggle {
  border: 1px solid var(--cp-border);
  background: var(--cp-surface);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero {
  min-height: 100svh;
  padding: 160px 32px 64px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}
.hero-grid, .hero-watermark { position: absolute; inset: 0; pointer-events: none; }
.hero-grid {
  background-image:
    linear-gradient(var(--cp-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--cp-border) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: .45;
  mask-image: radial-gradient(ellipse at center, var(--cp-text), transparent 72%);
}
.hero-watermark {
  background: url("assets/nd-mark-light.png") center 115% / min(760px, 78vw) auto no-repeat;
  opacity: .06;
}
html[data-theme="dark"] .hero-watermark { background-image: url("assets/nd-mark-dark.png"); opacity: .09; }
.hero-inner { max-width: 980px; text-align: center; position: relative; z-index: 1; }
.eyebrow-pill, .lab-meta span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--cp-border);
  background: var(--cp-surface);
  color: var(--cp-text-muted);
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: .11em;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cp-success);
}
.hero h1 {
  margin: 32px 0 0;
  font-size: clamp(48px, 7vw, 92px);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .98;
}
.hero h1 em { display: inline-block; font-size: 1.03em; }
.hero p {
  max-width: 680px;
  margin: 32px auto 0;
  color: var(--cp-text-muted);
  font-size: 19px;
}
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--cp-text); color: var(--cp-bg); border-color: var(--cp-text); }
.button.primary:hover { background: var(--cp-accent); border-color: var(--cp-accent); color: var(--cp-accent-fg); }
.button.secondary { background: transparent; color: var(--cp-text); border-color: var(--cp-border-strong); }
.button.secondary:hover { background: var(--cp-surface); }
.button.compact { padding: 10px 16px; }
.hero-meta {
  position: absolute;
  z-index: 1;
  bottom: 36px;
  display: flex;
  gap: 32px;
  color: var(--cp-text-soft);
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 10px;
  letter-spacing: .13em;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px 32px;
  border-top: 1px solid var(--cp-border);
  border-bottom: 1px solid var(--cp-border);
}
.stats article { border-top: 1px solid var(--cp-border-strong); padding-top: 18px; }
.stats strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: clamp(44px, 5vw, 68px);
  line-height: 1;
  font-weight: 400;
}
.stats span { color: var(--cp-text-muted); font-size: 14px; }

.section { padding: 120px 32px; }
.section-alt { background: var(--cp-bg-elevated); }
.section-heading {
  max-width: 1280px;
  margin: 0 auto 56px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 48px;
}
.section-heading > div { max-width: 760px; }
.section-heading > p { max-width: 390px; color: var(--cp-text-muted); margin: 0; }
.eyebrow, .lab-index, .mono-text {
  color: var(--cp-text-soft);
  font-family: Consolas, "Courier New", Courier, monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { content: "·"; margin-right: 8px; }
.section-heading h2 {
  margin: 18px 0 0;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 500;
}

.problem-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.editorial-card {
  min-height: 280px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 16px;
  transition: transform .2s ease, border-color .2s ease;
}
.editorial-card:hover { transform: translateY(-3px); border-color: var(--cp-border-strong); }
.card-number { font-family: Consolas, "Courier New", Courier, monospace; font-size: 11px; letter-spacing: .16em; color: var(--cp-text-soft); }
.editorial-card h3 { font-size: 23px; margin: 0 0 8px; font-weight: 500; }
.editorial-card p { color: var(--cp-text-muted); margin: 0; }

.question-ladder {
  max-width: 1280px;
  margin: 72px auto 0;
  padding: 40px;
  border: 1px solid var(--cp-border);
  border-radius: 16px;
  background: var(--cp-surface);
}
.question-ladder ol { list-style: none; padding: 0; margin: 24px 0 0; }
.question-ladder li {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-top: 1px solid var(--cp-border);
}
.question-ladder li > span { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 26px; }
.question-ladder strong, .question-ladder small { display: block; }
.question-ladder strong { font-size: 18px; font-weight: 500; }
.question-ladder small { color: var(--cp-text-muted); margin-top: 3px; }

.architecture { max-width: 860px; margin: 0 auto; display: grid; gap: 12px; text-align: center; }
.arch-node {
  padding: 22px;
  border: 1px solid var(--cp-border);
  border-radius: 16px;
  background: var(--cp-surface);
}
.arch-node.featured { border-color: var(--cp-border-strong); }
.arch-node span, .arch-node strong, .arch-node small { display: block; }
.arch-node span, .arch-arrow { color: var(--cp-text-soft); font-family: Consolas, "Courier New", Courier, monospace; font-size: 10px; letter-spacing: .13em; }
.arch-node strong { font-size: 20px; font-weight: 500; margin: 4px 0; }
.arch-node small { color: var(--cp-text-muted); }
.arch-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.arch-split { display: grid; grid-template-columns: 1fr 1fr; }

.labs-shell {
  max-width: 1440px;
  margin: 0 auto;
  padding: 96px 32px 120px;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
}
.lab-sidebar { position: sticky; top: 104px; align-self: start; }
.progress-label { display: flex; justify-content: space-between; margin-top: 28px; font-size: 12px; color: var(--cp-text-muted); }
.progress-track { height: 3px; margin: 10px 0 24px; background: var(--cp-border); overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--cp-accent); transition: width .25s ease; }
.lab-sidebar nav { display: grid; }
.lab-sidebar nav a {
  padding: 14px 8px;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: start;
  border-top: 1px solid var(--cp-border);
  font-size: 13px;
}
.lab-sidebar nav a > span { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 18px; }
.lab-sidebar nav a div { font-weight: 600; }
.lab-sidebar nav small { display: block; color: var(--cp-text-muted); font-weight: 400; }
.lab-sidebar nav a.active, .lab-sidebar nav a:hover { color: var(--cp-accent); }
.lab-content { min-width: 0; }
.lab-tools {
  margin-bottom: 18px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: end;
}
.search { flex: 1; }
.search span { display: block; margin-bottom: 6px; color: var(--cp-text-muted); font-size: 12px; }
.search input {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--cp-border);
  border-radius: .625rem;
  background: var(--cp-surface);
  color: var(--cp-text);
  outline: none;
}
.search input:focus { border-color: var(--cp-accent); }
.lab-panel {
  margin-bottom: 24px;
  padding: 40px;
  background: var(--cp-surface);
  border: 1px solid var(--cp-border);
  border-radius: 16px;
  box-shadow: 0 0 2px color-mix(in srgb, var(--cp-text) 12%, transparent), 0 1px 2px color-mix(in srgb, var(--cp-text) 14%, transparent);
}
.lab-header { display: flex; justify-content: space-between; gap: 24px; align-items: start; }
.lab-header h2 { margin: 8px 0 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: -.035em; font-weight: 500; }
.complete-button {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--cp-border-strong);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}
.complete-button.done { background: var(--cp-success); border-color: var(--cp-success); color: var(--cp-accent-fg); }
.lab-lead { color: var(--cp-text-muted); font-size: 17px; max-width: 760px; margin: 22px 0 18px; }
.lab-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 28px; }
.lab-meta span { padding: 5px 10px; font-size: 10px; }
details { border-top: 1px solid var(--cp-border); }
details:last-child { border-bottom: 1px solid var(--cp-border); }
summary {
  list-style: none;
  padding: 20px 4px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--cp-text-soft); font-size: 20px; font-weight: 400; }
details[open] summary::after { content: "−"; }
summary span { font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 20px; font-weight: 400; }
.step-body { padding: 0 4px 28px 46px; color: var(--cp-text-muted); }
.step-body p { margin-top: 0; }
.step-body ol, .step-body ul { padding-left: 22px; }
.step-body li { margin: 8px 0; }
pre {
  position: relative;
  margin: 16px 0;
  padding: 18px 66px 18px 18px;
  overflow-x: auto;
  background: var(--cp-bg-elevated);
  border: 1px solid var(--cp-border);
  border-radius: .625rem;
  color: var(--cp-text);
}
code { font-family: Consolas, "Courier New", Courier, monospace; font-size: 12.5px; white-space: pre; }
.copy {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 6px 9px;
  border: 1px solid var(--cp-border);
  border-radius: .625rem;
  background: var(--cp-surface);
  color: var(--cp-text-muted);
  cursor: pointer;
  font-size: 11px;
}
.success-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-left: 3px solid var(--cp-success);
  background: var(--cp-surface-soft);
  color: var(--cp-text);
}
.concept-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.concept-row span { padding: 10px 14px; border: 1px solid var(--cp-border); border-radius: .625rem; background: var(--cp-surface-soft); color: var(--cp-text); }
.concept-row b { font-family: Consolas, "Courier New", Courier, monospace; font-size: 11px; font-weight: 400; }
.no-results { padding: 44px; text-align: center; border: 1px dashed var(--cp-border-strong); border-radius: 16px; color: var(--cp-text-muted); }

.path-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.path-grid article { padding: 28px; min-height: 300px; background: var(--cp-surface); border: 1px solid var(--cp-border); border-radius: 16px; }
.path-grid strong { display: block; font-family: Georgia, "Times New Roman", serif; font-style: italic; font-size: 56px; line-height: 1; font-weight: 400; }
.path-grid span { display: block; margin-top: 8px; color: var(--cp-text-soft); font-family: Consolas, "Courier New", Courier, monospace; font-size: 10px; letter-spacing: .15em; }
.path-grid h3 { margin: 56px 0 8px; font-size: 21px; font-weight: 500; }
.path-grid p { color: var(--cp-text-muted); margin: 0; font-size: 14px; }

footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 32px;
  border-top: 1px solid var(--cp-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
footer p { color: var(--cp-text-muted); font-size: 13px; }

@media (max-width: 900px) {
  .site-nav { grid-template-columns: 1fr auto; }
  .site-nav nav { display: none; }
  .section-heading { align-items: start; flex-direction: column; }
  .problem-grid, .path-grid { grid-template-columns: 1fr 1fr; }
  .labs-shell { grid-template-columns: 1fr; gap: 24px; padding-top: 72px; }
  .lab-sidebar { position: static; }
  .lab-sidebar nav { grid-template-columns: repeat(3, 1fr); }
  .lab-sidebar nav a { border: 1px solid var(--cp-border); margin: -1px 0 0 -1px; }
}

@media (max-width: 620px) {
  html { scroll-padding-top: 82px; }
  .site-nav { top: 10px; width: calc(100% - 20px); height: 58px; padding: 0 14px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-copy span { display: none; }
  .language-picker select { width: 88px; padding: 7px 22px 7px 9px; }
  .theme-toggle { padding: 7px 10px; }
  .hero { padding: 130px 20px 84px; min-height: auto; }
  .hero h1 { font-size: 46px; }
  .hero p { font-size: 16px; }
  .hero-meta { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 28px 16px; padding: 48px 20px; }
  .section { padding: 80px 20px; }
  .problem-grid, .path-grid, .arch-columns { grid-template-columns: 1fr; }
  .question-ladder { padding: 24px 20px; }
  .labs-shell { padding: 64px 14px 80px; }
  .lab-sidebar nav { grid-template-columns: 1fr 1fr; }
  .lab-tools { align-items: stretch; flex-direction: column; }
  .lab-panel { padding: 28px 20px; }
  .lab-header { flex-direction: column; }
  .complete-button { align-self: flex-start; }
  .step-body { padding-left: 2px; }
  summary { grid-template-columns: 36px 1fr auto; }
  pre { padding: 50px 14px 14px; }
  footer { flex-direction: column; align-items: flex-start; padding: 44px 20px; }
}

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