:root {
    color-scheme: dark;
    --navy: #00296b;
    --navy-mid: #003f88;
    --navy-bright: #00509d;
    --gold: #fdc500;
    --gold-bright: #ffd500;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: color-mix(in srgb, var(--navy) 72%, #000);
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
}

code,
pre,
kbd {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.nav-link {
    display: block;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    font-weight: 600;
    transition: color 150ms ease, background-color 150ms ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    outline: none;
}

.doc-nav-link {
    display: block;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.5rem 0 0.5rem 1rem;
    color: rgba(255, 255, 255, 0.82);
    transition: border-color 150ms ease, color 150ms ease;
}

.doc-nav-link:hover,
.doc-nav-link:focus-visible {
    border-color: var(--gold-bright);
    color: #fff;
    outline: none;
}

.doc-kicker {
    margin: 0;
    color: var(--gold-bright);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.doc-heading {
    margin-top: 0.75rem;
    color: #fff;
    font-size: clamp(1.875rem, 4vw, 2.5rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.1;
}

.doc-lead {
    max-width: 48rem;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.0625rem;
    line-height: 1.8;
}

.doc-card {
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    background: rgba(0, 41, 107, 0.82);
    padding: 1.25rem;
}

.doc-card p {
    margin: 0.65rem 0 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.875rem;
    line-height: 1.65;
}

.doc-step {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: 1rem;
    padding: 1.25rem;
}

.doc-step > span {
    padding-top: 0.15rem;
    color: var(--gold-bright);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.75rem;
}

.doc-step strong {
    color: #fff;
}

.doc-step p {
    margin: 0.35rem 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.875rem;
    line-height: 1.6;
}

.code-window {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 1rem;
    background: color-mix(in srgb, var(--navy) 78%, #000);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.code-window-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1rem;
}

.code-window-bar span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 999px;
    background: var(--navy-bright);
}

.code-window-bar span:nth-child(2) {
    background: var(--gold);
}

.code-window-bar span:nth-child(3) {
    background: var(--gold-bright);
}

.code-window-bar b {
    margin-left: 0.4rem;
    color: rgba(255, 255, 255, 0.75);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.6875rem;
    font-weight: 400;
}

.code-window pre {
    overflow-x: auto;
    margin: 0;
    padding: 1.25rem;
    color: var(--gold-bright);
    font-size: 0.8125rem;
    line-height: 1.8;
}

.command-row {
    display: grid;
    gap: 0.5rem;
    background: rgba(0, 41, 107, 0.78);
    padding: 1rem 1.25rem;
}

.command-row code {
    width: fit-content;
    color: var(--gold-bright);
    font-size: 0.8125rem;
    font-weight: 700;
}

.command-row p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    line-height: 1.6;
}

.htmx-indicator {
    opacity: 0;
    transition: opacity 150ms ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

.htmx-swapping {
    opacity: 0;
    transition: opacity 120ms ease;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 180ms;
}

@media (min-width: 640px) {
    .command-row {
        grid-template-columns: minmax(11rem, 0.35fr) 1fr;
        align-items: baseline;
        gap: 1.5rem;
    }
}

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

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
    }
}
