/*
 * The documentation site's whole stylesheet.
 *
 * The accent is NativePHP's own: the two colours in upstream's application icon are a slate
 * blue (#54608D) and a teal (#4CABAD), taken straight from resources/build/icon.png rather
 * than guessed at. The teal is darkened to #0f7378 in light mode, where the brand value only
 * reaches 2.71:1 against white — below the 4.5:1 that body-sized link text needs — and used
 * as-is in dark mode, where it clears 7:1. The logo carries both colours unaltered.
 *
 * No external requests: system fonts, an inline SVG favicon, no CDN. A documentation site
 * that cannot render offline renders differently for whoever is behind a corporate proxy,
 * and this one gets read while something is broken.
 *
 * Three theme states. Tokens are defined for light on :root, redefined for dark under
 * prefers-color-scheme (guarded so an explicit light choice wins), and redefined again under
 * [data-theme="dark"] so the toggle wins in both directions. No colour is ever declared only
 * inside a media query — a page always has a complete palette.
 */

:root {
    --bg: #ffffff;
    --bg-alt: #f8f8fb;
    --bg-raised: #ffffff;
    --line: #e6e6ec;
    --line-strong: #d3d3de;
    --ink: #16161d;
    --ink-soft: #55555f;
    --ink-faint: #8b8b96;
    --accent: #0f7378;
    --accent-ink: #0e6a6f;
    --accent-wash: #eaf5f5;
    --code-bg: #f7f7fb;
    --mark: #fde68a;
    --shadow-sm: 0 1px 2px rgb(16 16 32 / 5%);
    --shadow: 0 4px 6px -2px rgb(16 16 32 / 6%), 0 12px 28px -12px rgb(16 16 32 / 14%);

    /* Syntax: one hue family, differing in weight and saturation, so code reads as text
       with structure rather than as a colour chart. */
    --syn-key: #6b4bc4;
    --syn-str: #0a7c5a;
    --syn-num: #b3541e;
    --syn-fn: #3b4f8f;
    --syn-cmt: #8b8b96;
    --syn-var: #a63a5f;

    --sidebar-w: 16.5rem;
    --toc-w: 14rem;
    --measure: 44rem;
    --radius: 10px;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0d0e12;
        --bg-alt: #12131a;
        --bg-raised: #16171f;
        --line: #23252f;
        --line-strong: #333644;
        --ink: #e8e8ef;
        --ink-soft: #a2a3b0;
        --ink-faint: #71727d;
        --accent: #4CABAD;
        --accent-ink: #6fd0d1;
        --accent-wash: #101f22;
        --code-bg: #11121a;
        --mark: #6b5a1f;
        --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
        --shadow: 0 4px 8px -2px rgb(0 0 0 / 45%), 0 16px 40px -20px rgb(0 0 0 / 70%);

        --syn-key: #b9a6f0;
        --syn-str: #7ee2b8;
        --syn-num: #f0a875;
        --syn-fn: #93a8e4;
        --syn-cmt: #6f707b;
        --syn-var: #f2879b;
    }
}

:root[data-theme="dark"] {
    --bg: #0d0e12;
    --bg-alt: #12131a;
    --bg-raised: #16171f;
    --line: #23252f;
    --line-strong: #333644;
    --ink: #e8e8ef;
    --ink-soft: #a2a3b0;
    --ink-faint: #71727d;
    --accent: #4CABAD;
    --accent-ink: #6fd0d1;
    --accent-wash: #101f22;
    --code-bg: #11121a;
    --mark: #6b5a1f;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow: 0 4px 8px -2px rgb(0 0 0 / 45%), 0 16px 40px -20px rgb(0 0 0 / 70%);

    --syn-key: #b9a6f0;
    --syn-str: #7ee2b8;
    --syn-num: #f0a875;
    --syn-fn: #93a8e4;
    --syn-cmt: #6f707b;
    --syn-var: #f2879b;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
}

body {
    margin: 0;
    /* The top bar is the one row that can be pushed wider than the viewport by its own
       controls; below 820px they shrink instead, and this is the backstop so a phone never
       gets a horizontal scrollbar on the whole document. */
    overflow-x: hidden;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.sr,
.skip {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.skip:focus {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 60;
    width: auto;
    height: auto;
    clip-path: none;
    padding: 0.5rem 0.85rem;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
}

a {
    color: var(--accent-ink);
}

/* ── Top bar ────────────────────────────────────── */

.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 3.5rem;
    padding: 0 clamp(0.75rem, 2vw, 1.5rem);
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(180%) blur(12px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.logo {
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 7px;
    background: linear-gradient(145deg, #54608D, #3B475E 55%, #4CABAD);
    box-shadow: var(--shadow-sm);
}

.brand-name span {
    color: var(--ink-faint);
    font-weight: 500;
}

.actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    min-width: 0;
}

.search {
    position: relative;
    min-width: 0;
    flex: 0 1 auto;
}

.search input {
    width: clamp(6rem, 26vw, 20rem);
    min-width: 0;
    padding: 0.42rem 2rem 0.42rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
}

.search input::placeholder {
    color: var(--ink-faint);
}

.search input:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
    outline-offset: 1px;
    border-color: var(--accent);
}

.search kbd {
    position: absolute;
    top: 50%;
    right: 0.45rem;
    transform: translateY(-50%);
    padding: 0.05rem 0.32rem;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: var(--bg);
    color: var(--ink-faint);
    font-family: var(--mono);
    font-size: 0.7rem;
    pointer-events: none;
}

.search input:focus + kbd {
    display: none;
}

.search-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    z-index: 50;
    width: min(30rem, 88vw);
    max-height: 26rem;
    overflow-y: auto;
    padding: 0.4rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-raised);
    box-shadow: var(--shadow);
}

.hit {
    display: block;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--ink);
}

.hit:hover,
.hit.active {
    background: var(--accent-wash);
}

.hit-title {
    display: block;
    font-size: 0.88rem;
    font-weight: 580;
}

.hit-sub {
    color: var(--accent-ink);
    font-weight: 500;
}

.hit-text {
    display: block;
    color: var(--ink-soft);
    font-size: 0.79rem;
    line-height: 1.5;
}

.hit-text mark {
    background: var(--mark);
    color: inherit;
    border-radius: 2px;
}

.search-empty {
    margin: 0;
    padding: 0.7rem;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.icon-button {
    display: grid;
    place-items: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg-alt);
    color: var(--ink-soft);
    font: inherit;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
}

.icon-button:hover {
    border-color: var(--accent);
    color: var(--accent-ink);
}

.burger {
    display: none;
    flex-direction: column;
    gap: 3px;
    width: 2rem;
    height: 2rem;
    padding: 0.45rem;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--bg-alt);
    cursor: pointer;
}

.burger span {
    display: block;
    height: 2px;
    border-radius: 1px;
    background: var(--ink);
}

/* ── Shell ──────────────────────────────────────── */

.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
    gap: 0 clamp(1.5rem, 3vw, 3rem);
    max-width: 96rem;
    margin: 0 auto;
    padding: 0 clamp(0.9rem, 2vw, 1.5rem);
}

.sidebar {
    position: sticky;
    top: 3.5rem;
    align-self: start;
    max-height: calc(100vh - 3.5rem);
    overflow-y: auto;
    padding: 1.75rem 0.5rem 2rem 0;
    scrollbar-width: thin;
}

main {
    min-width: 0;
    padding: 2.5rem 0 4rem;
}

.prose {
    max-width: var(--measure);
}

/* ── Sidebar navigation ─────────────────────────── */

.nav-group {
    margin: 1.4rem 0 0.4rem;
    padding: 0.75rem 0.6rem 0;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.nav-group:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.nav-item {
    display: block;
    padding: 0.34rem 0.6rem;
    border-radius: 7px;
    text-decoration: none;
    border-left: 2px solid transparent;
}

.nav-item:hover {
    background: var(--bg-alt);
}

.nav-item.active {
    background: var(--accent-wash);
    border-left-color: var(--accent);
}

.nav-name {
    display: block;
    color: var(--ink-soft);
    font-size: 0.865rem;
    font-weight: 520;
    line-height: 1.4;
}

.nav-item:hover .nav-name {
    color: var(--ink);
}

.nav-item.active .nav-name {
    color: var(--accent-ink);
    font-weight: 600;
}

.nav-hint {
    display: none;
    color: var(--ink-faint);
    font-size: 0.74rem;
    line-height: 1.4;
}

.nav-item.active .nav-hint {
    display: block;
}

.sidebar-note {
    margin: 1.5rem 0.6rem 0;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 0.73rem;
    line-height: 1.55;
}

/* ── On this page ───────────────────────────────── */

.toc {
    position: sticky;
    top: 4.5rem;
    align-self: start;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    margin-top: 2.75rem;
    padding-left: 0.9rem;
    border-left: 1px solid var(--line);
    font-size: 0.79rem;
    scrollbar-width: thin;
}

.toc-head {
    margin: 0 0 0.5rem;
    color: var(--ink-faint);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.toc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.toc li.lvl3 {
    padding-left: 0.8rem;
}

.toc a {
    display: block;
    padding: 0.18rem 0;
    color: var(--ink-soft);
    text-decoration: none;
    line-height: 1.45;
}

.toc a:hover {
    color: var(--accent-ink);
}

.toc a.current {
    color: var(--accent-ink);
    font-weight: 560;
}

/* ── Prose ──────────────────────────────────────── */

.prose > :first-child {
    margin-top: 0;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
    color: var(--ink);
    letter-spacing: -0.021em;
    line-height: 1.25;
    scroll-margin-top: 4.5rem;
}

/* The anchor wraps the heading text, so it has to beat `.prose a` — which is exactly the
   bug the first version of this site shipped: every heading rendered in link colour. */
.prose h1 > .anchor,
.prose h2 > .anchor,
.prose h3 > .anchor,
.prose h4 > .anchor {
    color: inherit;
    text-decoration: none;
}

.prose .anchor:hover::after {
    content: "#";
    margin-left: 0.35rem;
    color: var(--ink-faint);
    font-weight: 400;
}

.prose h1 {
    margin: 0 0 1.25rem;
    font-size: clamp(1.75rem, 3.6vw, 2.15rem);
    letter-spacing: -0.03em;
}

.prose h2 {
    margin: 2.75rem 0 0.9rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.32rem;
}

.prose h3 {
    margin: 2rem 0 0.6rem;
    font-size: 1.06rem;
}

.prose h4 {
    margin: 1.5rem 0 0.4rem;
    font-size: 0.95rem;
    color: var(--ink-soft);
}

.prose p {
    margin: 0 0 1rem;
}

.prose a {
    text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent);
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.prose a:hover {
    text-decoration-color: var(--accent);
}

.prose strong {
    font-weight: 620;
}

.prose ul,
.prose ol {
    margin: 0 0 1.1rem;
    padding-left: 1.25rem;
}

.prose li {
    margin: 0.3rem 0;
}

.prose li > ul,
.prose li > ol {
    margin: 0.3rem 0 0.45rem;
}

.prose hr {
    margin: 2.5rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.prose blockquote {
    margin: 1.35rem 0;
    padding: 0.1rem 0 0.1rem 1rem;
    border-left: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
    color: var(--ink-soft);
}

.prose blockquote > :last-child {
    margin-bottom: 0;
}

.prose img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.callout {
    margin: 2rem 0 0;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    background: var(--bg-alt);
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.callout strong {
    color: var(--ink);
}

/* ── Code ───────────────────────────────────────── */

code,
kbd,
samp {
    font-family: var(--mono);
    font-size: 0.875em;
}

.prose :not(pre) > code {
    padding: 0.1em 0.34em;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--code-bg);
    color: var(--ink);
    white-space: nowrap;
}

.code {
    position: relative;
    margin: 0 0 1.35rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--code-bg);
    overflow: hidden;
}

.code figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.45rem 0.3rem 0.85rem;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg-alt) 70%, transparent);
}

.code-lang {
    color: var(--ink-faint);
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.code .copy {
    padding: 0.15rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-faint);
    font: inherit;
    font-size: 0.72rem;
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
}

.code:hover .copy,
.code .copy:focus-visible {
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.code .copy:hover {
    border-color: var(--accent);
    color: var(--accent-ink);
}

.code .copy.done {
    border-color: var(--accent);
    color: var(--accent-ink);
}

.code pre {
    margin: 0;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    font-size: 0.83rem;
    line-height: 1.62;
    tab-size: 4;
}

.code pre code {
    color: var(--ink);
    white-space: pre;
}

/* highlight.js token classes, mapped onto the palette above. */
.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-doctag,
.hljs-meta .hljs-keyword {
    color: var(--syn-key);
}

.hljs-string,
.hljs-symbol,
.hljs-bullet,
.hljs-addition,
.hljs-attribute {
    color: var(--syn-str);
}

.hljs-number,
.hljs-quote,
.hljs-selector-class,
.hljs-type {
    color: var(--syn-num);
}

.hljs-title,
.hljs-title.function_,
.hljs-title.class_,
.hljs-name,
.hljs-built_in {
    color: var(--syn-fn);
}

.hljs-comment,
.hljs-meta {
    color: var(--syn-cmt);
    font-style: italic;
}

.hljs-variable,
.hljs-template-variable,
.hljs-params,
.hljs-attr,
.hljs-selector-attr {
    color: var(--syn-var);
}

.hljs-emphasis {
    font-style: italic;
}

.hljs-strong {
    font-weight: 600;
}

/* ── Tables ─────────────────────────────────────── */

.table-scroll {
    margin: 0 0 1.4rem;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-raised);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.865rem;
}

th {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--line-strong);
    background: var(--bg-alt);
    text-align: left;
    color: var(--ink-soft);
    font-size: 0.69rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    line-height: 1.55;
}

tr:last-child td {
    border-bottom: 0;
}

/* A headerless table is layout, not data: the first column carries the label. */
table.plain td:first-child {
    color: var(--ink);
    font-weight: 560;
    width: 30%;
}

td code {
    white-space: normal;
}

table.plain td:first-child code,
th code {
    white-space: nowrap;
}

/* ── Landing page ───────────────────────────────── */

.hero {
    position: relative;
    padding: 1.5rem 0 0;
}

.hero::before {
    content: "";
    position: absolute;
    top: -7rem;
    left: -12rem;
    z-index: -1;
    width: 44rem;
    height: 26rem;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 16%, transparent), transparent);
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 0.6rem;
    color: var(--accent-ink);
    font-size: 0.7rem;
    font-weight: 660;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.hero-title {
    margin: 0 0 0.85rem;
    max-width: 34ch;
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.hero-lede {
    margin: 0;
    max-width: 46rem;
    color: var(--ink-soft);
    font-size: 1.06rem;
    line-height: 1.62;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 1.6rem 0 0;
}

.button {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 570;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.button:hover {
    filter: brightness(1.07);
}

.button.ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
}

.button.ghost:hover {
    border-color: var(--accent);
    color: var(--accent-ink);
    filter: none;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 0.85rem;
    margin: 2.75rem 0 0;
    max-width: var(--measure);
}

.card {
    display: block;
    padding: 1.1rem 1.15rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-raised);
    text-decoration: none;
    color: var(--ink);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.14s ease, transform 0.14s ease;
}

.card:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    transform: translateY(-1px);
}

.card h3 {
    margin: 0 0 0.4rem;
    font-size: 0.98rem;
    letter-spacing: -0.015em;
}

.card p {
    margin: 0 0 0.65rem;
    color: var(--ink-soft);
    font-size: 0.855rem;
    line-height: 1.55;
}

.card .more {
    color: var(--accent-ink);
    font-size: 0.8rem;
    font-weight: 560;
}

.quickstart {
    max-width: var(--measure);
    margin: 2.5rem 0 0;
}

.quickstart-head {
    margin: 0 0 0.5rem;
    color: var(--ink-faint);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

/* ── Pager and footer ───────────────────────────── */

.pager {
    display: flex;
    justify-content: space-between;
    gap: 0.85rem;
    max-width: var(--measure);
    margin: 3.5rem 0 0;
}

.pager-link {
    display: block;
    flex: 0 1 auto;
    max-width: 47%;
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-decoration: none;
    background: var(--bg-raised);
}

.pager-link.next {
    text-align: right;
    margin-left: auto;
}

.pager-link:hover {
    border-color: var(--accent);
}

.pager-link span {
    display: block;
    color: var(--ink-faint);
    font-size: 0.72rem;
}

.pager-link strong {
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 570;
}

.footer {
    max-width: var(--measure);
    margin: 2.5rem 0 0;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
    color: var(--ink-faint);
    font-size: 0.79rem;
}

.footer a {
    color: var(--ink-soft);
    text-decoration: none;
}

.footer a:hover {
    color: var(--accent-ink);
}

.footer p {
    margin: 0.45rem 0 0;
}

/* ── Narrow ─────────────────────────────────────── */

@media (max-width: 1150px) {
    .shell {
        grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    }

    .toc,
    .toc-space {
        display: none;
    }
}

@media (max-width: 820px) {
    .burger {
        display: flex;
    }

    .shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .sidebar {
        position: fixed;
        inset: 3.5rem 0 auto;
        z-index: 30;
        max-height: calc(100vh - 3.5rem);
        padding: 1rem 1.25rem 1.5rem;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
        box-shadow: var(--shadow);
        display: none;
    }

    .sidebar.open {
        display: block;
    }

    .nav-hint {
        display: none;
    }

    .brand-name span {
        display: none;
    }

    .search input {
        width: 100%;
    }

    .search {
        flex: 1 1 auto;
    }

    /* The repository link is the first thing to go: it is in the footer of every page. */
    .icon-button.gh {
        display: none;
    }

    main {
        padding-top: 1.75rem;
    }
}

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

    * {
        transition: none !important;
    }
}

@media print {
    .topbar,
    .sidebar,
    .toc,
    .pager,
    .copy {
        display: none;
    }

    .shell {
        display: block;
    }
}

/* ── Everything here (the landing page's index) ─── */

.everything {
    max-width: var(--measure);
    margin: 3.5rem 0 0;
}

.everything-head {
    margin: 0 0 0.25rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.3rem;
    letter-spacing: -0.02em;
}

.group {
    margin: 1.75rem 0 0;
}

.group h2 {
    margin: 0 0 0.6rem;
    color: var(--ink-faint);
    font-size: 0.7rem;
    font-weight: 650;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.group-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.5rem;
}

.tile {
    display: block;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--bg-raised);
    text-decoration: none;
}

.tile:hover {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: var(--accent-wash);
}

.tile strong {
    display: block;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 580;
}

.tile span {
    display: block;
    color: var(--ink-faint);
    font-size: 0.78rem;
    line-height: 1.45;
}
