@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/dm-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/dm-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* TA39 design-system tokens (tailwind.config.ts is the source of truth) */
:root {
  color-scheme: light;
  --primary-50: #F9F9FF;
  --primary-100: #F3F1F7;
  --primary-200: #EBEBFF;
  --primary-300: #DDDCF8;
  --primary-600: #6462E9;
  --primary-700: #504EE4;
  --primary-800: #31309F;
  --canvas: #F5F6F9;
  --surface: #FFFFFF;
  --surface-soft: #F9F9FF;
  --ink: #1F1F1F;
  --body: #313131;
  --muted: #5F5F5F;
  --line: #DBDADF;
  --line-soft: #E6E6E6;
  --line-faint: #F2F2F2;
  --accent: #6462E9;
  --accent-dark: #504EE4;
  --warning: #F6C41C;
  --warning-soft: #FFF6D9;
  --warning-ink: #624D06;
  --radius-tag: 4px;
  --radius-input: 6px;
  --radius-tab: 8px;
  --radius-modal: 12px;
  --radius-card: 16px;
  --radius-pill: 90px;
  --shadow-card: 0 4px 37px rgba(104, 103, 215, 0.05);
  --shadow-common: 0 0 10px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { color: var(--accent-dark); }

/* Header — compact static header, flat white, no blur */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner, .site-footer__inner, .page-shell {
  width: min(1480px, calc(100% - 40px));
  margin-inline: auto;
}
.site-header__inner {
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.brand__logo { height: 34px; width: auto; display: block; }
.brand__name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em; }
.brand__context {
  background: var(--primary-200); color: var(--primary-800);
  border-radius: var(--radius-tag);
  padding: 3px 9px; font-size: 0.75rem; font-weight: 500; letter-spacing: 0;
}
.page-shell { padding-block: 32px 64px; }

/* Document layout — sticky contents rail + document card */
.doc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}
.doc-layout.has-toc { grid-template-columns: 216px minmax(0, 1fr); }
.doc-toc[hidden] { display: none; }
.doc-toc { position: sticky; top: 24px; }
.doc-toc__title {
  margin: 0 0 10px; padding-left: 12px;
  color: #5F5F5F; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.doc-toc nav { display: flex; flex-direction: column; gap: 2px; }
.doc-toc a {
  padding: 7px 12px; border-radius: var(--radius-pill);
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
  line-height: 1.35; text-decoration: none;
  transition: background 200ms ease-in-out, color 200ms ease-in-out;
}
.doc-toc a:hover, .doc-toc a:focus-visible { background: var(--primary-200); color: var(--primary-800); }
.doc-toc a.is-current { background: var(--primary-300); color: var(--primary-800); }
.doc-toc a[data-level="3"] { padding-left: 24px; font-size: 0.8125rem; font-weight: 400; }

/* Draft-status banner — feedback.warning tokens */
.review-banner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 32px; align-items: end;
  margin-bottom: 20px; padding: 21px 24px;
  border: 1px solid var(--warning);
  border-radius: var(--radius-modal);
  background: var(--warning-soft);
}
.review-banner__eyebrow {
  margin: 0 0 6px; color: var(--warning-ink);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.review-banner h2 { margin: 0; color: var(--ink); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
.review-banner p:not(.review-banner__eyebrow) { max-width: 76ch; margin: 8px 0 0; color: var(--warning-ink); font-size: 0.9375rem; }
.review-banner__meta { min-width: 150px; margin: 0; }
.review-banner__meta dt { color: var(--warning-ink); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.review-banner__meta dd { margin: 2px 0 0; color: var(--ink); font-weight: 600; }

/* Document card — white, 16px, shadow-card, no border */
.document {
  min-width: 0;
  padding: clamp(24px, 4vw, 56px);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.document > :first-child { margin-top: 0; }

/* Reference / status / audience / purpose block under the title */
.document h1 + p {
  margin: 0 0 8px; padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-modal);
  background: var(--surface-soft);
  font-size: 0.9375rem; line-height: 2;
}
.document h1 + p strong { color: var(--muted); font-weight: 500; }

.document h1, .document h2, .document h3, .document h4 {
  color: var(--ink); font-weight: 700; line-height: 1.2; text-wrap: balance;
}
.document h1 { max-width: 26ch; margin-bottom: 16px; font-size: clamp(1.75rem, 3.4vw, 2.5rem); letter-spacing: -0.02em; }
.document h2 { margin: 56px 0 18px; padding-top: 20px; border-top: 1px solid var(--line); font-size: clamp(1.35rem, 2.2vw, 1.625rem); letter-spacing: -0.02em; }
.document h3 { margin: 36px 0 14px; font-size: 1.1875rem; font-weight: 600; }
.document h4 { margin: 28px 0 12px; font-size: 1rem; font-weight: 600; }
.document p, .document ul, .document ol, .document blockquote { max-width: 68ch; color: var(--body); }
.document h1, .document h2, .document h3, .document h4 { scroll-margin-top: 24px; }
.document h2, .document h3, .document h4 { max-width: 44ch; }
.document li { margin-bottom: 6px; }
.document strong { color: var(--ink); font-weight: 600; }
.document code {
  padding: 0.15em 0.4em; border: 1px solid var(--line); border-radius: var(--radius-tag);
  background: var(--surface-soft); color: var(--primary-800);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.875em;
}

/* Tables — row rules only, sentence-case headers */
.document table {
  display: block; width: 100%; margin: 22px 0 34px; overflow-x: auto;
  border-collapse: collapse; font-size: 0.875rem; line-height: 1.5;
}
.document th, .document td { min-width: 132px; padding: 12px 14px 12px 0; text-align: left; vertical-align: top; }
.document th { color: var(--muted); font-size: 0.8125rem; font-weight: 600; border-bottom: 1px solid var(--line-soft); }
.document td { color: var(--body); border-bottom: 1px solid var(--line-faint); }
.document tbody tr:hover td { background: var(--primary-50); }
.document tr:last-child td { border-bottom: 0; }
.document th:first-child, .document td:first-child {
  position: sticky; left: 0; z-index: 1;
  min-width: 104px; padding-right: 16px;
  background: var(--surface);
  border-right: 1px solid var(--line-faint);
}
.document table.table--readiness td:last-child { white-space: nowrap; color: var(--ink); font-weight: 500; }
.document table caption { caption-side: top; text-align: left; }

.document blockquote {
  margin: 24px 0; padding: 18px 22px;
  border-radius: var(--radius-modal); background: var(--primary-100);
}
.document hr { margin: 44px 0; border: 0; border-top: 1px solid var(--line); }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer__inner {
  display: flex; justify-content: space-between; gap: 24px;
  padding-block: 24px; color: var(--muted); font-size: 0.8125rem;
}
.site-footer p { margin: 0; }

@media (max-width: 760px) {
  .site-header__inner, .site-footer__inner { align-items: flex-start; flex-direction: column; }
  .site-header__inner { padding-block: 16px; }
  .review-banner { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .doc-layout,
  .doc-layout.has-toc { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .doc-toc { position: static; }
  .doc-toc nav { flex-direction: row; flex-wrap: wrap; }
  .document { padding: 24px 20px; }
  .document h2 { margin-top: 44px; }
}

@media print {
  @page { margin: 12mm; }

  .site-header, .site-footer, .doc-toc { display: none; }
  body { background: #fff; }
  .page-shell { width: 100%; padding: 0; }
  .review-banner, .document { border: 0; box-shadow: none; }
  .doc-layout { display: block; }
  .document { overflow: visible; padding: 0; }
  .document table {
    display: table;
    width: 100%;
    table-layout: fixed;
    font-size: 7.5pt;
  }
  .document th,
  .document td,
  .document th:first-child,
  .document td:first-child {
    position: static;
    min-width: 0;
    padding: 5px 4px;
    overflow-wrap: anywhere;
  }
  .document table.table--readiness td:last-child { white-space: normal; }
  .document tr, .document h2, .document h3 { break-inside: avoid; }
  .document h2, .document h3 { break-after: avoid; }
}
