/* Krate marketing surface.
 *
 * Shares one visual system with @krate/base-docs-theme and @krate/components:
 * the same neutral ramp, the signal-orange accent, Inter + JetBrains Mono,
 * and a single elevation scale. Tokens are kept in sync by hand across
 * site.css, tokens.css and theme.css. */

:root {
    color-scheme: light dark;

    /* Type */
    --font-sans: 'Inter Variable', Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: 'JetBrains Mono Variable', "JetBrains Mono", "Fira Code", ui-monospace, monospace;

    /* Layout */
    --max-width: 1120px;
    --page-gutter: max(1.5rem, calc((100% - var(--max-width)) / 2 + 1.5rem));
    --header-height: 60px;
    --blur-intensity: 12px;

    /* Radii */
    --radius-sm: 8px;
    --radius: 8px;
    --radius-lg: 16px;
    --radius-pill: 999px;

    /* Neutral ramp (light) */
    --color-bg: #ffffff;
    --color-bg-subtle: #fafafa;
    --color-fg: #0a0a0a;
    --color-muted: #737373;
    --color-border: #e5e5e5;
    --color-border-strong: #d4d4d4;

    /* Signal accent */
    --color-primary: #f97316;
    --color-primary-hover: #ea580c;
    --color-primary-fg: #ffffff;
    --color-accent-bg: rgba(249, 115, 22, 0.08);
    --color-accent-border: rgba(249, 115, 22, 0.22);
    --color-positive: #15803d;

    /* AA-contrast text links: `--color-primary` fills buttons, this colours text. */
    --color-link: #c2410c;
    --color-link-hover: #9a3412;
    --color-action: #c2410c;
    --color-action-hover: #9a3412;

    --navbar-bg: rgba(255, 255, 255, 0.75);
    --overlay-bg: rgba(10, 10, 10, 0.4);

    /* Elevation - offset + soft blur, low alpha. Dark mode re-tints these. */
    --shadow-xs: 0 1px 2px rgba(23, 23, 23, 0.06);
    --shadow-sm: 0 1px 2px rgba(23, 23, 23, 0.06), 0 2px 6px -2px rgba(23, 23, 23, 0.08);
    --shadow-md: 0 2px 4px rgba(23, 23, 23, 0.05), 0 10px 24px -8px rgba(23, 23, 23, 0.12);
    --shadow-lg: 0 4px 10px rgba(23, 23, 23, 0.06), 0 24px 48px -16px rgba(23, 23, 23, 0.16);
    --hairline: none;
    --panel: var(--color-bg-subtle);
    --panel-border: var(--color-border);
    --panel-value: var(--color-link);
    --panel-label: var(--color-muted);
    /* Code boxes sit on the same surface as the cards beside them. */
    --code-bg: var(--color-bg-subtle);
    --code-bar: #f5f5f5;
    --code-fg: #262626;
    --code-muted: #525252;
    --code-keyword: #cf222e;
    --code-constant: #0550ae;
    --code-function: #8250df;
    --code-type: #953800;
    --code-tag: #116329;
    --code-string: #0a3069;
    --code-comment: #525252;
    --code-faint: #737373;
    --krate-code-bg: var(--code-bg);
    --krate-code-text: var(--code-fg);
    --krate-code-title-bg: var(--code-bar);
    --krate-code-title-text: var(--code-muted);

    /* Motion */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --color-bg: #0a0a0a;
    --color-bg-subtle: #0f0f0f;
    --color-fg: #fafafa;
    --color-muted: #a3a3a3;
    --color-border: #262626;
    --color-border-strong: #404040;
    --color-accent-bg: rgba(249, 115, 22, 0.12);
    --color-accent-border: rgba(249, 115, 22, 0.32);
    --color-positive: #4ade80;
    --color-link: #fb923c;
    --color-link-hover: #fdba74;
    --color-action: #c2410c;
    --color-action-hover: #9a3412;
    --navbar-bg: rgba(10, 10, 10, 0.8);
    --overlay-bg: rgba(0, 0, 0, 0.6);
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px -2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 32px -10px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.45), 0 30px 60px -20px rgba(0, 0, 0, 0.65);
    --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.045);
    --panel: #121212;
    --panel-border: #262626;
    --panel-value: #fb923c;
    --panel-label: #a3a3a3;
    --code-bar: #171717;
    --code-fg: #e5e5e5;
    --code-muted: #a3a3a3;
    --code-keyword: #ff7b72;
    --code-constant: #79c0ff;
    --code-function: #d2a8ff;
    --code-type: #f0883e;
    --code-tag: #7ee787;
    --code-string: #a5d6ff;
    --code-comment: #a3a3a3;
    --code-faint: #737373;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark;
        --color-bg: #0a0a0a;
        --color-bg-subtle: #0f0f0f;
        --color-fg: #fafafa;
        --color-muted: #a3a3a3;
        --color-border: #262626;
        --color-border-strong: #404040;
        --color-accent-bg: rgba(249, 115, 22, 0.12);
        --color-accent-border: rgba(249, 115, 22, 0.32);
        --color-positive: #4ade80;
        --color-link: #fb923c;
        --color-link-hover: #fdba74;
        --color-action: #c2410c;
        --color-action-hover: #9a3412;
        --navbar-bg: rgba(10, 10, 10, 0.8);
        --overlay-bg: rgba(0, 0, 0, 0.6);
        --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 2px 8px -2px rgba(0, 0, 0, 0.5);
        --shadow-md: 0 2px 6px rgba(0, 0, 0, 0.4), 0 14px 32px -10px rgba(0, 0, 0, 0.55);
        --shadow-lg: 0 6px 14px rgba(0, 0, 0, 0.45), 0 30px 60px -20px rgba(0, 0, 0, 0.65);
        --hairline: inset 0 1px 0 rgba(255, 255, 255, 0.045);
        --panel: #121212;
        --panel-border: #262626;
        --panel-value: #fb923c;
        --panel-label: #a3a3a3;
        --code-bar: #171717;
        --code-fg: #e5e5e5;
        --code-muted: #a3a3a3;
        --code-keyword: #ff7b72;
        --code-constant: #79c0ff;
        --code-function: #d2a8ff;
        --code-type: #f0883e;
        --code-tag: #7ee787;
        --code-string: #a5d6ff;
        --code-comment: #a3a3a3;
        --code-faint: #737373;
    }
}

/* ---- Base ---------------------------------------------------------------- */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--header-height);
}

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-fg);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
    caret-color: var(--color-primary);
}

::selection {
    background: color-mix(in srgb, var(--color-primary) 26%, transparent);
    color: var(--color-fg);
}

/* Browser chrome belongs to the system too. */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-border-strong) transparent;
}

*::-webkit-scrollbar {
    width: 11px;
    height: 11px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: var(--color-border-strong);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-muted);
}

a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.15s var(--ease-in-out);
}

a:hover {
    color: var(--color-link-hover);
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 2px solid var(--color-action);
    outline-offset: 2px;
    border-radius: 4px;
}

code,
pre {
    font-family: var(--font-mono);
    font-size: 0.875em;
    font-variant-ligatures: none;
}

img,
svg,
video {
    max-width: 100%;
    height: auto;
}

.site-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---- Navbar ---- */
.site-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 1rem;
    height: var(--header-height);
    padding-inline: var(--page-gutter);
    background: var(--navbar-bg);
    backdrop-filter: blur(var(--blur-intensity)) saturate(1.6);
    -webkit-backdrop-filter: blur(var(--blur-intensity)) saturate(1.6);
    border-bottom: 1px solid var(--color-border);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-navbar {
        background: var(--color-bg);
    }
}

.site-navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--color-fg);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.site-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    background: linear-gradient(140deg, #fb923c, #ea580c);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 2px rgba(234, 88, 12, 0.35);
}

.site-logo-image {
    display: block;
    flex: none;
    width: 28px;
    height: 28px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    object-fit: contain;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-left: auto;
}

.site-nav a {
    position: relative;
    color: var(--color-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s var(--ease-in-out);
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.35rem;
    height: 2px;
    border-radius: 2px;
    background: var(--color-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s var(--ease-out);
}

.site-nav a:hover {
    color: var(--color-fg);
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

/* Current page (aria-current="page") or the section it is in ("true"). */
.site-nav a[aria-current] {
    color: var(--color-fg);
}

.site-nav a[aria-current]::after {
    transform: scaleX(1);
}

/* ---- Header actions (social + theme toggle) ---- */
.site-navbar-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: 1rem;
}

.site-navbar-actions .social-link,
.site-navbar-actions .theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s var(--ease-in-out), color 0.15s var(--ease-in-out), border-color 0.15s var(--ease-in-out);
}

.site-navbar-actions .social-link:hover,
.site-navbar-actions .theme-toggle:hover {
    color: var(--color-fg);
    background: var(--color-bg-subtle);
    border-color: var(--color-border-strong);
}

/* Theme toggle: crossfade + rotate between sun and moon, mirroring the docs
   theme so the header behaves identically on every surface. */
.theme-toggle {
    position: relative;
}

.theme-toggle svg {
    position: absolute;
    width: 16px;
    height: 16px;
    transition: opacity 0.2s var(--ease-in-out), transform 0.2s var(--ease-in-out);
}

.theme-toggle svg:first-child,
:root:not([data-theme]) .theme-toggle svg:first-child {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-toggle svg:last-child {
    opacity: 0;
    transform: rotate(-30deg) scale(0.8);
}

:root[data-theme="dark"] .theme-toggle svg:first-child {
    opacity: 0;
    transform: rotate(30deg) scale(0.8);
}

:root[data-theme="dark"] .theme-toggle svg:last-child {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle svg:first-child {
        opacity: 0;
        transform: rotate(30deg) scale(0.8);
    }
    :root:not([data-theme="light"]) .theme-toggle svg:last-child {
        opacity: 1;
        transform: rotate(0deg) scale(1);
    }
}

/* ---- Hero: left-aligned, on a faint engineering grid ---- */
.hero {
    position: relative;
    isolation: isolate;
    padding: clamp(3rem, 7vw, 5.5rem) var(--page-gutter) clamp(2.5rem, 5vw, 4rem);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.hero-title {
    margin-block: 0 1.5rem;
    font-size: clamp(2.6rem, 1.2rem + 6.2vw, 5.5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
    font-weight: 800;
    text-wrap: balance;
    max-width: 13.5ch;
}

.hero-subtitle {
    max-width: 62ch;
    margin: 0 0 2rem;
    color: var(--color-muted);
    font-size: clamp(1.05rem, 1rem + 0.35vw, 1.25rem);
    line-height: 1.6;
    text-wrap: pretty;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: clamp(2.5rem, 5vw, 3.5rem);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 1.35rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1;
    transition: background-color 0.16s var(--ease-in-out), border-color 0.16s var(--ease-in-out),
        color 0.16s var(--ease-in-out), box-shadow 0.16s var(--ease-in-out), transform 0.16s var(--ease-out);
}

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

.btn-primary {
    background: var(--color-action);
    color: var(--color-primary-fg);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--color-action-hover);
    color: var(--color-primary-fg);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    border-color: var(--color-border-strong);
    background: var(--color-bg);
    color: var(--color-fg);
    box-shadow: var(--shadow-xs), var(--hairline);
}

.btn-secondary:hover {
    border-color: var(--color-fg);
    background: var(--color-bg);
    color: var(--color-fg);
}

/* ---- Hero: source on the left, what it compiles to on the right ---- */
.hero-demo {
    max-width: calc(var(--max-width) - 3rem);
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 1rem;
    align-items: stretch;
    text-align: left;
}

.hero-demo > * {
    min-width: 0;
}

.hero-demo-code .krate-code-block {
    height: 100%;
    margin: 0;
    min-width: 0;
    max-width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.hero-demo-code .krate-code-block pre {
    font-size: 0.9rem;
    line-height: 1.7;
}

.hero-demo-live {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    padding: 1.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-subtle);
    box-shadow: var(--shadow-sm), var(--hairline);
    text-align: center;
}

.hero-demo-live-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-link);
}

.hero-demo-live .demo {
    border: 0;
    background: none;
    box-shadow: none;
    padding: 0;
}

.hero-demo-live-note {
    max-width: 30ch;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ---- Live demo ---- */
.demo {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-subtle);
    box-shadow: var(--shadow-xs), var(--hairline);
}

.demo button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    color: var(--color-fg);
    cursor: pointer;
    font: inherit;
    font-size: 1.1rem;
    transition: background 0.15s var(--ease-in-out), border-color 0.15s var(--ease-in-out), color 0.15s var(--ease-in-out);
}

.demo button:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.demo button:active {
    background: var(--color-accent-bg);
}

.demo-value {
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 700;
    min-width: 3ch;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---- Feature grid ---- */
.features {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 5rem) 1.5rem 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
}

.feature-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    color: var(--color-fg);
    box-shadow: var(--shadow-xs), var(--hairline);
    transition: border-color 0.2s var(--ease-in-out), box-shadow 0.2s var(--ease-in-out), transform 0.2s var(--ease-out);
}

.feature-card:hover {
    border-color: var(--color-accent-border);
    color: var(--color-fg);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), var(--hairline);
}

.feature-card h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.3;
}

.feature-card p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.feature-card code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    font-weight: 600;
    color: var(--color-link);
    background: none;
    border: 0;
    padding: 0;
}

/* Home: one ruled spec sheet instead of eight separate boxes. The first two
   cells are the headline features and run larger. */
.bento {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    width: calc(100% - 3rem);
    max-width: calc(var(--max-width) - 3rem);
    padding: 0;
    margin-top: clamp(3rem, 6vw, 5rem);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}

.bento .feature-card {
    grid-column: span 2;
    padding: 1.75rem 1.75rem 2rem;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    transition: background-color 0.2s var(--ease-in-out), box-shadow 0.2s var(--ease-in-out);
}

.bento .feature-card:hover {
    transform: none;
    background: var(--color-bg-subtle);
    box-shadow: inset 0 2px 0 var(--color-primary);
}

.bento .feature-card:nth-child(-n + 3) {
    /* h2.sr-only is child 1, so the two lead cells are children 2 and 3. */
    grid-column: span 3;
}

.bento .feature-card:nth-child(-n + 3) h3 {
    font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.65rem);
    letter-spacing: -0.025em;
}

.bento .feature-card:nth-child(-n + 3) p {
    font-size: 1.02rem;
    max-width: 46ch;
}

.bento .feature-card:nth-child(3n + 1):not(:nth-child(-n + 3)) {
    /* Row starts of the three-up rows have no left rule. */
}

.bento .feature-card:nth-child(3),
.bento .feature-card:nth-child(6),
.bento .feature-card:nth-child(9) {
    border-right: 0;
}

.bento .feature-card:nth-last-child(-n + 3) {
    border-bottom: 0;
}

/* ---- Sections ---- */
.krate-code-block .krate-code-header {
    border-bottom-color: var(--color-border);
}

.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(3rem, 7vw, 5.5rem) 1.5rem;
}

.section + .section {
    padding-top: 0;
}

.section-title {
    max-width: 22ch;
    margin: 0 0 0.9rem;
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 800;
    text-wrap: balance;
    text-align: left;
}

.section-lede {
    max-width: 60ch;
    margin: 0 0 2.25rem;
    color: var(--color-muted);
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: left;
    text-wrap: pretty;
}

.section-lede a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--color-link) 40%, transparent);
    text-underline-offset: 3px;
}

.section code {
    color: var(--color-fg);
    background: var(--color-accent-bg);
    border: 1px solid var(--color-accent-border);
    padding: 0.05em 0.35em;
    border-radius: 5px;
    font-size: 0.85em;
}

/* ---- Comparison table ---- */
.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    box-shadow: var(--shadow-sm);
}

.compare {
    width: 100%;
    min-width: 36rem;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.95rem;
}

.compare th,
.compare td {
    padding: 0.9rem 1.15rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

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

.compare thead th {
    background: var(--color-bg-subtle);
    color: var(--color-muted);
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom-color: var(--color-border-strong);
}

.compare td:first-child,
.compare th:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--color-bg);
    color: var(--color-fg);
    font-weight: 600;
}

.compare thead th:first-child {
    background: var(--color-bg-subtle);
}

/* The Krate column is the subject; Astro and Next.js are the controls. */
.compare th:nth-child(2),
.compare td:nth-child(2) {
    background: var(--color-accent-bg);
    border-inline: 1px solid var(--color-accent-border);
}

.compare th:nth-child(2) {
    color: var(--color-link);
}

.compare td.yes {
    color: var(--color-link);
    font-weight: 700;
}

.compare td.no {
    color: var(--color-muted);
}

/* ---- Stats: a spec readout on the theme's panel colour ---- */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--panel);
    box-shadow: var(--shadow-md);
}

.stat {
    padding: clamp(1.5rem, 3vw, 2.25rem) clamp(1rem, 2vw, 1.75rem);
    border-left: 1px solid var(--panel-border);
}

.stat:first-child {
    border-left: 0;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: clamp(2.2rem, 1.2rem + 2.6vw, 3.4rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--panel-value);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    margin-top: 0.6rem;
    color: var(--panel-label);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.4;
}

/* ---- CTA: closing band, command on the right ---- */
.cta-band {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    column-gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
    padding: clamp(3.5rem, 8vw, 6rem) var(--page-gutter);
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-subtle);
    overflow: hidden;
}

.cta-copy {
    grid-column: 1;
    justify-self: end;
    width: 100%;
    max-width: 30rem;
}

.cta-band .krate-code-block {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    width: 100%;
    max-width: 34rem;
    margin: 0;
    text-align: left;
    overflow-x: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.cta-band h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(2rem, 1.3rem + 2.8vw, 3.1rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
    font-weight: 800;
    text-wrap: balance;
}

.cta-band p {
    margin: 0 0 1.75rem;
    color: var(--color-muted);
    font-size: 1.1rem;
}

/* ---- Footer ---- */
.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg);
    padding: clamp(2.5rem, 5vw, 4rem) var(--page-gutter) 1.75rem;
}

.site-footer-inner {
    max-width: calc(var(--max-width) - 3rem);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.site-footer-top.has-brand {
    display: grid;
    grid-template-columns: minmax(12rem, 17rem) minmax(0, 1fr);
    gap: 2.5rem 4rem;
    align-items: start;
}

/* Beside the brand block the columns share what is left, so three fit a row. */
.site-footer-top.has-brand .site-footer-columns {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 2rem;
}

.site-footer-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--color-fg);
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.site-footer-tagline {
    margin: 0.85rem 0 0;
    max-width: 17rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.55;
}

.site-footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 14rem));
    gap: 2rem 3rem;
}

.site-footer-column {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.site-footer-column-title {
    margin-bottom: 0.6rem;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-fg);
}

.site-footer-column a {
    display: inline-block;
    align-self: flex-start;
    padding: 0.3rem 0;
    color: var(--color-muted);
    font-size: 0.92rem;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 4px;
    transition: color 0.15s var(--ease-in-out), text-decoration-color 0.15s var(--ease-in-out);
}

.site-footer-column a:hover {
    color: var(--color-fg);
    text-decoration-color: var(--color-primary);
}

.site-footer-meta {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-muted);
    font-family: var(--font-mono);
    font-size: 0.78rem;
}

/* ---- Blog index: dated rows ---- */
.taxonomy-list {
    list-style: none;
    padding: 0;
    margin: 2.5rem 0 0;
    max-width: none;
    border-top: 1px solid var(--color-border-strong);
}

.taxonomy-list li {
    display: grid;
    grid-template-columns: 9.5rem minmax(0, 1fr);
    column-gap: 2rem;
    row-gap: 0.35rem;
    align-items: baseline;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-muted);
}

.taxonomy-list .site-badge {
    grid-column: 1;
    grid-row: 1 / span 2;
    justify-self: start;
    border: 0;
    padding: 0;
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
}

.taxonomy-list a {
    grid-column: 2;
    max-width: 40ch;
    font-weight: 700;
    font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
    letter-spacing: -0.02em;
    line-height: 1.25;
    color: var(--color-fg);
    text-wrap: balance;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: 5px;
    text-decoration-thickness: 2px;
}

.taxonomy-list a:hover {
    color: var(--color-fg);
    text-decoration-color: var(--color-primary);
}

.taxonomy-list li > span:last-child {
    grid-column: 2;
    max-width: 62ch;
    font-size: 1rem;
    line-height: 1.55;
}

.site-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.12rem 0.55rem;
}

/* ---- Article prose (blog posts) ---- */
.prose {
    max-width: 46rem;
}

.prose-back {
    margin: 0 0 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.prose .section-title {
    max-width: none;
    font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem);
}

.prose .section-lede {
    max-width: none;
    margin: 0 0 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--color-border);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.prose p {
    margin: 1.1rem 0;
    font-size: 1.08rem;
    line-height: 1.75;
    color: color-mix(in srgb, var(--color-fg) 90%, var(--color-bg));
}

.prose h2 {
    margin: 3rem 0 0.75rem;
    font-size: 1.65rem;
    line-height: 1.2;
    letter-spacing: -0.03em;
    font-weight: 750;
}

.prose h3 {
    margin: 2.25rem 0 0.5rem;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.prose ul,
.prose ol {
    margin: 1.1rem 0;
    padding-left: 1.4rem;
    font-size: 1.08rem;
    line-height: 1.7;
}

.prose li + li {
    margin-top: 0.4rem;
}

.prose li::marker {
    color: var(--color-primary);
}

.prose a {
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--color-link) 45%, transparent);
    text-underline-offset: 4px;
}

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

.prose :not(pre) > code {
    padding: 0.1em 0.35em;
    border: 1px solid var(--color-border);
    border-radius: 5px;
    background: var(--color-bg-subtle);
    font-size: 0.86em;
}

.prose pre {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.7;
}

.prose blockquote {
    margin: 1.5rem 0;
    padding: 0.25rem 0 0.25rem 1.25rem;
    border-left: 1px solid var(--color-border-strong);
    color: var(--color-muted);
}

.prose table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.prose th,
.prose td {
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

/* ---- Plain pages (showcase, changelog): cards sit flush with the heading ---- */
.section > .features {
    padding: 0.5rem 0 0;
}

.section > .hero-actions {
    margin-top: 0;
    margin-bottom: 0;
}

/* ---- 404 ---- */
.not-found {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: clamp(4rem, 12vw, 9rem) 1.5rem;
}

.not-found-code {
    font-family: var(--font-mono);
    font-size: clamp(5rem, 3rem + 14vw, 12rem);
    font-weight: 700;
    color: var(--color-link);
    line-height: 0.9;
    letter-spacing: -0.06em;
}

.not-found h1 {
    margin: 1.25rem 0 0.5rem;
    font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.not-found p {
    max-width: 44ch;
    color: var(--color-muted);
    font-size: 1.1rem;
    margin: 0 0 1.75rem;
}

/* ---- Code colours: the compiled stylesheet is dark-only, so the token
   colours are remapped here and follow the page theme. ---- */
body .chroma {
    color: var(--code-fg);
    background-color: var(--code-bg);
}

body .krate-code-block {
    border-color: var(--color-border);
}

body .krate-code-copy:hover {
    background: color-mix(in srgb, var(--code-fg) 10%, transparent);
    color: var(--code-fg);
}

body .chroma .err,
body .chroma .k,
body .chroma .kd,
body .chroma .kn,
body .chroma .kr,
body .chroma .kt,
body .chroma .nn,
body .chroma .o,
body .chroma .ow,
body .chroma .or,
body .chroma .gd,
body .chroma .gr,
body .chroma .gt {
    color: var(--code-keyword);
}

body .chroma .kc,
body .chroma .kp,
body .chroma .no,
body .chroma .nl,
body .chroma .py,
body .chroma .nv,
body .chroma .vc,
body .chroma .vg,
body .chroma .vi,
body .chroma .vm,
body .chroma .ld,
body .chroma .sa,
body .chroma .dl,
body .chroma .se,
body .chroma .sh,
body .chroma .sr,
body .chroma .gh,
body .chroma .gu {
    color: var(--code-constant);
}

body .chroma .nd,
body .chroma .nf,
body .chroma .fm {
    color: var(--code-function);
}

body .chroma .nc,
body .chroma .ni,
body .chroma .ne {
    color: var(--code-type);
}

body .chroma .nt,
body .chroma .gi {
    color: var(--code-tag);
}

body .chroma .l,
body .chroma .s,
body .chroma .sb,
body .chroma .sc,
body .chroma .sd,
body .chroma .s2,
body .chroma .si,
body .chroma .sx,
body .chroma .s1,
body .chroma .ss,
body .chroma .m,
body .chroma .mb,
body .chroma .mf,
body .chroma .mh,
body .chroma .mi,
body .chroma .il,
body .chroma .mo {
    color: var(--code-string);
}

body .chroma .c,
body .chroma .ch,
body .chroma .cm,
body .chroma .c1,
body .chroma .cs,
body .chroma .cp,
body .chroma .cpf,
body .chroma .go,
body .chroma .gp {
    color: var(--code-comment);
}

body .chroma .w {
    color: var(--code-faint);
}

/* ---- Code-block guards (from the Code component) ---- */
.krate-code-block {
    min-width: 0;
    max-width: 100%;
}

.krate-code-block pre {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ---- Authored entrance: one rise, staggered across the hero ---- */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .hero-title,
    .hero-subtitle,
    .hero-actions,
    .hero-demo {
        animation: rise 0.7s var(--ease-out) both;
    }
    .hero-title { animation-delay: 0.04s; }
    .hero-subtitle { animation-delay: 0.12s; }
    .hero-actions { animation-delay: 0.2s; }
    .hero-demo { animation-delay: 0.28s; }
}

@media (max-width: 900px) {
    .hero-demo {
        grid-template-columns: 1fr;
    }

    .cta-band {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 2rem;
    }

    .cta-copy,
    .cta-band .krate-code-block {
        grid-column: 1;
        grid-row: auto;
        justify-self: stretch;
        max-width: none;
    }

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

    .features.bento .feature-card,
    .features.bento .feature-card:nth-child(-n + 3) {
        grid-column: auto;
        border-right: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
    }

    .features.bento .feature-card:nth-child(odd) {
        border-right: 0;
    }

    .features.bento .feature-card:nth-last-child(-n + 2) {
        border-bottom: 0;
    }
}

@media (max-width: 760px) {
    .site-footer-top.has-brand {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Wrap the header instead of letting nav + actions overflow: brand and
       actions share the first row, links flow onto their own row. */
    .site-navbar {
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding: 0.5rem 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        gap: 0.25rem 1rem;
    }

    .site-nav {
        order: 3;
        flex-basis: 100%;
        margin-left: 0;
        gap: 0 1.1rem;
        flex-wrap: wrap;
    }

    .site-nav a {
        padding: 0.45rem 0;
        font-size: 0.88rem;
    }

    .site-nav a::after {
        bottom: 0.1rem;
    }

    .site-navbar-actions {
        margin-left: auto;
    }

    .hero-actions .btn-primary {
        flex: 1 1 100%;
    }

    .hero-actions .btn-secondary {
        flex: 1 1 8rem;
    }

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

    .taxonomy-list .site-badge,
    .taxonomy-list a,
    .taxonomy-list li > span:last-child {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 640px) {
    .site-footer-meta {
        flex-direction: column;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
    }

    .stat {
        border-left: 1px solid var(--panel-border);
        border-top: 1px solid var(--panel-border);
    }

    .stat:nth-child(odd) {
        border-left: 0;
    }

    .stat:nth-child(-n + 2) {
        border-top: 0;
    }

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

    .compare th,
    .compare td {
        padding: 0.7rem 0.8rem;
    }
}

@media (max-width: 520px) {
    .features.bento {
        grid-template-columns: minmax(0, 1fr);
    }

    .features.bento .feature-card,
    .features.bento .feature-card:nth-child(odd),
    .features.bento .feature-card:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid var(--color-border);
    }

    .features.bento .feature-card:last-child {
        border-bottom: 0;
    }

    .hero-demo-live {
        padding: 1.35rem 1.25rem;
    }
}

@media (max-width: 760px) {
    :root {
        --page-gutter: 1rem;
    }

    .section,
    .features {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .section,
    .features {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .features.bento {
        padding: 0;
        width: calc(100% - 2rem);
    }

    .feature-card {
        padding: 1.25rem;
    }
}

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

/* ---- Roadmap ---- */
.roadmap-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem 1rem;
    margin: -1rem 0 1.5rem;
    color: var(--color-muted);
    font-size: 0.82rem;
}

.roadmap-status {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    color: var(--color-muted);
    background: var(--color-bg-subtle);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.roadmap-status-now,
.roadmap-status-beta {
    border-color: var(--color-accent-border);
    background: var(--color-accent-bg);
    color: var(--color-link);
}

.roadmap-status-next {
    border-color: var(--color-border-strong);
    color: var(--color-fg);
}

.roadmap-status-gate {
    border-color: var(--color-link);
    color: var(--color-link);
}

.roadmap-section,
.roadmap-track {
    margin-top: 2.5rem;
}

.roadmap-track {
    padding-top: 2.5rem;
    border-top: 1px solid var(--color-border);
}

.roadmap-section + .roadmap-section {
    margin-top: 3rem;
}

.roadmap-track-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.roadmap-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem);
    letter-spacing: -0.025em;
    line-height: 1.15;
    text-wrap: balance;
}

.roadmap-lede {
    max-width: 760px;
    margin: 0;
    color: var(--color-muted);
    font-size: 1rem;
    line-height: 1.65;
    text-wrap: pretty;
}

.roadmap .features {
    max-width: none;
    margin: 1.5rem 0 0;
    padding: 0;
}

.roadmap .feature-card {
    cursor: default;
}

.roadmap .feature-card:hover {
    border-color: var(--color-border);
    transform: none;
    box-shadow: var(--shadow-xs), var(--hairline);
}

.roadmap-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.roadmap-panel {
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
    box-shadow: var(--shadow-xs), var(--hairline);
}

.roadmap-panel h3 {
    margin: 0 0 0.5rem;
    font-size: 0.98rem;
    font-weight: 650;
}

.roadmap-panel p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.92rem;
    line-height: 1.65;
}

.roadmap-panel p + p {
    margin-top: 0.6rem;
}

.roadmap-callout {
    margin-top: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--color-accent-border);
    border-radius: var(--radius-sm);
    background: var(--color-accent-bg);
    color: var(--color-fg);
    font-size: 0.92rem;
    line-height: 1.65;
}

.roadmap-table {
    margin-top: 1.5rem;
}

.roadmap-table .compare {
    font-size: 0.86rem;
}

.roadmap-table .compare th,
.roadmap-table .compare td {
    padding: 0.7rem 0.85rem;
    vertical-align: top;
}

.roadmap-subtitle {
    margin: 1.75rem 0 0.75rem;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.roadmap-phases {
    grid-template-columns: minmax(0, 1fr);
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.roadmap-phase {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg);
}

.roadmap-phase-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
}

.roadmap-phase-id {
    color: var(--color-muted);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.roadmap-phase-body {
    overflow-wrap: anywhere;
}

.roadmap-phase-body h3 {
    margin: 0 0 0.3rem;
    font-size: 0.98rem;
    font-weight: 650;
}

.roadmap-phase-body p {
    margin: 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

.roadmap-exit {
    margin-top: 0.55rem !important;
    color: var(--color-fg) !important;
    font-size: 0.85rem !important;
}

.roadmap-code {
    margin: 0.5rem 0 0;
    padding: 0.9rem 1rem;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-subtle);
    color: var(--color-fg);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    line-height: 1.7;
}

.roadmap-note {
    margin-top: 0.75rem !important;
    color: var(--color-muted);
    font-size: 0.85rem;
}

.roadmap-list {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.75;
}

.roadmap-list li + li {
    margin-top: 0.25rem;
}

.roadmap-list code {
    color: var(--color-fg);
}

.roadmap-not-planned {
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-bg-subtle);
}

.roadmap-not-planned .roadmap-list {
    max-width: 820px;
    margin-top: 0.75rem;
}

@media (max-width: 720px) {
    .roadmap-track-head {
        flex-direction: column;
    }

    .roadmap-phase {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
    }

    .roadmap-phase-meta {
        flex-direction: row;
        align-items: center;
    }

    .roadmap-table .compare {
        min-width: 620px;
    }
}
/* Accessibility: keyboard skip link (visually hidden until focused). */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 1000;
    padding: 0.6rem 1rem;
    background: var(--color-fg);
    color: var(--color-bg);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.875rem;
    text-decoration: none;
}

.skip-link:focus {
    left: 0;
}

/* Visually hidden but available to assistive tech. */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Header entry into the docs search (opens /docs/, where the palette lives). */
.site-search {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    height: 32px;
    padding: 0 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-muted);
    background: var(--color-bg-subtle);
    font-size: 0.875rem;
    text-decoration: none;
}

.site-search:hover {
    border-color: var(--color-border-strong);
    color: var(--color-fg);
}

.site-search kbd {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-muted);
}

/* The shortcut names the platform's modifier: Cmd on Apple devices, Ctrl
   elsewhere. ThemePrePaint sets data-platform before paint; with no script the
   label reads Ctrl. */
.site-search .kbd-mac {
    display: none;
}

:root[data-platform="mac"] .site-search .kbd-mac {
    display: inline;
}

:root[data-platform="mac"] .site-search .kbd-other {
    display: none;
}

/* Bundled variable fonts (also preloaded by the site layout). */
@font-face {
    font-family: 'Inter Variable';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: local('Inter'), local('Inter Variable'), url('/fonts/inter.woff2') format('woff2');
}

@font-face {
    font-family: 'JetBrains Mono Variable';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: local('JetBrains Mono'), local('JetBrains Mono Variable'), url('/fonts/jetbrains-mono.woff2') format('woff2');
}

