/* Design system for the portal. Plain CSS, no build step, no remote assets.
   Page-specific composition lives in portal.css; everything reusable is here.

   Direction: "lobby directory". Warm paper neutrals, an ink inverse, one
   vermilion accent for action and focus, semantic colours only for status.
   Typography pairs a system serif for display with the system sans for
   reading and system mono for codes, counts and labels.

   Breakpoints (media queries cannot read custom properties):
     600px   two-column to three-column tiles
     769px   navigation expands, rows go horizontal (<= 768 is the mobile menu)
     1024px  side-by-side section heads, hero gets its board column        */

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

:root {
  color-scheme: light;

  /* Surfaces: never pure white or pure black. */
  --bg: #f5f2ec;
  --surface: #ece7de;          /* sunken bands: footer */
  --surface-2: #e4ded3;        /* chips and code; not for control edges */
  --surface-raised: #fbf9f5;   /* lifted rows and tiles */
  --border: #d8d1c4;           /* decorative hairlines */
  --border-strong: #8a8376;    /* control edges: >= 3:1 on bg and raised */
  --rule: #1c1b19;             /* editorial top rules */

  --text: #1c1b19;
  --text-muted: #5a554c;

  /* One accent family. --primary keeps its old name for shared components. */
  --primary: #b03a10;
  --primary-hover: #8f2d0a;
  --primary-soft: #f3e2d7;
  --on-primary: #fbf9f5;
  --focus: #b03a10;

  /* Status: colour plus shape, never colour alone. */
  --success: #1e7338;
  --warning: #9a5b00;
  --danger: #b42318;

  /* Inverse panel (live tile, closing band). */
  --inverse-bg: #1f1d1a;
  --inverse-text: #efe9df;
  --inverse-muted: #b9b1a4;
  --inverse-accent: #ff8f63;
  --inverse-accent-hover: #ffab88;
  --inverse-on-accent: #1f0e05;
  --inverse-success: #7fdc9c;

  --shadow-rgb: 40 30 18;
  --shadow-1: 0 1px 1px rgb(var(--shadow-rgb) / 0.05), 0 1px 3px rgb(var(--shadow-rgb) / 0.06);
  --shadow-2: 0 1px 2px rgb(var(--shadow-rgb) / 0.06), 0 8px 20px -6px rgb(var(--shadow-rgb) / 0.14);
  --shadow-3: 0 2px 4px rgb(var(--shadow-rgb) / 0.06), 0 18px 40px -10px rgb(var(--shadow-rgb) / 0.22);

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    "Noto Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Iowan Old Style", Charter, "Bitstream Charter", "Sitka Text",
    Cambria, "Noto Serif", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC",
    Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* Type scale: fixed for reading sizes, fluid only for display sizes. */
  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.3125rem;
  --text-xl: clamp(1.75rem, 1.35rem + 1.3vw, 2.5rem);
  --text-2xl: clamp(2.5rem, 1.5rem + 4.2vw, 5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --section-pad: clamp(3.5rem, 2.5rem + 4vw, 6.5rem);

  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 10px;
  --radius-pill: 999px;

  --max-width: 1200px;
  --gutter: clamp(1.25rem, 0.75rem + 2.5vw, 2.5rem);
  --header-height: 4rem;
  --target: 2.75rem; /* 44px minimum hit area */

  /* Motion: brief, decelerating, transform/opacity first. */
  --dur-fast: 120ms;
  --dur: 200ms;
  --dur-slow: 320ms;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;

  --bg: #151412;
  --surface: #100f0d;
  --surface-2: #2a2723;
  --surface-raised: #1f1d1a;
  --border: #34302b;
  --border-strong: #746d62;
  --rule: #ece7de;
  --text: #ece7de;
  --text-muted: #a9a296;
  --primary: #ff8f63;
  --primary-hover: #ffab88;
  --primary-soft: #3b2219;
  --on-primary: #1f0e05;
  --focus: #ff8f63;
  --success: #62cf88;
  --warning: #f0b44c;
  --danger: #ff8a80;
  --inverse-bg: #26231f;
  --shadow-rgb: 0 0 0;
}

/* Follow the OS when the visitor has not chosen a theme explicitly. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --bg: #151412;
    --surface: #100f0d;
    --surface-2: #2a2723;
    --surface-raised: #1f1d1a;
    --border: #34302b;
    --border-strong: #746d62;
    --rule: #ece7de;
    --text: #ece7de;
    --text-muted: #a9a296;
    --primary: #ff8f63;
    --primary-hover: #ffab88;
    --primary-soft: #3b2219;
    --on-primary: #1f0e05;
    --focus: #ff8f63;
    --success: #62cf88;
    --warning: #f0b44c;
    --danger: #ff8a80;
    --inverse-bg: #26231f;
    --shadow-rgb: 0 0 0;
  }
}

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

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--primary-soft);
  color: var(--text);
}

h1,
h2,
h3,
h4 {
  margin: 0 0 var(--space-4);
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-2xl);
}

h2 {
  font-size: var(--text-xl);
}

h3 {
  font-size: var(--text-md);
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-4);
}

ul,
ol {
  padding-left: var(--space-5);
}

li + li {
  margin-top: var(--space-2);
}

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

a:hover {
  color: var(--primary-hover);
  text-decoration-thickness: 2px;
}

/* One focus treatment everywhere: a thick accent ring with a gap. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

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

.icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
}

code,
pre,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

:not(pre) > code {
  padding: 0.1em 0.35em;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: var(--space-7) 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-2);
  z-index: 100;
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-4);
  background: var(--inverse-bg);
  color: var(--inverse-text);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
  color: var(--inverse-text);
}

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

.prose {
  max-width: 68ch;
}

.muted {
  color: var(--text-muted);
}

/* ---- Header and navigation -------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--dur) var(--ease-out);
}

.site-header.is-scrolled {
  box-shadow: var(--shadow-2);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--target);
  color: var(--text);
  font-weight: 650;
  font-size: var(--text-md);
  letter-spacing: -0.01em;
  text-decoration: none;
}

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

.brand img {
  width: 2rem;
  height: 2rem;
}

.nav-toggle {
  display: none;
}

.site-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.nav-links a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--dur-fast) ease;
}

/* Underline indicator grows from the left on hover; fixed for the page. */
.nav-links a::after {
  content: "";
  position: absolute;
  left: var(--space-3);
  right: var(--space-3);
  bottom: 0.55rem;
  height: 2px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease-out);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--text);
}

.nav-links a:hover::after {
  transform: scaleX(1);
}

.nav-links a[aria-current="page"] {
  font-weight: 600;
}

.nav-links a[aria-current="page"]::after {
  background: var(--primary);
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
}

.theme-toggle,
.js-only {
  display: none;
}

/* Controls that only work with JavaScript, which adds the .js class. */
.js .theme-toggle,
.js .js-only {
  display: inline-flex;
}

/* Hollow moon for light, filled once dark is on. */
.theme-toggle[aria-pressed="true"] .icon-theme {
  fill: currentColor;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--target);
  min-width: var(--target);
  padding: var(--space-2) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--dur-fast) ease, border-color var(--dur-fast) ease,
    color var(--dur-fast) ease, transform var(--dur-fast) ease;
}

.btn:hover {
  text-decoration: none;
}

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

.btn .icon-out {
  transition: transform var(--dur) var(--ease-out);
}

.btn:hover .icon-out {
  transform: translate(2px, -2px);
}

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

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--on-primary);
}

.btn-secondary {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-raised);
  border-color: var(--text);
  color: var(--text);
}

.btn-ghost {
  padding: 0 var(--space-3);
  background: transparent;
  color: var(--text-muted);
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Unavailable controls: no pointer, no hover, dashed edge, still legible. */
.btn[disabled],
.btn[aria-disabled="true"] {
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* ---- Sections ---------------------------------------------------------- */

.section {
  padding: var(--section-pad) 0;
}

.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-6);
}

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

/* Section head beside its content on wide screens; the head stays in view. */
.split {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 1024px) {
  .split {
    grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
    gap: var(--space-8);
  }

  .split-head {
    position: sticky;
    top: calc(var(--header-height) + var(--space-6));
    align-self: start;
    margin-bottom: 0;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
}

.lead {
  color: var(--text-muted);
  font-size: var(--text-md);
  max-width: 60ch;
}

.hero {
  padding: var(--section-pad) 0;
}

.hero-grid {
  display: grid;
  gap: var(--space-7);
}

.hero .lead {
  margin-bottom: var(--space-6);
}

.page-head {
  padding: var(--space-8) 0 var(--space-6);
  border-bottom: 1px solid var(--border);
}

.page-head .lead {
  margin-bottom: 0;
}

/* ---- Cards and grids (shared; the portal home uses rows instead) ------- */

.grid {
  display: grid;
  gap: var(--space-5);
}

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

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

.card {
  padding: var(--space-5);
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.card h3 {
  margin-bottom: var(--space-2);
}

.card p:last-child,
.card ul:last-child {
  margin-bottom: 0;
}

.card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.25rem;
  padding: 0 var(--space-2);
  margin-bottom: var(--space-4);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
}

.feature-group {
  padding: var(--space-7) 0;
  border-bottom: 1px solid var(--border);
}

.feature-group:last-child {
  border-bottom: 0;
}

.feature-group-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: var(--space-6);
}

/* ---- Steps ------------------------------------------------------------- */

.steps {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps > li {
  position: relative;
  margin: 0;
  padding-left: 3.5rem;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
}

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

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

.code-block {
  margin: 0 0 var(--space-5);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.code-block figcaption {
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.code-block pre {
  margin: 0;
  padding: var(--space-4);
  overflow-x: auto;
  line-height: 1.55;
  tab-size: 2;
}

.code-block code {
  font-size: var(--text-sm);
  white-space: pre;
}

/* ---- Callouts, lists, FAQ --------------------------------------------- */

.callout {
  margin: 0 0 var(--space-5);
  padding: var(--space-4) var(--space-5);
  border-left: 3px solid var(--primary);
  background: var(--surface-raised);
}

.callout-warning {
  border-left-color: var(--warning);
}

.callout h3 {
  margin-bottom: var(--space-3);
}

.callout p:last-child,
.callout ul:last-child {
  margin-bottom: 0;
}

.terms {
  display: grid;
  grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
  gap: var(--space-3) var(--space-5);
}

.terms dt {
  font-weight: 600;
}

.terms dd {
  margin: 0;
  color: var(--text-muted);
}

.check-list {
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: var(--space-5);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.6em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--primary);
}

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

.faq details:first-child {
  border-top: 1px solid var(--border);
}

.faq summary {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding: var(--space-3) 0;
  font-weight: 600;
  cursor: pointer;
}

.faq details > div {
  padding-bottom: var(--space-4);
  color: var(--text-muted);
}

.faq details > div p:last-child {
  margin-bottom: 0;
}

table.codes {
  width: 100%;
  margin-bottom: var(--space-5);
  border-collapse: collapse;
  /* Equal-width digits so numbers line up down a column. */
  font-variant-numeric: tabular-nums;
}

table.codes th,
table.codes td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table.codes th {
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-weight: 600;
}

table.codes td:first-child {
  font-family: var(--font-mono);
  white-space: nowrap;
}

.table-wrap {
  overflow-x: auto;
}

/* ---- Status ------------------------------------------------------------ */

.status-panel {
  display: grid;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-raised);
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 1.75rem;
  padding: 0 var(--space-3);
  border: 1px solid currentColor;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  background: currentColor;
}

/* Shape differs per state so colour is never the only signal:
   live = filled dot, coming soon = hollow ring, unknown = diamond,
   down = square. */
.badge-ok {
  color: var(--success);
}

.badge-ok::before {
  border-radius: 50%;
}

.badge-soon {
  border-style: dashed;
  color: var(--text-muted);
}

.badge-soon::before {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: transparent;
}

.badge-unknown {
  color: var(--warning);
}

.badge-unknown::before {
  transform: rotate(45deg);
}

.badge-down {
  color: var(--danger);
}

.badge-down::before {
  border-radius: 1px;
}

.status-meta {
  margin: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
}

/* ---- CTA band and footer ---------------------------------------------- */

.cta-band {
  padding: var(--section-pad) 0;
}

.site-footer {
  padding: var(--space-8) 0 var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.footer-grid {
  display: grid;
  gap: var(--space-6);
}

.footer-about {
  max-width: 46ch;
}

.footer-about .brand {
  margin-bottom: var(--space-3);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-links li + li {
  margin-top: 0;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
  text-decoration: underline;
}

.site-footer p {
  margin: 0;
}

.footer-meta {
  margin-top: var(--space-6);
}

.footer-meta p {
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  overflow-wrap: anywhere;
}

/* The contact line wraps at narrow widths; padding keeps the link tall. */
.footer-meta a {
  display: inline-block;
  padding: var(--space-3) 0;
}

@media (min-width: 769px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .footer-links {
    flex-direction: column;
  }
}

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

@media (max-width: 768px) {
  .section {
    padding: var(--space-8) 0;
  }

  .grid-2,
  .grid-3,
  .steps-inline,
  .feature-group-grid,
  .terms {
    grid-template-columns: minmax(0, 1fr);
  }

  .terms dd {
    margin-bottom: var(--space-3);
  }

  /* Without JavaScript the nav simply wraps below the brand. With it, the
     nav becomes a panel that drops from the header behind the menu button.
     visibility keeps closed links out of the tab order. */
  .js .nav-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .js .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-4);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: var(--space-3) var(--gutter) var(--space-5);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-3);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem);
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out),
      visibility 0s linear var(--dur);
  }

  .js .site-nav.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    transition: opacity var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
  }

  .js .nav-links {
    flex-direction: column;
  }

  .js .nav-links a {
    display: flex;
    padding: 0 var(--space-2);
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    font-size: var(--text-md);
  }

  .js .nav-links a::after {
    display: none;
  }

  .js .nav-links a[aria-current="page"] {
    box-shadow: inset 3px 0 0 var(--primary);
    padding-left: var(--space-4);
  }

  .nav-actions {
    margin-left: 0;
  }
}

/* Menu icon: three bars that fold into a cross while the menu is open. */
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.125rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  transition: transform var(--dur) var(--ease-out), opacity var(--dur-fast) ease;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  transform: translateY(-6px);
}

.nav-toggle-bars::after {
  transform: translateY(6px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after {
  transform: rotate(-45deg);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

/* Windows High Contrast and similar: keep shapes and edges visible. */
@media (forced-colors: active) {
  .badge::before,
  .nav-toggle-bars,
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .badge-soon::before {
    background: Canvas;
    border-color: CanvasText;
  }

  .nav-toggle[aria-expanded="true"] .nav-toggle-bars {
    background: transparent;
  }

  /* Portal board tiles rely on 1px gaps and the row action on a fill;
     both vanish when colours are forced, so draw real edges. */
  .board-item,
  .entry-action {
    border: 1px solid CanvasText;
  }
}

@media print {
  .site-header,
  .site-footer,
  .cta-band,
  .theme-toggle,
  .nav-toggle {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }
}
