/* VCS Chat website: the one stylesheet.
   Five sections in order: Tokens, Reset/Base, Layout, Components, Utilities.
   Strict monochrome (the app's own black-and-white look): the locked grayscale
   from the build standard, no accent colour, red only for warnings.
   Every component here has a live demo on /stylesheet/: keep them in step. */

/* ============================================
   1. TOKENS
   ============================================ */
@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/roboto-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Roboto";
  src: url("/assets/fonts/roboto-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --gray-950: #050505;
  --gray-900: #0c0c0c;
  --gray-800: #262626;
  --gray-700: #404040;
  --gray-600: #525252;
  --gray-500: #6b6b6b;
  --gray-400: #a3a3a3;
  --gray-300: #d4d4d4;
  --gray-200: #e5e5e5;
  --gray-100: #f0f0f0;
  --gray-50:  #f7f7f7;

  --background: #ffffff;
  --background-alt: var(--gray-50);
  --foreground: var(--gray-900);
  --muted: var(--gray-50);
  --muted-foreground: var(--gray-500);
  --border: var(--gray-200);
  --border-strong: var(--gray-300);
  --primary: var(--gray-900);
  --primary-dark: var(--gray-950);
  --primary-foreground: #ffffff;
  --color-focus: var(--foreground);

  --surface-raised: #ffffff;
  --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.16);

  --footer-bg: var(--gray-900);
  --footer-fg: var(--gray-50);
  --footer-muted: var(--gray-400);
  --footer-border: var(--gray-800);

  --destructive: #b91c1c;
  --destructive-bg: rgba(220, 38, 38, 0.1);
  --destructive-foreground: #ffffff;

  --font-body: "Roboto", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  --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;

  --text-xs: 0.8125rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.25rem;
  --text-xl: 1.563rem;
  --text-2xl: 1.953rem;
  --text-display: 2.441rem;
  --leading-body: 1.5;
  --leading-heading: 1.2;
  --measure: 65ch;

  --radius: 4px;
  --radius-lg: 12px;
  --radius-app: 22%;   /* the app icon's own rounded square */

  /* A record only: the same value is typed into the nav media query and main.js. */
  --breakpoint-nav: 960px;
  --header-height: 4rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --dark-elevated: #1c1c1c;
  --background: var(--gray-950);
  --background-alt: var(--dark-elevated);
  --foreground: var(--gray-50);
  --muted: var(--dark-elevated);
  --muted-foreground: var(--gray-400);
  --border: var(--gray-800);
  --border-strong: var(--gray-700);
  --primary: var(--gray-50);
  --primary-dark: #ffffff;
  --primary-foreground: var(--gray-950);
  --surface-raised: var(--dark-elevated);
  --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.6);
  --footer-bg: var(--dark-elevated);
  --destructive: #f87171;
  --destructive-bg: rgba(248, 113, 113, 0.14);
  --destructive-foreground: var(--gray-950);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --dark-elevated: #1c1c1c;
    --background: var(--gray-950);
    --background-alt: var(--dark-elevated);
    --foreground: var(--gray-50);
    --muted: var(--dark-elevated);
    --muted-foreground: var(--gray-400);
    --border: var(--gray-800);
    --border-strong: var(--gray-700);
    --primary: var(--gray-50);
    --primary-dark: #ffffff;
    --primary-foreground: var(--gray-950);
    --surface-raised: var(--dark-elevated);
    --shadow-raised: 0 8px 24px rgba(0, 0, 0, 0.6);
    --footer-bg: var(--dark-elevated);
    --destructive: #f87171;
    --destructive-bg: rgba(248, 113, 113, 0.14);
    --destructive-foreground: var(--gray-950);
  }
}

/* Portal widgets (Statistics banner, Calls + Chat, Multi-mailer) read these names. */
:root {
  --accent: var(--primary);
  --accent-ink: var(--primary-foreground);
  --violet: var(--primary);              /* their hover colour */
  --surface: var(--background);
  --surface-2: var(--background-alt);
  --bg: var(--background);
  --text: var(--foreground);
  --text-muted: var(--muted-foreground);
  --text-soft: var(--muted-foreground);
  --line: var(--border);
  --line-strong: var(--border-strong);
  --font: var(--font-body);
  --sans: var(--font-body);
  --vcm-accent: var(--primary);          /* Multi-mailer button */
  --vcm-ink: var(--primary-foreground);
}
[data-voice-call][hidden], [data-voice-chat][hidden] { display: none !important; }

/* ============================================
   2. RESET / BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; }
:root { color-scheme: light dark; }
html { scroll-padding-top: var(--space-5); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--foreground);
  background: var(--background);
  -webkit-text-size-adjust: 100%;
}
:lang(th) { line-height: 1.7; }
img, svg { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  margin: var(--space-6) 0 var(--space-3);
  line-height: var(--leading-heading);
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: var(--text-2xl); margin-top: 0; }
h2 { font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); }
h4 { font-size: var(--text-base); }
p, ul, ol, dl { margin: 0 0 var(--space-4); }
p, li, dd, blockquote { max-width: var(--measure); }
li + li { margin-top: var(--space-1); }
a { color: var(--foreground); text-underline-offset: 0.15em; }
a:hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 700; }
code, kbd {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--space-1);
  overflow-wrap: anywhere;
}
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }
table { border-collapse: collapse; width: 100%; font-size: var(--text-sm); }
th, td { text-align: start; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-weight: 700; }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .btn, .nav-toggle, .card { border: 1px solid CanvasText; }
}
button, input, select, textarea { font: inherit; }
fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; }

/* ============================================
   3. LAYOUT
   ============================================ */
.container {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: var(--space-4);
}
.section { padding-block: var(--space-7); }
.section-alt { background: var(--background-alt); }
.section > .container > :first-child { margin-top: 0; }
:root[data-theme="dark"] .section-alt { --background-alt: var(--gray-800); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .section-alt { --background-alt: var(--gray-800); }
}
/* Hero band: every page opens on one. A dark island in both themes (its own tokens, so buttons, links and focus
   rings inside it just work), with a line drawing behind it from tools/make-hero-art.mjs. Text stays at least
   4.5:1 over the drawing: its strokes are faint, and the lead is --gray-300. */
.hero-band {
  --background: var(--gray-900);
  --foreground: #ffffff;
  --muted-foreground: var(--gray-300);
  --border: var(--gray-800);
  --border-strong: var(--gray-600);
  --primary: #ffffff;
  --primary-dark: var(--gray-100);
  --primary-foreground: var(--gray-900);
  --color-focus: #ffffff;
  color-scheme: dark;
  color: var(--foreground);
  background: var(--hero-art, none) right center / auto 100% no-repeat, var(--background);
}
:root[data-theme="dark"] .hero-band { --background: var(--dark-elevated); border-bottom: 1px solid var(--gray-800); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hero-band { --background: var(--dark-elevated); border-bottom: 1px solid var(--gray-800); }
}
.art-home            { --hero-art: url("/assets/img/hero/home.svg"); }
.art-features        { --hero-art: url("/assets/img/hero/features.svg"); }
.art-download        { --hero-art: url("/assets/img/hero/download.svg"); }
.art-guides          { --hero-art: url("/assets/img/hero/guides.svg"); }
.art-troubleshooting { --hero-art: url("/assets/img/hero/troubleshooting.svg"); }
.art-changelog       { --hero-art: url("/assets/img/hero/changelog.svg"); }
.art-privacy         { --hero-art: url("/assets/img/hero/privacy.svg"); }
.art-terms           { --hero-art: url("/assets/img/hero/terms.svg"); }
.art-contact         { --hero-art: url("/assets/img/hero/contact.svg"); }
.art-notfound        { --hero-art: url("/assets/img/hero/notfound.svg"); }
.art-stylesheet      { --hero-art: url("/assets/img/hero/stylesheet.svg"); }
.art-style           { --hero-art: url("/assets/img/hero/style.svg"); }

.page-head { padding: var(--space-8) 0 var(--space-7); }
.page-head h1 { font-size: var(--text-display); margin-bottom: var(--space-3); }
.page-head p { color: var(--muted-foreground); font-size: var(--text-lg); margin-bottom: 0; max-width: 36rem; }
.page-head .btn-row { margin-top: var(--space-5); }
.page-head__inner { display: grid; gap: var(--space-6); align-items: center; }
.grid { display: grid; gap: var(--space-4); grid-template-columns: 1fr; }
.with-toc { display: grid; gap: var(--space-6); grid-template-columns: 1fr; padding-block: var(--space-6); }
.with-toc > * { min-width: 0; }

/* ============================================
   4. COMPONENTS
   ============================================ */

/* --- Header and nav --- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: var(--header-height);
  padding-block: var(--space-2);
}
.site-header__logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--foreground);
  font-weight: 700;
  font-size: var(--text-lg);
  text-decoration: none;
  min-height: 2.75rem;   /* 44px target */
}
.site-header__logo img {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-app);
  box-shadow: 0 0 0 1px var(--border-strong);   /* keeps the black square's edge in dark mode */
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
}
.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
  display: block;
  width: 1.5rem;
  height: 2px;
  background: currentColor;
}
.nav-toggle__icon::before,
.nav-toggle__icon::after { content: ""; margin-block: 5px; }

.nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  max-height: calc(100dvh - var(--header-height) - var(--space-4));
  overflow-y: auto;
  padding: var(--space-2) var(--space-4);
  background: var(--surface-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-raised);
}
.nav--open { display: block; }
.nav__list { list-style: none; margin: 0; padding: 0; }
.nav__list li + li { margin-top: 0; }
.nav__link {
  display: flex;
  align-items: center;
  min-height: 2.75rem;   /* 44px target */
  padding: var(--space-2) 0;
  text-decoration: none;
  color: var(--foreground);
}
.nav__link:hover { text-decoration: underline; }
.nav__link[aria-current="page"] { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.4em; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: var(--space-3) var(--space-5);
  border-radius: 999px;   /* pills, as in the app */
  font-weight: 700;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.2;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn svg { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--foreground); }
.btn-outline:hover { border-color: var(--primary); }
.btn--big { font-size: var(--text-lg); padding: var(--space-4) var(--space-6); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* --- Hero (home) --- */
.hero { padding: var(--space-7) 0; }
.hero__inner { display: grid; gap: var(--space-6); align-items: center; }
.hero__eyebrow { font-size: var(--text-base); font-weight: 700; color: var(--muted-foreground); margin-bottom: var(--space-3); }
.hero__title { font-size: var(--text-display); margin-bottom: var(--space-4); }
.hero__lead { font-size: var(--text-lg); color: var(--muted-foreground); }
.hero__meta { font-size: var(--text-base); color: var(--muted-foreground); margin-top: var(--space-3); }

/* A drawn phone: a chat in the app's style. Pure markup + CSS; no photo. */
.phone {
  justify-self: center;
  width: min(100%, 18rem);
  padding: var(--space-3);
  border-radius: 2.25rem;
  background: var(--gray-900);
  box-shadow: 0 0 0 1px var(--border-strong), var(--shadow-raised);
}
.phone__screen {
  border-radius: 1.6rem;
  overflow: hidden;
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: var(--text-sm);
}
.phone__bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: #ffffff;
  border-bottom: 1px solid var(--gray-200);
}
.phone__avatar {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--gray-300);
  font-weight: 700;
  font-size: var(--text-xs);
}
.phone__name { font-weight: 700; line-height: 1.2; }
.phone__status { font-size: 0.75rem; color: var(--gray-600); }
.phone__chat { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-3); }
.phone__chip {
  justify-self: center;
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: #ffffff;
  font-size: 0.75rem;
  color: var(--gray-600);
  text-align: center;
}
.bubble {
  max-width: 80%;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-lg);
  background: #ffffff;
  line-height: 1.35;
}
.bubble--mine { justify-self: end; background: #141414; color: #ffffff; }
.bubble__time { display: block; font-size: 0.6875rem; opacity: 0.7; text-align: end; margin-top: var(--space-1); }
.phone__composer {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-3);
}
.phone__field { flex: 1; padding: var(--space-2) var(--space-3); border-radius: 999px; background: #ffffff; color: var(--gray-500); }
.phone__mic { flex: none; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--gray-900); }

/* Two people chatting (the Features hero): Alex's phone and Sam's, the same conversation from each side,
   joined by the direct, encrypted link between them. Drawn, like .phone; the whole thing is one role="img". */
.duo {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  align-items: start;
  justify-self: center;
  width: min(100%, 27rem);
}
.duo > * { min-width: 0; }
.duo .phone { width: 100%; padding: var(--space-2); border-radius: 1.75rem; font-size: 0.75rem; }
.duo .phone__screen { border-radius: 1.3rem; font-size: 0.75rem; }
.duo .phone:last-of-type { margin-top: var(--space-5); }
.duo .phone__bar { padding: var(--space-2) var(--space-3); }
.duo .phone__avatar { width: 1.75rem; height: 1.75rem; font-size: 0.6875rem; }
.duo .phone__status { font-size: 0.6875rem; }
.duo .phone__chat { padding: var(--space-2); gap: var(--space-1); }
.duo .bubble { padding: var(--space-1) var(--space-2); }
.duo .bubble__time { margin-top: 0; }
/* A wide photo keeps the hero short (it was 4:3, and the band ran to 680px). */
.duo .bubble__photo { aspect-ratio: 2 / 1; }
.duo .bubble { max-width: 88%; }
.duo .phone__mic { width: 1.75rem; height: 1.75rem; }
.duo .phone__field { padding: var(--space-1) var(--space-3); }
.duo__link {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  background: #ffffff;
  color: var(--gray-900);
  font-size: var(--text-xs);
  font-weight: 700;
  white-space: nowrap;
}
/* The link between the two phones: a dashed line either side of the chip. */
.duo__link::before, .duo__link::after { content: ""; width: clamp(1rem, 6vw, 3rem); border-top: 2px dashed var(--gray-600); margin-inline: var(--space-2); order: -1; }
.duo__link::after { order: 1; }
.duo__link { background: none; color: var(--foreground); padding: 0; }
.duo__chip { display: inline-flex; align-items: center; gap: var(--space-1); padding: var(--space-1) var(--space-3); border-radius: 999px; background: #ffffff; color: var(--gray-900); }
.duo__chip svg { width: 0.875rem; height: 0.875rem; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bubble--photo { padding: var(--space-1); width: 78%; }
.bubble__photo {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--radius-lg) - 4px);
  background:
    radial-gradient(circle at 70% 30%, #e5e5e5 0 10%, transparent 11%),
    linear-gradient(160deg, transparent 55%, #525252 56% 70%, transparent 71%),
    linear-gradient(200deg, transparent 50%, #6b6b6b 51%),
    linear-gradient(#a3a3a3, #d4d4d4);
}
.voice { display: flex; align-items: center; gap: var(--space-2); }
.voice__play { width: 0; height: 0; border-block: 0.4rem solid transparent; border-inline-start: 0.6rem solid currentColor; flex: none; }
.voice__wave { flex: 1; height: 1.25rem; min-width: 1rem;
  background: repeating-linear-gradient(90deg, currentColor 0 2px, transparent 2px 5px);
  -webkit-mask: linear-gradient(transparent 40%, #000 40% 60%, transparent 60%), radial-gradient(ellipse at 30% 50%, #000 45%, transparent 46%), radial-gradient(ellipse at 75% 50%, #000 35%, transparent 36%);
  mask: linear-gradient(transparent 40%, #000 40% 60%, transparent 60%), radial-gradient(ellipse at 30% 50%, #000 45%, transparent 46%), radial-gradient(ellipse at 75% 50%, #000 35%, transparent 36%);
  opacity: 0.7; }

/* --- Cards --- */
.card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
}
.card__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--space-3);
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
}
.card__icon svg { width: 1.375rem; height: 1.375rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.card__title { font-size: var(--text-lg); margin: 0 0 var(--space-2); }
.card p:last-child { margin-bottom: 0; }
.card--featured { border-color: var(--primary); border-width: 2px; }
.card--link { text-decoration: none; color: inherit; display: block; }
.card--link:hover { border-color: var(--primary); }
.card--link .card__title::after { content: " →"; }

/* --- Steps (numbered how-to) --- */
.steps { counter-reset: step; list-style: none; padding: 0; display: grid; gap: var(--space-4); }
.steps > li { counter-increment: step; position: relative; padding-left: var(--space-7); margin: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -0.1rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 700;
  font-size: var(--text-sm);
}

/* --- Notes and warnings --- */
.note {
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: var(--muted);
  max-width: var(--measure);
}
.note p:last-child { margin-bottom: 0; }
.note--warning { border-left-color: var(--destructive); background: var(--destructive-bg); }
.note__title { font-weight: 700; margin-bottom: var(--space-1); }

/* --- Download panel --- */
.download-panel {
  display: grid;
  gap: var(--space-5);
  padding: var(--space-6);
  border: 2px solid var(--primary);
  border-radius: var(--radius-lg);
}
.download-panel__head { display: flex; gap: var(--space-4); align-items: center; }
.download-panel__head img { width: 4rem; height: 4rem; border-radius: var(--radius-app); box-shadow: 0 0 0 1px var(--border-strong); }
.download-panel__head h2 { margin: 0; }
.download-panel__head p { margin: 0; color: var(--muted-foreground); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-1) var(--space-4); margin: 0; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.qr {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.qr img { width: 8rem; height: 8rem; padding: var(--space-2); background: #ffffff; border-radius: var(--radius); flex: none; }
.qr p { margin: 0; }

/* --- Table of contents (guides, troubleshooting) --- */
.toc { font-size: var(--text-base); }
.toc__title { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); margin: 0 0 var(--space-2); }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: flex; align-items: center; min-height: 2.75rem; padding: var(--space-1) var(--space-3); text-decoration: none; color: var(--muted-foreground); }
.toc a:hover { color: var(--foreground); text-decoration: underline; }

.guide { padding-bottom: var(--space-5); border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.guide:last-child { border-bottom: 0; }
.guide > h2 { margin-top: 0; }

/* --- Problem / fix (troubleshooting) --- */
.fix {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  background: var(--background);
}
.fix > summary {
  cursor: pointer;
  list-style: none;
  padding: var(--space-4) var(--space-5);
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
}
.fix > summary::-webkit-details-marker { display: none; }
.fix > summary::after { content: "+"; font-size: var(--text-lg); line-height: 1; color: var(--muted-foreground); }
.fix[open] > summary::after { content: "−"; }
.fix[open] > summary { border-bottom: 1px solid var(--border); }
.fix__body { padding: var(--space-4) var(--space-5); }
.fix__body > :last-child { margin-bottom: 0; }

/* --- Changelog --- */
.release {
  display: grid;
  gap: var(--space-2) var(--space-6);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--border);
}
.release__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-3); }
.release__version { font-size: var(--text-xl); margin: 0; }
.release__date { color: var(--muted-foreground); font-size: var(--text-sm); }
.release__title { font-weight: 700; margin-bottom: var(--space-2); }
.release ul { padding-left: var(--space-5); margin-bottom: 0; }
.badge {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.6;
  color: var(--foreground);
}
.badge--latest { background: var(--primary); color: var(--primary-foreground); border-color: var(--primary); }

/* --- Forms (contact) --- */
.form { display: grid; gap: var(--space-4); max-width: 36rem; }
.form-group { display: grid; gap: var(--space-1); }
.form-group label { font-weight: 700; }
.form input[type="text"], .form input[type="email"], .form textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--gray-500);   /* 3:1 against the page in both themes */
  border-radius: var(--radius);
  background: var(--background);
  color: var(--foreground);
  font-size: var(--text-base);
}
.form textarea { resize: vertical; min-height: 9rem; }
.form-hint { font-size: var(--text-base); color: var(--muted-foreground); margin: 0; }
.form .btn { justify-self: start; }
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { display: none; padding: var(--space-3) var(--space-4); border-radius: var(--radius); max-width: var(--measure); }
.form-status.is-visible { display: block; }
.form-status.is-success { background: var(--muted); border-left: 4px solid var(--primary); }
.form-status.is-error { background: var(--destructive-bg); border-left: 4px solid var(--destructive); }

/* --- Contact page --- */
.contact { display: grid; gap: var(--space-6); }
.contact > * { min-width: 0; }
.contact__aside { align-self: start; }

/* --- Mailing-list sign-up (the Multi-mailer draws the box inside [data-mail-subscribe]) --- */
.subscribe {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background-alt);
  max-width: 40rem;
}
.subscribe__title { font-size: var(--text-lg); margin: 0 0 var(--space-2); }

/* --- Call to action band --- */
.cta { text-align: center; }
.cta p { margin-inline: auto; }
.cta .btn-row { justify-content: center; }

/* --- Tick boxes --- */
.check-group { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); }
.check-group legend { margin-bottom: var(--space-2); font-weight: 700; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); }

/* --- Footer --- */
.site-footer {
  --color-focus: var(--footer-fg);
  background: var(--footer-bg);
  color: var(--footer-fg);
  border-top: 1px solid var(--footer-border);
  font-size: var(--text-sm);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover,
.site-footer a:focus-visible { text-decoration: underline; }
.site-footer__inner {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-7) var(--space-6);
  grid-template-columns: 1fr;
}
.site-footer__col { min-width: 0; }
.site-footer__brand { display: flex; align-items: center; gap: var(--space-2); font-weight: 700; font-size: var(--text-base); margin-bottom: var(--space-2); }
.site-footer__brand img { width: 1.75rem; height: 1.75rem; border-radius: var(--radius-app); box-shadow: 0 0 0 1px var(--footer-border); }
.site-footer__muted { color: var(--footer-muted); }
.site-footer__heading {
  margin-bottom: var(--space-2);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--footer-muted);
}
.site-footer__list { list-style: none; margin: 0; padding: 0; }
.site-footer__list li + li { margin-top: var(--space-1); }
.site-footer__bottom {
  border-top: 1px solid var(--footer-border);
  padding-block: var(--space-3);
  font-size: var(--text-xs);
  color: var(--footer-muted);
}
.site-footer__bottom p { margin: 0; max-width: none; }

/* --- Brand guide (/style/) --- */
.brand-guide { padding-block: var(--space-6); }
.brand-guide h2 { margin-top: var(--space-7); }
.brand-guide h3 { margin-top: var(--space-5); }
.bg-lead { font-size: var(--text-lg); }
.bg-tiles { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); }
.bg-tiles li { margin: 0; }
.bg-tile { display: grid; place-items: center; min-height: 8rem; padding: var(--space-5);
  border-radius: var(--radius-lg); border: 1px solid var(--border); background: #ffffff; color: var(--gray-900); }
.bg-tile.is-dark { background: var(--gray-900); color: var(--gray-50); border-color: var(--gray-800); }
.bg-tile.is-soft { background: var(--gray-100); color: var(--gray-900); border-color: var(--gray-200); }
.bg-tile img { width: 5rem; height: 5rem; border-radius: var(--radius-app); }
.bg-tile.is-dark img { box-shadow: 0 0 0 1px var(--gray-700); }
.bg-cap { font-size: var(--text-sm); color: var(--muted-foreground); margin: var(--space-2) 0 0; }
.bg-icon { display: flex; align-items: center; gap: var(--space-4); }
.bg-icon img { width: 4rem; height: 4rem; border-radius: var(--radius-app); box-shadow: 0 0 0 1px var(--border-strong); }
.bg-colors-wrap { overflow-x: auto; }
.bg-colors td { vertical-align: middle; }
.bg-sw { display: block; width: 56px; height: 36px; }
.bg-type { display: grid; gap: var(--space-4); }
.bg-type p { margin: 0; }
.bg-t-display { font-size: var(--text-display); font-weight: 700; line-height: var(--leading-heading); }
.bg-t-2xl { font-size: var(--text-2xl); font-weight: 700; line-height: var(--leading-heading); }
.bg-t-xl { font-size: var(--text-xl); font-weight: 700; line-height: var(--leading-heading); }
.bg-t-sm { font-size: var(--text-sm); }

/* ============================================
   5. UTILITIES
   ============================================ */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.text-center { text-align: center; }
.muted { color: var(--muted-foreground); }
.table-wrapper { overflow-x: auto; }
.stack-top { margin-top: var(--space-5); }

.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-2);
  background: var(--primary);
  color: var(--primary-foreground);
  padding: var(--space-2) var(--space-4);
  z-index: 100;
}
.skip-link:focus { top: var(--space-2); }

/* ============================================
   Media queries (mobile first)
   ============================================ */
@media (min-width: 480px) {
  .nav {
    left: auto;
    right: var(--space-4);
    width: min(20rem, calc(100% - 2 * var(--space-4)));
  }
}

/* Layout breakpoint */
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .hero__inner { grid-template-columns: 1.2fr 1fr; }
  .page-head__inner { grid-template-columns: 1fr 1.1fr; }
  .duo .phone:first-of-type { transform: rotate(-3deg); }
  .duo .phone:last-of-type { transform: rotate(3deg); }
  .hero { padding: var(--space-8) 0; }
  .site-footer__inner { grid-template-columns: 1.5fr repeat(3, 1fr); }
  .with-toc { grid-template-columns: 14rem 1fr; }
  .toc { position: sticky; top: var(--space-5); align-self: start; }
  .release { grid-template-columns: 12rem 1fr; }
  .release__head { flex-direction: column; gap: var(--space-1); }
  .download-panel { grid-template-columns: 1fr 1fr; align-items: start; }
  .download-panel > .download-panel__head { grid-column: 1 / -1; }
  .contact { grid-template-columns: 1.4fr 1fr; }
}

/* Nav breakpoint: the logo and six items fit on one row from here.
   Keep --breakpoint-nav and the matchMedia() in main.js on the same value. */
@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .nav {
    display: block;
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
  .nav__list { display: flex; gap: var(--space-5); }
}
