:root {
  color-scheme: light;
  --ink: #17251f;
  --ink-soft: #58645e;
  --paper: #f4f1e9;
  --paper-bright: #fbfaf6;
  --line: #d7d2c5;
  --moss: #315c4a;
  --moss-dark: #1e3c30;
  --sage: #dce7df;
  --sage-dark: #c8d9ce;
  --gold: #d5a154;
  --rust: #97523b;
  --shadow: 0 16px 42px rgba(23, 37, 31, 0.07);
  --serif: Iowan Old Style, Baskerville, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #edf1ed;
  --ink-soft: #adb8b1;
  --paper: #101914;
  --paper-bright: #18231e;
  --line: #36443c;
  --moss: #a8c9b8;
  --moss-dark: #d4e2da;
  --sage: #24372e;
  --sage-dark: #2d4739;
  --gold: #e1ae61;
  --rust: #e39a7d;
  --shadow: 0 16px 42px rgba(0, 0, 0, 0.23);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.62;
}
a { color: inherit; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, p { text-wrap: pretty; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--paper-bright);
  color: var(--ink);
  transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 680px;
  background:
    radial-gradient(circle at 85% 28%, rgba(213, 161, 84, 0.25), transparent 25%),
    linear-gradient(135deg, #13231c 0%, #244235 60%, #385b48 100%);
  color: #f8f5ec;
}
.hero::after {
  content: "";
  position: absolute;
  right: -10rem;
  bottom: -25rem;
  width: 45rem;
  height: 45rem;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  box-shadow: 0 0 0 6rem rgba(255,255,255,.025), 0 0 0 13rem rgba(255,255,255,.018);
}
.topbar,
.hero__content,
.page-shell,
footer {
  width: min(1200px, calc(100% - 40px));
  margin-inline: auto;
}
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}
.brand__mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.58);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 17px;
}
.topbar__actions { display: flex; gap: 8px; }
.button {
  padding: 9px 14px;
  border: 1px solid #f3eee1;
  border-radius: 999px;
  background: #f3eee1;
  color: #17251f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
}
.button--quiet { border-color: rgba(255,255,255,.28); background: transparent; color: inherit; }
.button:hover { transform: translateY(-1px); }
.button:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.hero__content {
  position: relative;
  z-index: 1;
  padding: 100px 0 130px;
}
.status-pill {
  display: inline-block;
  margin-bottom: 50px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 999px;
  color: rgba(255,255,255,.66);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.eyebrow,
.kicker {
  margin: 0 0 13px;
  color: var(--moss);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #e7bd79; }
h1 {
  max-width: 950px;
  margin: 0 0 25px;
  font-family: var(--serif);
  font-size: clamp(52px, 7.3vw, 91px);
  font-weight: 500;
  letter-spacing: -.047em;
  line-height: .98;
}
.dek {
  max-width: 730px;
  margin: 0;
  color: rgba(255,255,255,.75);
  font-family: var(--serif);
  font-size: clamp(20px, 2.3vw, 26px);
  line-height: 1.42;
}

.page-shell {
  display: grid;
  grid-template-columns: 235px minmax(0, 820px);
  justify-content: space-between;
  gap: 76px;
}
.sidebar { position: relative; }
.sidebar__inner {
  position: sticky;
  top: 24px;
  padding-top: 82px;
}
.sidebar__label {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.sidebar ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.sidebar li { border-bottom: 1px solid var(--line); }
.sidebar a {
  display: grid;
  grid-template-columns: 25px 1fr;
  gap: 7px;
  padding: 11px 1px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.3;
  text-decoration: none;
}
.sidebar a:hover, .sidebar a.is-active { color: var(--moss); }
.sidebar a span { color: var(--rust); font-size: 9px; font-weight: 850; }
.sidebar__note {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 28px;
  padding: 16px;
  border-left: 3px solid var(--gold);
  background: var(--paper-bright);
  font-size: 11px;
}
.sidebar__note span { color: var(--ink-soft); }

main { min-width: 0; }
.section {
  padding: 86px 0 94px;
  scroll-margin-top: 20px;
  border-bottom: 1px solid var(--line);
}
.section--lead { padding-top: 92px; }
.section-heading { margin-bottom: 43px; }
.section h2,
.handoff h2 {
  max-width: 760px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(36px, 4.3vw, 55px);
  font-weight: 500;
  letter-spacing: -.037em;
  line-height: 1.06;
}
.section h3 { margin: 0 0 7px; font-size: 18px; letter-spacing: -.015em; line-height: 1.3; }
.section p { color: var(--ink-soft); }
.section-intro { max-width: 650px; margin: 18px 0 0; font-family: var(--serif); font-size: 20px; }
.lead-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; margin-top: 35px; }
.lead {
  margin: 0;
  color: var(--ink) !important;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.55;
}
.callout {
  margin-top: 32px;
  padding: 25px 28px;
  border-left: 4px solid var(--gold);
  background: var(--sage);
}
.callout--decision { margin: 0; background: var(--moss-dark); color: var(--paper-bright); }
.callout strong { display: block; margin-bottom: 7px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.callout p { margin: 0; color: inherit; }
.callout--decision p { color: color-mix(in srgb, var(--paper-bright) 75%, transparent); }

.goal-list { border-top: 1px solid var(--line); }
.goal-list article {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 17px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}
.goal-list article > span { color: var(--rust); font-size: 11px; font-weight: 850; letter-spacing: .1em; }
.goal-list p { max-width: 650px; margin: 0; }

.inventory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inventory article {
  min-height: 255px;
  padding: 28px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}
.inventory p:last-child { margin-bottom: 0; }
.inventory__data { grid-column: 1 / -1; min-height: auto !important; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 25px 0 20px; }
.stat-grid div { display: flex; flex-direction: column; padding-right: 12px; border-right: 1px solid var(--line); }
.stat-grid div:last-child { border-right: 0; }
.stat-grid strong { font-family: var(--serif); font-size: 42px; font-weight: 500; line-height: 1; }
.stat-grid span { margin-top: 6px; color: var(--ink-soft); font-size: 11px; }
.small { font-size: 13px; }
.asset-label {
  display: inline-block;
  margin: 0 0 18px !important;
  padding: 5px 8px;
  border-radius: 3px;
  background: var(--sage);
  color: var(--moss) !important;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.caveat {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 22px;
  margin-top: 16px;
  padding: 18px 22px;
  border: 1px dashed var(--line);
}
.caveat strong { font-size: 12px; }
.caveat p { margin: 0; font-size: 13px; }

.system-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: stretch;
  gap: 14px;
}
.system-flow article { min-height: 250px; padding: 26px; border: 1px solid var(--line); background: var(--paper-bright); }
.flow-number { color: var(--rust); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.system-flow h3 { margin-top: 43px; font-family: var(--serif); font-size: 23px; }
.system-flow p { margin-bottom: 0; font-size: 14px; }
.flow-arrow { display: grid; place-items: center; color: var(--moss); font-size: 20px; }
.formula-card {
  margin: 24px 0;
  padding: 38px;
  background: #1e3c30;
  color: #f8f5ec;
}
.formula-card .kicker { color: var(--gold); }
.equation {
  max-width: 100%;
  margin: 18px 0 26px;
  padding: 22px 25px;
  overflow: hidden;
  border: 1px solid #3b5d4f;
  border-radius: 4px;
  background: #142b22;
}
.equation code {
  display: block;
  padding: 0;
  background: transparent;
  color: #fff0cf;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(14px, 2vw, 19px);
  line-height: 1.55;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.formula-card > p:last-child { margin: 0; color: rgba(255,255,255,.77); }
.formula-card strong { color: #fff; }
.formula-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 25px;
}
.formula-inputs div {
  display: flex;
  min-height: 95px;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.13);
  background: rgba(255,255,255,.055);
}
.formula-inputs span { color: rgba(255,255,255,.72); font-size: 13px; }
.formula-card--results { background: #4a3229; }
.formula-card--results .equation { border-color: #745142; background: #33221c; }
.example { display: grid; grid-template-columns: .85fr 1.15fr; gap: 35px; padding: 30px; background: var(--sage); }
.example ol { margin: 0; padding-left: 22px; }
.example li { margin-bottom: 12px; color: var(--ink-soft); }
.example li:last-child { margin-bottom: 0; }
.example-cases p { margin: 0 0 16px; }
.example-cases p:last-child { margin-bottom: 0; }

.proposal-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.proposal-grid article { min-height: 220px; padding: 29px; border: 1px solid var(--line); background: var(--paper-bright); }
.proposal-grid .proposal-derived { grid-column: 1 / -1; min-height: 200px; background: var(--sage); }
.proposal-tag, .phase-status {
  display: inline-block;
  margin-bottom: 35px;
  color: var(--rust);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.proposal-grid p { margin-bottom: 0; }

.rubric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rubric-grid article {
  min-height: 300px;
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--paper-bright);
  box-shadow: var(--shadow);
}
.rubric-grid .rubric-derived { grid-column: 1 / -1; min-height: 250px; background: var(--sage); }
.rubric-number {
  display: block;
  margin-bottom: 38px;
  color: var(--rust);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.rubric-grid h3 { font-family: var(--serif); font-size: 26px; }
.rubric-grid .rubric-question { color: var(--ink); font-size: 17px; font-weight: 750; }
.rubric-grid small { display: block; margin-top: 22px; color: var(--ink-soft); }

.reason-table { border-top: 1px solid var(--line); }
.reason-row { display: grid; grid-template-columns: .8fr 1.2fr; gap: 35px; padding: 22px 8px; border-bottom: 1px solid var(--line); }
.reason-row strong { font-size: 14px; }
.reason-row p { margin: 0; font-size: 14px; }
.reason-row--header { padding-top: 10px; padding-bottom: 10px; color: var(--ink-soft); font-size: 9px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }

.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; top: 20px; bottom: 20px; left: 21px; width: 1px; background: var(--line); }
.timeline__item { position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 26px; padding-bottom: 45px; }
.timeline__marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 850;
}
.timeline__item--current .timeline__marker { border-color: var(--gold); background: var(--gold); color: #2d2518; }
.timeline__item .phase-status { margin-bottom: 7px; }
.timeline__item p { margin: 0 0 10px; }
.timeline__item .output { font-size: 13px; }
code { padding: .13em .35em; border-radius: 3px; background: var(--sage); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .84em; }
.parallel-note { display: grid; grid-template-columns: 165px 1fr; gap: 25px; padding: 24px 27px; border-left: 4px solid var(--gold); background: var(--sage); }
.parallel-note span { color: var(--rust); font-size: 10px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.parallel-note p { margin: 0; }

.checklist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.checklist article { display: grid; grid-template-columns: 27px 1fr; gap: 11px; padding: 22px; border: 1px solid var(--line); background: var(--paper-bright); }
.checklist span { color: var(--moss); font-weight: 900; }
.checklist p { margin: 0; font-size: 14px; }
.not-doing { margin-top: 35px; padding: 30px; border: 1px solid var(--line); }
.not-doing ul { margin: 14px 0 0; padding-left: 20px; color: var(--ink-soft); }
.not-doing li { margin-bottom: 7px; }

.handoff {
  margin: 95px 0 120px;
  padding: 52px;
  background: var(--moss-dark);
  color: var(--paper-bright);
}
.handoff .eyebrow { color: var(--gold); }
.handoff h2 { margin-bottom: 24px; }
.handoff > p:last-child { max-width: 680px; margin-bottom: 0; color: color-mix(in srgb, var(--paper-bright) 72%, transparent); font-size: 18px; }

footer { display: flex; justify-content: space-between; padding: 35px 0 50px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }
footer p { margin: 0; }
footer a { color: var(--moss); font-weight: 800; text-decoration: none; }
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 4px;
  background: var(--ink);
  color: var(--paper-bright);
  box-shadow: var(--shadow);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: 180ms ease;
}
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .page-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .hero { min-height: 610px; }
  .system-flow { grid-template-columns: 1fr; }
  .flow-arrow { transform: rotate(90deg); }
}

@media (max-width: 650px) {
  .topbar, .hero__content, .page-shell, footer { width: min(100% - 28px, 1200px); }
  .brand span:last-child, .button--quiet { display: none; }
  .hero { min-height: 600px; }
  .hero__content { padding: 75px 0 100px; }
  .status-pill { margin-bottom: 42px; }
  h1 { font-size: 47px; }
  .section { padding: 68px 0 75px; }
  .lead-grid, .inventory, .proposal-grid, .rubric-grid, .checklist, .example { grid-template-columns: 1fr; }
  .inventory__data, .proposal-grid .proposal-derived, .rubric-grid .rubric-derived { grid-column: auto; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid div:nth-child(2) { border-right: 0; }
  .caveat, .reason-row, .reason-row--header, .parallel-note { grid-template-columns: 1fr; gap: 8px; }
  .formula-card { padding: 28px 22px; }
  .formula-inputs { grid-template-columns: 1fr; }
  .goal-list article { grid-template-columns: 40px 1fr; }
  .handoff { margin: 70px 0 85px; padding: 34px 26px; }
  footer { gap: 20px; }
}

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

@media print {
  :root { --paper: #fff; --paper-bright: #fff; --ink: #111; --ink-soft: #444; --line: #bbb; }
  .hero { min-height: auto; background: #fff; color: #111; }
  .hero::after, .topbar, .sidebar, .toast { display: none !important; }
  .hero .eyebrow, .eyebrow { color: #555; }
  .dek { color: #333; }
  .hero__content { padding: 45px 0; }
  .page-shell { display: block; }
  .section { padding: 45px 0; }
  .inventory article, .system-flow article, .proposal-grid article, .rubric-grid article, .checklist article { break-inside: avoid; box-shadow: none; }
}
