/* ==========================================================================
   Crawley Mesh Community - style.css

   Dark theme only. Tailwind's gray scale, as on the meshcore.io website
   (gray-900 page, gray-800 panels, gray-700 borders), plus our own
   blue-violet and purple accents, and a purple→violet glow behind the
   home page title. Not an official MeshCore palette.

   Mobile first: the base rules are for small screens; min-width media
   queries add room on bigger ones. No frameworks.

   Type: IBM Plex Sans for reading, JetBrains Mono for headings, the menu,
   buttons, labels, and code. Both from Google Fonts, self-hosted in
   /assets/fonts (SIL Open Font License, see the OFL-*.txt files there),
   Latin subset.

   Contrast (WCAG 2.2) on --bg:   --text 16.1:1 · --muted 7.0:1
                                  --violet 6.6:1 · --purple 6.7:1
                                  white on --violet-deep (buttons) 5.4:1
   ========================================================================== */

/* --- Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-var.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-var.woff2") format("woff2");
}

:root {
  color-scheme: dark;

  --bg: #111827;          /* Tailwind gray-900, page background */
  --bg-deep: #0b1120;     /* code blocks, header, footer */
  --surface: #1f2937;     /* Tailwind gray-800, panels */
  --line: #374151;        /* gray-700, decorative borders */
  --line-strong: #4b5563; /* gray-600 */
  --text: #f3f4f6;        /* gray-100 */
  --muted: #9ca3af;       /* gray-400 */
  --violet: #9393ff;      /* main accent (blue-violet) */
  --violet-deep: #5b5bd6; /* deeper blue-violet: button fills, under white text */
  --purple: #c084fc;      /* second accent (Tailwind purple-400) */
  --gradient: linear-gradient(90deg, var(--purple), var(--violet));

  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", "SF Mono",
    "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --wrap: 50rem; /* 800px: the whole site is one compact column */
  --gutter: 1rem;
}

/* --- Reset-ish ------------------------------------------------------------ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  /* Faint dot grid, like graph paper / a breadboard. Decorative only. */
  background-image: radial-gradient(rgb(255 255 255 / 0.045) 1px, transparent 1px);
  background-size: 1.5rem 1.5rem;
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Monospace for headings, the menu, buttons, labels, and code. Everything
   else (prose, lists, tables, notes) stays sans. */
h1,
h2,
h3,
h4,
code,
kbd,
pre,
samp,
.brand,
.site-nav,
.btn,
.panel__title,
.callout__title,
thead th,
.meshsim__count {
  font-family: var(--mono);
  /* Never let a font merge pairs like -> or != into single symbols. Keep
     every character literal: commands must look exactly as typed. */
  font-variant-ligatures: none;
}

main {
  flex: 1;
}

img,
svg {
  max-width: 100%;
  height: auto;
}

/* Elements with their own display value would otherwise ignore [hidden]. */
[hidden] {
  display: none !important;
}

::selection {
  background: var(--violet);
  color: var(--bg);
}

/* --- Accessibility helpers ------------------------------------------------ */

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--violet);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

/* <main tabindex="-1"> receives focus from the skip link; no ring needed. */
main:focus {
  outline: none;
}

/* --- Typography ----------------------------------------------------------- */

h1,
h2,
h3,
h4 {
  margin: 2rem 0 1rem;
  line-height: 1.25;
  font-weight: 700;
  /* A monospace space is as wide as a letter (0.6em), which leaves wide
     gaps between words. This trims it to about two-thirds. */
  word-spacing: -0.2em;
  text-wrap: balance;
}

h1 {
  margin-top: 0;
  font-size: clamp(1.9rem, 7vw, 3.25rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.35rem, 4.5vw, 1.75rem);
}

h3 {
  font-size: 1.15rem;
}

h3,
h4 {
  margin-top: 1.75rem;
}

h4 {
  font-size: 1rem;
}

p,
ul,
ol,
dl,
pre,
table,
figure,
details {
  margin: 0 0 1.25rem;
}

ul,
ol {
  padding-left: 1.5rem;
}

li + li {
  margin-top: 0.4rem;
}

strong {
  color: var(--text); /* not pure white, which glares on a dark page */
}

/* No italics: they make words run together for many dyslexic readers
   (British Dyslexia Association style guide). Emphasis shows as bold. */
em,
i,
cite,
dfn {
  font-style: normal;
  font-weight: 700;
}

small {
  color: var(--muted);
}

hr {
  margin: 2rem 0; /* the same gap as above an h2 */
  border: 0;
  border-top: 1px solid var(--line);
}

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
  cursor: help;
}

kbd {
  display: inline-block;
  padding: 0 0.4em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  border-radius: 4px;
  background: var(--surface);
  font-size: 0.85em;
  line-height: 1.5;
}

/* Mono glyphs are wider than the sans; 0.92em keeps inline code from
   looking bigger than the text around it. */
code {
  font-size: 0.92em;
}

pre code {
  font-size: inherit;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--surface);
  color: var(--violet); /* same as links; 5.5:1 on --surface */
}

/* --- Links ---------------------------------------------------------------- */

a {
  color: var(--violet);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Violet highlight on hover. */
a:hover {
  background: var(--violet);
  color: var(--bg);
  text-decoration: none;
}

/* External links open in a new tab, and every one gets a small arrow,
   announced as "(opens in a new tab)", so nobody is surprised by it. */
a[target="_blank"]::after {
  content: "\00a0\2197";
  content: "\00a0\2197" / " (opens in a new tab)";
  font-size: 0.85em;
}

/* --- Layout --------------------------------------------------------------- */

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

/* Home page sections. Spaced by their top padding alone (no padding or
   margin at the bottom), so the gap above each section, the first one
   included, is always the same. */
.section {
  padding-top: 2.5rem;
}

@media (min-width: 46rem) {
  .section {
    padding-top: 3rem;
  }
}

.section > :first-child,
.prose > :first-child {
  margin-top: 0;
}

.section > :last-child {
  margin-bottom: 0;
}

/* --- Header + nav --------------------------------------------------------- */

/* One thin neutral line below, the same weight as the footer's. */
.site-header {
  border-bottom: 1px solid var(--line);
  background: rgb(11 17 32 / 0.92);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 1rem;
  padding-block: 0.75rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  /* On small screens the brand takes the space left beside the Menu button,
     and the name wraps onto two lines if it has to, so the button never gets
     pushed onto a row of its own. */
  flex: 1 1 0;
  min-width: 0;
  line-height: 1.25;
  padding-block: 0.25rem;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
  text-decoration: none;
}

/* The radio-mast logo. Sized in em so it follows the wordmark. */
.brand__mark {
  display: block;
  width: 1.75em;
  height: 1.75em;
  flex: none;
}

/* No hover effect: the logo and name don't change. */
.brand:hover {
  background: none;
  color: var(--text);
}

/* On small screens the nav gets its own row under the brand. */
.site-nav {
  flex-basis: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li + li {
  margin-top: 0;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem; /* 44px touch target */
  padding: 0 0.6rem;
  color: var(--muted);
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--surface);
  color: var(--text);
}

/* Current page: white and bold, with a grey bar underneath (the header
   line's colour), so it isn't marked by colour alone. */
.site-nav a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 -3px 0 var(--line);
}

/* Menu button for small screens. It ships with the hidden attribute and
   site.js reveals it, so without JS the full nav simply shows. */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.9375rem;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle[aria-expanded="true"] {
  border-color: var(--violet);
  color: var(--violet);
}

.nav-toggle__bar {
  fill: currentColor;
  transform-origin: 10px 10px;
}

/* Open: the three bars turn into a cross. */
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

@media (prefers-reduced-motion: no-preference) {
  .nav-toggle__bar {
    transition: transform 0.15s ease, opacity 0.15s ease;
  }
}

/* Small screens with the menu button active: collapsed until opened, then
   a full-width list of rows under the header. */
@media (width < 52rem) {
  .nav-toggle[aria-expanded="false"] + .site-nav {
    display: none;
  }

  .nav-toggle:not([hidden]) + .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding-block: 0.25rem 0.5rem;
  }

  .nav-toggle:not([hidden]) + .site-nav a {
    display: flex;
    padding-inline: 0.75rem;
  }

  .nav-toggle:not([hidden]) + .site-nav a[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--line);
  }
}

/* Wide screens: everything in one row, no menu button. */
@media (width >= 52rem) {
  .site-header__inner {
    flex-wrap: nowrap;
    padding-block: 0;
  }

  /* Taller links make a taller header, and keep the current-page bar sitting
     right on the header's bottom edge. */
  .site-nav a {
    min-height: 3.5rem;
  }

  .brand {
    flex: none;
  }

  .site-nav {
    flex-basis: auto;
  }

  .nav-toggle {
    display: none;
  }
}

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

.hero {
  position: relative;
  padding-top: 2.5rem; /* nothing below: the next .section brings the gap */
  isolation: isolate;
}

/* Soft purple→violet glow behind the hero, centred. Decorative only. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: -4rem;
  /* Centred, and never past the edges, or phones get a sideways scroll. */
  inset-inline: 0;
  margin-inline: auto;
  width: min(36rem, 100%);
  aspect-ratio: 577 / 310;
  background: var(--gradient);
  opacity: 0.14;
  filter: blur(64px);
  border-radius: 50%;
  pointer-events: none;
}

/* Lighter violet at the top, deeper at the bottom. The fade starts at the
   top of the capitals, so the bottoms of the letters stay above 3:1 even
   over the glow. 1lh repeats it for each line, so a title that wraps on a
   phone gets it on both lines (where lh isn't supported, the gradient just
   spans the whole title). */
.hero h1 {
  background: linear-gradient(var(--violet) 20%, var(--violet-deep));
  background-size: 100% 1lh;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  /* A short shadow in the page colour, to lift it off the brighter glow. A
     drop-shadow filter, not text-shadow, which would paint over the clipped
     gradient. */
  filter: drop-shadow(0 1px 1.5px var(--bg));
}

/* No bottom padding, so the intro's margin overlaps the next heading's
   instead of adding to it: the gap matches the one between sections. */
.page-hero {
  padding-top: 2.5rem;
}

/* Short feature list in the home hero. */
.features {
  margin: 1.5rem 0;
}

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

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.75rem 0 0;
  padding: 0;
  list-style: none;
}

.actions li + li {
  margin-top: 0;
}

/* Filled, no border: white on deep violet (5.4:1). White rather than
   --text, which is 4.9:1 here. Violet with dark text on hover. */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  background: var(--violet-deep);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn:hover {
  background: var(--violet);
  color: var(--bg);
}

/* --- Flow diagram (solar guide): boxes joined by arrows ------------------ */

.flow {
  max-width: 28rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
}

.flow li {
  position: relative;
  margin: 0;
  padding: 0.6rem 1rem;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--violet);
  background: var(--surface);
}

.flow li + li {
  margin-top: 1.75rem;
}

/* Down arrow in the gap between boxes. */
.flow li + li::before {
  content: "↓";
  content: "↓" / "";
  position: absolute;
  top: -1.7rem;
  left: 1.5rem;
  color: var(--violet);
  font-weight: 700;
  line-height: 1.6rem;
}

/* --- Link list (home page links): two compact columns from 40rem ------- */

.link-groups {
  display: grid;
  gap: 1.25rem 2.5rem;
}

@media (min-width: 40rem) {
  .link-groups {
    grid-template-columns: 1fr 1fr;
  }
}

.link-groups h3 {
  margin: 0.5rem 0 0.75rem;
}

.link-list {
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.link-list:last-child {
  margin-bottom: 0;
}

.link-list li {
  margin: 0 0 0.6rem;
}

.link-list a {
  font-weight: 700;
}

/* The short description sits on its own line under the link. */
.link-list span {
  display: block;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* --- Mesh animation (FAQ page, driven by meshsim.js) ---------------------- */

.meshsim__svg {
  display: block;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  height: auto;
  overflow: visible;
}

.ms-link {
  stroke: var(--line-strong);
  stroke-width: 1.5;
  stroke-dasharray: 3 5;
}

.ms-route-line {
  fill: none;
  stroke: var(--purple);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.3;
}

.ms-user {
  fill: var(--bg-deep);
  stroke: var(--violet);
  stroke-width: 2.5;
}

.ms-mast {
  fill: none;
  stroke: var(--text);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.ms-mast-top {
  fill: var(--purple);
}

.ms-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
}

.ms-node--user .ms-label {
  fill: var(--text);
  font-weight: 700;
}

.ms-pkt--flood {
  fill: var(--violet);
}

.ms-pkt--direct {
  fill: var(--purple);
}

.ms-pkt--ack {
  fill: var(--bg);
  stroke: var(--text);
  stroke-width: 2;
}

.ms-pkt--faint {
  opacity: 0.3;
}

.ms-ripple {
  fill: none;
  stroke-width: 1.5;
}

.ms-ripple--flood {
  stroke: var(--violet);
}

.ms-ripple--direct {
  stroke: var(--purple);
}

.ms-ripple--ack {
  stroke: var(--text);
}

.ms-mark {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}

.ms-mark--ok {
  fill: var(--violet);
}

.ms-mark--dup,
.ms-legend-mark {
  fill: var(--muted);
  color: var(--muted);
}

.meshsim__caption {
  margin-top: 0.75rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* All captions share one grid cell; only the current one is visible. */
.meshsim__steps {
  display: grid;
  margin-bottom: 0.75rem;
}

.meshsim__step {
  grid-area: 1 / 1;
  margin: 0;
  visibility: hidden;
}

.meshsim__step.is-current {
  visibility: visible;
}

.meshsim__step b {
  color: var(--text);
}

.meshsim__count {
  color: var(--purple);
  font-family: var(--mono);
}

.meshsim__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  margin: 0 0 0.75rem;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.meshsim__legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
}

.meshsim__legend svg {
  width: 0.85em;
  height: 0.85em;
  overflow: visible;
}

.ms-legend-mark {
  font-family: var(--mono);
  font-weight: 700;
}

.meshsim__toggle {
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  cursor: pointer;
}

.meshsim__toggle:hover {
  border-color: var(--violet);
}

/* --- Panels (boxes with a title on the border) ---------------------------- */

/* The title sits 0.75rem above the box, so a 2rem top margin leaves the
   usual 1.25rem between the previous block and the title (1rem after a
   heading, as with text). */
.panel {
  position: relative;
  margin: 2rem 0 1.5rem;
  padding: 1.75rem 1rem 1rem;
  border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--surface) 45%, transparent);
}

:is(h2, h3, h4) + .panel {
  margin-top: 1.75rem;
}

.panel__title {
  position: absolute;
  top: 0;
  left: 0.75rem;
  margin: 0;
  padding: 0 0.5ch;
  transform: translateY(-50%);
  background: var(--bg);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
}

.panel > :last-child {
  margin-bottom: 0;
}

@media (min-width: 40rem) {
  .panel {
    padding: 2rem 1.5rem 1.5rem;
  }
}

/* Key / value list, e.g. radio settings. */
.kv {
  display: grid;
  gap: 0.25rem;
}

.kv > div {
  display: grid;
  grid-template-columns: minmax(7.5rem, 32%) 1fr;
  gap: 1rem;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

/* Plain definition lists, e.g. "what each command does". */
dl:not(.kv) dt {
  margin-top: 1rem;
  font-weight: 700;
}

dl:not(.kv) dt:first-child {
  margin-top: 0;
}

dl:not(.kv) dd {
  margin: 0.25rem 0 0 2ch;
  padding-left: 1.5ch;
  border-left: 1px solid var(--line);
}

/* --- Code blocks ---------------------------------------------------------- */

.code {
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet);
  background: var(--bg-deep);
}


.code pre {
  margin: 0;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  line-height: 1.6;
  tab-size: 2;
}

.code pre:focus-visible {
  outline-offset: -3px;
}

/* --- Two-column split ------------------------------------------------------ */

/* Grid items don't collapse margins, so the gaps are set here instead:
   the same as above an h3, and after a list. */
.split {
  display: grid;
  gap: 1.75rem 2rem;
  margin: 1.75rem 0 1.25rem;
}

.split > * > :last-child {
  margin-bottom: 0;
}

@media (min-width: 46rem) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.split h3 {
  margin-top: 0;
}

/* --- Callouts ------------------------------------------------------------- */

/* Notes and warnings look the same; the title says which it is. */
.callout {
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--violet);
  background: color-mix(in srgb, var(--violet) 7%, transparent);
}

.callout__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--violet);
}

.callout > :last-child {
  margin-bottom: 0;
}

/* --- Numbered steps ------------------------------------------------------ */

.steps {
  margin: 0 0 1.25rem;
  padding-left: 1.75rem;
}

.steps > li {
  margin: 0 0 1.25rem;
  padding-left: 0.35rem;
}

.steps > li::marker {
  color: var(--violet);
  font-weight: 700;
}

.steps > li > :last-child {
  margin-bottom: 0;
}

/* --- Tables --------------------------------------------------------------- */

.table-wrap {
  margin: 0 0 1.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
}

.table-wrap:focus-visible {
  outline-offset: 2px;
}

table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.875rem;
}

@media (min-width: 40rem) {
  table {
    font-size: 0.9375rem;
  }
}

caption {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  font-size: 0.875rem;
}

th,
td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th:first-child,
td:first-child {
  padding-left: 0.75rem;
}

th:last-child,
td:last-child {
  padding-right: 0.75rem;
}

@media (min-width: 40rem) {
  th,
  td {
    padding: 0.6rem 0.75rem;
  }
}

thead th {
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

tbody th {
  color: var(--text);
  font-weight: 700;
}

tbody tr:last-child > * {
  border-bottom: 0;
}

tfoot td,
tfoot th {
  border-top: 2px solid var(--line-strong);
  border-bottom: 0;
  font-weight: 700;
}

.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Details / FAQ: the browser's own disclosure arrow, in violet -------- */

details {
  border-bottom: 1px solid var(--line);
}

details:first-of-type,
h2 + details,
h3 + details {
  border-top: 1px solid var(--line);
}


details + details {
  margin-top: -1.25rem;
}

summary {
  padding: 0.85rem 0;
  cursor: pointer;
  font-weight: 700;
}

summary::marker {
  color: var(--violet);
}

summary:hover {
  color: var(--violet);
}

details > :not(summary) {
  margin-left: 1.15em;
}

details > :last-child {
  margin-bottom: 1.25rem;
}

/* --- Table of contents ---------------------------------------------------- */

.toc {
  margin: 1.5rem 0;
}

.toc ol {
  margin: 0;
  padding-left: 1.75rem;
}

.toc li::marker {
  color: var(--muted);
}

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

.site-footer {
  text-align: center;
  margin-top: 3rem;
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--line);
  background: var(--bg-deep);
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer__title {
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 1rem;
}

/* 'Since 2025' on its own line: small, slightly spaced, between two
   hairlines. Normal case: block capitals are harder to read. */
.footer__since {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.footer__since::before,
.footer__since::after {
  content: "";
  width: 1.75rem;
  height: 1px;
  background: var(--line-strong);
}

.footer__text {
  margin: 0 0 0.75rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1.5rem;
  margin: 0;
}

/* White and underlined, so they read as links. Hover/press gets the usual
   violet highlight. */
.footer-links a {
  display: inline-block;
  padding-block: 0.4rem; /* bigger touch target */
  color: var(--text);
}

.footer-links a:hover {
  color: var(--bg);
}

/* The page you're on: plain bold text, no underline. */
.footer-links a[aria-current="page"] {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

/* --- Forced colours (Windows High Contrast etc.) -------------------------- */

@media (forced-colors: active) {
  .hero h1 {
    background: none;
    color: CanvasText;
    filter: none;
  }

  .site-nav a[aria-current="page"] {
    border: 2px solid CanvasText;
  }

  .btn,
  .panel,
  .callout {
    border: 1px solid CanvasText;
  }
}

/* --- Print: guides get printed for build days, so print light ------------- */

@media print {
  :root {
    --bg: #fff;
    --bg-deep: #fff;
    --surface: #f3f4f6;
    --text: #000;
    --muted: #374151;
    --violet: #000;
    --violet-deep: #fff;
    --purple: #000;
    --line: #9ca3af;
    --line-strong: #6b7280;
  }

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

  .site-header,
  .site-footer,
  .skip-link,
  .hero::before,
  .actions {
    display: none !important;
  }

  .hero h1 {
    background: none;
    color: #000;
    filter: none;
  }

  a[target="_blank"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
  }

  .panel,
  .code,
  .callout,
  table,
  figure {
    break-inside: avoid;
  }
}
