/* ============================================================
   Wire Docs — modern documentation theme
   Light + dark, sticky chrome, refined typography.
   ============================================================ */

:root {
    color-scheme: light;

    --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

    /* Brand */
    --primary: #f59e0b;
    --primary-strong: #d97706;
    --primary-contrast: #1c1206;

    /* Light surfaces */
    --bg: #fbfbfc;
    --bg-grid: rgba(15, 23, 42, 0.025);
    --surface: #ffffff;
    --surface-2: #f6f7f9;
    --surface-3: #f1f2f4;

    --text: #18181b;
    --text-muted: #52525b;
    --text-soft: #71717a;
    --text-faint: #a1a1aa;

    --border: #ebebef;
    --border-strong: #dededf;

    --primary-soft: rgba(245, 158, 11, 0.12);
    --primary-ring: rgba(245, 158, 11, 0.32);

    --info: #2563eb;
    --info-soft: rgba(37, 99, 235, 0.1);
    --warning: #d97706;
    --warning-soft: rgba(217, 119, 6, 0.12);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.1);
    --success: #16a34a;
    --success-soft: rgba(22, 163, 74, 0.1);

    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow: 0 12px 32px -12px rgba(15, 23, 42, 0.18);
    --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, 0.28);

    --radius-xl: 20px;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;

    --sidebar-w: 290px;
    --toc-w: 240px;
    --header-h: 64px;
    --content-max: 900px;
    /* Readable line length for prose. Code blocks intentionally run wider than
       this (the full content column) so examples get room and highlighted
       lines read clearly — see "Focus Your Reader's Attention". */
    --prose-measure: 740px;

    /* Code surface stays dark in both themes */
    --code-bg: #18181b;
    --code-border: rgba(255, 255, 255, 0.08);
    --code-text: #e4e4e7;
}

[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0b0b0d;
    --bg-grid: rgba(255, 255, 255, 0.02);
    --surface: #131316;
    --surface-2: #18181b;
    --surface-3: #1f1f23;

    --text: #f4f4f5;
    --text-muted: #a1a1aa;
    --text-soft: #8b8b93;
    --text-faint: #6b6b73;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --primary-soft: rgba(245, 158, 11, 0.16);
    --primary-ring: rgba(245, 158, 11, 0.36);

    --info-soft: rgba(96, 165, 250, 0.14);
    --warning-soft: rgba(245, 158, 11, 0.16);
    --danger-soft: rgba(248, 113, 113, 0.14);
    --success-soft: rgba(74, 222, 128, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);

    --code-bg: #09090b;
    --code-border: rgba(255, 255, 255, 0.06);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--bg);
    background-image:
        linear-gradient(var(--bg-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

code,
pre {
    font-family: var(--font-mono);
}

::selection {
    background: var(--primary-soft);
}

/* Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-faint); background-clip: content-box; }

/* ============================================================
   Shell
   ============================================================ */

.site-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.site-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--header-h);
    padding: 16px 16px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(16px);
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: 9px;
    background: linear-gradient(140deg, var(--primary) 0%, var(--primary-strong) 100%);
    color: var(--primary-contrast);
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 14px -4px var(--primary-ring);
}

.brand-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}

.brand-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-strong);
    background: var(--primary-soft);
    padding: 3px 7px;
    border-radius: 6px;
    line-height: 1;
}

[data-theme="dark"] .brand-badge { color: var(--primary); }

.sidebar-nav {
    flex: 1;
    padding: 20px 14px 32px;
    display: grid;
    gap: 22px;
    align-content: start;
}

.nav-section > h2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 8px;
    padding: 6px 10px;
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    transition: color 120ms ease, background 120ms ease;
}

.nav-section > h2:hover { color: var(--text-muted); background: var(--surface-2); }
.nav-section > h2:focus-visible { outline: 2px solid var(--primary-ring); outline-offset: 2px; }

.nav-section-chevron {
    width: 9px;
    height: 9px;
    flex: none;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 160ms ease;
    opacity: 0.7;
    margin-bottom: 2px;
}

.nav-section.is-collapsed > h2 .nav-section-chevron { transform: rotate(-45deg); margin-bottom: -2px; }

.nav-section > ul {
    overflow: hidden;
    transition: none;
}

.nav-section.is-collapsed > ul { display: none; }

.nav-section ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 1px;
}

.nav-section a {
    position: relative;
    display: block;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    transition: background 130ms ease, color 130ms ease;
}

.nav-section a:hover {
    background: var(--surface-2);
    color: var(--text);
}

.nav-section a.is-active {
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-weight: 600;
}

[data-theme="dark"] .nav-section a.is-active {
    color: var(--primary);
}

.nav-section a.is-active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    border-radius: 0 3px 3px 0;
    background: var(--primary);
}

/* ---------- Main column ---------- */

.site-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    height: var(--header-h);
    padding: 0 28px;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    backdrop-filter: blur(16px);
}

.nav-toggle {
    display: none;
    width: 40px;
    height: 40px;
    flex: none;
    padding: 0;
    position: relative;
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-toggle span {
    position: absolute;
    left: 11px;
    right: 11px;
    height: 1.5px;
    background: var(--text);
    border-radius: 999px;
}
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 19px; }
.nav-toggle span:nth-child(3) { top: 24px; }

/* Search trigger */
.search-shell {
    position: relative;
    width: min(100%, 420px);
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 88px 0 38px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background:
        var(--surface)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E")
        no-repeat 12px center;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 130ms ease, box-shadow 130ms ease;
}

.search-input::placeholder { color: var(--text-soft); }

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.search-kbd {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    display: inline-flex;
    gap: 3px;
    pointer-events: none;
}

.search-kbd kbd {
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-soft);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    line-height: 1;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 60vh;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 40;
}

.search-results[hidden] { display: none; }

.search-result {
    display: block;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
}

.search-result:hover,
.search-result.is-active {
    background: var(--surface-2);
}

.search-result strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.search-result small {
    display: block;
    color: var(--text-soft);
    font-size: 12.5px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 130ms ease, color 130ms ease, border-color 130ms ease;
}

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

.icon-button svg { width: 18px; height: 18px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- Page body ---------- */

.page-body {
    flex: 1;
    width: 100%;
    margin: 0 auto;
    padding: 40px 28px 80px;
    max-width: calc(var(--content-max) + var(--toc-w) + 64px);
}

.content-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--toc-w);
    gap: 56px;
    align-items: start;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    font-size: 13px;
    color: var(--text-soft);
}

.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { color: var(--text-faint); }
.breadcrumb .current { color: var(--text-muted); }

/* Page hero (within article column) */
.page-hero { margin-bottom: 8px; }

.eyebrow {
    margin: 0 0 10px;
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

[data-theme="dark"] .eyebrow { color: var(--primary); }

.page-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.6rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.025em;
}

.page-hero .lead {
    margin: 14px 0 0;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1.6;
}

.hero-preview {
    margin: 28px 0 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface-2);
}

.hero-preview img {
    display: block;
    width: 100%;
    height: auto;
}

/* Preview gallery */
.preview-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 28px 0 0;
}

.preview-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.preview-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.preview-card a { display: block; }

.preview-card-image {
    margin: 0;
    aspect-ratio: 16 / 10;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
}

.preview-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.preview-card-copy { padding: 16px 18px; }
.preview-card-copy strong { display: block; font-size: 15px; font-weight: 600; }
.preview-card-copy p { margin: 6px 0 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.55; }

/* ============================================================
   Article typography
   ============================================================ */

.docs-article {
    min-width: 0;
    max-width: var(--content-max);
    font-size: 16px;
}

.docs-article > *:first-child { margin-top: 0; }

/* Keep prose at a comfortable measure while code blocks, tables, and other
   wide surfaces use the full (wider) content column. */
.docs-article > p,
.docs-article > ul,
.docs-article > ol,
.docs-article > dl,
.docs-article > blockquote,
.docs-article > h1,
.docs-article > h2,
.docs-article > h3,
.docs-article > h4 {
    max-width: var(--prose-measure);
}

.docs-article h2,
.docs-article h3,
.docs-article h4 {
    scroll-margin-top: calc(var(--header-h) + 24px);
    position: relative;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--text);
}

.docs-article h2 {
    margin: 48px 0 16px;
    padding-bottom: 8px;
    font-size: 1.6rem;
    border-bottom: 1px solid var(--border);
}

.docs-article h3 { margin: 32px 0 12px; font-size: 1.25rem; }
.docs-article h4 { margin: 26px 0 10px; font-size: 1.05rem; }

.heading-anchor {
    position: absolute;
    left: -1.2em;
    top: 0;
    width: 1.2em;
    opacity: 0;
    color: var(--text-faint);
    font-weight: 400;
    transition: opacity 120ms ease;
}

.docs-article h2:hover .heading-anchor,
.docs-article h3:hover .heading-anchor,
.docs-article h4:hover .heading-anchor { opacity: 1; }

.heading-anchor:hover { color: var(--primary-strong); }

.docs-article p {
    margin: 0 0 18px;
    color: var(--text-muted);
    line-height: 1.75;
}

.docs-article ul,
.docs-article ol {
    margin: 0 0 18px;
    padding-left: 24px;
    color: var(--text-muted);
}

.docs-article li { margin: 6px 0; line-height: 1.7; }
.docs-article li::marker { color: var(--text-faint); }

.docs-article strong { color: var(--text); font-weight: 650; }

.docs-article a {
    color: var(--primary-strong);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--primary-ring);
    text-underline-offset: 2px;
    transition: text-decoration-color 130ms ease;
}

[data-theme="dark"] .docs-article a { color: var(--primary); }
.docs-article a:hover { text-decoration-color: var(--primary); }

.docs-article hr {
    margin: 40px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

/* Blockquote / callout */
.docs-article blockquote {
    margin: 24px 0;
    padding: 14px 18px;
    border-left: 3px solid var(--primary);
    background: var(--primary-soft);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    color: var(--text-muted);
}

.docs-article blockquote p:last-child { margin-bottom: 0; }

/* Tables */
.docs-article table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 24px 0;
    font-size: 14.5px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.docs-article thead { background: var(--surface-2); }

.docs-article th,
.docs-article td {
    padding: 11px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}

.docs-article th { color: var(--text); font-weight: 600; }
.docs-article td { color: var(--text-muted); }
.docs-article tbody tr:last-child td { border-bottom: 0; }
.docs-article tbody tr:hover { background: var(--surface-2); }

/* Inline code */
.docs-article :not(pre) > code {
    font-size: 0.86em;
    padding: 0.15em 0.42em;
    border-radius: 6px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
    overflow-wrap: break-word;
}

/* On narrow screens, let long inline code tokens wrap instead of overflowing */
@media (max-width: 720px) {
    .docs-article :not(pre) > code { white-space: normal; word-break: break-word; }
}

/* Code blocks */
.code-block {
    position: relative;
    margin: 24px 0;
}

.docs-article pre {
    margin: 0;
    overflow-x: auto;
    padding: 18px 20px;
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.docs-article pre code {
    display: block;
    padding: 0;
    background: transparent;
    border: 0;
    color: var(--code-text);
    font-size: 13.5px;
    line-height: 1.7;
    white-space: pre;
}

/* Torchlight highlighted blocks (background-color set inline by Torchlight) */
.docs-article pre.torchlight code {
    color: inherit;
}

/* Torchlight preserves the raw source in a sibling <textarea> for the copy
   button and hides it with an inline style. Hide it defensively too, so a
   partial/failed highlight run can never leak it as duplicated raw code — the
   visible code always lives in the <pre> above it. */
.docs-article [data-torchlight-original] {
    display: none !important;
}

.torchlight .line {
    display: block;
    min-height: 1.5em;
    white-space: pre;
}

/* "Focus Your Reader's Attention" (https://torchlight.dev/docs/annotations/focus)
   Lines annotated with `[tl! focus]` keep their `.line-focus` class; every other
   line in the block is blurred and dimmed so the eye lands on what matters.
   Hovering (or keyboard-focusing) the block brings the full example back. */
.torchlight.has-focus-lines .line:not(.line-focus) {
    transition: filter 0.3s ease, opacity 0.3s ease;
    filter: blur(1.4px);
    opacity: 0.55;
}

.torchlight.has-focus-lines:hover .line:not(.line-focus),
.code-block:focus-within .torchlight.has-focus-lines .line:not(.line-focus) {
    filter: blur(0);
    opacity: 1;
}

.torchlight .line-number,
.torchlight .summary-caret {
    margin-right: 1.2em;
    color: rgba(255, 255, 255, 0.3);
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 9px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: #d4d4d8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 7px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 130ms ease, background 130ms ease, color 130ms ease;
}

.code-block:hover .copy-button,
.copy-button:focus-visible { opacity: 1; }

.copy-button:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.copy-button.is-copied { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); }
.copy-button svg { width: 13px; height: 13px; }

/* Images in article */
.docs-article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

/* Prev / Next */
.page-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.page-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: border-color 130ms ease, background 130ms ease, transform 130ms ease;
}

.page-nav-link:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.page-nav-link.is-next { text-align: right; align-items: flex-end; }
.page-nav-link span { font-size: 12px; color: var(--text-soft); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; }
.page-nav-link strong { font-size: 15px; font-weight: 600; color: var(--text); }

/* ---------- Table of contents ---------- */

.page-toc {
    position: sticky;
    top: calc(var(--header-h) + 32px);
    align-self: start;
    max-height: calc(100vh - var(--header-h) - 64px);
    overflow-y: auto;
}

.toc-title {
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.page-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid var(--border);
    display: grid;
    gap: 1px;
}

.page-toc li.level-3 a { padding-left: 26px; }

.page-toc a {
    display: block;
    padding: 5px 14px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.5;
    transition: color 120ms ease, border-color 120ms ease;
}

.page-toc a:hover { color: var(--text); }

.page-toc a.is-active {
    color: var(--primary-strong);
    border-left-color: var(--primary);
    font-weight: 600;
}

[data-theme="dark"] .page-toc a.is-active { color: var(--primary); }

/* ============================================================
   Home page
   ============================================================ */

.home-main { padding: 0; }

.home-hero {
    position: relative;
    overflow: hidden;
    padding: 88px 28px 72px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(60% 70% at 50% -10%, var(--primary-soft), transparent 70%);
    pointer-events: none;
}

.home-hero-inner { position: relative; max-width: 760px; margin: 0 auto; }

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 8px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.hero-badge .dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.home-hero h1 {
    margin: 0;
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 850;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.home-hero h1 .grad {
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-strong) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.home-hero .lead {
    margin: 22px auto 0;
    max-width: 600px;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1.65;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 22px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: background 130ms ease, border-color 130ms ease, transform 130ms ease, box-shadow 130ms ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
    background: var(--primary);
    color: var(--primary-contrast);
    box-shadow: 0 8px 22px -8px var(--primary-ring);
}
.btn-primary:hover { background: var(--primary-strong); }

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

/* Home content sections */
.home-section {
    max-width: 1120px;
    margin: 0 auto;
    padding: 72px 28px 0;
}

.home-section:last-of-type { padding-bottom: 96px; }

.section-intro { max-width: 640px; margin: 0 0 36px; }
.section-intro .eyebrow { text-align: left; }
.section-intro h2 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}
.section-intro p { margin: 12px 0 0; color: var(--text-muted); font-size: 16px; line-height: 1.65; }

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.feature-card {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.feature-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.feature-card a { display: block; height: 100%; }

.feature-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

.feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform 400ms ease;
}

.feature-card:hover .feature-image img { transform: scale(1.03); }

.feature-copy { padding: 22px 24px 24px; }
.feature-copy h3 {
    margin: 0 0 8px;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.feature-copy h3 .arrow { color: var(--primary-strong); transition: transform 150ms ease; }
.feature-card:hover .feature-copy h3 .arrow { transform: translateX(3px); }
.feature-copy p { margin: 0; color: var(--text-muted); font-size: 14.5px; line-height: 1.6; }

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 8px;
}

.stat-card {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
    text-align: center;
}

.stat-card strong {
    display: block;
    font-size: 2.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(120deg, var(--primary) 0%, var(--primary-strong) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.stat-card span { display: block; margin-top: 6px; color: var(--text-muted); font-size: 14px; }

/* Preview showcase */
.preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

/* Overview panels */
.overview-panels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.overview-panel {
    padding: 26px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--surface);
}

.overview-panel h3 { margin: 0 0 12px; font-size: 1.15rem; font-weight: 700; }
.overview-panel p { margin: 0; color: var(--text-muted); line-height: 1.7; }
.overview-panel code {
    font-size: 0.86em;
    padding: 0.12em 0.4em;
    border-radius: 6px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text);
}

.panel-list { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 10px; }
.panel-list li {
    position: relative;
    padding-left: 26px;
    color: var(--text-muted);
    line-height: 1.6;
}
.panel-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 16px;
    height: 16px;
    background: var(--primary-soft);
    border-radius: 5px;
}
.panel-list li::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 10px;
    width: 5px;
    height: 8px;
    border: solid var(--primary-strong);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
}

.site-footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--text-soft);
    font-size: 13.5px;
}

.site-footer-inner a:hover { color: var(--text); }

/* ============================================================
   Version switcher
   ============================================================ */

/* Switchers sit on their own row below the brand, so the brand name always has
   the full header width and is never overlapped. */
.sidebar-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.sidebar-tools .locale-switcher { margin-right: auto; }

.sidebar-close {
    display: none;
    width: 36px;
    height: 36px;
    flex: none;
    align-items: center;
    justify-content: center;
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 130ms ease, color 130ms ease;
}

.sidebar-close svg { width: 18px; height: 18px; }
.sidebar-close:hover { background: var(--surface-2); color: var(--text); }

.version-switcher { position: relative; }

.version-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 30px;
    padding: 0 7px 0 11px;
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: background 130ms ease, border-color 130ms ease;
}

.version-trigger:hover { background: var(--surface-3); border-color: var(--text-faint); }

.version-chevron {
    width: 13px;
    height: 13px;
    color: var(--text-soft);
    transition: transform 160ms ease;
}

.version-switcher.is-open .version-chevron { transform: rotate(180deg); }

.version-menu {
    position: absolute;
    top: calc(100% + 8px);
    /* Anchored to the trigger's right edge (the version switcher sits at the
       sidebar's right) so it opens inward and never overflows the sidebar. */
    right: 0;
    min-width: 190px;
    max-width: calc(var(--sidebar-w) - 32px);
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 70;
}

.version-menu[hidden] { display: none; }

.version-menu-title {
    margin: 4px 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-soft);
}

.version-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
}

a.version-item:hover { background: var(--surface-2); color: var(--text); }
.version-item.is-current { color: var(--text); font-weight: 600; }
.version-item.is-disabled { opacity: 0.55; cursor: not-allowed; }
.version-item-label { display: inline-flex; align-items: center; gap: 8px; }

.version-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-soft);
    line-height: 1.4;
}

.version-tag.is-current { background: var(--primary-soft); color: var(--primary-strong); }
[data-theme="dark"] .version-tag.is-current { color: var(--primary); }
.version-tag.is-soon { background: var(--info-soft); color: var(--info); }

/* Language switcher — shares the version switcher's shell vocabulary. */
.locale-switcher { position: relative; }

.locale-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 8px;
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    border-radius: 999px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: -0.01em;
    transition: background 130ms ease, border-color 130ms ease;
}

.locale-trigger:hover { background: var(--surface-3); border-color: var(--text-faint); }
.locale-globe { width: 15px; height: 15px; color: var(--text-soft); }

.locale-chevron {
    width: 13px;
    height: 13px;
    color: var(--text-soft);
    transition: transform 160ms ease;
}

.locale-switcher.is-open .locale-chevron { transform: rotate(180deg); }

.locale-menu {
    position: absolute;
    top: calc(100% + 8px);
    /* Opens from the trigger's left edge — the language switcher sits at the
       sidebar's left, so a right-anchored menu would overflow off-screen. */
    left: 0;
    right: auto;
    min-width: 180px;
    max-width: calc(var(--sidebar-w) - 32px);
    max-height: calc(100vh - var(--header-h) - 32px);
    overflow-y: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    z-index: 70;
}

.locale-menu[hidden] { display: none; }

.locale-menu-title {
    margin: 4px 10px 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-soft);
}

.locale-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text-muted);
}

a.locale-item:hover { background: var(--surface-2); color: var(--text); }
.locale-item.is-current { color: var(--text); font-weight: 600; }
.locale-check { width: 15px; height: 15px; color: var(--primary); flex: none; }

/* "Not translated yet" fallback notice at the top of an untranslated page. */
.translation-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 28px;
    padding: 12px 16px;
    border: 1px solid var(--info-soft);
    border-radius: var(--radius-md);
    background: var(--info-soft);
    color: var(--info);
    font-size: 13.5px;
    font-weight: 500;
}

.translation-notice svg { width: 18px; height: 18px; flex: none; }

/* ============================================================
   Reading progress + back to top
   ============================================================ */

.reading-progress {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 3px;
    z-index: 45;
    pointer-events: none;
    background: transparent;
}

.reading-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
    transition: width 80ms linear;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    cursor: pointer;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: 50%;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 180ms ease, transform 180ms ease, visibility 180ms, color 130ms ease, border-color 130ms ease;
}

.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { color: var(--text); border-color: var(--text-faint); transform: translateY(-2px); }
.back-to-top svg { width: 20px; height: 20px; }

/* ============================================================
   Mobile table of contents (disclosure)
   ============================================================ */

.mobile-toc {
    display: none;
    margin: 4px 0 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.mobile-toc > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text);
}

.mobile-toc > summary::-webkit-details-marker { display: none; }
.mobile-toc-chevron { width: 16px; height: 16px; color: var(--text-soft); transition: transform 160ms ease; }
.mobile-toc[open] .mobile-toc-chevron { transform: rotate(180deg); }

.mobile-toc ul {
    list-style: none;
    margin: 0;
    padding: 0 8px 10px;
    display: grid;
    gap: 1px;
}

.mobile-toc li.level-3 a { padding-left: 28px; }

.mobile-toc a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13.5px;
    line-height: 1.5;
}

.mobile-toc a:hover { background: var(--surface-2); color: var(--text); }

/* ============================================================
   Search trigger + mobile search sheet
   ============================================================ */

.search-trigger { display: none; }

.search-cancel {
    display: none;
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--primary-strong);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 4px;
    white-space: nowrap;
}

[data-theme="dark"] .search-cancel { color: var(--primary); }
.search-backdrop { display: none; }

/* Horizontal scroll container for wide tables (added by JS) */
.table-scroll {
    margin: 24px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-md);
}

.table-scroll table { margin: 0; }

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

.site-overlay { display: none; }

/* Larger touch targets on touch devices */
@media (pointer: coarse) {
    .nav-section a { padding-top: 10px; padding-bottom: 10px; }
    .mobile-toc a { padding-top: 10px; padding-bottom: 10px; }
    .table-scroll table { min-width: 34rem; }
}

@media (max-width: 1180px) {
    .content-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .page-toc { display: none; }
    .mobile-toc { display: block; }
    .docs-article { max-width: 100%; }
}

@media (max-width: 980px) {
    :root { --sidebar-w: 0px; }

    .site-shell { grid-template-columns: 1fr; }

    .reading-progress { left: 0; }

    .site-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(86vw, 320px);
        padding-left: env(safe-area-inset-left, 0px);
        z-index: 60;
        transform: translateX(-100%);
        transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
        background: var(--surface);
    }

    body.nav-open .site-sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }

    .sidebar-close { display: inline-flex; }

    .site-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 50;
        opacity: 0;
        pointer-events: none;
        transition: opacity 200ms ease;
    }
    body.nav-open .site-overlay { display: block; opacity: 1; pointer-events: auto; }

    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

    .topbar {
        padding-left: max(16px, env(safe-area-inset-left, 0px));
        padding-right: max(16px, env(safe-area-inset-right, 0px));
    }
    .page-body { padding: 28px 18px 64px; }
}

@media (max-width: 720px) {
    .search-kbd { display: none; }
    .feature-grid,
    .preview-grid,
    .preview-gallery,
    .overview-panels,
    .stats-row,
    .page-nav { grid-template-columns: 1fr; }

    .home-hero { padding: 64px 20px 52px; }
    .home-section { padding-top: 56px; }

    /* Search collapses behind a trigger and opens as a top sheet */
    .search-shell { display: none; }
    .search-trigger { display: inline-flex; }
    .github-link { display: none; }

    body.search-open .search-shell {
        display: flex;
        align-items: center;
        gap: 8px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        width: auto;
        z-index: 80;
        padding: 11px max(16px, env(safe-area-inset-right, 0px)) 11px max(16px, env(safe-area-inset-left, 0px));
        background: var(--surface);
        border-bottom: 1px solid var(--border);
    }

    body.search-open .search-input { flex: 1; height: 42px; }
    body.search-open .search-cancel { display: inline-block; }

    body.search-open .search-results {
        position: fixed;
        top: 64px;
        left: 0;
        right: 0;
        max-height: calc(100dvh - 64px);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
        box-shadow: none;
    }

    body.search-open .search-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 75;
        background: rgba(0, 0, 0, 0.4);
    }

    .back-to-top { right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
    * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ============================================================
   2026 redesign — Vue/VitePress-flavoured surfaces + motion
   Layered on top of the base theme; rules here intentionally
   override the earlier hero / card / button definitions.
   ============================================================ */

:root {
    --brand-grad: linear-gradient(115deg, #f59e0b 0%, #fb7185 48%, #d946ef 100%);
    --brand-grad-soft: linear-gradient(115deg, rgba(245, 158, 11, 0.16), rgba(217, 70, 239, 0.14));
    --ring-grad: linear-gradient(140deg, rgba(245, 158, 11, 0.55), rgba(217, 70, 239, 0.45));
}

/* Reveal targets start hidden ONLY when motion is enabled; JS animates them in
   and clears .has-motion if GSAP is unavailable so nothing stays invisible. */
.has-motion .hero-badge,
.has-motion .home-hero h1,
.has-motion .home-hero .lead,
.has-motion .hero-actions > *,
.has-motion .section-intro,
.has-motion .feature-card,
.has-motion .preview-card,
.has-motion .stat-card,
.has-motion .overview-panel,
.has-motion .docs-article .page-hero,
.has-motion .docs-article > h2,
.has-motion .page-toc {
    opacity: 0;
}

/* ---- Hero: animated aurora + gradient headline ---- */
.home-hero {
    padding: 104px 28px 84px;
    border-bottom: 1px solid var(--border);
    isolation: isolate;
}

.home-hero::before {
    content: "";
    position: absolute;
    inset: -20% -10% auto -10%;
    height: 520px;
    background:
        radial-gradient(38% 55% at 22% 8%, rgba(245, 158, 11, 0.30), transparent 70%),
        radial-gradient(40% 55% at 82% 4%, rgba(217, 70, 239, 0.26), transparent 72%),
        radial-gradient(45% 60% at 50% 0%, rgba(251, 113, 133, 0.22), transparent 70%);
    filter: blur(8px);
    pointer-events: none;
    z-index: -1;
    animation: hero-aurora 18s ease-in-out infinite alternate;
}

[data-theme="dark"] .home-hero::before { opacity: 0.72; }

@keyframes hero-aurora {
    0%   { transform: translate3d(-3%, 0, 0) scale(1); }
    50%  { transform: translate3d(3%, 2%, 0) scale(1.06); }
    100% { transform: translate3d(2%, -1%, 0) scale(1.02); }
}

.hero-badge {
    backdrop-filter: blur(8px);
    background: color-mix(in srgb, var(--surface) 78%, transparent);
}

.home-hero h1 { font-size: clamp(2.6rem, 6.4vw, 4.3rem); font-weight: 870; }

.home-hero h1 .grad {
    background: var(--brand-grad);
    background-size: 220% 220%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: grad-shift 8s ease infinite;
}

@keyframes grad-shift {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ---- Buttons: gradient primary with glow ---- */
.btn { height: 48px; border-radius: 999px; transition: transform 160ms cubic-bezier(.22,1,.36,1), box-shadow 200ms ease, filter 200ms ease; }

.btn-primary {
    background: var(--brand-grad);
    background-size: 160% 160%;
    color: #fff;
    box-shadow: 0 12px 30px -10px rgba(217, 70, 239, 0.5), 0 6px 16px -8px rgba(245, 158, 11, 0.5);
}
.btn-primary:hover { transform: translateY(-2px); filter: saturate(1.08) brightness(1.03); box-shadow: 0 18px 40px -12px rgba(217, 70, 239, 0.6); }

.btn-ghost { border-radius: 999px; }
.btn-ghost:hover { transform: translateY(-2px); }

/* ---- Cards: gradient-ring hover lift ---- */
.feature-card,
.preview-card,
.overview-panel {
    position: relative;
    border-radius: var(--radius-lg);
    transition: transform 260ms cubic-bezier(.22,1,.36,1), box-shadow 260ms ease, border-color 200ms ease;
}

.feature-card::after,
.preview-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: var(--ring-grad);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 240ms ease;
    pointer-events: none;
}

.feature-card:hover,
.preview-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.feature-card:hover::after,
.preview-card:hover::after { opacity: 1; }

.stat-card { transition: transform 240ms cubic-bezier(.22,1,.36,1), box-shadow 240ms ease; }
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.stat-card strong {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---- Eyebrows pick up the brand gradient ---- */
.section-intro .eyebrow,
.page-hero .eyebrow {
    background: var(--brand-grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 700;
}

/* ---- Smooth dropdown reveal for the switchers ---- */
.version-menu:not([hidden]),
.locale-menu:not([hidden]) { animation: menu-pop 160ms cubic-bezier(.22,1,.36,1); }

@keyframes menu-pop {
    from { opacity: 0; transform: translateY(-6px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- Color palette swatches (the ->color() vzorník in the docs) ---- */
.wire-swatches {
    margin: 0 0 18px;
    max-width: var(--content-max);
}

.wire-swatch-group {
    margin: 0 0 8px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.wire-swatch-group:not(:first-child) { margin-top: 22px; }

.wire-swatch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 10px;
}

.wire-swatch {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.wire-swatch__chip {
    height: 40px;
    border-radius: 8px;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.wire-swatch__name {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}

.wire-swatch__alias {
    font-size: 0.72rem;
    color: var(--text-soft);
}

[data-theme="dark"] .wire-swatch__chip {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
