/* ==========================================================================
   bizzbun — creative agency operations
   Design system + document styles · Segment 1 of 2
   Pairs with index.html

   Contents
   01. Design tokens
   02. Reset & base
   03. Typography
   04. Layout primitives
   05. Header, nav, scroll progress
   06. Hero
   07. Section headers
   08. Cards & grids
   09. Badges, chips, labels
   10. Buttons
   11. Stats & metrics
   12. Tables
   13. Plan timeline (phases)
   14. Gantt schedule
   15. Flow & architecture diagrams
   16. Roles
   17. Milestones & steps
   18. Checklist
   19. Callouts
   20. Code & API routes
   21. Schema explorer
   22. Footer
   23. Responsive
   24. Print & motion
   ========================================================================== */

/* 01. DESIGN TOKENS
   ========================================================================== */

:root {
  /* Palette — warm paper, ink, terracotta, pine */
  --paper:        #f6f1e8;
  --paper-deep:   #efe8db;
  --surface:      #fffdf9;
  --surface-soft: #fbf7ef;

  --ink:          #17150f;
  --ink-2:        #3b372d;
  --muted:        #6e6759;
  --faint:        #948c7b;

  --line:         #e4dccd;
  --line-soft:    #efe8da;
  --line-strong:  #cfc3ae;

  --accent:       #d9532b;
  --accent-deep:  #a93a17;
  --accent-wash:  #f8e3d7;
  --accent-line:  #edc3af;

  --pine:         #103c31;
  --pine-2:       #1a5847;
  --sage:         #7d9b8a;

  --gold:         #b9852b;
  --gold-wash:    #f7ecd6;
  --ok:           #2e7a5b;
  --ok-wash:      #e2efe8;
  --warn:         #b1651c;
  --warn-wash:    #faeadb;
  --danger:       #b23a2b;
  --danger-wash:  #f7e1dc;

  /* Type */
  --font-display: "Instrument Serif", "Iowan Old Style", "Palatino Linotype",
                  Palatino, Georgia, serif;
  --font-sans:    "Inter", "Inter Tight", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono",
                  Menlo, Consolas, monospace;

  --fs-display: clamp(3.1rem, 7vw, 5.9rem);
  --fs-h2:      clamp(2rem, 3.7vw, 3.1rem);
  --fs-h3:      clamp(1.1rem, 1.25vw, 1.3rem);
  --fs-body:    clamp(0.98rem, 0.32vw + 0.9rem, 1.06rem);
  --fs-small:   0.845rem;
  --fs-micro:   0.7rem;

  /* Space & shape */
  --shell:      1280px;
  --gutter:     clamp(20px, 5vw, 56px);
  --measure:    70ch;
  --r-xs:       7px;
  --r-sm:       10px;
  --r:          14px;
  --r-lg:       20px;
  --r-pill:     999px;

  --space-section: clamp(64px, 8.5vw, 116px);

  --shadow-sm: 0 1px 2px rgba(23, 21, 15, 0.05);
  --shadow:    0 1px 2px rgba(23, 21, 15, 0.05),
               0 18px 38px -26px rgba(23, 21, 15, 0.42);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 02. RESET & BASE
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 560px at 88% -8%, rgba(217, 83, 43, 0.10), transparent 62%),
    radial-gradient(900px 500px at -12% 4%, rgba(16, 60, 49, 0.07), transparent 60%),
    radial-gradient(800px 600px at 50% 108%, rgba(185, 133, 43, 0.07), transparent 65%);
  background-repeat: no-repeat;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.65;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--ink);
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  transition: color 160ms var(--ease), text-decoration-color 160ms var(--ease);
}

a:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

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

/* 03. TYPOGRAPHY
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.15;
  text-wrap: balance;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.02;
}

h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); letter-spacing: -0.01em; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

strong { color: var(--ink); font-weight: 600; }
em { font-style: italic; }

.lead {
  max-width: var(--measure);
  color: var(--muted);
  font-size: clamp(1.02rem, 0.5vw + 0.92rem, 1.16rem);
  line-height: 1.6;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1.4;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.8em;
  letter-spacing: 0.01em;
}

.muted { color: var(--muted); }
.small { font-size: var(--fs-small); }
.tiny {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.06em;
  color: var(--muted);
}

.mark {
  background: linear-gradient(transparent 58%, var(--accent-wash) 58%, var(--accent-wash) 94%, transparent 94%);
  color: var(--ink);
  padding: 0 2px;
}

.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;
}

/* 04. LAYOUT PRIMITIVES
   ========================================================================== */

.shell {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.layout {
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-block: clamp(40px, 6vw, 72px);
}

.main {
  min-width: 0;
  display: grid;
  gap: var(--space-section);
}

.section {
  scroll-margin-top: 96px;
}

.section > * + * { margin-top: 22px; }

.stack-sm > * + * { margin-top: 10px; }

.hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin-block: clamp(32px, 5vw, 56px);
}

.hr--short {
  width: 64px;
  border-top-color: var(--line-strong);
}

/* 05. HEADER, NAV, SCROLL PROGRESS
   ========================================================================== */

.scroll-progress {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
}

.scroll-progress__fill {
  display: block;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

@supports (animation-timeline: scroll()) {
  .scroll-progress__fill {
    animation: bb-progress linear both;
    animation-timeline: scroll(root block);
  }

  @keyframes bb-progress {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(246, 241, 232, 0.86);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding: 11px var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand:hover { color: var(--ink); }

.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--accent);
  color: #fff8f2;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  padding-bottom: 3px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14);
}

.brand__name {
  color: var(--ink);
  font-weight: 650;
  font-size: 1.08rem;
  letter-spacing: -0.035em;
}

.brand__tag {
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin-left: auto;
}

.nav::-webkit-scrollbar { display: none; }

.nav__link {
  padding: 7px 11px;
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  transition: color 150ms var(--ease), background-color 150ms var(--ease);
}

.nav__link:hover {
  color: var(--ink);
  background: var(--surface);
}

.nav__link[aria-current="true"] {
  color: var(--ink);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
}

/* 06. HERO
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(44px, 7vw, 88px) clamp(36px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}

.hero::before {
  content: "";
  position: absolute;
  inset: -30% -10% auto auto;
  width: 620px;
  height: 620px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 83, 43, 0.10), transparent 66%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(286px, 356px);
  gap: clamp(28px, 4vw, 60px);
  align-items: end;
}

.hero__title {
  margin: 18px 0 0;
  font-size: var(--fs-display);
  line-height: 0.94;
  letter-spacing: -0.028em;
  text-wrap: balance;
}

.hero__title em {
  font-style: italic;
  color: var(--accent);
}

.hero__sub {
  max-width: 54ch;
  margin-top: 22px;
  color: var(--muted);
  font-size: clamp(1.02rem, 0.55vw + 0.9rem, 1.18rem);
  line-height: 1.62;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
}

.hero__side {
  display: grid;
  gap: 12px;
}

.hero__note {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  line-height: 1.65;
  letter-spacing: 0.03em;
  color: var(--faint);
}

.doc-flag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.doc-flag__dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.doc-flag__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.35;
}

/* Spec card — dark pine panel in the hero */
.spec {
  position: relative;
  overflow: hidden;
  padding: 24px 22px 20px;
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 100% at 100% 0%, #1d5c4a 0%, #123f33 45%, #0d3128 100%);
  color: #f1e9db;
  box-shadow:
    0 1px 2px rgba(13, 49, 40, 0.3),
    0 24px 50px -30px rgba(13, 49, 40, 0.85);
}

.spec::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -90px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(241, 233, 219, 0.14);
  border-radius: 50%;
  pointer-events: none;
}

.spec__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(241, 233, 219, 0.18);
}

.spec__head span {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(241, 233, 219, 0.58);
}

.spec__head strong {
  color: #f6efe3;
  font-size: 0.86rem;
  font-weight: 600;
}

.spec__rows {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
}

.spec__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(241, 233, 219, 0.16);
  font-size: 0.82rem;
}

.spec__row:last-child { border-bottom: 0; }

.spec__k {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241, 233, 219, 0.52);
  white-space: nowrap;
}

.spec__v {
  color: #f4ecdf;
  text-align: right;
  font-weight: 500;
}

.spec__v em {
  color: #e9a98f;
  font-style: normal;
}

/* Meta strip under the hero title */
.hero__meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: clamp(32px, 5vw, 54px);
  border-top: 1px solid var(--line);
}

.hero__meta > div {
  padding: 18px 20px 0 0;
}

.hero__meta > div + div {
  padding-left: 20px;
  border-left: 1px solid var(--line);
}

.meta__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  line-height: 1;
  color: var(--ink);
}

.meta__label {
  display: block;
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 07. SECTION HEADERS
   ========================================================================== */

.section__head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding-top: 2px;
}

.section__num {
  padding-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.section__title {
  font-size: var(--fs-h2);
}

.section__head .lead {
  margin-top: 12px;
}

/* 08. CARDS & GRIDS
   ========================================================================== */

.grid {
  display: grid;
  gap: 14px;
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  position: relative;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.card--soft {
  background: var(--surface-soft);
  border-color: var(--line-soft);
  box-shadow: none;
}

.card--plain {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.card--dark {
  border-color: transparent;
  background: var(--pine);
  color: rgba(241, 233, 219, 0.78);
}

.card--dark h3,
.card--dark .card__title { color: #f4ecdf; }

.card--accent {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, #fffdf9, var(--accent-wash));
}

.card__title {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card__text {
  margin-top: 8px;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.6;
}

.card__foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 13px;
  border-top: 1px dashed var(--line);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
  color: var(--faint);
}

.card__badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 600;
  flex-shrink: 0;
}

.card__badge--pine { background: var(--ok-wash); color: var(--pine-2); }
.card__badge--gold { background: var(--gold-wash); color: var(--gold); }

/* Scope cards — large ghost letter */
.scope-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: clamp(18px, 2.2vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.scope-card__letter {
  font-family: var(--font-display);
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
}

.scope-card--pine .scope-card__letter { color: var(--pine-2); }
.scope-card--gold .scope-card__letter { color: var(--gold); }

.scope-card h3 { margin-bottom: 4px; }
.scope-card p { color: var(--muted); font-size: var(--fs-small); }

/* Small lined list */
.ticks {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
}

.ticks li {
  position: relative;
  padding-left: 17px;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 6px;
  height: 6px;
  border-radius: 1.5px;
  background: var(--accent-line);
}

.ticks--pine li::before { background: var(--sage); }
.ticks--plain li::before { background: var(--line-strong); }

/* Deferred features */
.defer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.defer li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.defer li::before {
  content: "×";
  color: var(--faint);
  font-family: var(--font-mono);
  text-decoration: none;
}

/* 09. BADGES, CHIPS, LABELS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.6;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge--accent { color: var(--accent-deep); background: var(--accent-wash); border-color: var(--accent-line); }
.badge--ok     { color: var(--ok); background: var(--ok-wash); border-color: #c9dfd3; }
.badge--gold   { color: var(--warn); background: var(--gold-wash); border-color: #ecd8b3; }
.badge--dark   { color: #f4ecdf; background: var(--pine); border-color: var(--pine); }
.badge--ghost  { background: transparent; }
.badge--no-dot::before { display: none; }

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  letter-spacing: 0.03em;
}

.chip--accent {
  border-color: var(--accent-line);
  background: var(--accent-wash);
  color: var(--accent-deep);
}

.chip--dark {
  border-color: rgba(241, 233, 219, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(241, 233, 219, 0.82);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
  color: var(--muted);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend__swatch {
  width: 18px;
  height: 7px;
  border-radius: 3px;
  background: var(--accent);
}

.legend__swatch--pine { background: var(--pine-2); }
.legend__swatch--gold { background: var(--gold); }
.legend__swatch--line {
  background: transparent;
  border: 1px dashed var(--line-strong);
}

/* 10. BUTTONS
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 18px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 550;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease),
              border-color 160ms var(--ease), color 160ms var(--ease);
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--solid {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-sm);
}

.btn--solid:hover {
  background: var(--accent);
  color: #fff;
}

.btn--accent {
  background: var(--accent);
  color: #fff8f2;
}

.btn--accent:hover {
  background: var(--accent-deep);
  color: #fff;
}

.btn--ghost {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
}

.btn--sm {
  min-height: 34px;
  padding: 6px 13px;
  font-size: 0.78rem;
}

.btn__arrow {
  font-family: var(--font-mono);
  font-size: 0.9em;
  opacity: 0.7;
  transition: transform 160ms var(--ease);
}

.btn:hover .btn__arrow { transform: translateX(2px); }

/* 11. STATS & METRICS
   ========================================================================== */

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}

.metric {
  padding: clamp(16px, 2vw, 24px);
}

.metric + .metric {
  border-left: 1px solid var(--line);
}

.metric__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.6rem);
  line-height: 1;
  color: var(--ink);
}

.metric__value span {
  font-family: var(--font-mono);
  font-size: 0.34em;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-left: 3px;
}

.metric__label {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

/* 12. TABLES
   ========================================================================== */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
  text-align: left;
}

.data caption {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
}

.data th {
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.data td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  vertical-align: top;
}

.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr { transition: background-color 140ms var(--ease); }
.data tbody tr:hover { background: var(--surface-soft); }

.data td strong,
.data td .cell-title {
  display: block;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.885rem;
}

.data td .cell-sub {
  display: block;
  margin-top: 2px;
  color: var(--faint);
  font-size: 0.76rem;
}

.data .num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-2);
  white-space: nowrap;
}

.data .nowrap { white-space: nowrap; }

.data--compact td { padding: 9px 18px; }

.table-note {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  line-height: 1.6;
  color: var(--faint);
}

/* 13. PLAN TIMELINE (PHASES)
   ========================================================================== */

.plan-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface-soft);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.plan-note strong { color: var(--ink); font-weight: 600; }

.plan {
  position: relative;
  display: grid;
  gap: 16px;
  padding-left: 46px;
}

.plan::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--line-strong) 22%, var(--line-strong) 88%, transparent 100%);
}

.phase {
  position: relative;
  padding: clamp(18px, 2.4vw, 26px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}

.phase:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.phase__dot {
  position: absolute;
  left: -46px;
  top: 20px;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.phase--active {
  border-color: var(--accent-line);
  background: linear-gradient(180deg, #fffdf9 55%, #fdf4ed 100%);
}

.phase--active .phase__dot {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 5px var(--accent-wash);
}

.phase--buffer .phase__dot {
  border-style: dashed;
  background: var(--surface);
  color: var(--faint);
}

.phase__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.phase__heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.phase__index {
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

.phase__title {
  font-size: clamp(1.05rem, 1.4vw, 1.22rem);
  font-weight: 600;
  letter-spacing: -0.015em;
}

.phase__dates {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-soft);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.phase__dates .sep { color: var(--line-strong); }

.phase__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
}

.phase__meta .badge { transform: translateY(-1px); }

.phase__body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.phase__tasks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phase__tasks li {
  position: relative;
  padding-left: 15px;
  color: var(--muted);
  font-size: 0.805rem;
  line-height: 1.5;
}

.phase__tasks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 1px;
}

.phase--active .phase__tasks li::before { border-color: var(--accent); }

.phase__side {
  display: grid;
  gap: 10px;
  align-content: start;
}

.exit {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: var(--surface-soft);
}

.exit__label {
  display: block;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.exit p {
  color: var(--ink-2);
  font-size: 0.8rem;
  line-height: 1.5;
}

.load {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.load__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  letter-spacing: 0.05em;
  color: var(--muted);
}

.load__head strong { color: var(--ink); font-weight: 600; }

.meter {
  height: 5px;
  margin-top: 8px;
  border-radius: var(--r-pill);
  background: var(--line-soft);
  overflow: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  width: var(--fill, 50%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #e88a54);
}

.meter--pine > span { background: linear-gradient(90deg, var(--pine-2), var(--sage)); }
.meter--gold > span { background: linear-gradient(90deg, var(--gold), #d8ab5a); }
.meter--ghost > span { background: var(--line-strong); }

/* 14. GANTT SCHEDULE
   ========================================================================== */

.gantt-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.gantt {
  min-width: 720px;
}

.gantt__head,
.gantt__row {
  display: grid;
  grid-template-columns: 150px repeat(9, minmax(0, 1fr));
  align-items: stretch;
}

.gantt__head {
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.gantt__head > span {
  padding: 10px 12px;
  border-left: 1px solid var(--line-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.gantt__head > span:first-child {
  border-left: 0;
  text-align: left;
  padding-left: 16px;
}

.gantt__head .is-off { color: var(--faint); opacity: 0.72; }

.gantt__row {
  min-height: 46px;
  border-bottom: 1px solid var(--line-soft);
}

.gantt__row:last-child { border-bottom: 0; }

.gantt__label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 14px 8px 16px;
  border-right: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.3;
}

.gantt__label span {
  margin-top: 2px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.gantt__track {
  grid-column: 2 / -1;
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  align-items: center;
  padding: 8px 0;
  background-image: linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: calc(100% / 9) 100%;
}

.gantt__bar {
  grid-row: 1;
  grid-column: var(--start) / span var(--span);
  display: flex;
  align-items: center;
  height: 27px;
  margin-inline: 3px;
  padding: 0 9px;
  border-radius: 6px;
  overflow: hidden;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gantt__bar--prep {
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
}

.gantt__bar--core {
  background: linear-gradient(90deg, var(--pine), var(--pine-2));
}

.gantt__bar--build {
  background: linear-gradient(90deg, var(--accent), #e37a4e);
}

.gantt__bar--portal {
  background: linear-gradient(90deg, #9c5c3f, var(--gold));
}

.gantt__bar--harden {
  background: linear-gradient(90deg, var(--gold), #d5a95c);
  color: #3a2a0e;
}

.gantt__bar--buffer {
  border: 1px dashed var(--accent-line);
  background: repeating-linear-gradient(135deg, var(--accent-wash) 0 6px, transparent 6px 12px);
  color: var(--accent-deep);
}

.gantt__bar--milestone {
  background: var(--ink);
  color: var(--paper);
}

.gantt__key {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
}

/* 15. FLOW & ARCHITECTURE DIAGRAMS
   ========================================================================== */

.flow {
  display: grid;
  justify-items: center;
  gap: 0;
  padding: clamp(20px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 26px,
    var(--surface-soft);
}

.flow__node {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: min(100%, 280px);
  padding: 11px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.flow__node strong {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 600;
}

.flow__node span {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.flow__node--accent {
  border-color: var(--accent);
  background: var(--accent);
}

.flow__node--accent strong { color: #fff8f2; }
.flow__node--accent span { color: rgba(255, 248, 242, 0.72); }

.flow__node--dark {
  border-color: var(--pine);
  background: var(--pine);
}

.flow__node--dark strong { color: #f4ecdf; }
.flow__node--dark span { color: rgba(244, 236, 223, 0.6); }

.flow__arrow {
  position: relative;
  width: 1px;
  height: 30px;
  background: var(--line-strong);
}

.flow__arrow::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 5px;
  height: 5px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
  transform: translateX(-50%) rotate(45deg);
}

.flow__arrow--loop {
  height: 38px;
  background: transparent;
  border-left: 1px dashed var(--accent);
}

.flow__arrow--loop::after {
  border-color: var(--accent);
}

.flow__note {
  max-width: 34ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  line-height: 1.6;
  text-align: center;
}

.flow__label {
  margin: 2px 0;
  padding: 3px 10px;
  border: 1px solid var(--accent-line);
  border-radius: var(--r-pill);
  background: var(--accent-wash);
  color: var(--accent-deep);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Architecture panel */
.arch {
  padding: clamp(22px, 3.2vw, 36px);
  border-radius: var(--r-lg);
  background:
    radial-gradient(120% 100% at 0% 0%, #194f40 0%, #113a2f 55%, #0c2d25 100%);
  color: rgba(241, 233, 219, 0.72);
  box-shadow: 0 24px 50px -34px rgba(13, 49, 40, 0.9);
}

.arch__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(241, 233, 219, 0.16);
}

.arch__head h3 { color: #f4ecdf; }

.arch__head span {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(241, 233, 219, 0.45);
}

.arch__body {
  display: grid;
  justify-items: center;
  padding-top: 20px;
}

.arch__tier {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.arch__tile {
  padding: 9px 14px;
  border: 1px solid rgba(241, 233, 219, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: #eae2d4;
  font-size: 0.78rem;
  line-height: 1.3;
  text-align: center;
}

.arch__tile small {
  display: block;
  margin-top: 3px;
  color: rgba(241, 233, 219, 0.44);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.arch__tile--accent {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff8f2;
}

.arch__tile--accent small { color: rgba(255, 248, 242, 0.7); }

.arch__tile--focus {
  border-color: rgba(233, 169, 143, 0.55);
  background: rgba(217, 83, 43, 0.14);
  color: #fbe6da;
}

.arch__link {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 9px 0;
}

.arch__link span {
  color: rgba(241, 233, 219, 0.4);
  font-family: var(--font-mono);
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.arch__link::after {
  content: "↓";
  color: var(--accent);
  font-size: 0.85rem;
  line-height: 1;
  opacity: 0.8;
}

.arch__split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.arch__footer {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(241, 233, 219, 0.18);
  color: rgba(241, 233, 219, 0.55);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  line-height: 1.65;
  text-align: center;
}

.arch__footer strong { color: #f0c6b3; font-weight: 500; }

/* 16. ROLES
   ========================================================================== */

.role {
  padding: clamp(18px, 2.2vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}

.role__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.role__name {
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.role__id {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: var(--faint);
}

.role .ticks { margin-top: 12px; }

/* 17. MILESTONES & STEPS
   ========================================================================== */

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__item {
  position: relative;
  padding: 0 0 22px 26px;
  border-left: 1px solid var(--line-strong);
  margin-left: 4px;
}

.timeline__item:last-child {
  padding-bottom: 0;
  border-left-color: transparent;
}

.timeline__dot {
  position: absolute;
  left: -4.5px;
  top: 4px;
  width: 8px;
  height: 8px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--paper);
}

.timeline__item--done .timeline__dot {
  border-color: var(--pine-2);
  background: var(--pine-2);
}

.timeline__date {
  display: block;
  margin-bottom: 3px;
  font-family: var(--font-mono);
  font-size: 0.63rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-deep);
}

.timeline__title {
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.timeline__text {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.55;
}

.steps {
  counter-reset: step;
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  color: var(--muted);
  font-size: 0.83rem;
  line-height: 1.5;
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.56rem;
  letter-spacing: 0.02em;
}

.steps li strong { color: var(--ink); font-weight: 550; }

.steps--wide { gap: 12px; }

.steps--wide li { font-size: 0.845rem; }

/* 18. CHECKLIST
   ========================================================================== */

.checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--line-soft);
  overflow: hidden;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 16px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.82rem;
  line-height: 1.5;
  cursor: pointer;
  transition: background-color 140ms var(--ease);
}

.check:hover { background: var(--surface-soft); }

.check input {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  transition: background-color 140ms var(--ease), border-color 140ms var(--ease);
}

.check input::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg) scale(0.4);
  opacity: 0;
  transition: opacity 120ms var(--ease), transform 120ms var(--ease);
}

.check input:checked {
  border-color: var(--pine-2);
  background: var(--pine-2);
}

.check input:checked::after {
  opacity: 1;
  transform: rotate(45deg) scale(1);
}

.check:has(input:checked) { color: var(--muted); }

/* 19. CALLOUTS
   ========================================================================== */

.note {
  position: relative;
  padding: 15px 18px 15px 46px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 0.855rem;
  line-height: 1.6;
}

.note::before {
  content: "!";
  position: absolute;
  left: 16px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--line-soft);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
}

.note strong { color: var(--ink); }

.note--rule {
  border-color: var(--accent-line);
  border-left: 2px solid var(--accent);
  background: var(--accent-wash);
}

.note--rule::before { background: var(--accent); color: #fff; }

.note--ok {
  border-color: #cde2d6;
  background: var(--ok-wash);
}

.note--ok::before { content: "✓"; background: var(--pine-2); color: #fff; }

.note--warn {
  border-color: #ecd8b3;
  background: var(--gold-wash);
}

.note--warn::before { background: var(--gold); color: #fff; }

.note--dark {
  border-color: transparent;
  background: var(--pine);
  color: rgba(241, 233, 219, 0.76);
}

.note--dark strong { color: #f4ecdf; }
.note--dark::before { background: var(--accent); color: #fff; }

.quote {
  margin: 0;
  padding: clamp(22px, 3vw, 34px);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--r) var(--r) 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.7rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.quote cite {
  display: block;
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* 20. CODE & API ROUTES
   ========================================================================== */

code,
.code {
  font-family: var(--font-mono);
  font-size: 0.83em;
}

code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--accent-deep);
  white-space: nowrap;
}

.code-block {
  overflow-x: auto;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: #14120d;
  color: #e8dfd0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.75;
  tab-size: 2;
}

.code-block code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  white-space: pre;
}

.code-block .c-key { color: #e79770; }
.code-block .c-str { color: #a8c6a4; }
.code-block .c-dim { color: #857c6b; }

.kbd {
  display: inline-block;
  min-width: 20px;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-align: center;
}

.routes {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  overflow: hidden;
}

.route {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.route:last-child { border-bottom: 0; }

.route__method {
  justify-self: start;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
}

.m-get   { background: var(--ok-wash);     color: var(--ok); }
.m-post  { background: var(--accent-wash); color: var(--accent-deep); }
.m-patch { background: var(--gold-wash);   color: var(--warn); }
.m-del   { background: var(--danger-wash); color: var(--danger); }

.route__path {
  font-family: var(--font-mono);
  font-size: 0.775rem;
  color: var(--ink);
  word-break: break-word;
}

.route__desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.76rem;
}

/* 21. SCHEMA EXPLORER
   ========================================================================== */

.schema-list {
  display: grid;
  gap: 8px;
}

.schema {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}

.schema[open] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.schema summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  transition: background-color 140ms var(--ease);
}

.schema summary::-webkit-details-marker { display: none; }

.schema summary:hover { background: var(--surface-soft); }

.schema__icon {
  position: relative;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface-soft);
}

.schema__icon::before,
.schema__icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: var(--muted);
  transform: translate(-50%, -50%);
}

.schema__icon::before { width: 9px; height: 1px; }
.schema__icon::after  { width: 1px; height: 9px; transition: opacity 140ms var(--ease); }

.schema[open] .schema__icon { background: var(--accent); border-color: var(--accent); }
.schema[open] .schema__icon::before,
.schema[open] .schema__icon::after { background: #fff; }
.schema[open] .schema__icon::after { opacity: 0; }

.schema__name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.schema__use {
  margin-left: auto;
  padding-left: 12px;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.05em;
  text-align: right;
}

.schema__body {
  padding: 4px 16px 14px;
  border-top: 1px dashed var(--line);
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.field {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--line);
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.field:last-child { border-bottom: 0; }

.field__name { color: var(--ink-2); }
.field__name b { color: var(--accent-deep); font-weight: 500; }
.field__type { color: var(--faint); font-size: 0.64rem; text-align: right; }

.schema__foot {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

/* 22. FOOTER
   ========================================================================== */

.site-footer {
  margin-top: clamp(56px, 8vw, 100px);
  padding-block: clamp(40px, 6vw, 68px) 30px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(90% 120% at 80% 0%, #17493c 0%, #103c31 55%, #0b2c24 100%);
  color: rgba(241, 233, 219, 0.62);
}

.site-footer__inner {
  width: min(100%, var(--shell));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 56px);
}

.site-footer h4 {
  margin-bottom: 12px;
  color: rgba(241, 233, 219, 0.44);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-footer .brand__name { color: #f6efe3; }

.site-footer .brand__tag {
  border-left-color: rgba(241, 233, 219, 0.2);
  color: rgba(241, 233, 219, 0.5);
}

.footer__lede {
  max-width: 38ch;
  margin-top: 16px;
  color: rgba(241, 233, 219, 0.6);
  font-size: 0.86rem;
  line-height: 1.65;
}

.footer__list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.83rem;
}

.footer__list a {
  color: rgba(241, 233, 219, 0.7);
  text-decoration: none;
}

.footer__list a:hover { color: #f0c6b3; }

.footer__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: clamp(32px, 5vw, 52px);
  padding-top: 18px;
  border-top: 1px solid rgba(241, 233, 219, 0.14);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: rgba(241, 233, 219, 0.42);
}

.footer__meta a { color: rgba(241, 233, 219, 0.6); text-decoration: none; }
.footer__meta a:hover { color: #f0c6b3; }

.footer__word {
  margin-top: 26px;
  color: rgba(241, 233, 219, 0.06);
  font-family: var(--font-display);
  font-size: clamp(3rem, 11vw, 8.5rem);
  line-height: 0.8;
  letter-spacing: -0.04em;
  user-select: none;
}

/* 23. RESPONSIVE
   ========================================================================== */

@media (max-width: 1120px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc { display: none; }

  .hero__grid {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .hero__side {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
    align-items: end;
    gap: 18px;
  }

  .hero__note { padding-bottom: 2px; }

  .hero__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero__meta > div:nth-child(3) {
    padding-left: 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }

  .hero__meta > div:nth-child(4) { border-top: 1px solid var(--line-soft); }
}

@media (max-width: 900px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .phase__body { grid-template-columns: minmax(0, 1fr); }
  .phase__side { grid-row: 1; }

  .arch__split { grid-template-columns: minmax(0, 1fr); }
  .arch__tier { gap: 6px; }
}

@media (max-width: 780px) {
  .brand__tag { display: none; }

  .nav { gap: 0; }

  .layout { padding-top: 30px; }

  .grid--2 { grid-template-columns: minmax(0, 1fr); }

  .checks { grid-template-columns: minmax(0, 1fr); }

  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric:nth-child(3) { border-left: 0; border-top: 1px solid var(--line); }
  .metric:nth-child(4) { border-top: 1px solid var(--line); }

  .fields { grid-template-columns: minmax(0, 1fr); }

  .site-footer__grid { grid-template-columns: minmax(0, 1fr); }

  .quote { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
}

@media (max-width: 700px) {
  .section__head {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .section__num { padding-top: 0; }

  .plan { padding-left: 0; }
  .plan::before { display: none; }

  .phase__dot {
    position: static;
    margin-bottom: 12px;
  }

  .phase__top {
    display: grid;
    gap: 10px;
  }

  .phase__dates { justify-self: start; }

  .phase__tasks { grid-template-columns: minmax(0, 1fr); }

  .hero__side { grid-template-columns: minmax(0, 1fr); }

  .hero__meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .hero__meta > div { padding-right: 12px; }

  /* Tables become stacked records */
  .table-wrap { border: 0; background: transparent; overflow: visible; }

  table.data { display: block; }

  .data caption {
    display: block;
    padding: 0 0 10px;
    border: 0;
  }

  .data thead { display: none; }

  .data tbody { display: grid; gap: 10px; }

  .data tr {
    display: block;
    padding: 4px 0;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--surface);
  }

  .data td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 8px 14px;
    border-bottom: 0;
    text-align: right;
  }

  .data td + td { border-top: 1px dashed var(--line-soft); }

  .data td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    padding-top: 2px;
    color: var(--faint);
    font-family: var(--font-mono);
    font-size: 0.58rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-align: left;
    text-transform: uppercase;
  }

  .data td[data-label=""]::before { display: none; }

  .data td strong,
  .data td .cell-title { text-align: right; }

  .data td .cell-sub { text-align: right; }

  .route {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 13px;
  }

  .schema summary { padding: 11px 13px; gap: 9px; }
  .schema__use { display: none; }
  .schema__body { padding: 4px 13px 12px; }
}

@media (max-width: 520px) {
  .hero__meta { grid-template-columns: minmax(0, 1fr); }

  .hero__meta > div {
    padding: 14px 0 0;
    border-left: 0 !important;
    border-top: 1px solid var(--line-soft);
  }

  .hero__meta > div:first-child { border-top: 0; }

  .hero__actions .btn { flex: 1 1 auto; }

  .metrics { grid-template-columns: minmax(0, 1fr); }
  .metric + .metric { border-left: 0; border-top: 1px solid var(--line); }

  .doc-flag { font-size: 0.6rem; }
}

/* 24. PRINT & MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  :root {
    --paper: #fff;
    --surface: #fff;
    --surface-soft: #fafafa;
    --line: #d8d8d8;
    --muted: #444;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
  }

  .site-header,
  .scroll-progress,
  .toc,
  .hero__actions,
  .hero__note,
  .footer__word,
  .site-footer {
    display: none !important;
  }

  .layout {
    display: block;
    padding-block: 0;
  }

  .main { gap: 32px; }

  .section { break-inside: avoid; }

  .card,
  .phase,
  .schema,
  .role,
  .quote,
  .note,
  .metrics,
  .table-wrap,
  .gantt-wrap,
  .checks {
    break-inside: avoid;
    box-shadow: none;
  }

  .hero { padding-top: 0; border-bottom: 1px solid #000; }
  .hero__title { font-size: 40pt; }
  .spec,
  .arch,
  .note--dark,
  .site-footer {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  a { color: #000; text-decoration: none; }

  .gantt { min-width: 0; }
  .gantt-wrap { overflow: visible; }
}