/* ===================================================================
   SPLogbook website stylesheet
   One dark theme, WCAG 2.2 AA contrast, no external resources.
   =================================================================== */

/* ===================================================================
   Self-hosted fonts — SIL Open Font License 1.1 (see fonts/OFL.txt)
   No requests are made to fonts.googleapis.com or fonts.gstatic.com.
   =================================================================== */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-500-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-500-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-700-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('/assets/fonts/space-grotesk-700-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Cyrillic subsets — generated locally from the same SIL OFL 1.1 sources and
   served from /assets/fonts/. They are loaded only for cyrillic code points
   (plus U+03A9, the omega of the "50 Ω" dummy load), so Latin editions never
   download them. Space Grotesk (display face) has no Cyrillic coverage,
   therefore the display stack falls back to the local Inter subset instead of
   a random system font. No external font server is used. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/inter-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+03A9, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+03A9, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ===================================================================
   Design tokens — one calm dark theme (WCAG 2.2 AA contrast)
   Text on --surface: primary 15.8:1, secondary 9.6:1, muted 6.1:1.
   =================================================================== */

:root {
  --bg: #0b0f14;
  --surface: #121821;
  --surface-2: #18202b;
  --border: #263241;
  --border-strong: #3a4a5e;

  --text: #e8edf3;
  --text-2: #c2ccd8;
  --muted: #9aa8b8;

  --accent: #ffb547;
  --accent-ink: #1a1204;
  --link: #7cc7ff;
  --ok: #5fd39a;
  --warn: #ffcf70;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --container: 1160px;
  --header-h: 104px;
  --target: 44px;
}

/* ===================================================================
   Base
   =================================================================== */

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

* { margin: 0; padding: 0; }

html {
  font-size: 16px;
  color-scheme: dark;
  background: var(--bg);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open { overflow: hidden; }

[id] { scroll-margin-top: calc(var(--header-h) + 16px); }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--text); }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}

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

code, pre, kbd, .tabular-nums {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

code {
  font-size: max(0.875em, 12px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05em 0.35em;
  overflow-wrap: anywhere;
}

kbd {
  display: inline-block;
  font-size: 0.8125rem;
  line-height: 1.4;
  padding: 0 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
}

.container-narrow { max-width: 820px; }

.sr-only {
  position: absolute !important;
  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: 1rem;
  top: -100px;
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  border-radius: var(--radius-sm);
}

.skip-link:focus { top: 0.75rem; color: var(--accent-ink); }

/* ===================================================================
   Buttons and badges
   =================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: var(--target);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #ffc76e; color: var(--accent-ink); }

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

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

.btn.is-copied, .is-copied { color: var(--ok); }

.badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.5;
  padding: 0.05rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  background: var(--surface-2);
  vertical-align: middle;
}

.badge-accent { border-color: var(--accent); color: var(--accent); }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

/* ===================================================================
   Header
   =================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 15, 20, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}

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

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 32px;
  font-size: 0.8125rem;
}

.topbar-item { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--text-2); }
.topbar-label { color: var(--muted); }
.topbar-value { color: var(--text); }
.topbar-link { text-decoration: none; min-height: 24px; }
.topbar-link:hover .topbar-value { color: var(--accent); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  min-height: var(--target);
  margin-right: auto;
}

.brand-name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 500; }
.brand-name strong { font-weight: 700; }

.nav { display: flex; align-items: center; gap: 0.15rem; }

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.nav-link:hover, .nav-link-active { color: var(--text); background: var(--surface-2); }
.nav-link-active { box-shadow: inset 0 -2px 0 var(--accent); }

.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.menu-button {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--target);
  height: var(--target);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

/* Language selector (native <details>, works without JavaScript) */
.lang-switcher { position: relative; }

.lang-switcher summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: var(--target);
  padding: 0 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-size: 0.875rem;
}

.lang-switcher summary::-webkit-details-marker { display: none; }
.lang-code { font-family: var(--font-mono); font-weight: 700; }
.lang-caret { color: var(--muted); }

.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 13rem;
  list-style: none;
  padding: 0.35rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 150;
}

.lang-menu a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: var(--target);
  padding: 0 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
}

.lang-menu a:hover { background: var(--surface-2); }
.lang-menu a[aria-current="true"] { color: var(--accent); }
.lang-menu code { background: none; border: 0; color: var(--muted); }

/* ===================================================================
   Sections
   =================================================================== */

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

.section-head { max-width: 760px; margin-bottom: 2.25rem; }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-bottom: 0.75rem; }
.section-lead { color: var(--text-2); font-size: 1.0625rem; }
.section-more { margin-top: 1.75rem; }
.section-more a, .card-link a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; }

/* Hero */
.hero { padding: 4rem 0 4.5rem; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem;
  align-items: center;
}

.hero-title { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-bottom: 1.1rem; }
.hero-lead { font-size: 1.125rem; color: var(--text-2); margin-bottom: 1.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.25rem; }

.hero-release { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--text-2); margin-bottom: 1rem; }
.hero-release-version { font-weight: 700; color: var(--accent); min-height: 24px; display: inline-flex; align-items: center; }
.hero-release-date { color: var(--muted); }

.hero-facts { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; }
.hero-facts li {
  font-size: 0.875rem;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
}

.platform-notice {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.9375rem;
}

.platform-notice--warning { border-color: var(--warn); }

.hero-shot { margin: 0; }

.shot-button {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.hero-shot figcaption { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }

/* Pillars and cards */
.pillars, .cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
  gap: 1.25rem;
  list-style: none;
  padding: 0;
}

.pillar, .card {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.section-alt .card { background: var(--bg); }

.pillar h3, .card h3 { font-size: 1.125rem; margin-bottom: 0.5rem; }
.pillar p, .card p { color: var(--text-2); font-size: 0.9375rem; }
.card-link { margin-top: 0.5rem; }

/* ===================================================================
   Downloads
   =================================================================== */

.release-line { margin-top: 0.75rem; color: var(--text-2); }
.release-line a { display: inline-flex; align-items: center; min-height: 24px; }
.release-status { margin-top: 0.5rem; color: var(--ok); font-weight: 600; }

.dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
}

.dl-platform {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dl-platform.detected-os { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dl-platform-title { font-size: 1.35rem; margin-bottom: 0.5rem; }
.dl-req { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 0.5rem; }

.dl-list { list-style: none; padding: 0; margin-top: 1rem; display: grid; gap: 1rem; }

.dl-item {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.dl-name { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 1.0625rem; }
.dl-desc { color: var(--text-2); font-size: 0.9375rem; }
.dl-file { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.875rem; color: var(--muted); }
.dl-hash { font-size: 0.8125rem; color: var(--muted); }
.dl-hash-label { font-weight: 700; margin-right: 0.35rem; }
.hash, .hash-code { word-break: break-all; }
.dl-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.dl-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.dl-box {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.dl-box h3 { font-size: 1.125rem; margin: 0 0 0.5rem; }
.dl-box h3 + p { margin-bottom: 0.5rem; }
.dl-box p { color: var(--text-2); font-size: 0.9375rem; margin-bottom: 0.75rem; }
.dl-box p a { display: inline-flex; align-items: center; min-height: 24px; }
.dl-box * + h3 { margin-top: 1.25rem; }
.dl-files { list-style: none; padding: 0; margin-bottom: 0.75rem; display: grid; gap: 0.25rem; }
.dl-files a { display: inline-flex; align-items: center; min-height: var(--target); }
.dl-note { color: var(--muted); font-size: 0.875rem; }

/* ===================================================================
   FAQ and contact
   =================================================================== */

.faq-list { display: grid; gap: 0.75rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.faq-item summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before { content: "+"; width: 1.5rem; color: var(--accent); font-weight: 700; flex: none; }
.faq-item[open] summary::before { content: "−"; }
.faq-answer { padding: 0 1rem 1rem 2.5rem; color: var(--text-2); }

.contact { text-align: center; }
.contact .section-lead { margin-bottom: 1.25rem; }
.contact-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.contact-email { font-size: 1.25rem; font-weight: 600; display: inline-flex; align-items: center; min-height: var(--target); }
.contact-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; color: var(--muted); }
.contact-links a { display: inline-flex; align-items: center; min-height: var(--target); }

/* Screenshot dialog */
.dialog {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.85);
}

.dialog[hidden] { display: none; }
.dialog-body { position: relative; max-width: min(1400px, 100%); }
.dialog-body img { border-radius: var(--radius-sm); }

.dialog-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  width: var(--target);
  height: var(--target);
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

/* ===================================================================
   Footer
   =================================================================== */

.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-top: 3rem; }

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.footer-desc { color: var(--text-2); font-size: 0.9375rem; margin: 0.75rem 0; max-width: 32rem; }
.footer-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.footer-title { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.footer-links { list-style: none; padding: 0; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.footer-links a:hover { color: var(--text); text-decoration: underline; }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

/* ===================================================================
   Documentation, changelog and privacy pages
   =================================================================== */

.section-container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 1rem; }

.docs-hero { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); background: var(--surface); }
.breadcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--muted); margin-bottom: 1rem; }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 24px; }
.docs-title { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.75rem; }
.docs-lead { color: var(--text-2); font-size: 1.0625rem; max-width: 760px; }
.docs-updated { margin-top: 0.75rem; font-size: 0.875rem; color: var(--muted); }

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 3rem;
  padding-top: 2.5rem;
  padding-bottom: 4rem;
}

.docs-sidebar-inner { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow-y: auto; }
.docs-sidebar-header { margin-bottom: 0.5rem; }
.sidebar-title { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc-list, .toc-sublist { list-style: none; padding: 0; }
.toc-sublist { padding-left: 0.85rem; border-left: 1px solid var(--border); margin: 0.1rem 0 0.4rem 0.35rem; }
.toc-list a { display: flex; align-items: center; min-height: 32px; color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.toc-sublist a { font-size: 0.875rem; color: var(--muted); }
.toc-list a:hover { color: var(--text); }

.docs-article { min-width: 0; }
.docs-section { padding-bottom: 2.25rem; margin-bottom: 2.25rem; border-bottom: 1px solid var(--border); }
.docs-section:last-child { border-bottom: 0; }
.docs-article h2 { font-size: 1.6rem; margin-bottom: 1rem; }
.docs-article h3 { font-size: 1.2rem; margin: 1.5rem 0 0.6rem; }
.docs-article p, .docs-article li { color: var(--text-2); }
.docs-article p + p, .docs-article p + ul, .docs-article ul + p { margin-top: 0.75rem; }
.docs-article li + li { margin-top: 0.35rem; }

.code-block { margin: 0.85rem 0; }
.code-block pre {
  overflow-x: auto;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  line-height: 1.55;
}
.code-block code { background: none; border: 0; padding: 0; font-size: inherit; overflow-wrap: normal; }

.callout { margin: 1rem 0; padding: 1rem 1.1rem; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); border-left-width: 4px; background: var(--surface); }
.callout-info { border-left-color: var(--link); }
.callout-warning { border-left-color: var(--warn); }
.callout-title { font-weight: 700; color: var(--text); margin-bottom: 0.35rem; }

.data-table-wrapper { overflow-x: auto; margin: 0.85rem 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.data-table th, .data-table td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table thead th { background: var(--surface-2); color: var(--text); }
.data-table tbody th { color: var(--text); font-weight: 600; }
.data-table tr:last-child th, .data-table tr:last-child td { border-bottom: 0; }

[tabindex="0"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.changelog-page, .privacy-page { padding-top: 2.5rem; padding-bottom: 4rem; }
.privacy-article { max-width: 820px; }
.changelog-timeline { display: grid; gap: 1.25rem; max-width: 860px; }
.changelog-entry { padding: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.changelog-badge-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.changelog-date { color: var(--muted); font-size: 0.875rem; }
.changelog-version { font-size: 1.5rem; margin-bottom: 0.75rem; }
.changelog-body ul { color: var(--text-2); }
.changelog-body li + li { margin-top: 0.4rem; }
.changelog-links { margin-top: 1rem; }
.changelog-links a { display: inline-flex; align-items: center; min-height: var(--target); font-weight: 600; }

/* ===================================================================
   Neutral pages: language selector (/) and 404
   =================================================================== */

.choose-main, .notfound-main { min-height: 100vh; display: flex; align-items: center; padding: 3rem 0; }
.choose-container, .notfound-container { max-width: 960px; }
.choose-brand { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; }
.choose-brand-name { font-family: var(--font-display); font-size: 1.75rem; }
.choose-main h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.75rem; }
.choose-intro, .notfound-intro { color: var(--text-2); font-size: 1.0625rem; margin-bottom: 1.75rem; }
.choose-grid, .notfound-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 1rem; }

.choose-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "code name arrow" "desc desc desc";
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.choose-card:hover { border-color: var(--accent); color: var(--text); }
.choose-code { grid-area: code; font-family: var(--font-mono); font-weight: 700; color: var(--accent); }
.choose-name { grid-area: name; font-weight: 600; font-size: 1.0625rem; }
.choose-arrow { grid-area: arrow; color: var(--muted); }
.choose-desc { grid-area: desc; color: var(--text-2); font-size: 0.875rem; }
.choose-note { margin-top: 1.75rem; color: var(--muted); font-size: 0.9375rem; }
.choose-legal, .notfound-legal { margin-top: 1rem; color: var(--muted); font-size: 0.875rem; }
.choose-legal a, .notfound-legal a { display: inline-flex; align-items: center; min-height: 24px; }

.notfound-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 1rem; font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 0.75rem; }
.notfound-code { font-family: var(--font-mono); color: var(--accent); }
.notfound-lang { padding: 1.1rem 1.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.notfound-lang-name { font-size: 1.125rem; margin-bottom: 0.5rem; }
.notfound-lang-name code { font-size: 0.8125rem; }
.notfound-lang p { color: var(--text-2); font-size: 0.9375rem; }
.notfound-links { list-style: none; padding: 0; margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0 1rem; }
.notfound-links a { display: inline-flex; align-items: center; min-height: var(--target); }

/* ===================================================================
   Responsive layout
   =================================================================== */

@media (max-width: 1080px) {
  .nav-link { padding: 0 0.5rem; font-size: 0.875rem; }
}

@media (max-width: 960px) {
  .menu-button { display: inline-flex; }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem 1rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }

  .nav.active { display: flex; }
  .header-inner { position: relative; }
  .nav-link { font-size: 1rem; padding: 0 0.75rem; }

  .hero-grid, .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .hero-grid { gap: 2rem; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .docs-sidebar-inner { position: static; max-height: none; }
  .docs-layout { gap: 1.5rem; }
}

@media (max-width: 560px) {
  .section { padding: 3rem 0; }
  .hero { padding: 2.5rem 0 3rem; }
  .dl-grid, .dl-extra { grid-template-columns: minmax(0, 1fr); }
  .dl-platform, .dl-box, .pillar, .card, .changelog-entry { padding: 1.1rem; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar-label { display: none; }
  .lang-name { display: none; }
  .hero-actions .btn { width: 100%; }
}

@media (max-width: 360px) {
  .brand-name { font-size: 1.05rem; }
}
