/* Suitetrail docs site.
   No external fonts, scripts, images or CDNs: everything is in this file and in inline SVG.
   A strict CSP applies (style-src 'self', no inline styles); see _headers.
   Direction: warm paper, hairline rules, one accent, flat artifacts. No gradients, glows or shadows. */

/* ---------- Tokens ---------- */

:root {
  --paper: #fafaf8;
  --paper-2: #f3f2ee;
  --surface: #ffffff;
  --ink: #141413;
  --ink-2: #3d3d39;
  --muted: #6b6a63;
  --faint: #9a988f;
  --rule: #e4e2dc;
  --rule-strong: #cfccc2;

  --accent: #0f6e56;
  --accent-hover: #0b5a46;
  --accent-ink: #ffffff;
  --accent-soft: #e6f0eb;
  --accent-rule: #b8d6c9;

  /* Atlassian Design System colours, used only inside the product illustrations */
  --ads-text: #172b4d;
  --ads-subtle: #44546f;
  --ads-faint: #626f86;
  --ads-border: #dfe1e6;
  --ads-sunken: #f7f8f9;
  --ads-blue: #0c66e4;
  --ads-blue-bg: #e9f2ff;
  --ok-bg: #dcfff1;
  --ok-ink: #216e4e;
  --bad-bg: #ffeceb;
  --bad-ink: #ae2e24;
  --warn-bg: #fff7d6;
  --warn-ink: #7f5f01;
  --warn-rule: #e9cf6b;
  --neutral-bg: #f1f2f4;
  --neutral-ink: #44546f;
  --ok-bar: #22a06b;
  --bad-bar: #e2483d;
  --warn-bar: #e2b203;

  --ph-bg: #fbeee8;
  --ph-ink: #96361a;

  --term-bg: #141413;
  --term-rule: #141413;
  --term-ink: #e8e6df;
  --term-dim: #8f8d85;
  --term-ok: #7fd1ad;
  --term-key: #e6c07b;

  --sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
  --wide: 1160px;
  --measure: 780px;
  --gutter: 32px;
  --r: 4px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #141413;
    --paper-2: #1a1a18;
    --surface: #1c1c1a;
    --ink: #f0efea;
    --ink-2: #cfcdc5;
    --muted: #9c9a92;
    --faint: #75736c;
    --rule: #2b2b28;
    --rule-strong: #3d3c37;
    --accent: #62c3a2;
    --accent-hover: #86d3b8;
    --accent-ink: #0f1a16;
    --accent-soft: #19302a;
    --accent-rule: #2b5446;
    --ads-text: #dee4ea;
    --ads-subtle: #b6c2cf;
    --ads-faint: #9fadbc;
    --ads-border: #38414a;
    --ads-sunken: #161a1d;
    --ads-blue: #579dff;
    --ads-blue-bg: #092957;
    --ok-bg: #164b35;
    --ok-ink: #7ee2b8;
    --bad-bg: #5d1f1a;
    --bad-ink: #fd9891;
    --warn-bg: #533f04;
    --warn-ink: #f5cd47;
    --warn-rule: #7f5f01;
    --neutral-bg: #2c333a;
    --neutral-ink: #b6c2cf;
    --ph-bg: #3a221b;
    --ph-ink: #f3b49f;
    --term-bg: #0e0e0d;
    --term-rule: #2b2b28;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --paper: #141413;
  --paper-2: #1a1a18;
  --surface: #1c1c1a;
  --ink: #f0efea;
  --ink-2: #cfcdc5;
  --muted: #9c9a92;
  --faint: #75736c;
  --rule: #2b2b28;
  --rule-strong: #3d3c37;
  --accent: #62c3a2;
  --accent-hover: #86d3b8;
  --accent-ink: #0f1a16;
  --accent-soft: #19302a;
  --accent-rule: #2b5446;
  --ads-text: #dee4ea;
  --ads-subtle: #b6c2cf;
  --ads-faint: #9fadbc;
  --ads-border: #38414a;
  --ads-sunken: #161a1d;
  --ads-blue: #579dff;
  --ads-blue-bg: #092957;
  --ok-bg: #164b35;
  --ok-ink: #7ee2b8;
  --bad-bg: #5d1f1a;
  --bad-ink: #fd9891;
  --warn-bg: #533f04;
  --warn-ink: #f5cd47;
  --warn-rule: #7f5f01;
  --neutral-bg: #2c333a;
  --neutral-ink: #b6c2cf;
  --ph-bg: #3a221b;
  --ph-ink: #f3b49f;
  --term-bg: #0e0e0d;
  --term-rule: #2b2b28;
  color-scheme: dark;
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 24px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

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

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

svg {
  flex: none;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: var(--gutter);
  top: 10px;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  padding: 6px 12px;
  z-index: 100;
}

.container {
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 0 var(--gutter);
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.15;
  font-weight: 700;
}

p,
ul,
ol,
pre,
dl {
  margin: 14px 0 0;
}

ul,
ol {
  padding-left: 1.25em;
}

li + li {
  margin-top: 6px;
}

li::marker {
  color: var(--faint);
}

code,
pre,
kbd,
.mono {
  font-family: var(--mono);
  font-variant-ligatures: none;
}

code,
kbd {
  font-size: 0.86em;
}

:not(pre) > code {
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: 0.05em 0.35em;
  border-radius: 3px;
  color: var(--ink);
}

td,
.num {
  font-variant-numeric: tabular-nums;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Monospace section index, e.g. "01 / Story drift" */
.index {
  display: block;
  margin: 0 0 18px;
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.index b {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- Brand mark ---------- */

.logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

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

.logo svg {
  width: 20px;
  height: 20px;
}

.lm-bg {
  fill: var(--accent);
}

.lm-trail {
  fill: none;
  stroke: var(--accent-ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lm-dot {
  fill: var(--accent-ink);
}

/* ---------- Header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header .container {
  display: flex;
  align-items: center;
  gap: 36px;
  height: 60px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-size: 0.875rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 60px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.header-cta {
  margin-left: auto;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.header-cta:hover {
  color: var(--accent);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r);
  border: 1px solid var(--ink);
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
}

.btn-primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
  color: var(--paper);
}

.btn-text {
  border-color: transparent;
  padding: 0 4px;
  color: var(--ink);
}

.btn-text:hover {
  color: var(--accent);
}

/* ---------- Hero ---------- */

.hero {
  border-bottom: 1px solid var(--rule);
}

.hero .container {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 64px;
  align-items: start;
  padding-top: 88px;
  padding-bottom: 96px;
}

.hero h1 {
  font-size: clamp(2.25rem, 1.6rem + 2vw, 3.125rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  font-weight: 750;
}

.hero .lede {
  margin-top: 24px;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 32px;
}

.facts {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--rule);
  font-size: 0.875rem;
  color: var(--ink-2);
}

.facts li {
  display: grid;
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 16px;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
}

.facts dt,
.facts .k {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--muted);
  padding-top: 2px;
}

/* ---------- Flat product artifacts ---------- */

.frame {
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  background: var(--surface);
  min-width: 0;
}

.frame + .frame {
  margin-top: 16px;
}

.frame-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
}

.frame-bar b {
  color: var(--ink);
  font-weight: 600;
}

.frame-bar .sep {
  color: var(--faint);
}

.frame-bar .end {
  margin-left: auto;
}

/* Jira issue illustration: Atlassian tokens */
.jira {
  color: var(--ads-text);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.jira .body {
  padding: 16px 16px 18px;
}

.issue-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ads-faint);
  font-size: 0.75rem;
}

.issue-type {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  background: #22a06b;
}

.issue-type svg {
  width: 10px;
  height: 10px;
  color: #ffffff;
}

.issue-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.issue-title strong {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: -0.012em;
}

.key {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--ads-subtle);
}

.lz {
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.6875rem;
  font-weight: 650;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.lz-pass {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.lz-fail {
  background: var(--bad-bg);
  color: var(--bad-ink);
}

.lz-stale {
  background: var(--warn-bg);
  color: var(--warn-ink);
  box-shadow: inset 0 0 0 1px var(--warn-rule);
}

.lz-prog {
  background: var(--ads-blue-bg);
  color: var(--ads-blue);
}

.lz-neutral {
  background: var(--neutral-bg);
  color: var(--neutral-ink);
}

.st-panel {
  margin-top: 16px;
  border: 1px solid var(--ads-border);
  border-radius: 3px;
}

.st-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ads-border);
  font-weight: 600;
  font-size: 0.78rem;
}

.st-panel-head svg {
  width: 14px;
  height: 14px;
}

.st-panel-head .warn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: var(--warn-ink);
  background: var(--warn-bg);
  box-shadow: inset 0 0 0 1px var(--warn-rule);
  border-radius: 3px;
  padding: 1px 7px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.st-panel-head .warn svg {
  width: 12px;
  height: 12px;
}

.tests {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tests li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 12px;
  border-bottom: 1px solid var(--ads-border);
  min-width: 0;
}

.tests .t-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.diff {
  margin: 0;
  padding: 8px 0;
  background: var(--ads-sunken);
  font-family: var(--mono);
  font-size: 0.72rem;
  line-height: 1.75;
}

.diff-label {
  display: block;
  padding: 0 12px 4px;
  color: var(--ads-faint);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
}

.diff > span:not(.diff-label) {
  display: block;
  padding: 0 12px;
  white-space: pre-wrap;
}

.diff .del {
  background: var(--bad-bg);
  color: var(--bad-ink);
}

.diff .add {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.diff .ctx {
  color: var(--ads-subtle);
}

/* CI run illustration */
.ci .body {
  padding: 14px 16px 16px;
}

.ci-stat {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
  font-variant-numeric: tabular-nums;
}

.ci-stat .fail {
  color: var(--bad-ink);
}

.ci-stat .arrow {
  color: var(--faint);
  font-weight: 400;
}

.stack-bar {
  display: flex;
  gap: 2px;
  height: 6px;
  margin-top: 10px;
}

.stack-bar i {
  display: block;
  height: 100%;
}

.stack-bar .p {
  background: var(--ok-bar);
  flex: 436;
}

.stack-bar .f {
  background: var(--bad-bar);
  flex: 45;
}

.stack-bar .s {
  background: var(--rule-strong);
  flex: 18;
}

.stack-bar .b {
  background: var(--warn-bar);
  flex: 1;
  min-width: 3px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

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

.legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
}

.legend .p { background: var(--ok-bar); }
.legend .f { background: var(--bad-bar); }
.legend .s { background: var(--rule-strong); }
.legend .b { background: var(--warn-bar); }

.groups {
  width: 100%;
  margin-top: 14px;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.groups th,
.groups td {
  padding: 6px 0;
  border-top: 1px solid var(--rule);
  text-align: left;
  font-weight: 400;
  color: var(--ink-2);
}

.groups thead th {
  border-top: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.groups .n {
  width: 3rem;
  font-weight: 600;
  color: var(--ink);
}

.groups td:last-child,
.groups th:last-child {
  text-align: right;
}

/* Terminal */
.term {
  margin: 0;
  padding: 14px 16px;
  background: var(--term-bg);
  border: 1px solid var(--term-rule);
  border-radius: var(--r);
  color: var(--term-ink);
  font-family: var(--mono);
  font-size: 0.75rem;
  line-height: 1.75;
  overflow-x: auto;
  white-space: pre;
}

.frame .term {
  border: 0;
  border-top: 1px solid var(--rule);
  border-radius: 0 0 var(--r) var(--r);
}

.term .pr,
.term .c {
  color: var(--term-dim);
}

.term .ok {
  color: var(--term-ok);
}

.term .k {
  color: var(--term-key);
}

figcaption,
.caption {
  margin-top: 10px;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ---------- Chapters (numbered editorial sections) ---------- */

.chapter {
  border-bottom: 1px solid var(--rule);
}

.chapter .container {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 64px;
  padding-top: 88px;
  padding-bottom: 88px;
  align-items: start;
}

.chapter h2 {
  font-size: clamp(1.625rem, 1.3rem + 0.9vw, 2rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.chapter p {
  color: var(--ink-2);
  max-width: 48ch;
}

.chapter h2 + p {
  margin-top: 18px;
  font-size: 1.0625rem;
}

.chapter figure {
  margin: 0;
  min-width: 0;
}

.points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  max-width: 48ch;
}

.points li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  margin: 0;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: 0.9375rem;
}

.points svg {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--accent);
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
}

.more svg {
  width: 15px;
  height: 15px;
}

/* Drift record artifact */
.hashes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--rule);
}

.hashes div {
  padding: 12px 16px;
  font-size: 0.75rem;
  color: var(--muted);
}

.hashes div + div {
  border-left: 1px solid var(--rule);
}

.hashes code {
  display: block;
  margin-top: 2px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 0.8125rem;
  color: var(--ink);
}

.hashes .changed code {
  color: var(--warn-ink);
}

.frame .diff {
  background: transparent;
  padding: 12px 0;
}

.frame .diff > span:not(.diff-label) {
  padding: 0 16px;
}

.frame .diff-label {
  padding: 0 16px 6px;
}

.frame-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
}

.fake-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 3px;
  background: var(--neutral-bg);
  color: var(--ads-text);
  font-size: 0.78rem;
  font-weight: 500;
}

.fake-btn.primary {
  background: var(--ads-blue);
  color: #ffffff;
}

.fake-btn.subtle {
  background: transparent;
}

/* Manifest / mapping tables inside frames */
.frame > table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.frame > table th,
.frame > table td {
  padding: 9px 16px;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}

.frame > table thead th {
  border-top: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-2);
  white-space: nowrap;
}

.frame > table tbody th {
  font-weight: 600;
  white-space: nowrap;
}

.frame > table td {
  color: var(--ink-2);
}

.frame td.skip-reason {
  color: var(--muted);
}

/* ---------- Pricing ---------- */

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

.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.compare th,
.compare td {
  padding: 12px 16px;
  border-top: 1px solid var(--rule);
  text-align: left;
  vertical-align: middle;
}

.compare thead th {
  border-top: 0;
  vertical-align: bottom;
  padding-top: 18px;
  padding-bottom: 16px;
}

.compare thead th:first-child {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-h {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.plan-p {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--muted);
}

.compare .hl {
  background: var(--accent-soft);
}

.compare thead .hl {
  box-shadow: inset 0 3px 0 var(--accent);
}

.compare tbody th {
  font-weight: 500;
  color: var(--ink);
}

.compare td {
  color: var(--ink-2);
  width: 30%;
}

.compare svg {
  width: 16px;
  height: 16px;
  vertical-align: -3px;
}

.compare .yes {
  color: var(--accent);
}

.compare .no {
  color: var(--faint);
}

/* ---------- Docs index list ---------- */

.doc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule-strong);
}

.doc-list li {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.doc-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  gap: 4px 16px;
  padding: 18px 0;
  color: var(--ink);
  text-decoration: none;
}

.doc-list a:hover b {
  color: var(--accent);
}

.doc-list b {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.doc-list span {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.875rem;
}

.doc-list svg {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  width: 16px;
  height: 16px;
  color: var(--faint);
}

.legal-line {
  margin-top: 18px;
  font-size: 0.875rem;
  color: var(--muted);
}

/* ---------- Documentation pages ---------- */

.doc {
  max-width: calc(var(--measure) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 72px var(--gutter) 104px;
}

.doc h1 {
  font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
  letter-spacing: -0.04em;
  line-height: 1.06;
  font-weight: 750;
}

.doc h2 {
  font-size: 1.375rem;
  letter-spacing: -0.025em;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
}

.doc h3 {
  font-size: 1.0625rem;
  margin-top: 28px;
}

.doc p,
.doc li {
  color: var(--ink-2);
}

.doc strong {
  color: var(--ink);
  font-weight: 650;
}

.doc .lede {
  margin-top: 18px;
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.doc .meta {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.875rem;
}

.doc ul li + li,
.doc ol li + li {
  margin-top: 8px;
}

.toc {
  margin-top: 36px;
  padding: 16px 0 0;
  border-top: 1px solid var(--rule-strong);
  font-size: 0.9375rem;
}

.toc strong {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc ol {
  margin-top: 10px;
  columns: 2;
  column-gap: 40px;
  padding-left: 1.4em;
}

.toc li {
  break-inside: avoid;
}

.toc li + li {
  margin-top: 4px;
}

.toc li::marker {
  font-family: var(--mono);
  font-size: 0.8em;
}

.toc a {
  text-decoration: none;
  color: var(--ink-2);
}

.toc a:hover {
  color: var(--accent);
}

.note {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rule-strong);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  background: var(--surface);
}

.note > svg {
  width: 16px;
  height: 16px;
  margin-top: 4px;
  color: var(--accent);
}

.note p {
  margin: 0;
  font-size: 0.9375rem;
}

.draft-banner {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 40px;
  padding: 14px 16px;
  border: 1px solid var(--warn-rule);
  border-left-width: 3px;
  border-radius: var(--r);
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.draft-banner > svg {
  width: 16px;
  height: 16px;
  margin-top: 4px;
}

.draft-banner strong {
  color: inherit;
}

.ph {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--ph-bg);
  color: var(--ph-ink);
  padding: 0.06em 0.4em;
  border-radius: 3px;
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.table-wrap {
  margin-top: 20px;
  overflow-x: auto;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  background: var(--surface);
}

.table-wrap table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.875rem;
  line-height: 1.55;
}

.table-wrap th,
.table-wrap td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-top: 1px solid var(--rule);
}

.table-wrap td {
  color: var(--ink-2);
}

.table-wrap thead th {
  border-top: 0;
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

.table-wrap tbody th {
  font-weight: 600;
  color: var(--ink);
}

.table-wrap td code {
  white-space: nowrap;
}

/* Architecture diagram (security page) */
.arch {
  margin-top: 24px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r);
  background: var(--surface);
  padding: 20px;
}

.arch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.arch-label svg {
  width: 14px;
  height: 14px;
}

.arch-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.node {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 12px;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--paper);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.node .ni {
  color: var(--ink-2);
  padding-top: 1px;
}

.node .ni svg {
  width: 16px;
  height: 16px;
}

.node b {
  display: block;
  font-weight: 650;
  color: var(--ink);
}

.node span {
  color: var(--muted);
}

.arch-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 6px 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
}

.arch-link svg {
  width: 14px;
  height: 34px;
  color: var(--accent);
}

.arch-zone {
  padding: 14px;
  border: 1px solid var(--accent-rule);
  border-radius: 3px;
  background: var(--accent-soft);
}

.arch-zone .arch-label {
  color: var(--accent);
}

.arch-zone .arch-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.arch-zone .node {
  background: var(--surface);
  border-color: var(--accent-rule);
}

.arch-zone .ni {
  color: var(--accent);
}

.arch-out {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px dashed var(--rule-strong);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.8125rem;
}

.arch-out svg {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--bad-ink);
}

.arch-out b {
  color: var(--ink);
  font-weight: 600;
}

.flow-caption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8125rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
}

.site-footer .container {
  padding-top: 56px;
  padding-bottom: 48px;
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.footer-top p {
  margin-top: 12px;
  max-width: 36ch;
}

.footer-col h2 {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer-col ul {
  list-style: none;
  padding: 0;
  margin-top: 14px;
}

.footer-col li + li {
  margin-top: 8px;
}

.site-footer a {
  color: var(--ink-2);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--accent);
}

.site-footer a[aria-current="page"] {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--rule-strong);
}

.footer-bottom {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 6px;
  font-size: 0.8125rem;
}

.footer-bottom p {
  margin: 0;
  max-width: 90ch;
}

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .hero .container,
  .chapter .container {
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
  }

  .hero .container {
    padding-top: 56px;
    padding-bottom: 64px;
  }

  .chapter .container {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .chapter p,
  .points {
    max-width: 62ch;
  }
}

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

  .footer-top > :first-child {
    grid-column: 1 / -1;
  }

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

@media (max-width: 640px) {
  :root {
    --gutter: 16px;
  }

  body {
    font-size: 0.9688rem;
  }

  .site-header .container {
    gap: 16px;
  }

  .header-cta {
    display: none;
  }

  .site-nav {
    gap: 16px;
    margin-left: auto;
  }

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

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

  .hashes div + div {
    border-left: 0;
    border-top: 1px solid var(--rule);
  }

  .arch {
    padding: 14px;
  }

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

  .toc ol {
    columns: 1;
  }

  .doc {
    padding-top: 44px;
  }

  .table-wrap table {
    min-width: 600px;
  }

  .compare th,
  .compare td {
    padding: 10px 12px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .actions {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}

/* ---------- Additions: hero figure, light code block ---------- */

.hero-figure {
  margin: 0;
  min-width: 0;
}

.code {
  margin: 0;
  padding: 16px;
  font-size: 0.75rem;
  line-height: 1.75;
  color: var(--ink-2);
  overflow-x: auto;
  white-space: pre;
}

.code .k {
  color: var(--accent);
}

.code .c {
  color: var(--faint);
}
