/* Matter Settle, direction B "Settling Trace" (site v2, 2026-10-16).
   One stylesheet, no framework. Tokens first; dark is the default, light is a designed second set.
   Signal colour is mint #3DDC97. On the light page mint is only ever a fill under ink, or a halo behind the ink trace. */

/* ---------- Fonts (self-hosted, OFL 1.1, see /assets/v2/fonts/LICENSES.md) ---------- */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("/assets/v2/fonts/atkinson-hyperlegible-next-wght.18b2a1a3.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Martian Mono";
  src: url("/assets/v2/fonts/martian-mono-wght.d0be3a78.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
/* Metric-matched fallbacks, measured in Chrome against Liberation Sans / Liberation Mono (Arial / Courier New metrics). */
@font-face {
  font-family: "Atkinson Fallback";
  src: local("Arial"), local("Liberation Sans"), local("Helvetica");
  size-adjust: 99.5%; ascent-override: 98.5%; descent-override: 32.2%; line-gap-override: 0%;
}
@font-face {
  font-family: "Martian Fallback";
  src: local("Courier New"), local("Liberation Mono"), local("Courier");
  size-adjust: 116.6%; ascent-override: 85.8%; descent-override: 17.2%; line-gap-override: 0%;
}

/* ---------- Tokens ---------- */
:root {
  color-scheme: dark;
  --page: #0B0C0D; --surface: #151718; --surface2: #1F2224;
  --ink: #F3F3EF; --ink2: #B0B4B8;
  --link: #3DDC97;
  --accent: #3DDC97; --on-accent: #0B0C0D;
  --btn-edge: #3DDC97; --btn-hover-bg: #F3F3EF; --btn-hover-ink: #0B0C0D;
  --edge: #A6AAAE; --field: #7D8286; --focus: #FFFFFF;
  --trace: #3DDC97; --halo: transparent;
  --ok: #F3F3EF;
  --grid: #1F2224; --line: #2C3033;
  --sans: "Atkinson Hyperlegible Next", "Atkinson Fallback", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Martian Mono", "Martian Fallback", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --wrap: 80rem;
  --gutter: clamp(1rem, 4vw, 3rem);
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #F1F2EE; --surface: #FFFFFF; --surface2: #E3E5E0;
  --ink: #0B0C0D; --ink2: #44484C;
  --link: #0B0C0D;
  --btn-edge: #0B0C0D; --btn-hover-bg: #0B0C0D; --btn-hover-ink: #3DDC97;
  --edge: #44484C; --field: #6A6E72; --focus: #0B0C0D;
  --trace: #0B0C0D; --halo: #3DDC97;
  --ok: #14532D;
  --grid: #E3E5E0; --line: #C9CCC6;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #F1F2EE; --surface: #FFFFFF; --surface2: #E3E5E0;
    --ink: #0B0C0D; --ink2: #44484C;
    --link: #0B0C0D;
    --btn-edge: #0B0C0D; --btn-hover-bg: #0B0C0D; --btn-hover-ink: #3DDC97;
    --edge: #44484C; --field: #6A6E72; --focus: #0B0C0D;
    --trace: #0B0C0D; --halo: #3DDC97;
    --ok: #14532D;
    --grid: #E3E5E0; --line: #C9CCC6;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The header is sticky: anchors and focused elements must land below it (WCAG 2.4.11). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 5.75rem; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: 1.125rem; line-height: 1.6;
  font-synthesis: none; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
svg { display: block; }
h1, h2, h3 { margin: 0; line-height: 1.1; font-weight: 800; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.375rem, 1.25rem + 4.6vw, 4.5rem); line-height: 1.02; letter-spacing: -0.025em; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); }
h3 { font-size: 1.25rem; font-weight: 700; line-height: 1.25; letter-spacing: 0; }
p, ul, ol { margin: 0; }
p + p { margin-top: 1em; }
.hero-copy > *, .sec-head > *, .page-head-grid > div > *, .address-block > * { margin-top: 0; }
em { font-style: normal; font-weight: 700; }
strong, b { font-weight: 700; }
cite { font-style: normal; font-weight: 700; }
::selection { background: var(--accent); color: var(--on-accent); }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a:not([class]):focus-visible { background: var(--accent); color: var(--on-accent); }

.label, .mono {
  font-family: var(--mono); font-weight: 500; font-size: 0.8125rem; line-height: 1.4;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink2);
}
.mono { text-transform: none; letter-spacing: 0; }
.rel-label { margin-bottom: 0.75rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.lede { font-size: clamp(1.1875rem, 1.05rem + 0.5vw, 1.375rem); line-height: 1.5; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.skip {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 10; padding: 0.75rem 1rem;
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.skip:focus { top: 0.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.625rem 1.25rem;
  font: 700 1rem/1.2 var(--sans); text-decoration: none; text-align: center;
  background: var(--accent); color: var(--on-accent);
  border: 2px solid var(--btn-edge); border-radius: 0; cursor: pointer;
}
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.js-only { display: none; }
.js .js-only { display: inline-flex; }

/* ---------- Header (sticky; DOM order brand, nav, theme = visual order at every width) ---------- */
.site-header { position: relative; z-index: 5; border-bottom: 1px solid var(--edge); background: var(--page); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; padding-block: 0.75rem; }
.brand { display: inline-flex; align-items: center; gap: 0.625rem; min-height: 2.75rem; color: var(--ink); text-decoration: none; margin-right: auto; }
.brand svg { width: 2rem; height: 2rem; flex: none; }
.brand-text { display: grid; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand-sub { font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--ink2); }
.mark-bg { fill: var(--ink); }
.mark-line { stroke: var(--page); }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.nav-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.nav-list a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav-list a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 4px; text-underline-offset: 0.35em; }
:root[data-theme="light"] .nav-list a[aria-current="page"] { text-decoration-color: currentColor; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .nav-list a[aria-current="page"] { text-decoration-color: currentColor; } }
.icon-btn {
  display: none; align-items: center; justify-content: center; gap: 0.5rem;
  min-width: 2.75rem; min-height: 2.75rem; padding: 0 0.625rem;
  background: transparent; color: var(--ink); border: 2px solid var(--edge); border-radius: 0;
  font: 500 0.95rem/1 var(--sans); cursor: pointer;
}
.icon-btn svg { width: 1.25rem; height: 1.25rem; flex: none; }
.js .icon-btn { display: inline-flex; }
/* The theme button shows the theme it switches to (its label says the same). */
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-btn .i-moon { display: block; }
  :root:not([data-theme="dark"]) .theme-btn .i-sun { display: none; }
}
/* Below 1056 px: without JavaScript the links wrap under the brand; with it they fold into a menu panel. The CTA stays outside the menu. */
@media (max-width: 65.999rem) {
  html:not(.js) .site-nav { flex: 1 1 100%; }
  html:not(.js) .nav-list { flex-basis: 100%; }
  .js .site-header { position: sticky; top: 0; }
  .js .nav-list { display: none; }
  .js .nav-list.is-open {
    display: grid; gap: 0; position: absolute; left: 0; right: 0; top: 100%;
    padding: 0.25rem var(--gutter) 1rem; background: var(--page); border-bottom: 2px solid var(--edge);
  }
  .js .nav-list.is-open a { min-height: 3rem; width: 100%; border-bottom: 1px solid var(--line); font-size: 1.125rem; }
}
/* Phones: row 1 is the brand, row 2 is Menu, the CTA and the theme button. Only row 2 stays on screen when scrolling:
   the header sticks at minus the height of row 1 (padding 0.375 + brand 2.75 + row gap 0.375 = 3.5rem). */
@media (max-width: 39.999rem) {
  html { scroll-padding-top: 4.75rem; }
  .site-header .wrap { padding-block: 0.375rem 0.5rem; gap: 0.375rem 0.5rem; }
  .brand { flex: 1 0 100%; height: 2.75rem; }
  .js .site-header { top: -3.5rem; }
  .site-nav { flex: 1 1 0; min-width: 0; gap: 0.5rem; flex-wrap: nowrap; }
  html:not(.js) .site-nav { flex-wrap: wrap; }
  .nav-cta { flex: 1 1 auto; min-width: 0; padding-inline: 0.625rem; }
}
/* Short viewports (landscape phones, 200% zoom): a sticky header would cover a third of the screen, so it scrolls away. */
@media (max-height: 30rem) { .site-header, .js .site-header { position: static; } html { scroll-padding-top: 0; } }
@media (max-width: 23.499rem) { .menu-btn .menu-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
@media (min-width: 66rem) {
  .site-header { position: sticky; top: 0; }
  .site-header .wrap { flex-wrap: nowrap; gap: 1.5rem; }
  .nav-list { flex-wrap: nowrap; gap: 1.5rem; margin-right: 0.25rem; }
  .site-nav { gap: 1.25rem; }
  .menu-btn, .js .menu-btn { display: none; }
}

/* ---------- Bands and section heads ---------- */
.band { padding-block: clamp(3.5rem, 2.5rem + 4vw, 6.5rem); border-top: 1px solid var(--line); }
.band--surface { background: var(--surface); }
.sec-head { display: grid; align-content: start; gap: 0.875rem; max-width: 46rem; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.sec-head p:not(.label) { color: var(--ink2); }
.label .n { color: var(--ink); }

/* ---------- Hero (home) ---------- */
.hero {
  position: relative; border-bottom: 1px solid var(--edge);
  background-color: var(--page);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
}
.hero-grid { display: grid; gap: 2rem; padding-block: clamp(2.5rem, 1.5rem + 5vw, 5.5rem) 0; }
.hero-copy { display: grid; gap: 1.25rem; align-content: start; padding-bottom: 0.5rem; }
.hero-copy .lede { max-width: 38rem; }
.hero-for { max-width: 36rem; color: var(--ink2); }
.hero-copy .btn-row { margin-top: 0.5rem; }
.disamb { font-size: 0.95rem; color: var(--ink2); max-width: 36rem; }
.hero-fig { position: relative; margin: 0; align-self: end; max-width: 34rem; }
.hero-fig svg { width: 100%; height: auto; aspect-ratio: 2 / 1; overflow: visible; }
.hero-fig figcaption { position: absolute; right: 0; bottom: calc(33.3% + 0.4rem); }
@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: end; column-gap: 2.5rem; }
  .hero-copy { padding-bottom: clamp(2.5rem, 4vw, 4.5rem); }
  .hero-fig { margin-bottom: 1.5rem; }
}
.trace-line { fill: none; stroke: var(--trace); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; vector-effect: non-scaling-stroke; }
.trace-halo { fill: none; stroke: var(--halo); stroke-width: 8; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.trace-base { stroke: var(--ink2); stroke-width: 1.5; stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: no-preference) {
  /* Draws once per page load, home page only. fill-mode none: if the animation never runs, the finished trace shows. */
  .hero .trace-line { animation: draw 1.4s cubic-bezier(.3,.7,.3,1); }
  .hero .trace-halo { animation: fade 1.4s ease-out; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* Readout strip: the four services, anchor links down the page */
.readout { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--edge); }
.readout li { border-bottom: 1px solid var(--line); }
.readout li:nth-child(odd) { border-right: 1px solid var(--line); }
.readout a {
  display: flex; gap: 0.625rem; align-items: baseline; min-height: 3.5rem; height: 100%;
  padding: 0.875rem 0.75rem; color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.3;
}
.readout a .mono { color: var(--ink2); font-weight: 500; }
@media (min-width: 56rem) {
  .readout { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .readout li { border-bottom: 0; border-right: 1px solid var(--line); }
  .readout li:last-child { border-right: 0; }
  .readout a { padding: 1.25rem 1rem; }
  .readout li:first-child a { padding-left: 0; }
}

/* ---------- Channel rows (replace card grids) ---------- */
.ch-list { list-style: none; padding: 0; border-bottom: 1px solid var(--line); }
.ch-list > li { border-top: 1px solid var(--line); }
.ch {
  position: relative; display: grid; grid-template-columns: 3.5rem minmax(0, 1fr); gap: 0.25rem 1rem;
  padding: 1.25rem 0.75rem 1.25rem 0; min-height: 4rem; color: var(--ink); text-decoration: none;
}
a.ch:focus-visible { background: var(--surface2); color: var(--ink); }
a.ch::before { content: ""; position: absolute; left: -0.75rem; top: 0; bottom: 0; width: 4px; background: transparent; }
a.ch:focus-visible::before { background: var(--accent); }
a.ch:focus-visible .ch-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
.ch-id { grid-row: 1 / span 3; padding-top: 0.25rem; }
.ch-title { font-size: clamp(1.1875rem, 1.05rem + 0.6vw, 1.5rem); font-weight: 700; line-height: 1.25; }
.ch > :not(.ch-id) { grid-column: 2; }
.ch-desc { color: var(--ink2); max-width: 40rem; }
.ch-out { color: var(--ink2); }
.ch-out::before { content: "\2192\00a0"; }
@media (min-width: 56rem) {
  .ch { grid-template-columns: 4.5rem minmax(0, 1fr) minmax(0, 18rem); padding-block: 1.5rem; column-gap: 1.5rem; }
  .ch-id { grid-row: 1 / span 2; }
  .ch > .ch-out { grid-column: 3; grid-row: 1 / span 2; align-self: center; text-align: right; text-wrap: balance; }
  .ch-desc { grid-column: 2; }
}
.ch-name { display: block; margin-bottom: 0.25rem; }
.split .ch { grid-template-columns: 3.5rem minmax(0, 1fr); }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; display: grid; gap: 0; }
.steps li { position: relative; padding: 0 0 1.75rem 2.25rem; border-left: 2px solid var(--edge); margin-left: 0.5rem; }
.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; left: -0.5625rem; top: 0.3rem; width: 1rem; height: 1rem;
  background: var(--page); border: 2px solid var(--ink);
}
.band--surface .steps li::before { background: var(--surface); }
.steps li:first-child::before { background: var(--accent); border-color: var(--btn-edge); }
:root[data-theme="light"] .steps li:first-child::before { border-color: var(--ink); }
.steps .label { display: block; margin-bottom: 0.375rem; }
.steps h3 { margin-bottom: 0.375rem; }
.steps p { color: var(--ink2); }
@media (min-width: 56rem) {
  .steps { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; }
  .steps li { padding: 2rem 0 0; border-left: 0; border-top: 2px solid var(--edge); margin-left: 0; }
  .steps li:last-child { border-top-color: var(--edge); }
  .steps li::before { left: 0; top: -0.5625rem; }
}

/* ---------- Terms table ---------- */
.terms { list-style: none; padding: 0; border-top: 2px solid var(--ink); }
.terms li { display: grid; grid-template-columns: 3rem minmax(0, 1fr); gap: 0.25rem 1rem; padding-block: 1rem; border-bottom: 1px solid var(--line); }
.terms .label { padding-top: 0.3rem; color: var(--ink); }
.terms p { grid-column: 2; color: var(--ink2); }
@media (min-width: 56rem) {
  .terms li { grid-template-columns: 4.5rem 14rem minmax(0, 1fr); align-items: baseline; padding-block: 1.125rem; column-gap: 1.5rem; }
  .terms p { grid-column: 3; color: var(--ink); }
}
.terms.plain li { grid-template-columns: 3rem minmax(0, 1fr); }
.terms.plain p { grid-column: 2; color: var(--ink); }
.terms.plain .label { padding-top: 0.25rem; }

/* ---------- Spec rows (question | answer), used on inner pages ---------- */
.spec { border-top: 2px solid var(--ink); }
.spec-row { display: grid; gap: 0.75rem; padding-block: clamp(1.75rem, 1.25rem + 2vw, 2.75rem); border-bottom: 1px solid var(--line); }
.spec-row h2 { font-size: clamp(1.375rem, 1.15rem + 0.8vw, 1.75rem); }
.spec-row h3 { font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem); }
.spec-row h2 .label { display: block; margin-bottom: 0.5rem; }
.spec-body { max-width: 42rem; }
.spec-body > * + * { margin-top: 1rem; }
@media (min-width: 56rem) {
  .spec-row { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: 3rem; }
}
.ticks { list-style: none; padding: 0; display: grid; gap: 0.625rem; }
.ticks li { position: relative; padding-left: 1.75rem; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.72em; width: 0.875rem; height: 2px; background: var(--ink2); }
.kv { display: grid; gap: 0; border-top: 1px solid var(--line); margin: 0; }
.kv > div { display: grid; gap: 0.125rem 1.25rem; padding-block: 0.875rem; border-bottom: 1px solid var(--line); }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; color: var(--ink2); }
@media (min-width: 40rem) { .kv > div { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); } }

/* ---------- Page head (inner pages) ---------- */
.page-head { border-bottom: 1px solid var(--edge); padding-block: clamp(1.5rem, 1rem + 2vw, 2.5rem) clamp(2.5rem, 1.5rem + 4vw, 4.5rem); }
.crumbs ol { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 0.5rem; }
.crumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.crumbs li + li::before { content: "/"; color: var(--ink2); }
.crumbs a { color: var(--ink2); display: inline-flex; align-items: center; min-height: 1.75rem; text-decoration-thickness: 1px; }
.crumbs [aria-current] { color: var(--ink); }
.page-head-grid { display: grid; gap: 1.5rem 3rem; margin-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.page-head-grid > div { display: grid; gap: 1.25rem; align-content: start; }
.page-head .lede { max-width: 40rem; }
.page-head-grid > .readings { align-self: start; }
.page-fig { margin: 0; align-self: end; max-width: 30rem; }
.page-fig svg { width: 100%; height: auto; aspect-ratio: 4 / 1; }
@media (min-width: 56rem) { .page-head-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.jump ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.jump a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* ---------- Flow diagram (HTML, not SVG, so it reflows and stays text) ---------- */
.flow { list-style: none; padding: 0; display: grid; gap: 2.25rem; margin-top: 0.5rem; }
.flow li { position: relative; padding: 1.125rem 1.25rem 1.25rem; border: 2px solid var(--edge); background: var(--page); }
.band--surface .flow li { background: var(--surface); }
.flow li:nth-child(2) { border-color: var(--ink); }
.flow .label { display: block; margin-bottom: 0.5rem; }
.flow h3 { margin-bottom: 0.375rem; }
.flow p { color: var(--ink2); font-size: 1rem; line-height: 1.5; }
.flow li + li::before {
  content: ""; position: absolute; left: 1.5rem; top: calc(-2.25rem - 2px); height: 2.25rem; width: 0; border-left: 2px solid var(--trace);
}
.flow li + li::after {
  content: ""; position: absolute; left: calc(1.5rem - 5px); top: -9px; border: 6px solid transparent; border-top-color: var(--trace); border-bottom: 0;
}
@media (min-width: 56rem) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; }
  .flow li + li::before { left: calc(-2.5rem - 2px); top: 2.25rem; width: 2.5rem; height: 0; border-left: 0; border-top: 2px solid var(--trace); }
  .flow li + li::after { left: -9px; top: calc(2.25rem - 5px); border: 6px solid transparent; border-left-color: var(--trace); border-right: 0; }
}

/* ---------- Callout, FAQ rows, panels, layout helpers ---------- */
.callout { border-left: 4px solid var(--ink2); padding: 0.25rem 0 0.25rem 1.25rem; max-width: 42rem; }
.qa { border-top: 1px solid var(--line); }
.qa details { border-bottom: 1px solid var(--line); }
.qa summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; padding-block: 0.75rem;
  font-weight: 700; font-size: 1.125rem; line-height: 1.35; cursor: pointer; list-style: none;
}
.qa summary::-webkit-details-marker { display: none; }
.qa summary::after { content: "+"; font-family: var(--mono); font-weight: 500; font-size: 1.25rem; color: var(--ink2); flex: none; }
.qa details[open] summary::after { content: "\2212"; }
.qa details p { padding-bottom: 1.25rem; max-width: 42rem; color: var(--ink2); }
.panel { border: 2px solid var(--edge); background: var(--surface); padding: clamp(1.25rem, 1rem + 1.5vw, 2rem); }
.split { display: grid; gap: 2.5rem; }
@media (min-width: 56rem) { .split { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: 4rem; } }
.more, .more-text { margin-top: 2rem; }
.split > .sec-head { margin-bottom: 0; }
.h-sm { font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem); }
.stack > * + * { margin-top: 1.25rem; }

/* Location and fact readouts */
.readings { display: grid; gap: 0; border-top: 2px solid var(--ink); margin: 0; }
.readings > div { display: grid; grid-template-columns: minmax(0, 7.5rem) minmax(0, 1fr); gap: 1rem; padding-block: 0.875rem; border-bottom: 1px solid var(--line); }
.readings dt { padding-top: 0.2rem; }
.readings dd { margin: 0; font-weight: 700; }
.readings.text dd { font-weight: 400; }
@media (min-width: 25rem) { .readings.text > div { grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); } }

/* ---------- Contact ---------- */
.address { font-family: var(--mono); font-weight: 600; font-size: clamp(1rem, 0.85rem + 1vw, 1.375rem); overflow-wrap: anywhere; color: var(--ink); line-height: 1.35; }
.address a { color: var(--ink); display: inline-block; padding-block: 0.3rem; }
.address-block { display: grid; gap: 1rem; }
.status { min-height: 1.6em; font-weight: 700; color: var(--ok); }
.status:not(:empty)::before { content: "\2713\00a0"; }
.status.is-error::before { content: "\00d7\00a0"; }
.field { display: grid; gap: 0.375rem; }
.field + .field { margin-top: 1rem; }
.field label { font-weight: 700; }
.field .hint { font-size: 1rem; color: var(--ink2); }
.field input, .field textarea {
  width: 100%; font: 400 1rem/1.5 var(--sans); color: var(--ink); background: var(--page);
  border: 2px solid var(--field); border-radius: 0; padding: 0.625rem 0.75rem;
}
.field textarea { min-height: 17rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { border-color: var(--ink); }
.mail-form .btn-row { margin-top: 1rem; }
.note { font-size: 1rem; color: var(--ink2); }
.js .fallback:not(.is-shown) { display: none; }
.example-msg { margin: 0.75rem 0 0; border-left: 4px solid var(--ink2); padding: 0.25rem 0 0.25rem 1.25rem; }

/* ---------- Guides ---------- */
.meta-line { margin-top: 0.25rem; }
.summary { font-size: clamp(1.125rem, 1.05rem + 0.3vw, 1.25rem); line-height: 1.55; border-left: 4px solid var(--accent); padding: 0.25rem 0 0.25rem 1.25rem; }
:root[data-theme="light"] .summary { border-left-color: var(--ink); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .summary { border-left-color: var(--ink); } }
.ch-date { color: var(--ink2); font-size: 0.8125rem; }
.guide-grid { display: grid; gap: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.prose { max-width: 44rem; }
.prose > * + * { margin-top: 1rem; }
.prose > h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-top: 2.75rem; }
.prose > h2:first-child { margin-top: 0; }
.prose > h2 .label { display: block; margin-bottom: 0.5rem; }
.guide h1 { font-size: clamp(2.125rem, 1.25rem + 3.4vw, 3.75rem); }
.h1-sub { display: block; margin-top: 0.3em; font-size: 0.55em; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.toc { display: none; }
@media (min-width: 64rem) {
  .guide-grid { grid-template-columns: minmax(0, 46rem) minmax(0, 16rem); justify-content: space-between; column-gap: 4rem; }
  .guide-grid > :not(.toc) { grid-column: 1; }
  .toc { display: block; grid-column: 2; grid-row: 1 / span 3; align-self: start; position: sticky; top: 6.5rem; }
  .toc ol { list-style: none; padding: 0; margin: 0.75rem 0 0; border-left: 2px solid var(--line); }
  .toc a { display: flex; align-items: center; min-height: 2rem; padding: 0.25rem 0 0.25rem 1rem; color: var(--ink2); text-decoration: none; font-size: 1rem; line-height: 1.3; }
  .toc a:focus-visible { color: var(--ink); }
}
.q-item { margin-top: 2.25rem; }
.q-item h3 { font-size: clamp(1.1875rem, 1.1rem + 0.4vw, 1.375rem); margin-bottom: 0.875rem; }
.q-item h3 .label { display: block; margin-bottom: 0.375rem; }
.artifact { max-width: 52rem; border: 2px solid var(--edge); background: var(--surface); padding: clamp(1rem, 0.75rem + 1.5vw, 1.75rem); }
.artifact-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; }
.artifact-head .label { color: var(--ink); }
.artifact-text {
  margin: 0.75rem 0 0; padding: 1rem; background: var(--page); border: 1px solid var(--line);
  font: 500 0.8125rem/1.65 var(--mono); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
}
.src-list { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.src-list li { padding-block: 0.875rem; border-bottom: 1px solid var(--line); }

/* ---------- Pilot: the sample scope ---------- */
.flag { max-width: 52rem; border: 2px dashed var(--ink); padding: 0.875rem 1.125rem; margin-bottom: 1.5rem; }
.scope-doc { border: 2px solid var(--edge); background: var(--page); padding: clamp(1rem, 0.75rem + 1.5vw, 2rem); }
.scope-title { font-weight: 800; font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem); line-height: 1.25; padding-bottom: 1rem; border-bottom: 2px solid var(--ink); }
.scope-title .label { display: block; margin-bottom: 0.375rem; }
.scope { list-style: none; padding: 0; }
.scope > li { display: grid; gap: 0.75rem 2.5rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.scope-line .label, .scope-note .label { display: block; margin-bottom: 0.375rem; }
.scope-line .label { color: var(--ink); }
.scope-line .ticks { margin-top: 0.25rem; }
.scope-note { border-left: 4px solid var(--ink2); padding-left: 1rem; }
.scope-note p { color: var(--ink2); font-size: 1rem; }
@media (min-width: 56rem) { .scope > li { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }

/* ---------- Stub (404) ---------- */
.stub { padding-block: clamp(3rem, 2rem + 5vw, 6rem); }
.stub p { margin-top: 1.25rem; }
.stub p.label { margin: 0 0 0.75rem; }
.stub .ticks { margin-top: 1rem; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--edge); background: var(--surface); padding-block: 3rem 2rem; font-size: 1rem; }
.foot-grid { display: grid; gap: 2rem; }
@media (min-width: 56rem) { .foot-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 3rem; } }
.foot-disamb { font-weight: 700; max-width: 30rem; margin-top: 1rem; }
.foot-links { list-style: none; padding: 0; display: grid; gap: 0; }
.foot-links a { display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--ink); }
.foot-meta { display: grid; gap: 0.25rem; align-content: start; }
.foot-meta a, .more a { display: inline-flex; align-items: center; min-height: 2.75rem; }
.foot-meta p + p { margin-top: 0; }
.foot-small { margin-top: 2rem; padding-top: 1.25rem; border-top: 1px solid var(--line); color: var(--ink2); font-size: 0.9rem; }

/* ---------- Hover: only on devices that can hover, so a tap does not leave a row highlighted ---------- */
@media (hover: hover) {
  a:not([class]):hover { background: var(--accent); color: var(--on-accent); text-decoration-color: currentColor; }
  .btn:hover { background: var(--btn-hover-bg); color: var(--btn-hover-ink); border-color: var(--btn-hover-bg); }
  .btn--ghost:hover { background: var(--ink); color: var(--page); border-color: var(--ink); }
  .brand:hover .brand-name { text-decoration: underline; text-decoration-thickness: 2px; }
  .nav-list a:hover { text-decoration: underline; text-decoration-thickness: 2px; color: var(--ink); }
  .nav-list a[aria-current="page"]:hover { text-decoration-thickness: 4px; }
  .icon-btn:hover { border-color: var(--ink); }
  .readout a:hover { background: var(--surface2); color: var(--ink); }
  .readout a:hover .t { text-decoration: underline; text-decoration-thickness: 2px; }
  a.ch:hover { background: var(--surface2); color: var(--ink); }
  a.ch:hover::before { background: var(--accent); }
  a.ch:hover .ch-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.15em; }
  .qa summary:hover { text-decoration: underline; text-decoration-thickness: 2px; }
  .crumbs a:hover { color: var(--on-accent); }
  .toc a:hover { color: var(--ink); text-decoration: underline; }
}

/* ---------- Forced colours ---------- */
@media (forced-colors: active) {
  .btn, .icon-btn, .panel, .flow li, .field input, .field textarea, .artifact, .scope-doc, .flag { border: 2px solid ButtonText; }
  .btn { background: ButtonFace; color: ButtonText; }
  .trace-line, .trace-base { stroke: CanvasText; }
  .trace-halo { stroke: transparent; }
  .mark-bg { fill: CanvasText; } .mark-line { stroke: Canvas; }
  a.ch::before, .steps li::before { background: CanvasText; }
  :focus-visible { outline: 3px solid Highlight; }
  .hero { background-image: none; }
}

/* ---------- Print ---------- */
@media print {
  :root:not(#print) { --page: #fff; --surface: #fff; --surface2: #fff; --ink: #000; --ink2: #000; --link: #000; --edge: #000; --line: #999; --trace: #000; --halo: transparent; --grid: transparent; }
  html { scroll-padding-top: 0; }
  body { font-size: 11pt; background: #fff; color: #000; }
  .site-header { position: static !important; border-bottom: 1px solid #000; }
  .site-nav, .nav-list, .icon-btn, .btn, .skip, .crumbs, .readout, .js-only, .mail-form .field, .mail-form .btn-row, .status, .jump { display: none !important; }
  .fallback { display: none !important; }
  .trace-line, .trace-halo { animation: none !important; }
  .hero-fig { max-width: 24rem; }
  .steps li:first-child::before { background: #000; border-color: #000; }
  .hero, .band--surface, .site-footer, .artifact, .artifact-text { background: #fff; }
  .band { padding-block: 1.5rem; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
  .ch, .terms li, .spec-row, .flow li, .steps li, .scope > li, details, figure { break-inside: avoid; }
  details::details-content { content-visibility: visible; display: block; }
  .address { font-size: 12pt; }
}
