:root {
  --ink: #13262f;
  --ink-soft: #3f545d;
  --paper: #f5f1e8;
  --paper-deep: #ebe4d6;
  --card: #fffdf8;
  --line: #d9d0c0;
  --teal: #0f6f69;
  --teal-dark: #0a4d49;
  --orange: #d46532;
  --orange-soft: #f3d6c6;
  --green: #27744e;
  --navy: #102a38;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Iowan Old Style, Charter, Georgia, serif;
  --shadow: 0 18px 50px rgba(30, 43, 45, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 4%, rgba(15,111,105,.10), transparent 27rem),
    var(--paper);
  font-family: var(--sans);
  line-height: 1.68;
}
a { color: var(--teal-dark); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--orange); }
img { max-width: 100%; }
button, input { font: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 68px;
  border-bottom: 1px solid rgba(217,208,192,.85);
  background: rgba(245,241,232,.92);
  backdrop-filter: blur(14px);
}
.header-inner {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
  letter-spacing: -.025em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--navy);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 20px;
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.12);
}
.brand small { display: block; color: var(--ink-soft); font-size: 10px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.header-links { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; font-weight: 650; }
.header-links a { color: var(--ink-soft); text-decoration: none; }
.search-link {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 13px;
  background: var(--card);
}
.menu-toggle { display: none; margin-left: auto; border: 0; background: none; font-size: 23px; color: var(--ink); }

.app-shell {
  max-width: 1480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 274px minmax(0, 900px) 210px;
  gap: 38px;
  padding: 38px 28px 90px;
}
.side-nav { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 118px); overflow: auto; padding-right: 8px; }
.home-nav { display: none; }
.nav-kicker, .eyebrow {
  color: var(--orange);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.side-nav ul, .toc ul { list-style: none; padding: 0; margin: 10px 0 24px; }
.side-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 590;
  text-decoration: none;
  line-height: 1.35;
}
.side-nav a:hover, .side-nav a[aria-current="page"] { background: var(--card); color: var(--teal-dark); }
.side-nav a[aria-current="page"] { box-shadow: inset 3px 0 var(--orange); }
.nav-number { display: inline-block; width: 25px; color: #8b7e6b; font-family: var(--mono); font-size: 11px; }

.doc { min-width: 0; }
.doc-hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: clamp(28px, 6vw, 62px);
  border-radius: 24px;
  color: #f9f6ef;
  background: var(--navy);
  box-shadow: var(--shadow);
}
.doc-hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  right: -110px;
  top: -120px;
  border: 40px solid rgba(243,214,198,.14);
  border-radius: 50%;
}
.doc-hero .eyebrow { color: #e9a580; }
.doc-hero h1 { max-width: 760px; margin: 10px 0 14px; font-family: var(--serif); font-size: clamp(37px, 6vw, 64px); line-height: 1.02; letter-spacing: -.035em; }
.doc-hero p { max-width: 680px; margin: 0; color: #c7d4d7; font-size: 17px; }
.hero-meta { margin-top: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-meta span { padding: 5px 10px; border: 1px solid rgba(255,255,255,.15); border-radius: 999px; color: #dce7e7; font-size: 11px; font-weight: 700; }

.progress-banner, .task-progress {
  border: 1px solid #e0aa89;
  background: #fff7f1;
  color: #713b24;
}
.progress-banner { margin: 0 0 28px; padding: 20px 22px; border-radius: 14px; display: flex; gap: 14px; }
.progress-dot { flex: 0 0 10px; height: 10px; margin-top: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 5px var(--orange-soft); }
.progress-banner strong { display: block; margin-bottom: 2px; color: #552a17; }

.prose {
  padding: clamp(24px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255,253,248,.9);
  box-shadow: var(--shadow);
}
.prose h2, .prose h3, .prose h4 { scroll-margin-top: 88px; color: var(--navy); }
.prose h2 { margin: 2.3em 0 .7em; padding-top: .45em; border-top: 1px solid var(--line); font-family: var(--serif); font-size: clamp(26px, 4vw, 36px); line-height: 1.18; letter-spacing: -.02em; }
.prose h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { margin: 1.8em 0 .45em; font-size: 21px; line-height: 1.3; }
.prose p { margin: 0 0 1.15em; }
.prose strong { color: #152d38; }
.prose ul, .prose ol { padding-left: 1.35em; margin: .7em 0 1.25em; }
.prose li { margin: .32em 0; }
.prose li::marker { color: var(--orange); font-weight: 700; }
.prose blockquote { margin: 1.4em 0; padding: 5px 0 5px 20px; border-left: 4px solid var(--orange); color: var(--ink-soft); }
.prose code { padding: .14em .36em; border-radius: 5px; background: #eee9df; color: #854326; font-family: var(--mono); font-size: .88em; }
.prose pre { overflow: auto; margin: 1.4em 0; padding: 18px; border-radius: 12px; background: #112833; color: #e8efef; line-height: 1.55; }
.prose pre code { padding: 0; background: none; color: inherit; }
.math-block { overflow-x: auto; margin: 1.6em 0; padding: 16px; border-left: 3px solid var(--teal); background: #edf4f1; text-align: center; }

.table-wrap { overflow-x: auto; margin: 1.35em 0 2em; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.48; }
th { padding: 11px 13px; color: white; background: var(--navy); text-align: left; font-size: 11px; letter-spacing: .045em; text-transform: uppercase; }
td { padding: 12px 13px; border-top: 1px solid var(--line); vertical-align: top; }
tr:nth-child(even) td { background: rgba(235,228,214,.33); }
.progress-cell { min-width: 170px; color: #7b4026; font-weight: 700; }
.progress-cell::before { content: "○"; margin-right: 7px; color: var(--orange); }
.task-progress { margin: -4px 0 20px; padding: 12px 14px; border-radius: 10px; font-size: 13px; font-weight: 650; }

.toc { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; }
.toc a { display: block; margin: 7px 0; color: #607179; font-size: 11px; line-height: 1.35; text-decoration: none; }
.toc a:hover { color: var(--orange); }

.landing-shell { max-width: 1240px; margin: 0 auto; padding: 42px 28px 90px; }
.landing-hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 26px; align-items: stretch; }
.landing-hero .doc-hero { margin: 0; min-height: 470px; display: flex; flex-direction: column; justify-content: flex-end; }
.status-panel { padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); }
.status-panel h2 { margin: 9px 0 5px; font-family: var(--serif); font-size: 31px; line-height: 1.13; }
.status-stat { margin: 25px 0 10px; font-family: var(--serif); font-size: 66px; line-height: 1; color: var(--teal-dark); }
.status-panel p { color: var(--ink-soft); }
.section-head { max-width: 720px; margin: 80px 0 25px; }
.section-head h2 { margin: 6px 0 8px; font-family: var(--serif); font-size: clamp(32px, 5vw, 48px); line-height: 1.05; }
.section-head p { color: var(--ink-soft); }
.overview-feature { display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; margin-top: 26px; padding: 32px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.overview-feature h2 { margin: 8px 0 12px; font-family: var(--serif); font-size: 32px; line-height: 1.15; }
.overview-feature p { color: var(--ink-soft); }
.overview-button { display: inline-block; padding: 11px 18px; border-radius: 9px; background: var(--teal-dark); color: white; font-size: 14px; font-weight: 700; text-decoration: none; }
.overview-button:hover { color: white; background: var(--navy); }
.overview-topics { display: grid; align-content: center; gap: 12px; }
.overview-topics a { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 650; text-decoration: none; }
.overview-return { margin: 0 0 22px; font-size: 14px; font-weight: 650; }
.workstream-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.workstream-card { min-height: 235px; padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: inherit; background: var(--card); text-decoration: none; transition: transform .18s, box-shadow .18s; }
.workstream-card:hover { transform: translateY(-3px); color: inherit; box-shadow: var(--shadow); }
.workstream-card .index { color: var(--orange); font-family: var(--mono); font-size: 11px; font-weight: 800; }
.workstream-card h3 { margin: 15px 0 8px; font-family: var(--serif); font-size: 25px; line-height: 1.12; }
.workstream-card p { margin: 0 0 18px; color: var(--ink-soft); font-size: 13px; }
.task-count { display: inline-block; margin-top: auto; padding: 4px 9px; border-radius: 999px; color: var(--teal-dark); background: #deefea; font-size: 11px; font-weight: 750; }
.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--line); }
.principle { padding: 26px; background: var(--card); }
.principle b { display: block; margin-bottom: 7px; color: var(--navy); }
.principle p { margin: 0; color: var(--ink-soft); font-size: 13px; }
.sequence { counter-reset: step; display: grid; gap: 10px; }
.sequence a { display: grid; grid-template-columns: 44px 1fr auto; gap: 15px; align-items: center; padding: 16px 19px; border: 1px solid var(--line); border-radius: 12px; color: inherit; background: var(--card); text-decoration: none; }
.sequence a::before { counter-increment: step; content: counter(step, decimal-leading-zero); color: var(--orange); font-family: var(--mono); font-weight: 800; }
.sequence strong { color: var(--navy); }
.sequence span { color: var(--ink-soft); font-size: 12px; }
.sequence em { color: #7b4026; font-size: 11px; font-style: normal; font-weight: 750; }

.site-footer { padding: 32px 28px; border-top: 1px solid var(--line); color: #697980; text-align: center; font-size: 12px; }
.search-dialog { width: min(680px, calc(100% - 30px)); border: 0; border-radius: 18px; padding: 0; box-shadow: 0 28px 100px rgba(16,42,56,.30); background: var(--card); }
.search-dialog::backdrop { background: rgba(16,42,56,.55); backdrop-filter: blur(3px); }
.search-box { padding: 23px; }
.search-box input { width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); outline: none; }
.search-box input:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(15,111,105,.12); }
.search-results { max-height: 54vh; overflow: auto; margin-top: 12px; }
.search-result { display: block; padding: 11px 12px; border-radius: 9px; color: inherit; text-decoration: none; }
.search-result:hover { background: var(--paper); color: inherit; }
.search-result strong { display: block; color: var(--teal-dark); }
.search-result span { color: var(--ink-soft); font-size: 12px; }

@media (max-width: 1160px) {
  .app-shell { grid-template-columns: 238px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 820px) {
  .header-links { display: none; }
  .menu-toggle { display: block; }
  .app-shell { display: block; padding: 22px 16px 60px; }
  .side-nav { position: fixed; inset: 68px 0 auto 0; z-index: 19; display: none; max-height: calc(100vh - 68px); padding: 20px; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
  .side-nav.open { display: block; }
  .prose { padding: 24px 18px; }
  .landing-shell { padding: 22px 16px 60px; }
  .landing-hero { grid-template-columns: 1fr; }
  .overview-feature { grid-template-columns: 1fr; padding: 24px; }
  .landing-hero .doc-hero { min-height: 430px; }
  .workstream-grid { grid-template-columns: repeat(2, 1fr); }
  .principles { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
  .header-inner { padding: 0 16px; }
  .brand small { display: none; }
  .doc-hero { border-radius: 17px; }
  .workstream-grid { grid-template-columns: 1fr; }
  .sequence a { grid-template-columns: 35px 1fr; }
  .sequence em { grid-column: 2; }
  .progress-banner { display: block; }
  .progress-dot { margin: 0 0 12px; }
}

@media print {
  .site-header, .side-nav, .toc, .site-footer { display: none; }
  body { background: white; }
  .app-shell { display: block; max-width: none; padding: 0; }
  .doc-hero { color: black; background: white; box-shadow: none; border: 1px solid #aaa; }
  .doc-hero p { color: #333; }
  .prose { box-shadow: none; border: 0; }
}
