/* =========================================================================
   SpatiaLite & GeoPackage Automation — global styles
   Light, elegant, professional spatial palette (teal + blue + green).
   ========================================================================= */

:root {
  /* Palette */
  --c-bg: #f5f8f7;
  --c-bg-alt: #eef3f2;
  --c-surface: #ffffff;
  --c-text: #1d2b32;
  --c-muted: #566570;
  --c-border: #e1e9e8;
  --c-border-strong: #cdd9d7;

  --c-primary: #0f766e;       /* teal 700 */
  --c-primary-600: #0d9488;   /* teal 600 */
  --c-primary-050: #e2f4f1;
  --c-accent: #2563eb;        /* blue 600 */
  --c-accent-050: #e6efff;
  --c-green: #15803d;
  --c-amber: #b45309;

  --c-code-bg: #f2f6f5;
  --c-code-border: #e1e9e8;
  --c-inline-code-bg: #e8f1ef;

  /* Typography */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Fira Code", Menlo,
    Consolas, "Liberation Mono", monospace;

  --fs-300: 0.85rem;
  --fs-400: 1rem;
  --fs-500: 1.15rem;
  --fs-600: 1.4rem;
  --fs-700: 1.85rem;
  --fs-800: 2.35rem;
  --fs-900: clamp(2.4rem, 1.6rem + 3vw, 3.6rem);

  /* Space / shape */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  --shadow-sm: 0 1px 2px rgba(16, 42, 39, 0.06), 0 1px 3px rgba(16, 42, 39, 0.05);
  --shadow-md: 0 6px 16px rgba(16, 42, 39, 0.08), 0 2px 6px rgba(16, 42, 39, 0.05);
  --shadow-lg: 0 18px 40px rgba(16, 42, 39, 0.12);

  --header-height: 66px;
  --w-page: 92rem;     /* wide on desktop / widescreen */
  --w-narrow: 64rem;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---- Reset / base ------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--fs-400);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: var(--c-accent);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
a:hover {
  color: var(--c-primary);
}
h1, h2, h3, h4 {
  line-height: 1.2;
  font-weight: 700;
  color: var(--c-text);
}
:focus-visible {
  outline: 3px solid var(--c-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Sticky-header-aware in-page scrolling */
:target,
h1[id], h2[id], h3[id], h4[id], h5[id], h6[id] {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}

.site-main {
  flex: 1 0 auto;
  width: 100%;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  z-index: 100;
  background: var(--c-primary);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus {
  top: 0.5rem;
  color: #fff;
}

/* =========================================================================
   Header / navigation
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  max-width: var(--w-page);
  margin: 0 auto;
  min-height: var(--header-height);
  padding: 0 clamp(1rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--c-text);
}
.brand:hover {
  color: var(--c-text);
}
.brand__logo {
  width: 40px;
  height: 40px;
  transition: transform 0.25s var(--ease);
}
.brand:hover .brand__logo {
  transform: rotate(-6deg) scale(1.05);
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.brand__title {
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.brand__sub {
  font-size: 0.72rem;
  color: var(--c-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.primary-nav__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  color: var(--c-text);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  transition: background 0.18s var(--ease), color 0.18s var(--ease);
}
.nav-link:hover {
  background: var(--c-primary-050);
  color: var(--c-primary);
}
.nav-link.is-active {
  background: var(--c-primary);
  color: #fff;
}
.nav-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.nav-toggle__bar {
  height: 2px;
  width: 100%;
  background: var(--c-text);
  border-radius: 2px;
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 860px) {
  .nav-toggle {
    display: flex;
  }
  .primary-nav {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease);
  }
  .primary-nav.is-open {
    max-height: 60vh;
  }
  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.75rem clamp(1rem, 4vw, 2rem) 1.25rem;
  }
  .nav-link {
    padding: 0.75rem 0.9rem;
  }
}

/* =========================================================================
   Footer
   ========================================================================= */
.site-footer {
  flex-shrink: 0;
  margin-top: var(--sp-8);
  background: #0c2b29;
  color: #cfe3df;
}
.site-footer a {
  color: #aee3d8;
}
.site-footer a:hover {
  color: #fff;
}
.site-footer__inner {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: var(--sp-7) clamp(1rem, 3vw, 2rem) var(--sp-5);
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--sp-6);
}
.site-footer__brand {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
}
.site-footer__logo {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}
.site-footer__tag {
  max-width: 40ch;
  color: #9fbdb7;
}
.site-footer__heading {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7fa39c;
  margin-bottom: var(--sp-3);
}
.site-footer__nav ul {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}
.site-footer__bar {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  padding: var(--sp-4);
  font-size: var(--fs-300);
  color: #8fb0aa;
}
@media (max-width: 640px) {
  .site-footer__inner {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   Hero / home
   ========================================================================= */
.hero {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: clamp(2.5rem, 5vw, 5rem) clamp(1rem, 4vw, 2.5rem) var(--sp-6);
  text-align: center;
}
.hero__logo-row {
  display: flex;
  justify-content: center;
  margin-bottom: var(--sp-5);
}
.hero__logo {
  width: clamp(120px, 18vw, 168px);
  height: auto;
  filter: drop-shadow(0 12px 28px rgba(15, 118, 110, 0.25));
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.hero__title {
  font-size: var(--fs-900);
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-3);
}
.hero__accent {
  background: linear-gradient(120deg, var(--c-primary), var(--c-accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__tagline {
  font-size: var(--fs-500);
  color: var(--c-muted);
  font-weight: 500;
  margin-bottom: var(--sp-5);
}
.hero__intro {
  max-width: none; /* match the width of the rest of the page */
  margin: 0 0 var(--sp-6);
  text-align: left;
}
.hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  justify-content: center;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  text-align: left;
  padding: 0.9rem 1.4rem 0.9rem 0.9rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  color: var(--c-text);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-primary-600);
  color: var(--c-text);
}
.cta-btn__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  flex-shrink: 0;
}
.cta-btn__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.cta-btn--1 .cta-btn__icon { background: linear-gradient(135deg, #0f766e, #0d9488); }
.cta-btn--2 .cta-btn__icon { background: linear-gradient(135deg, #2563eb, #6d28d9); }
.cta-btn__text {
  display: flex;
  flex-direction: column;
}
.cta-btn__label {
  font-weight: 700;
}
.cta-btn__hint {
  font-size: var(--fs-300);
  color: var(--c-muted);
}

/* Sections grid on home */
.sections {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: var(--sp-6) clamp(1rem, 4vw, 2.5rem) var(--sp-7);
}
.sections__heading {
  font-size: var(--fs-700);
  text-align: center;
}
.sections__intro {
  max-width: 60ch;
  margin: var(--sp-3) auto var(--sp-6);
  text-align: center;
  color: var(--c-muted);
}

/* =========================================================================
   Cards
   ========================================================================= */
.card-grid {
  list-style: none;
  padding: 0;
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card-grid--lg {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sp-5);
}
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-primary-600);
}
.card__link {
  display: block;
  height: 100%;
  padding: var(--sp-5);
  color: var(--c-text);
}
.card__link:hover {
  color: var(--c-text);
}
.card--feature .card__link {
  padding: var(--sp-6);
}
.card__badge {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  margin-bottom: var(--sp-3);
}
.card__badge svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: #fff;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card__badge--1 { background: linear-gradient(135deg, #0f766e, #0d9488); }
.card__badge--2 { background: linear-gradient(135deg, #2563eb, #6d28d9); }
.card__title {
  font-size: var(--fs-500);
  margin-bottom: var(--sp-2);
}
.card__desc {
  color: var(--c-muted);
  font-size: 0.95rem;
}
.card__meta {
  margin-top: var(--sp-3);
  font-size: var(--fs-300);
  color: var(--c-primary);
  font-weight: 600;
}
.card__cta {
  display: inline-block;
  margin-top: var(--sp-3);
  font-weight: 600;
  color: var(--c-accent);
}
.card:hover .card__cta {
  color: var(--c-primary);
}

/* =========================================================================
   Document page
   ========================================================================= */
.doc {
  max-width: var(--w-page);
  margin: 0 auto;
  padding: var(--sp-5) clamp(1rem, 4vw, 2.5rem) var(--sp-7);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0;
  font-size: var(--fs-300);
  color: var(--c-muted);
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: 0.35rem;
  color: var(--c-border-strong);
}
.breadcrumbs [aria-current="page"] {
  color: var(--c-text);
  font-weight: 600;
}
.doc__header {
  margin: var(--sp-4) 0 var(--sp-5);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
}
.doc__title {
  font-size: var(--fs-800);
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--c-primary), var(--c-accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.doc__lede {
  margin-top: var(--sp-3);
  font-size: var(--fs-500);
  color: var(--c-muted);
}

/* =========================================================================
   Prose (rendered markdown) — full container width on desktop
   ========================================================================= */
.prose {
  font-size: 1.05rem;
}
.prose > * + * {
  margin-top: var(--sp-4);
}
.prose h2 {
  font-size: var(--fs-700);
  margin-top: var(--sp-7);
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--c-primary-050);
  color: var(--c-primary);
}
.prose h3 {
  font-size: var(--fs-600);
  margin-top: var(--sp-6);
  color: var(--c-text);
}
.prose h4 {
  font-size: var(--fs-500);
  margin-top: var(--sp-5);
}
/* Text fills the full width of its container on desktop (no narrow column). */
.prose p,
.prose li {
  max-width: none;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li + li {
  margin-top: 0.35rem;
}
.prose a {
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--c-accent) 35%, transparent);
  text-underline-offset: 2px;
  transition: color 0.18s var(--ease), text-decoration-color 0.18s var(--ease);
}
.prose a:hover {
  text-decoration-color: var(--c-primary);
}
.heading-anchor {
  margin-left: 0.4rem;
  font-weight: 400;
  color: var(--c-border-strong);
  text-decoration: none;
  opacity: 0;
  transition: opacity 0.15s var(--ease), color 0.15s var(--ease);
}
.prose h2:hover .heading-anchor,
.prose h3:hover .heading-anchor,
.prose h4:hover .heading-anchor {
  opacity: 1;
}
.heading-anchor:hover {
  color: var(--c-primary);
}
.prose blockquote {
  border-left: 4px solid var(--c-primary-600);
  background: var(--c-primary-050);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #15403c;
}
.prose strong {
  color: #123a36;
}
.prose hr {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: var(--sp-6) 0;
}

/* Inline code — subtle, no border, blends in */
.prose :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--c-inline-code-bg);
  color: #0c4a44;
  padding: 0.12em 0.4em;
  border-radius: 5px;
}

/* =========================================================================
   Code blocks (build-time Prism highlight) + copy button
   ========================================================================= */
.code-block {
  position: relative;
  margin: var(--sp-5) 0;
  border: 1px solid var(--c-code-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--c-code-bg);
  box-shadow: var(--shadow-sm);
}
.code-block__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem 0.4rem 0.9rem;
  background: #e7efed;
  border-bottom: 1px solid var(--c-code-border);
}
.code-block__lang {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4b6862;
  font-weight: 700;
}
.copy-btn {
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-primary);
  background: #fff;
  border: 1px solid var(--c-border-strong);
  border-radius: 6px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.1s var(--ease);
}
.copy-btn:hover {
  background: var(--c-primary);
  color: #fff;
}
.copy-btn.is-copied {
  background: var(--c-green);
  border-color: var(--c-green);
  color: #fff;
}
.code-block pre {
  margin: 0;
  padding: var(--sp-4);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
  background: var(--c-code-bg);
  color: #243b38;
  tab-size: 4;
}
.code-block code {
  font-family: inherit;
}

/* Prism token theme — light, palette-matched */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #6a8a84; font-style: italic; }
.token.punctuation { color: #54706b; }
.token.keyword, .token.boolean, .token.atrule, .token.important { color: #b5179e; font-weight: 600; }
.token.string, .token.char, .token.attr-value, .token.regex { color: #0a7d4d; }
.token.number, .token.constant, .token.symbol { color: #b45309; }
.token.function, .token.class-name { color: #1d4ed8; }
.token.operator, .token.entity, .token.url { color: #0e7490; }
.token.tag, .token.selector, .token.property { color: #0f766e; }
.token.attr-name { color: #7c3aed; }
.token.builtin, .token.namespace { color: #0891b2; }
.token.deleted { color: #b91c1c; }
.token.inserted { color: #15803d; }

/* =========================================================================
   Tables — styled + horizontally scrollable
   ========================================================================= */
.table-scroll {
  margin: var(--sp-5) 0;
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}
.table-scroll table {
  border-collapse: collapse;
  width: 100%;
  min-width: 32rem;
  font-size: 0.95rem;
}
.table-scroll th,
.table-scroll td {
  padding: 0.7rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}
.table-scroll thead th {
  background: var(--c-primary-050);
  color: #0c4a44;
  font-weight: 700;
  white-space: nowrap;
}
.table-scroll tbody tr:nth-child(even) {
  background: var(--c-bg-alt);
}
.table-scroll tbody tr:hover {
  background: var(--c-accent-050);
}

/* =========================================================================
   Task lists — togglable, no bullet, line-through when done
   ========================================================================= */
.contains-task-list {
  list-style: none;
  padding-left: 0.25rem;
}
.task-list-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  list-style: none;
}
.task-list-item::marker {
  content: "";
}
.task-list-item-checkbox {
  appearance: none;
  -webkit-appearance: none;
  margin-top: 0.28em;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  border: 2px solid var(--c-border-strong);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.task-list-item-checkbox::after {
  content: "";
  width: 0.6em;
  height: 0.32em;
  border-left: 2.5px solid #fff;
  border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  margin-top: -0.1em;
  transition: transform 0.15s var(--ease);
}
.task-list-item-checkbox:checked {
  background: var(--c-primary);
  border-color: var(--c-primary);
}
.task-list-item-checkbox:checked::after {
  transform: rotate(-45deg) scale(1);
}
.task-list-item.is-done {
  color: var(--c-muted);
  text-decoration: line-through;
  text-decoration-color: var(--c-border-strong);
}

/* =========================================================================
   FAQ accordions (native <details>, plus JS-generated)
   ========================================================================= */
.faq-item,
.prose details {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-surface);
  margin: var(--sp-3) 0;
  overflow: hidden;
}
.faq-item > summary,
.prose details > summary {
  cursor: pointer;
  list-style: none;
  padding: var(--sp-3) var(--sp-4);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-3);
  background: var(--c-bg-alt);
}
.faq-item > summary::-webkit-details-marker,
.prose details > summary::-webkit-details-marker {
  display: none;
}
.faq-item > summary::after,
.prose details > summary::after {
  content: "+";
  font-size: 1.3rem;
  color: var(--c-primary);
  transition: transform 0.2s var(--ease);
}
.faq-item[open] > summary::after,
.prose details[open] > summary::after {
  transform: rotate(45deg);
}
.faq-item__body,
.prose details > *:not(summary) {
  padding: var(--sp-2) var(--sp-4) var(--sp-4);
}

/* =========================================================================
   Related content
   ========================================================================= */
.related {
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}
.related__heading {
  font-size: var(--fs-600);
  margin-bottom: var(--sp-4);
}
.pill-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}
.pill {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--c-text);
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.pill:hover {
  background: var(--c-primary-050);
  border-color: var(--c-primary-600);
  color: var(--c-primary);
}

/* Mermaid */
.mermaid {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--sp-4);
  margin: var(--sp-5) 0;
  text-align: center;
  overflow-x: auto;
}

/* =========================================================================
   Diagrams (hand-authored, palette-matched inline SVG)
   ========================================================================= */
.diagram {
  margin: var(--sp-6) 0;
  padding: var(--sp-5) var(--sp-4);
  background: linear-gradient(180deg, var(--c-surface), var(--c-bg-alt));
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}
.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 auto;
  min-width: 320px;
}
.diagram figcaption {
  margin-top: var(--sp-3);
  font-size: var(--fs-300);
  color: var(--c-muted);
  text-align: center;
  font-style: italic;
}

/* SVG primitive classes shared across all diagrams */
.dg-node { fill: #fff; stroke: var(--c-border-strong); stroke-width: 1.5; }
.dg-node--teal  { fill: #e2f4f1; stroke: #0f766e; stroke-width: 1.5; }
.dg-node--blue  { fill: #e6efff; stroke: #2563eb; stroke-width: 1.5; }
.dg-node--green { fill: #e7f6ec; stroke: #15803d; stroke-width: 1.5; }
.dg-node--amber { fill: #fbf0df; stroke: #b45309; stroke-width: 1.5; }
.dg-node--pink  { fill: #fce7f0; stroke: #db2777; stroke-width: 1.5; }
.dg-node--slate { fill: #eef3f2; stroke: #566570; stroke-width: 1.5; }
.dg-fill-teal  { fill: #0f766e; }
.dg-fill-blue  { fill: #2563eb; }
.dg-fill-green { fill: #15803d; }
.dg-fill-amber { fill: #b45309; }
.dg-fill-pink  { fill: #db2777; }
.dg-fill-slate { fill: #64748b; }
.dg-edge { fill: none; stroke: #5b6b78; stroke-width: 2; }
.dg-edge--dash { stroke-dasharray: 6 4; }
.dg-edge--teal { stroke: #0f766e; }
.dg-grid { stroke: #e1e9e8; stroke-width: 1; }
.dg-t { fill: var(--c-text); font-family: var(--font-sans); font-size: 14px; }
.dg-t--head { font-weight: 700; }
.dg-t--sm { font-size: 11.5px; fill: var(--c-muted); }
.dg-t--mono { font-family: var(--font-mono); font-size: 12.5px; }
.dg-t--inv { fill: #fff; }
.dg-t--mid { text-anchor: middle; }
.dg-t--end { text-anchor: end; }

@media (prefers-reduced-motion: no-preference) {
  .diagram svg .dg-pulse { animation: dgpulse 3s var(--ease) infinite; }
}
@keyframes dgpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* 404 */
.notfound {
  max-width: var(--w-narrow);
  margin: 0 auto;
  text-align: center;
  padding: var(--sp-8) clamp(1rem, 4vw, 2rem);
}
.notfound h1 {
  font-size: var(--fs-900);
  color: var(--c-primary);
}

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