/* PisoWiFiHub — main stylesheet
   Order: tokens → dark mode → reset → base → layout → utilities → reduced motion
   Tokens from Design System Section 15 — do not substitute values. */

/* ═══════════════════════════════════════════════════════════
   1. CUSTOM PROPERTIES — light (Design System §15)
   ═══════════════════════════════════════════════════════════ */

:root {
  color-scheme: light dark;

  /* ── TEXT ─────────────────────────────────────────── */
  --c-text:          #132B38;  /* 14.68 on white, AAA     */
  --c-text-2:        #4A6270;  /*  6.42 on white, AA      */
  --c-text-3:        #6E8793;  /*  3.78 — 18px+ only      */
  --c-ink:           #0F2430;  /* 15.97 on white, AAA     */

  /* ── PRIMARY | held, safe, informational ──────────── */
  --c-primary:       #0A5A75;  /*  7.69 on white, AAA     */
  --c-primary-hover: #084A61;  /*  9.71 on white          */
  --c-primary-tint:  #E6F1F5;  /* primary on it: 6.69     */

  /* ── ACCENT | running, live, counting ─────────────── */
  --c-accent:        #E8820C;  /* ink on it: 5.80, AA     */
  --c-accent-deep:   #B8650A;  /*  4.28 — 18px+ only      */
  --c-accent-text:   #8F4E08;  /*  5.81 on accent-tint    */
  --c-accent-tint:   #FDF2E0;

  /* ── SURFACES ─────────────────────────────────────── */
  --c-surface:       #FFFFFF;
  --c-surface-2:     #F4F7F8;
  --c-surface-3:     #E9EFF1;

  /* ── BORDERS ──────────────────────────────────────── */
  --c-border:        #DCE4E7;  /* decorative only         */
  --c-border-2:      #C3D0D5;  /* decorative only         */
  --c-border-input:  #7C939C;  /*  3.23 — meets UI min    */

  /* ── TYPE ─────────────────────────────────────────── */
  /* Instrument Sans Fallback inserted for metric-matched swap (Dev Prompt 7.3) */
  --font-sans: "Instrument Sans", "Instrument Sans Fallback", system-ui, -apple-system,
               "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono",
               "Roboto Mono", Menlo, Consolas, monospace;

  --t-h1:      clamp(30px, 5vw, 44px);
  --t-h2:      clamp(23px, 3.2vw, 30px);
  --t-h3:      clamp(18px, 2.2vw, 21px);
  --t-h4:      17px;
  --t-lead:    clamp(17px, 2vw, 19px);
  --t-body-lg: var(--t-lead); /* Content Component Kit §5 — alias of --t-lead */
  --t-body:    18px;
  --t-body-sm: 15px;
  --t-meta:    14px;
  --t-caption: 13px;
  --t-mono:    15px;

  /* ── SPACING ──────────────────────────────────────── */
  --s-1:  4px;   --s-2:  8px;   --s-3: 12px;  --s-4: 16px;
  --s-5: 20px;   --s-6: 24px;   --s-8: 32px;  --s-10: 40px;
  --s-12: 48px;  --s-16: 64px;  --s-20: 80px; --s-24: 96px;

  /* ── CONTAINERS ───────────────────────────────────── */
  /* One section width site-wide (Design Fixes v2 §1 / §1c). */
  --w-container: 1024px;
  --w-prose:     72ch;   /* .measure only — rare deliberately narrow block */
  /* Aliases — same value as --w-container so leftover refs cannot diverge */
  --w-content:   var(--w-container);
  --w-wide:      var(--w-container);

  /* Vertical rhythm (Design Fixes v2 §1b) */
  --section-y: 48px; /* to 639px */

  /* ── RADIUS ───────────────────────────────────────── */
  --r-sm: 6px;  --r-md: 10px;  --r-lg: 14px;  --r-pill: 999px;

  /* ── ELEVATION ────────────────────────────────────── */
  --e-0: none;
  --e-1: 0 1px 2px rgba(15,36,48,.06), 0 2px 8px rgba(15,36,48,.04);
  --e-2: 0 4px 16px rgba(15,36,48,.10);

  /* Hover raised surface — light: no-op; dark overrides below */
  --c-surface-raised: var(--c-surface);
  --c-border-hover:   var(--c-border-2);
}

/* ═══════════════════════════════════════════════════════════
   2. DARK MODE — prefers-color-scheme + [data-theme]
   ═══════════════════════════════════════════════════════════ */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-text:          #E6EEF1;  /* 15.07 on bg, AA  */
    --c-text-2:        #A3B8C1;  /*  8.59 on bg, AA  */
    --c-text-3:        #7E97A1;
    --c-ink:           #E6EEF1;
    --c-primary:       #4FB3D1;  /*  7.34 on bg, AA  */
    --c-primary-hover: #6AC4DE;
    --c-primary-tint:  #16303C;
    --c-accent:        #F5A742;  /*  8.85 on bg, AA  */
    --c-accent-deep:   #F5A742;
    --c-accent-text:   #F0B468;
    --c-accent-tint:   #2A1F10;
    --c-surface:       #0B1A22;
    --c-surface-2:     #132B36;
    --c-surface-3:     #1A3744;
    --c-border:        #24404D;  /* decorative only  */
    --c-border-2:      #2F5260;
    --c-border-input:  #5A7F8E;  /*  3.1 — meets min */
    /* Dark elevation — near-black rgba shadows are invisible on #0B1A22 */
    --e-1: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.4);
    --c-surface-raised: #152B37;
    --c-border-hover:   #3E6474;
  }
}

:root[data-theme="dark"] {
  --c-text:          #E6EEF1;  /* 15.07 on bg, AA  */
  --c-text-2:        #A3B8C1;  /*  8.59 on bg, AA  */
  --c-text-3:        #7E97A1;
  --c-ink:           #E6EEF1;
  --c-primary:       #4FB3D1;  /*  7.34 on bg, AA  */
  --c-primary-hover: #6AC4DE;
  --c-primary-tint:  #16303C;
  --c-accent:        #F5A742;  /*  8.85 on bg, AA  */
  --c-accent-deep:   #F5A742;
  --c-accent-text:   #F0B468;
  --c-accent-tint:   #2A1F10;
  --c-surface:       #0B1A22;
  --c-surface-2:     #132B36;
  --c-surface-3:     #1A3744;
  --c-border:        #24404D;  /* decorative only  */
  --c-border-2:      #2F5260;
  --c-border-input:  #5A7F8E;  /*  3.1 — meets min */
  --e-1: 0 1px 2px rgba(0,0,0,.5), 0 6px 18px rgba(0,0,0,.4);
  --c-surface-raised: #152B37;
  --c-border-hover:   #3E6474;
}

/* ═══════════════════════════════════════════════════════════
   2b. FONT FACE
   ═══════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Instrument Sans";
  src: url("/assets/fonts/instrument-sans-var.woff2") format("woff2-variations");
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC,
                 U+2000-206F, U+2070-209F, U+20A0-20BF;
}

@font-face {
  font-family: "Instrument Sans Fallback";
  src: local("Roboto"), local("Segoe UI"), local("system-ui");
  size-adjust: 100%;
  ascent-override: 90%;
  descent-override: 22%;
}

/* ═══════════════════════════════════════════════════════════
   3. RESET
   ═══════════════════════════════════════════════════════════ */

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  min-height: 100%;
  line-height: 1.65;
  overflow-x: clip;
}

img,
picture,
svg,
video,
canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ═══════════════════════════════════════════════════════════
   4. BASE ELEMENTS
   ═══════════════════════════════════════════════════════════ */

body {
  background: var(--c-surface);
  color: var(--c-text);
  font: 400 var(--t-body) / 1.65 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  color: var(--c-text);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  color: var(--c-ink);
  font-size: var(--t-h1);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h2 {
  font-size: var(--t-h2);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-block-start: var(--s-8); /* ≤32px between blocks */
  margin-block-end: var(--s-6);   /* 24px to first thing under it */
}

h3 {
  font-size: var(--t-h3);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin-block-start: var(--s-8);
  margin-block-end: var(--s-2); /* 8px to its paragraph */
}

h4 {
  font-size: var(--t-h4);
  line-height: 1.4;
  letter-spacing: 0;
}

.hd-sep {
  opacity: 0.45;
  padding-inline: 0.25em;
  font-weight: 400;
}

p {
  font-size: var(--t-body);
  line-height: 1.65;
  margin-block-end: var(--s-4); /* 16px paragraph to paragraph */
  max-width: none; /* container enforces measure (§1c) */
  hyphens: none;
  text-align: left;
}

p:last-child {
  margin-block-end: 0;
}

.lead {
  font-size: var(--t-lead);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-text);
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

ul, ol {
  padding-inline-start: var(--s-6);
  margin-block-end: var(--s-4);
  max-width: none;
}

li {
  margin-block-end: var(--s-2);
}

li:last-child {
  margin-block-end: 0;
}

code {
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

/* Tables — tabular figures; wrap in .table-scroll for overflow */
table {
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: var(--t-body-sm);
  line-height: 1.5;
}

th, td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  border-bottom: 1px solid var(--c-border-2);
  vertical-align: top;
}

th {
  background: var(--c-surface-3);
  color: var(--c-text);
  font-weight: 600;
  font-size: var(--t-meta);
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-block-end: var(--s-4);
  max-width: 100%;
}

.table-scroll:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* Direct answer block — Design System §4.4 */
.answer-block {
  font-size: var(--t-lead);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-text);
  border-inline-start: 3px solid var(--c-primary);
  padding-block: var(--s-2);
  padding-inline-start: var(--s-5);
  margin-block: var(--s-8) 0;
  max-width: none;
  background: none;
}

/* Meta / secondary text — 14px, so --c-text-2 (text-3 is 18px+ only) */
.meta {
  font-size: var(--t-meta);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.005em;
  color: var(--c-text-2);
}

.text-2 {
  color: var(--c-text-2);
}

/* ═══════════════════════════════════════════════════════════
   5. LAYOUT — containers and sections
   ═══════════════════════════════════════════════════════════ */

/* One container, one gutter. Every section. No exceptions. */
.container {
  width: 100%;
  max-width: var(--w-container);
  margin-inline: auto;
  padding-inline: var(--s-4); /* 16px — to 639px */
}

@media (min-width: 640px) {
  :root {
    --section-y: 64px;
  }

  .container {
    padding-inline: var(--s-6); /* 24px — 640 to 1023px */
  }
}

@media (min-width: 1024px) {
  :root {
    --section-y: 80px;
  }

  .container {
    padding-inline: var(--s-8); /* 32px — 1024px and up */
  }
}

/* Narrower prose inside a section. Left-aligned — never centres itself. */
.measure {
  max-width: var(--w-prose);
}

/* Vertical space owned by the section (§1b). One value every page. */
.section {
  padding-block: var(--section-y);
}

.section > :first-child,
.section > .container > :first-child {
  margin-block-start: 0;
}

.section > :last-child,
.section > .container > :last-child {
  margin-block-end: 0;
}

/* Alternating surfaces — rhythm, not stripes */
main > .section:nth-of-type(odd) {
  background: var(--c-surface);
}

main > .section:nth-of-type(even) {
  background: var(--c-surface-2);
}

/* Section intro → next block: 24px (h2 margin-end already --s-6) */
.section > .container > h2 + p {
  margin-block-end: var(--s-8); /* 32px to card grid / next block */
}

/* Single-line closing note — only when all four §1 conditions hold */
.section-note {
  text-align: center;
  margin-block-start: var(--s-8);
  margin-block-end: 0;
  max-width: none;
}

/* ═══════════════════════════════════════════════════════════
   5b. CHROME — skip link, header, breadcrumb, footer
   ═══════════════════════════════════════════════════════════ */

.skip-link {
  position: absolute;
  inset-inline-start: var(--s-4);
  inset-block-start: var(--s-4);
  z-index: 100;
  padding: var(--s-2) var(--s-4);
  background: var(--c-primary);
  /* --c-surface is white in light, ink in dark — white-on-cyan fails dark AA */
  color: var(--c-surface);
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 56px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  /* Shadow only — never animate background across a theme swap (§6). */
  transition: box-shadow 180ms ease;
}

.site-header.is-scrolled {
  box-shadow: var(--e-2);
  background: color-mix(in srgb, var(--c-surface) 92%, transparent);
  backdrop-filter: blur(10px);
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: var(--s-4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  flex-shrink: 0;
}

/* Design Fixes v2 §6 — theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--c-text-2);
  cursor: pointer;
  transition: color 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--c-primary);
  background: var(--c-primary-tint);
  border-color: var(--c-border);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.theme-toggle-icons {
  display: grid;
  place-items: center;
}

.theme-toggle-icons .theme-icon {
  grid-area: 1 / 1;
  width: 20px;
  height: 20px;
}

/* Light UI → show moon (action: switch to dark). Dark UI → show sun. */
.theme-toggle .theme-icon--sun { display: none; }
.theme-toggle .theme-icon--moon { display: block; }
.theme-toggle--dark .theme-icon--sun { display: block; }
.theme-toggle--dark .theme-icon--moon { display: none; }

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  color: var(--c-text);
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo:hover {
  color: var(--c-text);
  text-decoration: none;
}

.logo-mark {
  color: var(--c-primary);
  flex-shrink: 0;
}

.site-logo-wordmark {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--c-text);
}

.nav-desktop {
  display: none;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.nav-item {
  position: relative;
  margin: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  min-height: 44px;
  padding-inline: var(--s-3);
  color: var(--c-text);
  font-weight: 500;
  font-size: var(--t-body);
  text-decoration: none;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
}

.nav-link:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.nav-chevron {
  transition: transform 160ms ease;
}

.nav-dropdown-trigger[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  inset-block-start: 100%;
  inset-inline-start: 0;
  min-width: 220px;
  margin: 0;
  padding: var(--s-2);
  list-style: none;
  background: var(--c-surface);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-md);
  box-shadow: var(--e-2);
  max-width: none;
}

.nav-dropdown-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--s-3);
  color: var(--c-text);
  text-decoration: none;
  border-radius: var(--r-sm);
  font-weight: 500;
}

.nav-dropdown-link:hover {
  background: var(--c-primary-tint);
  color: var(--c-primary);
  text-decoration: none;
}

.nav-mobile-trigger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: var(--s-2);
  width: 44px;
  height: 44px;
  padding: var(--s-3);
  color: var(--c-text);
}

.nav-mobile-trigger-bar {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}

.nav-mobile {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--c-surface);
  padding: var(--s-4);
  overflow-y: auto;
}

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-block-end: var(--s-4);
}

.nav-mobile-title {
  font-size: var(--t-h3);
  font-weight: 600;
}

.nav-mobile-close {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text);
}

.nav-mobile-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.nav-mobile-item {
  margin: 0;
  border-bottom: 1px solid var(--c-border);
}

.nav-mobile-link {
  display: flex;
  align-items: center;
  min-height: 56px;
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
}

.nav-mobile-link:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.nav-mobile-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--s-3) var(--s-4);
  max-width: none;
}

.nav-mobile-sublink {
  display: flex;
  align-items: center;
  min-height: 48px;
  color: var(--c-text-2);
  text-decoration: none;
  font-weight: 500;
}

.nav-mobile-sublink:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.breadcrumb {
  margin-block: 0 var(--s-8);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
  font-size: var(--t-meta);
  font-weight: 500;
  color: var(--c-text-2);
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  margin: 0;
}

.breadcrumb-item:not(:last-child)::after {
  content: "›";
  color: var(--c-text-3);
  speak: never;
}

.breadcrumb-item a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumb-item[aria-current="page"] span {
  color: var(--c-text);
}

.page-main {
  padding-block: var(--section-y);
}

/* Homepage: sections own the vertical rhythm — do not stack page padding on them */
.page-main:has(> .section) {
  padding-block: 0;
}

.page-main > .container > :first-child {
  margin-block-start: 0;
}

.page-main > .container > :last-child {
  margin-block-end: 0;
}

/* Blueprint 14.5 — author byline + last-verified under H1 */
.page-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--s-2);
  margin-block: var(--s-2) var(--s-6);
  max-width: none;
  font-size: var(--t-meta);
  font-weight: 500;
  line-height: 1.4;
  color: var(--c-text-2);
}

.page-byline a {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.page-byline-sep {
  color: var(--c-text-2);
}

/* Footer is always a dark band. --c-ink / --c-surface-2 flip in dark theme
   and would make the footer pale with unreadable white headings — lock the
   surface to light-theme ink and use light muted text that does not flip. */
.site-footer {
  /* Always-dark band: lock ink + primary so theme flip cannot pale the footer
     or leave --c-primary (light-theme teal) unreadable on #0F2430. */
  --footer-bg: #0F2430;
  --footer-muted: #C5D4DA;
  --c-primary: #4FB3D1;
  --c-primary-hover: #6AC4DE;
  background: var(--footer-bg);
  color: var(--footer-muted);
  color-scheme: dark;
  padding-block: var(--s-12) var(--s-6);
}

.site-footer-inner {
  display: grid;
  gap: var(--s-8);
}

.site-logo--footer .site-logo-wordmark {
  color: #fff;
}

.site-logo--footer .logo-mark {
  color: var(--c-primary);
}

.footer-desc,
.footer-independence {
  font-size: var(--t-body-sm);
  line-height: 1.6;
  color: var(--footer-muted);
  max-width: 36ch;
  margin-block-end: var(--s-3);
}

/* §7c — column heading is a label, not a link */
.footer-heading {
  font-size: var(--t-body-sm);
  font-weight: 600;
  line-height: 1.5;
  color: var(--c-primary);
  margin: 0 0 var(--s-4);
  letter-spacing: 0;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.footer-list li {
  margin: 0;
}

.footer-link {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--footer-muted);
  font-size: var(--t-body-sm);
  text-decoration: none;
}

.footer-link:hover,
.footer-link:focus-visible {
  color: var(--c-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* §7h — social row between columns and copyright */
.footer-social {
  margin-block-start: var(--s-8);
}

.footer-social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-2);
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--footer-muted); /* --c-text-2 equivalent on always-dark band */
  border-radius: var(--r-md);
  text-decoration: none;
  transition: color 150ms ease;
}

.footer-social-link .icon {
  width: 20px;
  height: 20px;
}

.footer-social-link:hover,
.footer-social-link:focus-visible {
  color: var(--c-primary);
  text-decoration: none;
}

.footer-bar {
  margin-block-start: var(--s-8);
  padding-block-start: var(--s-4);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-copy {
  font-size: var(--t-meta);
  color: var(--footer-muted);
  margin: 0;
  max-width: none;
  text-align: center;
}

@media (min-width: 640px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1024px) {
  .site-header {
    height: 64px;
  }

  .nav-desktop {
    display: block;
  }

  .nav-mobile-trigger {
    display: none;
  }

  .site-footer-inner {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

/* ═══════════════════════════════════════════════════════════
   5c. COMPONENTS — address chip, buttons, cards, trust, tools, FAQ
   ═══════════════════════════════════════════════════════════ */

/* Address chip — Design System §8 */
.addr {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  max-width: 100%;
  padding: var(--s-1) var(--s-3);
  background: var(--c-primary-tint);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-sm);
  vertical-align: baseline;
}

.addr code {
  color: var(--c-primary);
  font-family: var(--font-mono);
  font-size: var(--t-mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.5;
}

.addr--lg code {
  font-size: var(--t-h3);
  font-weight: 600;
}

.addr--inline {
  padding: var(--s-1) var(--s-2);
}

/* Address chips inside headings inherit heading weight/size */
h1 .addr--inline code,
h2 .addr--inline code,
h3 .addr--inline code {
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
}

.addr--inline .addr-copy {
  display: none;
}

/* Inline chip inside a text link — keep chip chrome, no nested button */
a .addr--inline {
  text-decoration: none;
  vertical-align: baseline;
}

a .addr--inline code {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.addr-copy {
  margin: 0;
  margin-inline-start: var(--s-1);
  padding: var(--s-1) var(--s-2);
  min-height: 36px;
  border: none;
  border-inline-start: 1px solid var(--c-border-input);
  border-radius: 0;
  background: transparent;
  color: var(--c-primary);
  font-size: var(--t-meta);
  font-weight: 500;
  cursor: pointer;
  line-height: 1.2;
}

.addr-copy:hover {
  color: var(--c-primary-hover);
}

.no-js .addr-copy {
  display: none;
}

/* Buttons — Design System §6 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  border: none;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

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

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

.btn--lg {
  min-height: 52px;
  padding-inline: var(--s-6);
  font-size: var(--t-body);
  font-weight: 600;
}

.btn--md {
  min-height: 44px;
  padding-inline: var(--s-5);
  font-size: var(--t-body);
  font-weight: 500;
}

.btn--sm {
  min-height: 36px;
  padding-inline: var(--s-4);
  font-size: var(--t-meta);
  font-weight: 500;
}

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

.btn--primary:hover {
  background: var(--c-primary-hover);
  color: var(--c-surface);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--c-primary) 28%, transparent);
  transform: translateY(-1px);
}

.btn--secondary {
  background: transparent;
  color: var(--c-primary);
  border: 1.5px solid var(--c-primary);
}

.btn--secondary:hover {
  background: var(--c-primary-tint);
  color: var(--c-primary);
  transform: translateY(-1px);
}

/* Accent: ink text on amber — never white (2.75 fail) */
.btn--accent {
  background: var(--c-accent);
  color: var(--c-ink);
}

.btn--accent:hover {
  background: var(--c-accent-deep);
  color: var(--c-ink);
}

.btn--quiet {
  background: transparent;
  color: var(--c-primary);
  padding-inline: var(--s-2);
}

.btn--quiet:hover {
  color: var(--c-primary-hover);
}

.btn-arrow {
  transition: transform 160ms ease-out;
}

.btn:hover .btn-arrow {
  transform: translateX(3px);
}

.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Trust strip — Design Fixes v2 §5 / §7j: boxed, lighter than content cards */
.trust-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: none;
}

.trust-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--s-1);
  margin: 0;
  padding: var(--s-5);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-md);
  background: transparent;
}

.trust-icon {
  display: flex;
  color: var(--c-primary);
  margin-block-end: var(--s-1);
}

.trust-icon .icon {
  width: 20px;
  height: 20px;
}

.trust-label {
  font-size: var(--t-body-sm);
  font-weight: 600;
  line-height: 1.4;
  color: var(--c-ink);
}

.trust-sub {
  font-size: var(--t-caption);
  line-height: 1.4;
  color: var(--c-text-2);
}

@media (min-width: 640px) {
  .trust-strip {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-6) var(--s-8);
  }
}

@media (min-width: 1024px) {
  .trust-strip {
    grid-template-columns: repeat(4, 1fr);
  }
}

.section--trust-band .trust-strip {
  padding-block-start: 0;
  border-top: none;
}

/* Cards — Design Fixes v2 §7 / §7b */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  text-align: left;
  background: var(--c-surface);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  box-shadow: var(--e-0);
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: var(--c-primary-tint);
  border-radius: var(--r-md);
  color: var(--c-primary);
}

.card-icon .icon {
  width: 20px;
  height: 20px;
}

.card-title {
  margin: var(--s-4) 0 0;
  font-size: var(--t-h3);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--c-ink);
}

.card-icon + .card-title {
  margin-block-start: var(--s-4);
}

.card:not(:has(.card-icon)) > .card-title {
  margin-block-start: 0;
}

.card-title a {
  color: var(--c-primary);
  text-decoration: none;
}

.card-title a:hover {
  color: var(--c-primary-hover);
  text-decoration: none;
}

/* Full-card tap target — anchor stays on the title only */
.card--interactive .card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card-body {
  flex: 1 1 auto;
  margin: var(--s-2) 0 0;
  font-size: var(--t-body);
  line-height: 1.6;
  color: var(--c-text-2);
  max-width: none;
}

.card-body--prose {
  flex: 0 0 auto;
}

.card-body--prose p {
  margin: 0 0 var(--s-3);
  max-width: none;
}

.card-body--prose p:last-child {
  margin-block-end: 0;
}

.card-body--ellipsis {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.card-date {
  display: block;
  margin-block-start: auto;
  padding-block-start: var(--s-3);
}

/* §3 — published: primary title; unpublished: ink title + Coming soon */
.card--soon {
  cursor: default;
}

.card--soon .card-title {
  color: var(--c-ink);
}

.card-soon {
  position: absolute;
  inset-block-start: var(--s-4);
  inset-inline-end: var(--s-4);
  z-index: 1;
  padding: 2px 8px;
  font-size: var(--t-body-sm);
  line-height: 1.4;
  color: var(--c-text-2);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-pill);
  pointer-events: none;
}

.card--interactive:focus-within {
  background: var(--c-surface-raised);
  box-shadow: var(--e-1);
  border-color: color-mix(in srgb, var(--c-primary) 35%, var(--c-border));
}

/* §7b — multi-paragraph: height from content, not stretched */
.card--prose {
  height: auto;
}

.card--prose .card-body {
  flex: 0 0 auto;
}

/* Card grids */
.card-grid {
  display: grid;
  align-items: stretch;
  gap: var(--s-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-grid > * {
  min-width: 0;
  align-self: stretch;
}

.card-grid--prose {
  align-items: start;
}

.card-grid--prose > * {
  align-self: start;
}

.card-grid + p,
.card-grid + .section-note {
  margin-block-start: var(--s-8);
}

@media (min-width: 640px) {
  .card-grid {
    gap: var(--s-5);
  }

  /* Four guide cards: 2 across — never 3+1 orphan (§7b) */
  .card-grid--guides {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .card-grid--problems {
    grid-template-columns: 1fr;
  }

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

@media (min-width: 1024px) {
  .card-grid {
    gap: var(--s-6);
  }

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

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

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

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

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

/* Tool well — Design System §9.1
   Top margin only: section padding owns the space below (rule 21). */
.tool-well {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-lg);
  padding: var(--s-5);
  margin-block: var(--s-8) 0; /* 32px from intro — section owns outer space */
  box-shadow: var(--e-1);
  transition: box-shadow 180ms ease-out;
}

@media (min-width: 1024px) {
  .tool-well {
    padding: var(--s-8);
  }
}

/* FAQ panel — Design Fixes v2 §7g */
.faq {
  max-width: none;
  text-align: left;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-lg);
  padding: var(--s-8);
}

.faq > h2 {
  margin-block-start: 0;
  margin-block-end: var(--s-4);
}

.faq > h2 + p,
.faq-intro {
  margin-block: 0 var(--s-6);
  max-width: none;
}

.faq-item {
  border-bottom: 1px solid var(--c-border);
  border-top: none;
  margin: 0;
  /* No background-color transition — theme flips must not leave open rows
     stuck on the previous theme's --c-surface (white-on-dark fail). */
}

.faq-item:first-of-type {
  border-top: none;
}

.faq-item:last-of-type {
  border-bottom: none;
}

.faq-item[open] {
  background-color: var(--c-surface);
  border-radius: var(--r-md);
}

.faq-item > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  width: 100%;
  min-height: 48px;
  padding-block: var(--s-4);
  padding-inline: var(--s-3);
  cursor: pointer;
  list-style: none;
  color: var(--c-text);
  transition: background-color 140ms ease;
}

.faq-item > summary::-webkit-details-marker {
  display: none;
}

.faq-item > summary::marker {
  content: "";
}

.faq-item > summary:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.faq-item > summary h3 {
  margin: 0;
  flex: 1;
  font-size: var(--t-h3);
  font-weight: 600;
  color: var(--c-text);
  max-width: none;
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--c-text-2);
  transition: transform 160ms ease;
}

.faq-item[open] > summary .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding-block: 0 var(--s-4);
  padding-inline: var(--s-3) var(--s-8);
}

.faq-answer p {
  margin: 0;
  font-size: var(--t-body-sm);
  color: var(--c-text);
  max-width: none;
}

/* Trust — same container as every section; no inner measure narrowing */
.trust-inner {
  max-width: none;
}

/* Icon base */
.icon {
  display: block;
}

/* Homepage hero — full-bleed atmosphere, two-column desktop.
   Symmetric padding via modifier (DS §5.1 hero step); not stacked on children. */
.section--hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* padding from .section / --section-y only */
  background:
    radial-gradient(1200px 480px at 12% -10%, color-mix(in srgb, var(--c-primary) 14%, transparent), transparent 60%),
    radial-gradient(900px 420px at 92% 8%, color-mix(in srgb, var(--c-accent) 12%, transparent), transparent 55%),
    linear-gradient(180deg, var(--c-surface-2) 0%, var(--c-surface) 72%);
}

.section--hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--c-border) 55%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--c-border) 55%, transparent) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.35), transparent 85%);
  pointer-events: none;
}

.hero {
  display: grid;
  gap: var(--s-8); /* ≤32px inside section */
  align-items: center;
}

@media (min-width: 900px) {
  /* §7d — 55 / 45 split (was equal halves → 464px left) */
  .hero {
    grid-template-columns: minmax(0, 55fr) minmax(0, 45fr);
    gap: var(--s-8);
  }
}

.hero-brand {
  display: block;
  margin: 0 0 var(--s-3);
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--c-primary);
  max-width: none;
}

/* §7d — H1 one step down so it sets in three lines */
.hero-copy h1 {
  font-size: var(--t-h2);
  margin-block-end: var(--s-4);
}

.hero-copy .lead {
  margin-block-end: var(--s-4);
  max-width: 42ch; /* kept — deliberate narrow lead */
  color: var(--c-text-2);
}

/* §7d — intro loses border/left bar; keeps every word as ordinary lead */
.hero-copy .hero-intro {
  margin: 0 0 var(--s-4);
  max-width: none;
  border: none;
  border-inline-start: none;
  padding: 0;
  background: none;
  font-size: var(--t-lead);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-text);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-block: var(--s-4) 0;
  max-width: none;
}

.hero-ctas .btn {
  text-decoration: none;
}

.hero-dgm {
  justify-self: center;
  width: 100%;
  max-width: 480px;
  color: var(--c-primary);
}

@media (min-width: 900px) {
  .hero-copy {
    grid-column: 1;
    grid-row: 1;
  }

  .hero-dgm {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    max-width: none;
  }
}

.dgm {
  width: 100%;
  height: auto;
  max-width: 100%;
  color: var(--c-primary);
  display: block;
}

.dgm--lifecycle-v {
  display: none;
}

@media (max-width: 639px) {
  .dgm--lifecycle-h {
    display: none;
  }

  .dgm--lifecycle-v {
    display: block;
    max-width: 300px;
    margin-inline: auto;
  }
}

.lifecycle {
  margin-block: var(--s-8);
  padding: var(--s-5);
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-lg);
  color: var(--c-primary);
}

.lifecycle-caption {
  margin: var(--s-4) 0 0;
  text-align: center;
  max-width: none;
}

.owner-redirect {
  margin-block-start: var(--s-8);
  max-width: none;
}

.section--closing p {
  max-width: none;
  font-size: var(--t-lead);
  line-height: 1.65;
}

.verified {
  margin-block-start: var(--s-8);
}

/* Tool forms */
.tool-form {
  display: grid;
  gap: var(--s-4);
  margin-block-end: var(--s-4);
}

.tool-field label {
  display: block;
  font-size: var(--t-meta);
  font-weight: 500;
  color: var(--c-text-2);
  margin-block-end: var(--s-2);
}

.tool-field select {
  display: block;
  width: 100%;
  min-height: 48px;
  padding-inline: var(--s-3);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border-input);
  border-radius: var(--r-sm);
  color: var(--c-text);
}

/* Result slot — Design Fixes v2 §2 empty vs filled */
.tool-result-slot {
  margin-block-start: var(--s-8);
}

.tool-result {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--s-5);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-md);
  background: var(--c-surface-2);
  transition:
    opacity 180ms ease-out,
    transform 180ms ease-out,
    background-color 180ms ease-out,
    border-color 180ms ease-out;
}

.tool-result--empty {
  min-height: 96px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  border-style: dashed;
  background: transparent;
  text-align: center;
}

.tool-result--empty .tool-result-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--c-text-2);
}

.tool-result-text {
  margin: 0;
  font-size: var(--t-body);
  line-height: 1.5;
  color: var(--c-text-2);
  max-width: 36ch;
}

.tool-result.is-filled {
  min-height: 0;
  justify-content: flex-start;
  align-items: stretch;
  text-align: left;
  border-style: solid;
  background: var(--c-surface-2);
  animation: tool-result-in 180ms ease-out;
}

@keyframes tool-result-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-result.is-filled {
    animation: none;
  }
}

.tool-result:focus {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

.tool-result h2.meta {
  margin: 0 0 var(--s-3);
  font-size: var(--t-meta);
  font-weight: 500;
  color: var(--c-text-2);
  max-width: none;
}

.tool-fallback {
  margin-block-start: var(--s-6);
}

.tool-fallback-title {
  font-size: var(--t-h3);
  margin: 0 0 var(--s-4);
}

/* No-JS: keep static tables; hide interactive chrome that needs script */
.no-js .tool--platform .tool-progress,
.no-js .tool--platform .tool-nav,
.no-js .tool--platform #platform-screens {
  display: none;
}

.tool-progress {
  margin-block-end: var(--s-4);
}

.tool-step-text {
  font-size: var(--t-meta);
  font-weight: 500;
  color: var(--c-text-2);
  margin: 0 0 var(--s-2);
  max-width: none;
}

.tool-dots {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.tool-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--c-border-2);
  transition: background-color 160ms ease;
}

.tool-dot.is-active {
  background: var(--c-primary);
}

.tool-fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.tool-legend {
  font-size: var(--t-h3);
  font-weight: 600;
  margin: 0 0 var(--s-4);
  color: var(--c-text);
}

.tool-options {
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-block-end: var(--s-4);
}

.tool-option {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: 48px;
  padding: var(--s-3);
  border-bottom: 1px solid var(--c-border);
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.tool-option:last-child {
  border-bottom: none;
}

.tool-option:has(input:checked) {
  background: var(--c-primary-tint);
  box-shadow: inset 0 0 0 1.5px var(--c-primary);
}

.tool-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-3);
}

.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-block: var(--s-3);
}

.tool-tab {
  min-height: 44px;
  padding-inline: var(--s-3);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-weight: 500;
}

.tool-tab.is-active {
  background: var(--c-primary-tint);
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.tool-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-2) var(--s-4);
  margin-block: var(--s-4);
}

.tool-facts dt {
  font-size: var(--t-meta);
  font-weight: 500;
  color: var(--c-text-2);
}

.tool-facts dd {
  margin: 0;
  font-size: var(--t-body-sm);
  color: var(--c-text);
}

@media (min-width: 480px) {
  .tool-facts {
    grid-template-columns: 10rem 1fr;
  }
}

/* Content-page diagrams (pillar pages) */
.content-figure {
  margin-block: var(--s-8);
  max-width: none;
}

.content-figure .dgm--content {
  width: 100%;
  height: auto;
  max-width: 100%;
  color: var(--c-primary);
  display: block;
}

.content-figure figcaption {
  margin: var(--s-3) 0 0;
  font-size: var(--t-meta);
  color: var(--c-text-2);
  text-align: center;
  max-width: none;
}

/* Legacy alias — prefer .langblock (kit §9) */
.lang-tl {
  margin-block: var(--s-4) 0;
  max-width: none;
}

/* Author monogram — no photo; SVG only (Blueprint 14.5) */
.author-monogram {
  margin-block: 0 var(--s-6);
}

.author-monogram-svg {
  display: block;
  border-radius: 50%;
}

/* ═══════════════════════════════════════════════════════════
   6. UTILITIES — keep under 10
   ═══════════════════════════════════════════════════════════ */

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

.u-text-2 { color: var(--c-text-2); }
.u-ink { color: var(--c-ink); }
.u-mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════════════
   6b. CONTENT COMPONENT KIT v1.1
   ═══════════════════════════════════════════════════════════ */

/* --- 1. Callout --- */
.callout {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--s-3);
  align-items: start;
  padding: var(--s-5);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border-input);
  border-inline-start: 3px solid var(--c-primary);
  background: var(--c-primary-tint);
  margin-block: var(--s-8);
  max-width: none;
}

.callout--tip {
  border-inline-start-color: var(--c-primary);
  background: var(--c-primary-tint);
}

.callout--key {
  border-inline-start-color: var(--c-primary);
  background: var(--c-surface-2);
}

.callout--warning,
.callout--donot {
  border-inline-start-color: var(--c-accent-deep);
  background: var(--c-accent-tint);
}

.callout--donot {
  border-inline-start-width: 4px;
}

.callout-icon {
  width: 20px;
  height: 20px;
  margin-block-start: var(--s-1);
  color: var(--c-primary);
  flex-shrink: 0;
}

.callout--warning .callout-icon,
.callout--donot .callout-icon {
  color: var(--c-accent-text);
}

.callout-body {
  min-width: 0;
}

.callout-body > :first-child { margin-block-start: 0; }
.callout-body > :last-child { margin-block-end: 0; }

.callout-body p {
  max-width: none;
  color: var(--c-text);
}

.callout--warning .callout-body p,
.callout--donot .callout-body p {
  color: var(--c-ink);
}

/* --- 2. Numbered steps — Design Fixes v2 §7f: full-width rows, not a card grid --- */
.steps {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-4);
  margin-block: var(--s-8);
  padding: 0;
  list-style: none;
  counter-reset: none;
  max-width: none;
}

.step {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: var(--s-4);
  row-gap: var(--s-2);
  align-items: start;
  width: 100%;
  height: auto;
  padding: var(--s-5);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: none;
}

.step-num {
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--c-primary);
  color: var(--c-surface);
  font-size: var(--t-body-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.step-title {
  margin: 0;
  font-size: var(--t-h4);
  font-weight: 600;
  color: var(--c-text);
  max-width: none;
}

.step-body {
  grid-column: 2;
  margin: 0;
  font-size: var(--t-body-sm);
  color: var(--c-text-2);
  max-width: none;
}

/* Optional figure or extra content inside a step <li> (after step-body) */
.step-after {
  grid-column: 1 / -1;
  margin-block-start: var(--s-3);
  min-width: 0;
}

.step-after .figure {
  margin-block: 0;
  max-width: none;
}

.step-after .figure-frame {
  padding: var(--s-4);
}

/* --- 3. Tick / cross checklist --- */
.checklist {
  margin-block: var(--s-8);
  max-width: none;
}

.checklist--pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}

@media (min-width: 768px) {
  .checklist--pair {
    grid-template-columns: 1fr 1fr;
    gap: var(--s-8);
  }
}

.checklist-head {
  margin: 0 0 var(--s-3);
  font-size: var(--t-meta);
  font-weight: 600;
  color: var(--c-text);
  max-width: none;
}

.checklist-col {
  list-style: none;
  margin: 0;
  padding: var(--s-4);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.checklist-col li {
  display: flex;
  align-items: flex-start;
  gap: var(--s-3);
  min-height: 44px;
  padding-block: var(--s-3);
  margin: 0;
  border-bottom: 1px solid var(--c-border);
  font-size: var(--t-body-sm);
  color: var(--c-text);
}

.checklist-col li:last-child {
  border-bottom: none;
}

.checklist-icon {
  width: 18px;
  height: 18px;
  margin-block-start: var(--s-1);
  flex-shrink: 0;
}

.checklist-col--yes .checklist-icon { color: var(--c-primary); }
.checklist-col--no .checklist-icon { color: var(--c-accent-text); }

/* --- 4. Enhanced comparison table --- */
.table-enhanced {
  width: 100%;
}

.table-enhanced thead th {
  background: var(--c-surface-2);
  color: var(--c-ink);
  font-weight: 600;
  position: sticky;
  inset-block-start: 0;
  z-index: 1;
}

.table-enhanced tbody tr:nth-child(even) {
  background: var(--c-surface-2);
}

@media (hover: hover) and (pointer: fine) {
  .table-enhanced tbody tr {
    transition: background-color 150ms ease-out;
  }

  .table-enhanced tbody tr:hover {
    background: var(--c-surface-raised);
  }
}

.table-enhanced .addr,
.table-enhanced td.cell-addr {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: var(--s-1) var(--s-3);
  border-radius: var(--r-pill);
  font-size: var(--t-meta);
  font-weight: 600;
  line-height: 1.2;
}

.pill--yes {
  background: var(--c-primary-tint);
  color: var(--c-primary);
}

.pill--no {
  background: var(--c-accent-tint);
  color: var(--c-accent-text);
}

.table-scroll {
  position: relative;
}

.table-scroll--fade::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  width: 28px;
  pointer-events: none;
  background: linear-gradient(
    to right,
    transparent,
    color-mix(in srgb, var(--c-surface) 85%, transparent)
  );
}

@media (min-width: 640px) {
  .table-scroll--fade::after {
    display: none;
  }
}

/* --- 5. Quick answer box --- */
.quick-answer {
  background: var(--c-surface-2);
  border-inline-start: 3px solid var(--c-primary);
  border-radius: var(--r-md);
  padding: var(--s-5);
  max-width: none;
  margin-block: var(--s-8);
  font-size: var(--t-body-lg);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-text);
}

.quick-answer p {
  margin: 0;
  max-width: none;
  font-size: inherit;
  line-height: inherit;
}

/* --- 6. Figure block --- */
.figure {
  margin-block: var(--s-8);
  max-width: none;
}

.figure-frame {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-lg);
  padding: var(--s-6);
}

.figure-frame .dgm,
.figure-frame svg,
.figure-frame picture,
.figure-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  color: var(--c-primary);
}

.figure-caption {
  margin: var(--s-3) 0 0;
  font-size: var(--t-body-sm);
  color: var(--c-text-2);
  text-align: center;
  max-width: none;
}

/* --- 6b. Inline highlight ---
   Colour + weight + shape. Never colour alone. No animation (kit §6c).
   Max one per section (two at most). Never inside a callout or table cell. */
.hl {
  background: var(--c-accent-tint);
  color: var(--c-accent-text);
  font-weight: 600;
  padding: 0.1em 0.35em;
  border-radius: var(--r-sm);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* --- 9. Language block --- */
.langblock {
  background: var(--c-surface-2);
  border-inline-start: 3px solid var(--c-primary);
  border-radius: var(--r-md);
  padding: var(--s-6);
  margin-block: var(--s-8);
  max-width: none;
}

.langblock > :first-child { margin-block-start: 0; }
.langblock > :last-child { margin-block-end: 0; }

.langblock h2,
.langblock h3 {
  max-width: none;
}

.langblock p,
.langblock li {
  max-width: none;
}

/* --- 10. Parallel option cards ---
   Same grid/border/radius/padding as step cards.
   No number badge. No connector line. <ul>, not <ol>. */
.options {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
  margin-block: var(--s-8);
  padding: 0;
  list-style: none;
}

.option {
  padding: var(--s-5);
  border: 1px solid var(--c-border-input);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--e-0);
}

.option-title {
  margin: 0 0 var(--s-2);
  font-size: var(--t-h4);
  font-weight: 600;
  color: var(--c-text);
  max-width: none;
}

.option-body {
  margin: 0;
  font-size: var(--t-body-sm);
  color: var(--c-text-2);
  max-width: none;
}

.option-body > :first-child { margin-block-start: 0; }
.option-body > :last-child { margin-block-end: 0; }

.option-body p {
  margin-block: 0 var(--s-3);
  font-size: inherit;
  color: inherit;
  max-width: none;
}

@media (min-width: 640px) {
  .options {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-6);
  }
}

@media (min-width: 1024px) {
  .options {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-8);
  }
}

/* Theme swap must not inherit hover/header bg transitions (Design Fixes v2 §6). */
html.theme-changing,
html.theme-changing * {
  transition: none !important;
}

/* ═══════════════════════════════════════════════════════════
   7i. HOVER TIERS — Design Fixes v2 §7i
   Interactive: lift + shadow. Content boxes: colour only.
   Never scale. Touch devices never stick in hover.
   ═══════════════════════════════════════════════════════════ */

@media (hover: hover) and (pointer: fine) {
  /* Interactive — cards, buttons, link-shaped controls */
  .card--interactive,
  .card--soon,
  .btn {
    transition:
      background-color 180ms ease-out,
      border-color 180ms ease-out,
      box-shadow 180ms ease-out,
      transform 180ms ease-out,
      color 180ms ease-out;
  }

  .card--interactive:hover,
  .card--soon:hover {
    background: var(--c-surface-raised);
    border-color: var(--c-border-hover);
    box-shadow: var(--e-1);
    transform: translateY(-3px);
    cursor: pointer;
  }

  .btn:hover {
    cursor: pointer;
  }

  /* Content boxes — no lift, no shadow, no scale */
  .step,
  .callout,
  .trust-item,
  .checklist-col,
  .faq-item {
    transition:
      background-color 150ms ease-out,
      border-color 150ms ease-out;
  }

  .step:hover,
  .callout:hover,
  .trust-item:hover,
  .checklist-col:hover {
    background: var(--c-surface-raised);
    border-color: var(--c-border-hover);
    cursor: default;
  }

  .faq-item:hover:not([open]) {
    background: var(--c-surface-raised);
    cursor: default;
  }

  .faq-item[open]:hover {
    background-color: var(--c-surface);
    cursor: default;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card--interactive,
  .card--soon,
  .btn,
  .step,
  .callout,
  .trust-item,
  .checklist-col,
  .faq-item {
    transition: none;
  }

  .card--interactive:hover,
  .card--soon:hover {
    transform: none;
  }
}

/* ═══════════════════════════════════════════════════════════
   7. REDUCED MOTION — Design System §15
   ═══════════════════════════════════════════════════════════ */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
