/* oss.bowerbird.si. Tokens follow Bowerbird's brand (bwb-cloud resources/css/marketing.css). */

@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/instrument-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-600-normal.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --paper: #f8fafa;
  --canvas: #eef2f4;
  --canvas-deep: #e3eaed;
  --ink: #1c2a33;
  --ink-muted: #566670;
  --line: #d3dce0;
  --line-strong: #b3c2c9;
  --control-line: #7a8d98;
  --brand: #2a5d8a;
  --brand-deep: #1e476c;
  --brand-soft: #dde8f0;
  --rust: #985132;
  --ok: #36703f;
  --ok-soft: #e1ede0;
  --note: #ece6d3;
  --code-bg: #ffffff;
  --inline-code-bg: #e5ecef;
  --inline-code-line: #cfd9de;
  --inline-code-ink: #13212b;
  --mark: #f3e2a8;
  --scroll-shadow: rgb(28 42 51 / 0.3);
  --shadow: 0 1px 2px rgb(28 42 51 / 0.06), 0 8px 24px rgb(28 42 51 / 0.08);
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --radius: 10px;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #263541;
    --canvas: #1e2a33;
    --canvas-deep: #18232b;
    --ink: #e4ebee;
    --ink-muted: #a5b5bd;
    --line: #3d4f5b;
    --line-strong: #536774;
    --control-line: #758b9a;
    --brand: #9cc7e6;
    --brand-deep: #c6e0f2;
    --brand-soft: #2b4356;
    --rust: #e2ad8a;
    --ok: #98cd9f;
    --ok-soft: #2b4232;
    --note: #433d2c;
    --code-bg: #18232b;
    --inline-code-bg: #2e3f4b;
    --inline-code-line: #415462;
    --inline-code-ink: #eef3f5;
    --mark: #5a4b1f;
    --scroll-shadow: rgb(0 0 0 / 0.65);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #263541;
  --canvas: #1e2a33;
  --canvas-deep: #18232b;
  --ink: #e4ebee;
  --ink-muted: #a5b5bd;
  --line: #3d4f5b;
  --line-strong: #536774;
  --control-line: #758b9a;
  --brand: #9cc7e6;
  --brand-deep: #c6e0f2;
  --brand-soft: #2b4356;
  --rust: #e2ad8a;
  --ok: #98cd9f;
  --ok-soft: #2b4232;
  --note: #433d2c;
  --code-bg: #18232b;
  --inline-code-bg: #2e3f4b;
  --inline-code-line: #415462;
  --inline-code-ink: #eef3f5;
  --mark: #5a4b1f;
  --scroll-shadow: rgb(0 0 0 / 0.65);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 8px 24px rgb(0 0 0 / 0.3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
a { color: var(--brand); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-deep); }
h1, h2, h3, h4, h5, h6, strong, b, th { font-weight: 600; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
img, svg { max-width: 100%; }
kbd {
  font: 600 0.75rem/1 var(--mono);
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  color: var(--ink-muted);
  background: var(--paper);
}

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  transform: translateY(-160%);
  z-index: 50;
  padding: 8px 12px;
  background: var(--paper);
  border-radius: 6px;
}
.skip:focus { transform: none; border: 1px solid var(--brand); box-shadow: var(--shadow); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1360px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand__bird { width: 30px; height: 30px; }
.brand__word { font-weight: 600; }
.brand__sub { color: var(--ink-muted); letter-spacing: -0.01em; }
.byline { font-size: 0.85rem; color: var(--ink-muted); text-decoration: none; }
.site-nav { display: flex; gap: 18px; margin-left: 12px; }
.site-nav a, .site-menu__panel a { color: var(--ink-muted); text-decoration: none; font-weight: 400; font-size: 0.95rem; }
.site-nav a:hover, .site-menu__panel a:hover { color: var(--ink); }
.site-nav a[aria-current="page"], .site-menu__panel a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.site-menu { display: none; }
.site-menu__toggle { list-style: none; }
.site-menu__toggle::-webkit-details-marker { display: none; }
.site-menu__panel {
  position: absolute;
  top: 100%;
  right: 16px;
  min-width: 10rem;
  padding: 6px;
  border: 1px solid var(--control-line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.site-menu__panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 6px;
}
.site-menu__panel a:hover { background: var(--canvas); }
.site-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-button, .theme-button, .site-menu__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.search-button { min-width: 200px; }
.search-button kbd { margin-left: auto; }
.search-button:hover, .theme-button:hover, .site-menu__toggle:hover { border-color: var(--brand); color: var(--ink); }
.theme-button { width: 36px; justify-content: center; padding: 0; }
.theme-button__moon { display: none; }
:root[data-theme="dark"] .theme-button__sun { display: none; }
:root[data-theme="dark"] .theme-button__moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-button__sun { display: none; }
  :root:not([data-theme="light"]) .theme-button__moon { display: block; }
}

/* Home */
.hero { border-bottom: 1px solid var(--line); background: var(--paper); }
.hero__inner { max-width: 960px; margin: 0 auto; padding: 72px 20px 56px; }
.hero__title {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.1;
  letter-spacing: -0.035em;
  font-weight: 600;
  max-width: 18ch;
}
.hero__lead { margin: 0; font-size: 1.15rem; color: var(--ink-muted); max-width: 60ch; }
.hero__note { margin: 20px 0 0; font-size: 0.95rem; color: var(--ink-muted); }
.hero__eyebrow { margin: 0 0 12px; font-size: 0.85rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
.packages { max-width: 960px; margin: 0 auto; padding: 48px 20px 72px; }
.packages__title { font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 20px; }
.packages__empty { color: var(--ink-muted); }
.package-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.package-card__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.package-card__link:hover { border-color: var(--brand); box-shadow: var(--shadow); color: var(--ink); }
.package-card__top { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.package-card__name { font: 600 0.95rem/1.3 var(--mono); color: var(--brand); white-space: nowrap; }
.package-card__title { font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.package-card__summary { color: var(--ink-muted); font-size: 0.95rem; }
.package-card__based { margin-top: auto; padding-top: 8px; font-size: 0.85rem; color: var(--ink-muted); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  color: var(--ink-muted);
  background: var(--canvas);
}
.badge--stable { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge--beta, .badge--alpha { color: var(--brand); background: var(--brand-soft); border-color: transparent; }
.badge--unreleased { background: var(--note); border-color: transparent; color: var(--ink); }

/* Docs layout: nav · content · on this page */
.docs {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 220px;
  gap: 40px;
  align-items: start;
}
.docs-nav {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 28px 0;
}
.docs-nav__summary {
  list-style: none;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 10px;
  cursor: default;
}
@media (width > 860px) { .docs-nav__summary { pointer-events: none; } }
.docs-nav__summary::-webkit-details-marker { display: none; }
.docs-nav__list { list-style: none; margin: 0; padding: 0; }
.docs-nav__list a {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.95rem;
  line-height: 1.35;
}
.docs-nav__list a:hover { color: var(--ink); background: var(--canvas-deep); }
.docs-nav__list a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); font-weight: 600; }

.docs-main { padding: 28px 0 72px; min-width: 0; }
.crumbs { font-size: 0.85rem; color: var(--ink-muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.crumbs li { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.crumbs li + li::before { content: "/"; content: "/" / ""; }
.crumbs a { padding: 4px 0; color: var(--ink-muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.crumbs [aria-current] { color: var(--ink); }

.pkg-head {
  max-width: 780px;
  padding: 12px 16px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}
.pkg-head__eyebrow { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.pkg-head__eyebrow a { font: 600 0.95rem/1.3 var(--mono); text-decoration: none; }
.pkg-facts { margin: 0; display: grid; gap: 10px; font-size: 0.92rem; }
.pkg-facts > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.pkg-facts dt { color: var(--ink-muted); font-weight: 600; }
.pkg-facts dd { margin: 0; }
.pkg-facts code { white-space: nowrap; }
.doc-title { font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 18px; font-weight: 600; }
.credits { margin: 0; padding-left: 1.1em; }
.credits li + li { margin-top: 4px; }
.pkg-head__trust, .pkg-head__facts-link { margin: 6px 0 0; font-size: 0.88rem; color: var(--ink-muted); }

/* Prose */
.prose { max-width: 780px; }
.prose h1, .page h1 { font-size: clamp(1.8rem, 3.4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 20px; font-weight: 600; }
.prose h2 { font-size: 1.45rem; letter-spacing: -0.02em; margin: 1.9em 0 0.6em; padding-top: 0.4em; border-top: 1px solid var(--line); line-height: 1.25; font-weight: 600; }
.prose > h2:first-child, .prose > h1 + h2 { border-top: 0; padding-top: 0; }
.prose h3 { font-size: 1.15rem; margin: 1.8em 0 0.5em; line-height: 1.3; font-weight: 600; }
.prose h4 { font-size: 1rem; margin: 1.5em 0 0.4em; font-weight: 600; }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose li + li { margin-top: 0.3em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 3px solid var(--brand); color: var(--ink-muted); background: var(--paper); border-radius: 0 8px 8px 0; }
/* Inline code, wherever it appears: prose, tables, headings, package facts */
.prose :not(pre) > code, .pkg-hero :not(pre) > code, .feature :not(pre) > code, .pkg-facts code, .pkg-credits__facts code, .catalogue code, .pkg-parity code, .doc-foot__source code {
  font-family: var(--mono);
  font-size: 0.84em;
  font-weight: 400;
  line-height: 1.4;
  color: var(--inline-code-ink);
  padding: 0.08em 0.36em;
  border: 1px solid var(--inline-code-line);
  border-radius: 5px;
  background: var(--inline-code-bg);
  overflow-wrap: break-word;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  font-variant-ligatures: none;
}
.prose :is(h1, h2, h3, h4) code { font-size: 0.86em; font-weight: 600; }
.prose pre {
  margin: 0 0 1.2em;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background-color: var(--code-bg) !important;
  overflow-x: auto;
  font: 0.84rem/1.6 var(--mono);
  font-variant-ligatures: none;
  tab-size: 4;
}
.prose pre code { font: inherit; background: none; padding: 0; }
.giallo-l { display: inline-block; min-height: 1lh; width: 100%; }
.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 1.2em;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.prose th, .prose td { padding: 8px 12px; border: 1px solid var(--line); vertical-align: top; text-align: left; font-variant-numeric: tabular-nums; }
/* Code in table cells: one line (the table scrolls), and a lighter chip so rows stay compact */
.prose table :not(pre) > code { white-space: nowrap; padding: 0.04em 0.3em; }
.prose table :not(a, pre) > code { border-color: transparent; }
.prose th { background: var(--canvas-deep); font-weight: 600; }
.prose td { background: var(--paper); }
a:has(> code:only-child) { text-decoration: none; }
:is(.prose, .pkg-hero, .feature, .pkg-facts, .pkg-credits__facts, .catalogue, .pkg-parity, .doc-foot__source) a > code {
  color: var(--brand);
  border-color: var(--brand);
  border-color: color-mix(in srgb, var(--control-line) 55%, var(--brand));
}
:is(.prose, .pkg-hero, .feature, .pkg-facts, .pkg-credits__facts, .catalogue, .pkg-parity, .doc-foot__source) a:hover > code { background: var(--brand-soft); border-color: var(--brand); }
.prose .footnote-definition { font-size: 0.9rem; color: var(--ink-muted); }

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink-muted);
  font: 600 0.75rem/1.4 var(--font);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.code-wrap { position: relative; margin-bottom: 1.2em; }
.prose .code-wrap > pre { margin: 0; }
.code-wrap:hover .copy-button, .copy-button:focus-visible { opacity: 1; }
@media (hover: none) {
  .copy-button { opacity: 1; min-height: 36px; }
  .prose .code-wrap > pre { padding-top: 52px; }
}

.doc-foot { max-width: 780px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.doc-foot__source { font-size: 0.88rem; color: var(--ink-muted); margin: 0 0 20px; }
.pager { display: flex; gap: 12px; justify-content: space-between; }
.pager a {
  display: flex;
  flex-direction: column;
  flex: 1;
  max-width: 50%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  text-decoration: none;
  font-weight: 600;
}
.pager a:hover { border-color: var(--brand); }
.pager span { font-size: 0.8rem; font-weight: 400; color: var(--ink-muted); }
.pager__next { margin-left: auto; text-align: right; }

.toc { position: sticky; top: var(--header-h); max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 28px 0; font-size: 0.88rem; }
.toc__title { margin: 0 0 8px; font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 12px; }
.toc a { display: block; padding: 3px 0 3px 8px; border-left: 2px solid transparent; color: var(--ink-muted); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc a[aria-current="true"] { color: var(--brand); }
.toc a[aria-current="true"] { border-color: var(--brand); font-weight: 600; }

/* Plain pages */
.page { max-width: 780px; margin: 0 auto; padding: 48px 20px 72px; }

/* Bowerbird Cloud slot (off until approved) */
.bowerbird-cta { border-top: 1px solid var(--line); background: var(--paper); }
.bowerbird-cta__inner { max-width: 960px; margin: 0 auto; padding: 32px 20px; display: grid; gap: 6px; }
.bowerbird-cta__heading { margin: 0; font-weight: 600; font-size: 1.1rem; }
.bowerbird-cta__text { margin: 0; color: var(--ink-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--canvas-deep); font-size: 0.9rem; color: var(--ink-muted); }
.site-footer__inner { max-width: 1360px; margin: 0 auto; padding: 28px 20px 36px; }
.site-footer p { margin: 0 0 10px; max-width: 80ch; }
.site-footer .disclaimer strong { color: var(--ink); }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer__links a { color: var(--ink-muted); }

/* Search */
.search {
  width: min(640px, calc(100vw - 24px));
  max-height: min(70vh, 640px);
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.search[open] { display: flex; flex-direction: column; }
.search::backdrop { background: rgb(14 22 28 / 0.45); }
.search__form { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--ink-muted); }
.search__form:focus-within { box-shadow: inset 0 -2px 0 var(--brand); }
.search__input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; font-size: 1.05rem; outline: none; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__close { border: 1px solid var(--control-line); border-radius: 6px; background: var(--canvas); color: var(--ink-muted); font: 600 0.75rem/1 var(--font); padding: 5px 7px; cursor: pointer; }
.search__status { margin: 0; padding: 8px 16px 0; font-size: 0.85rem; color: var(--ink-muted); }
.search__status:empty { display: none; }
.search__results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search__results a { display: block; padding: 10px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; }
.search__results a:hover, .search__results a[data-selected] { background: var(--brand-soft); }
.search__results a[data-selected] { box-shadow: inset 3px 0 0 var(--brand); }
.search__result-meta { display: block; font: 600 0.78rem/1.3 var(--mono); color: var(--brand); margin-bottom: 2px; }
.search__result-title { display: block; font-weight: 600; }
.search__result-excerpt { display: block; font-size: 0.88rem; color: var(--ink-muted); margin-top: 2px; }
.search__results mark { color: var(--ink); background: var(--mark); border-radius: 3px; padding: 0 2px; }

/* Responsive */
@media (max-width: 1180px) {
  .docs { grid-template-columns: 220px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .site-nav { display: none; }
  .site-menu { display: block; }
  .search-button { min-width: 0; }
  .search-button kbd, .search-button__label { display: none; }
  .search-button, .theme-button, .site-menu__toggle { width: 44px; height: 44px; justify-content: center; padding: 0; }
  .site-header__inner { padding: 0 16px; gap: 12px; }
  .docs { display: block; padding: 0 16px; }
  .docs-nav { position: static; max-height: none; padding: 16px 0 0; overflow: visible; }
  .docs-nav__details { border: 1px solid var(--control-line); border-radius: var(--radius); background: var(--paper); }
  .docs-nav__summary { margin: 0; padding: 12px 14px; cursor: pointer; display: flex; justify-content: space-between; text-transform: none; letter-spacing: 0; font-size: 0.95rem; color: var(--ink); }
  .docs-nav__summary::after { content: "▾"; color: var(--ink-muted); }
  .docs-nav__details[open] .docs-nav__summary::after { content: "▴"; }
  .docs-nav__list { padding: 0 6px 8px; }
  .docs-nav__list a { display: flex; align-items: center; min-height: 44px; }
  .docs-main { padding-top: 16px; }
  .pkg-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .pkg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__inner { padding: 48px 16px 40px; }
  .packages { padding: 36px 16px 56px; }
  .page { padding: 32px 16px 56px; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .pager__next { margin-left: 0; text-align: left; }
  .pkg-links a { display: inline-block; padding: 8px 0; }
  .search__close { min-width: 44px; min-height: 44px; }
  .site-footer__inner { padding: 24px 16px 32px; }
  .site-footer__links { gap: 10px 18px; }
  .site-footer__links a { padding: 4px 0; }
}
@media (max-width: 420px) {
  .brand { flex-shrink: 0; gap: 6px; font-size: 0.98rem; }
  .brand__bird { width: 26px; height: 26px; }
}
@media (max-width: 385px) {
  .brand__text { display: grid; line-height: 1.1; }
}
@media (max-width: 340px) {
  .brand__sub { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.search__result-excerpt { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Package home (landing) */
.pkg-hero { background: var(--paper); border-bottom: 1px solid var(--line); }
.pkg-hero__inner { max-width: 960px; margin: 0 auto; padding: 64px 20px 52px; }
.pkg-hero__eyebrow { margin: 0 0 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--ink-muted); font-weight: 600; font-size: 0.9rem; }
.pkg-hero__name { margin: 0; font: 600 clamp(1.9rem, 4.6vw, 3rem)/1.1 var(--mono); letter-spacing: -0.03em; color: var(--ink); overflow-wrap: anywhere; }
.pkg-hero__tagline { margin: 14px 0 0; font-size: clamp(1.25rem, 2.6vw, 1.6rem); line-height: 1.3; letter-spacing: -0.02em; font-weight: 600; max-width: 32ch; }
.pkg-hero__lead { margin: 16px 0 0; font-size: 1.1rem; color: var(--ink-muted); max-width: 62ch; }
.pkg-hero__actions { margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pkg-hero__install { margin-top: 20px; max-width: 760px; }
.pkg-hero__install pre, .pkg-hero__install .code-wrap { margin: 0; }
/* The one-line install command: the copy button sits beside the code, never over it */
.pkg-hero__install .code-wrap { display: flex; align-items: center; gap: 8px; }
.prose.pkg-hero__install .code-wrap > pre { flex: 1; min-width: 0; padding: 14px 16px; }
.pkg-hero__install .copy-button { position: static; opacity: 1; flex: none; }
.pkg-hero :not(pre) > code { white-space: nowrap; }
.pkg-hero__note { margin: 18px 0 0; font-size: 0.95rem; color: var(--ink-muted); }
/* Package facts, read from the package's files at the pinned commit */
.pkg-hero__facts { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.pkg-stats { margin: 0; display: grid; gap: 16px 28px; grid-template-columns: repeat(auto-fit, minmax(150px, max-content)); }
.pkg-stats dt { margin: 0 0 2px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); }
.pkg-stats dd { margin: 0; font-size: 0.98rem; }
.pkg-links { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.95rem; }
.button {
  display: inline-flex; align-items: center; height: 42px; padding: 0 18px; border-radius: 9px;
  border: 1px solid var(--control-line); background: var(--canvas); color: var(--ink);
  font-weight: 600; text-decoration: none;
}
.button:hover { border-color: var(--brand); color: var(--ink); }
.button--primary { background: var(--brand); border-color: var(--brand); color: var(--paper); }
.button--primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--paper); }
.pkg-features, .pkg-parity, .pkg-examples, .pkg-docs { max-width: 960px; margin: 0 auto; padding: 48px 20px 0; }
.feature-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); }
.feature { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.feature__title { margin: 0 0 6px; font-size: 1.05rem; letter-spacing: -0.01em; }
.feature__text { margin: 0; color: var(--ink-muted); font-size: 0.95rem; }
.pkg-section__title { margin: 0 0 18px; font-size: 1.35rem; letter-spacing: -0.02em; }
.pkg-examples__body { max-width: none; }
.pkg-examples__body h3 { margin: 1.6em 0 0.5em; font-size: 1.1rem; }
.pkg-examples__body h3:first-child { margin-top: 0; }
.pkg-credits { margin-top: 56px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); }
.pkg-credits__inner { max-width: 960px; margin: 0 auto; padding: 40px 20px; }
.credits--large li + li { margin-top: 8px; }
.pkg-credits__facts { margin: 18px 0 0; font-size: 0.92rem; color: var(--ink-muted); }
.pkg-head__eco { font-size: 0.9rem; color: var(--ink-muted); }
.pkg-credits__trust { margin: 8px 0 0; font-size: 0.92rem; color: var(--ink-muted); }
.pkg-docs { padding-bottom: 72px; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.doc-list a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); text-decoration: none; }
.doc-list a:hover { border-color: var(--brand); }
.doc-list__title { font-weight: 600; }
.doc-list__text { color: var(--ink-muted); font-size: 0.88rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.packages__group { margin: 28px 0 12px; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-muted); }
.packages__group:first-of-type { margin-top: 0; }
.docs-nav__home { font-weight: 600; color: var(--ink) !important; }
@media (max-width: 860px) {
  .pkg-hero__inner { padding: 40px 16px 36px; }
  .pkg-features, .pkg-parity, .pkg-examples, .pkg-docs { padding: 36px 16px 0; }
  .pkg-docs { padding-bottom: 56px; }
  .pkg-credits__inner { padding: 32px 16px; }
}
/* giallo writes `color-scheme: light dark` on each block, which would make its light-dark() colours follow the
   system setting instead of the theme toggle. Code follows the page's scheme. */
pre.giallo { color-scheme: inherit !important; }

.pkg-parity { overflow-wrap: break-word; }
.pkg-parity .pkg-stats { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 20px; }
@media (max-width: 860px) {
  .pkg-parity .pkg-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 420px) {
  .pkg-parity .pkg-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.catalogue-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(to right, var(--paper) 30%, transparent) left center / 28px 100%,
    linear-gradient(to left, var(--paper) 30%, transparent) right center / 28px 100%,
    radial-gradient(farthest-side at left center, var(--scroll-shadow), transparent) left center / 12px 100%,
    radial-gradient(farthest-side at right center, var(--scroll-shadow), transparent) right center / 12px 100%
    var(--paper);
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
}
.catalogue { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.catalogue th, .catalogue td { padding: 10px 12px; text-align: left; vertical-align: top; }
.catalogue thead { background: color-mix(in srgb, var(--canvas) 70%, transparent); }
.catalogue thead th { white-space: nowrap; }
.catalogue tbody tr { border-top: 1px solid var(--line); }
.catalogue time, .catalogue th[scope="row"] a { white-space: nowrap; }
.parity-coverage { margin: 18px 0; }
.parity-coverage summary { cursor: pointer; font-weight: 600; padding: 10px 0; }
.parity-coverage ul { max-height: 24rem; overflow-y: auto; border-top: 1px solid var(--line); padding: 10px 8px 0 20px; }
.parity-coverage li + li, .parity-differences div + div { margin-top: 8px; }
.parity-differences { margin: 8px 0 0; }
.parity-differences dt { font-weight: 600; }
.parity-differences dt code { font-size: 0.84em; }
.parity-differences dd { margin: 2px 0 0; color: var(--ink-muted); }
