/* ============================================================
   LubMesh — design system
   Swappable themes via <html data-theme>. The theme is chosen
   automatically at load (system light -> day, system dark -> radar);
   the header toggle overrides the choice and persists it in
   localStorage. All colors flow through the tokens below:
     day    — light, LoRa-green accent, high legibility
     night  — deep-slate, cyan/teal accent, "radio at night"
     radar  — dark green, signal-green accent, terminal glow
   ============================================================ */

/* ---------- Theme tokens ---------- */
/* :root doubles as the no-JS / default fallback (the light "day" theme). */
:root,
[data-theme="day"] {
  --bg: #f4f8f5;
  --surface: #ffffff;
  --surface-2: #e9f1ec;
  --text: #16211c;
  --muted: #5c6f64;
  --accent: #159a55;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(21, 154, 85, 0.10);
  --border: #d8e3dc;
  --code-bg: #0d1a13;
  --code-text: #d2ecdd;
  --shadow: 0 6px 24px rgba(20, 60, 40, 0.08);
  --shadow-lift: 0 16px 44px rgba(20, 60, 40, 0.14);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 960px;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;
}

[data-theme="night"] {
  --bg: #0e1116;
  --surface: #161b22;
  --surface-2: #1c232e;
  --text: #cdd6e2;
  --muted: #7e8da0;
  --accent: #35c4d6;
  --accent-contrast: #04202a;
  --accent-soft: rgba(53, 196, 214, 0.14);
  --border: #232c38;
  --code-bg: #0a0e14;
  --code-text: #cfe0f0;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 16px 44px rgba(0, 0, 0, 0.6);
}

[data-theme="radar"] {
  --bg: #06110d;
  --surface: #0c1a14;
  --surface-2: #10241b;
  --text: #cfe9d9;
  --muted: #5f8a78;
  --accent: #39d98a;
  --accent-contrast: #04211a;
  --accent-soft: rgba(57, 217, 138, 0.14);
  --border: #173a2b;
  --code-bg: #08160f;
  --code-text: #c6ecd6;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 16px 44px rgba(0, 0, 0, 0.7);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background-color .25s ease, color .25s ease;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}
.page { min-height: calc(100vh - 220px); padding: 40px 20px 64px; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color .25s ease, border-color .25s ease;
}
/* Two-row header: the brand (+ the actions at the right edge) form line 1;
   the nav items form a horizontal row on line 2 (wrapping to further lines
   on narrow screens). */
.header-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 0 12px;
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand-logo { width: 34px; height: 34px; }
.brand-name { font-family: var(--font-display); font-size: 20px; letter-spacing: -0.02em; }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; width: 100%; gap: 6px 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 500;
  font-size: 15px;
  white-space: nowrap;
  transition: color .18s ease, background-color .18s ease;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--accent-soft); }
.nav-icon { font-size: 16px; line-height: 1; }
.nav-label { }

.header-actions { display: flex; align-items: center; gap: 8px; }

/* Theme toggle: a small icon button in the header. The icon shows the mode
   you're switching TO (sun while in radar/dark, moon while in day/light), so
   it always previews the result of the click. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  transition: color .18s ease, border-color .18s ease, background-color .25s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle .icon-sun,
.theme-toggle .icon-moon { display: none; }
[data-theme="day"] .theme-toggle .icon-moon { display: block; }
[data-theme="radar"] .theme-toggle .icon-sun { display: block; }
[data-theme="night"] .theme-toggle .icon-sun { display: block; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center; gap: 4px;
  width: 42px; height: 42px; padding: 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface);
}
.nav-toggle-bar { display: block; height: 2px; width: 100%; background: var(--text); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle.active .nav-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.active .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.active .nav-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* page title (rendered by the engine as the H1 on every page) */
.page-title { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -0.02em; margin-bottom: 6px; }
.page-title + .block.intro p, .lead { color: var(--muted); font-size: 1.08rem; }

/* ============================================================
   Layout treatments
   `layout:` frontmatter -> <body class="layout-<name>">.
   The build wraps each ## section in <section class="block"> (and content
   before the first ## in <section class="block intro">), so every treatment
   below reflows the SAME content DOM by styling .page + .block. Each page's
   layout is fixed by its `layout:` frontmatter (there is no live switcher).
   All values are token-driven so they work in every theme.
   ============================================================ */

/* base: a .block is a neutral content unit (the global reset already zeroes margins) */
.page .block { margin: 0; }

/* ---------- layout-list — the home page: a simple index of every page ---------- */
.layout-list .page { padding-top: 30px; }
.layout-list .page-title { margin-bottom: 8px; }
.layout-list .block.intro p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 68ch;
  margin: 0 0 26px;
}
.layout-list .page-list-intro {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}
.layout-list .page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.layout-list .page-item { border-bottom: 1px solid var(--border); }
.layout-list .page-link {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 17px 14px;
  color: var(--text);
  transition: background-color .18s ease;
}
/* accent left border revealed on hover */
.layout-list .page-link::before {
  content: "";
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform .18s ease;
}
/* arrow revealed on hover */
.layout-list .page-link::after {
  content: "\2192";
  margin-left: auto;
  color: var(--accent);
  font-size: 1.05rem;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity .18s ease, transform .18s ease;
}
.layout-list .page-link:hover { background: var(--accent-soft); text-decoration: none; }
.layout-list .page-link:hover::before { transform: scaleY(1); }
.layout-list .page-link:hover::after { opacity: 1; transform: translateX(0); }
.layout-list .page-icon { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.layout-list .page-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.06rem;
  flex: 0 1 auto;
  min-width: 0;
}
.layout-list .page-desc {
  flex: 0 1 auto;
  margin-left: auto;
  color: var(--muted);
  font-size: .94rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 44ch;
}
@media (max-width: 640px) {
  /* wrap the descriptor under the name, full width */
  .layout-list .page-desc {
    flex-basis: 100%;
    margin-left: 0;
    padding-left: 36px;
    white-space: normal;
    max-width: none;
  }
  .layout-list .page-link::after { display: none; }
}
/* Nested sub-pages grouped under a top-level page (nested content paths).
   The sub-list indents one level; sub-items reuse the .page-item/.page-link
   rules (incl. borders) so they read as a clean sublist of the parent. */
.layout-list .page-item-group { border-bottom: 0; } /* no double line under the last sub-item */
.layout-list .page-list-sub {
  list-style: none;
  margin: 0;
  padding: 0 0 0 22px;
}
.layout-list .page-list-sub .page-link { padding: 11px 14px; }
.layout-list .page-list-sub .page-icon { font-size: 17px; }
.layout-list .page-list-sub .page-name { font-size: .98rem; }
.layout-list .page-list-sub .page-desc { font-size: .86rem; }

/* ---------- layout-default — clean, intentional base for pages without a specific layout ---------- */
.layout-default .page {
  max-width: 900px;          /* comfortable reading column, centered */
  margin-inline: auto;
}
.layout-default .block { margin: 0 0 10px; }
.layout-default .block.intro { margin: 0 0 28px; }
.layout-default .block.intro p {
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 72ch;
}
.layout-default .block h2 { margin: 44px 0 16px; }
.layout-default .block h3 { margin: 28px 0 12px; }
.layout-default .block > :last-child { margin-bottom: 0; }

/* ---------- layout-article — long-form reading ---------- */
.layout-article .page {
  max-width: 720px;          /* comfortable reading measure, left-aligned in the container */
  line-height: 1.75;
}
.layout-article .page-title {
  font-size: clamp(2.1rem, 5vw, 2.9rem);
  margin-bottom: 10px;
}
/* the intro (before the first ##) is a slightly muted lead */
.layout-article .block.intro { margin: 0 0 4px; }
.layout-article .block.intro p {
  color: var(--muted);
  font-size: 1.1rem;
  margin: 0 0 20px;
}
.layout-article .block h2 {
  margin: 52px 0 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent);   /* section headers stand out */
}
.layout-article .block h3 { margin: 34px 0 12px; }
.layout-article .block p { margin: 0 0 18px; }
.layout-article .block > :last-child { margin-bottom: 0; }

/* ---------- layout-reference — data / table-forward ---------- */
.layout-reference .page { max-width: 1000px; margin-inline: auto; }
.layout-reference .page-title { font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 10px; }
.layout-reference .block { margin: 0 0 18px; }
.layout-reference .block.intro { margin: 0 0 26px; }
.layout-reference .block.intro p {
  color: var(--muted);
  font-size: 1.06rem;
}
.layout-reference .block h2 { margin: 40px 0 14px; }
.layout-reference .table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);                 /* a surface behind each table */
  overflow: hidden;
  margin: 0 0 24px;
}
.layout-reference .page table { font-size: 1rem; }
.layout-reference .page th,
.layout-reference .page td { padding: 14px 18px; }
.layout-reference .page thead th {
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: .96rem;
  letter-spacing: .02em;
}
.layout-reference .page tbody tr:nth-child(even) { background: var(--surface-2); }
/* key-value / label rows (definition lists) */
.layout-reference .page dl {
  margin: 0 0 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 18px;
  display: grid;
  grid-template-columns: minmax(120px, 240px) 1fr;
  gap: 10px 20px;
}
.layout-reference .page dt {
  font-weight: 600;
  font-family: var(--font-display);
  color: var(--text);
}
.layout-reference .page dd { margin: 0; color: var(--muted); }

/* ---------- layout-cards — fixed 2-column card grid ----------
   .page is always a 2-column grid (on every viewport width) and each .block is
   a card. .block.intro spans full width and acts as a header, not a card. The
   raw-HTML .card/.card-grid markup (the cards layout opt-in) is kept and also
   spans full width (with its own responsive 3->2->1 col behavior). */
.layout-cards .page {
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.layout-cards .page-title,
.layout-cards .block.intro,
.layout-cards .card-grid,
.layout-cards .quicklinks { grid-column: 1 / -1; }
.layout-cards .page-title { font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 8px; }
/* the intro spans full width and acts as a header, not a card */
.layout-cards .block.intro {
  padding: 0 0 4px;
  background: transparent;
  border: none;
  box-shadow: none;
}
.layout-cards .block.intro::before { display: none; }
.layout-cards .block.intro p { color: var(--muted); margin: 0 0 22px; }
/* each ## section becomes a card: surface, border, radius, hover lift + accent top border */
.layout-cards .block {
  position: relative;
  padding: 20px 18px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* accent top border revealed on hover */
.layout-cards .block::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}
.layout-cards .block:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}
.layout-cards .block:hover::before { transform: scaleX(1); }
.layout-cards .block h2 { font-size: 1.3rem; margin: 0 0 10px; }
.layout-cards .block h2 .heading-anchor { font-size: 1rem; }
.layout-cards .block > :last-child { margin-bottom: 0; }
/* raw-HTML card markup (owner-authored, the cards layout opt-in) */
.layout-cards .card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 8px 0 20px;
}
.layout-cards .card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 20px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
/* accent top border revealed on hover */
.layout-cards .card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .2s ease;
}
.layout-cards .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
  text-decoration: none;
}
.layout-cards .card:hover::before { transform: scaleX(1); }
.layout-cards .card-icon { font-size: 30px; line-height: 1; }
.layout-cards .card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.14rem;
}
.layout-cards .card-blurb {
  color: var(--muted);
  font-size: .93rem;
  line-height: 1.5;
}
.layout-cards .card .btn { margin-top: auto; align-self: flex-start; }
/* fallback: a top-level plain list (outside any .block) still reads well here */
.layout-cards .page > ul,
.layout-cards .page > ol {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-left: 0;
  list-style: none;
  margin: 8px 0 18px;
}
.layout-cards .page > ul > li,
.layout-cards .page > ol > li {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0;
}
@media (max-width: 860px) {
  .layout-cards .card-grid { grid-template-columns: repeat(2, 1fr); }
  .layout-cards .page > ul, .layout-cards .page > ol { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .layout-cards .card-grid { grid-template-columns: 1fr; }
}

/* ---------- layout-faq — Q&A ----------
   Each .block is one Q&A: the <h2> opening the block is the question (accent,
   larger), the rest of the block is the answer. Subtle dividers separate blocks. */
.layout-faq .page { max-width: 760px; margin-inline: auto; }
.layout-faq .page-title { font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 8px; }
.layout-faq .block.intro { margin: 0 0 8px; }
.layout-faq .block.intro p {
  color: var(--muted);
  font-size: 1.06rem;
  margin: 0 0 18px;
}
/* the heading opening each block, styled as a question */
.layout-faq .block h2 {
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 10px;
}
/* sub-questions (###) stay question-ish too */
.layout-faq .block h3 {
  color: var(--accent);
  font-size: 1.18rem;
  margin: 22px 0 8px;
}
/* the answer: comfortable prose */
.layout-faq .block p {
  line-height: 1.7;
  margin: 0 0 14px;
}
/* subtle divider between Q&A blocks */
.layout-faq .block + .block {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}
/* optional <details>/<summary> collapsible Q&A accordions */
.layout-faq .page details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 18px;
  margin: 0 0 12px;
}
.layout-faq .page summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--accent);
  padding: 14px 0;
}
.layout-faq .page details[open] summary { color: var(--text); }
.layout-faq .page details p { margin: 0 0 14px; }
.layout-faq .page details p:last-child { margin-bottom: 10px; }

/* ---------- Content typography ---------- */
.page h1, .page h2, .page h3 { scroll-margin-top: 80px; }
.page h2 { font-size: 1.7rem; margin: 44px 0 14px; letter-spacing: -0.015em; }
.page h3 { font-size: 1.28rem; margin: 30px 0 10px; }
.page p { margin: 0 0 16px; }
.page p:last-child { margin-bottom: 0; }
.page ul, .page ol { margin: 0 0 16px; padding-left: 24px; }
.page li { margin: 6px 0; }
.page li::marker { color: var(--accent); }
.page strong { color: var(--text); font-weight: 600; }

/* inline code */
.page code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 6px;
}
/* fenced code block */
.page pre {
  background: var(--code-bg);
  color: var(--code-text);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--border);
  line-height: 1.55;
  transition: background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.page pre code { background: transparent; color: inherit; padding: 0; font-size: 0.92em; }
[data-theme="radar"] .page pre { box-shadow: 0 0 22px rgba(57, 217, 138, 0.18); border-color: rgba(57, 217, 138, 0.35); }
[data-theme="night"] .page pre { box-shadow: 0 0 22px rgba(53, 196, 214, 0.10); }

/* blockquote as a callout (notes / warnings) */
.page blockquote {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}
.page blockquote p { margin: 0; }
.page blockquote p + p { margin-top: 8px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 0 0 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.page table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
  background: var(--surface);
}
.page th, .page td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.page thead th {
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.page tbody tr:nth-child(even) { background: var(--surface-2); }
.page tbody tr:last-child td { border-bottom: none; }

/* anchor links on ## / ### headings */
.heading-anchor { color: var(--accent); opacity: 0; margin-left: 8px; font-weight: 400; transition: opacity .15s ease; }
.page h2:hover .heading-anchor, .page h3:hover .heading-anchor { opacity: 1; }

/* horizontal rule */
.page hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }

/* images in content */
.page img { border-radius: var(--radius-sm); margin: 6px 0 18px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1;
  border: 1px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-secondary:hover { background: var(--accent-soft); }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }

/* quick-link list (used on the home "live network" section) */
.quicklinks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.quicklink {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.quicklink:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow); text-decoration: none; }
.quicklink .ql-icon { font-size: 20px; }
.quicklink .ql-label { font-weight: 600; }
.quicklink .ql-sub { color: var(--muted); font-size: 0.86rem; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 34px 0;
  margin-top: 20px;
  transition: background-color .25s ease, border-color .25s ease;
}
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.footer-mission { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; color: var(--text); }
.footer-bots { color: var(--muted); font-size: 0.92rem; }
.footer-bots strong { color: var(--text); }
.footer-copy { color: var(--muted); font-size: 0.85rem; }

/* ---------- Responsive (mobile-first tweaks) ---------- */
@media (max-width: 720px) {
  .page { padding-top: 26px; }
  /* Collapse back to the classic single row: brand (left) + the theme toggle
     and hamburger (right); the nav stays a hidden dropdown below the 64px
     header. */
  .header-inner {
    flex-direction: row;
    align-items: center;
    height: 64px;
    padding: 0;
  }
  .header-row { flex: 1 1 auto; min-width: 0; }
  .site-nav {
    position: absolute;
    top: 64px; left: 0; right: 0;
    width: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px 20px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
  }
  .site-nav.open { opacity: 1; transform: translateY(0); visibility: visible; }
  .nav-link { padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .cards { grid-template-columns: 1fr; }
  .quicklinks { grid-template-columns: 1fr; }
}
@media (max-width: 460px) {
  .brand-name { font-size: 18px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover, .btn:hover, .quicklink:hover, .layout-cards .block:hover { transform: none; }
}
