.stream-page {
    --stream-ground: #121318;
    --stream-field: #191b24;
    --stream-panel: #212431;
    --stream-code: #101116;
    --stream-ink: #f5f6fb;
    --stream-muted: #bec3d5;
    --stream-accent: #c4b5fd;
    background: var(--stream-ground);
    color: var(--stream-ink);
    font-family: Inter, system-ui, sans-serif;
}

.stream-wrap {
    width: min(100% - 40px, 1120px);
    margin-inline: auto;
}

.stream-page h1,
.stream-page h2,
.stream-page h3 {
    margin: 0;
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.035em;
    text-wrap: balance;
}

.stream-page h1 {
    max-width: 10ch;
    font-size: clamp(3rem, 5.8vw, 5.5rem);
}

.stream-page h2 {
    font-size: clamp(2rem, 3.8vw, 3.25rem);
}

.stream-page h3 {
    font-size: 1.3rem;
}

.stream-page p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--stream-muted);
}

.stream-page a {
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.stream-page a:focus-visible,
.stream-page summary:focus-visible,
.stream-page pre:focus-visible {
    outline: 2px solid var(--stream-accent);
    outline-offset: 4px;
}

.stream-hero,
.stream-quickstart,
.stream-faq {
    display: grid;
    align-items: center;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
    gap: clamp(2rem, 6vw, 6rem);
    padding-block: clamp(3.75rem, 9vw, 8rem);
}

.stream-intro > p:first-of-type {
    max-width: 36ch;
    margin-top: 1.75rem;
    font-size: clamp(1.125rem, 2vw, 1.375rem);
}

.stream-intro .stream-note {
    max-width: 43ch;
    margin-top: 1.5rem;
}

.stream-note a,
.stream-example-note a,
.stream-doc-links a,
.stream-faq a,
.stream-link {
    color: var(--stream-accent);
    text-decoration-line: underline;
}

.stream-actions,
.stream-doc-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-top: 1.75rem;
}

.stream-button {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    padding: .75rem 1.15rem;
    background: var(--stream-accent);
    color: var(--stream-code);
    font-weight: 650;
}

.stream-button:hover {
    background: var(--stream-ink);
}

.stream-example,
.stream-command {
    min-width: 0;
    margin: 0;
    padding: clamp(1rem, 3vw, 2rem);
    background: var(--stream-panel);
}

.stream-page figcaption {
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
}

.stream-samples {
    min-width: 0;
    padding: 0;
    margin: 0;
}

.stream-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.stream-options {
    display: flex;
    gap: .375rem;
    margin-bottom: 1rem;
}

.stream-options label {
    display: grid;
    place-items: center;
    min-height: 44px;
    min-width: 74px;
    padding-inline: .75rem;
    background: var(--stream-field);
    color: var(--stream-muted);
    cursor: pointer;
}

.stream-options label:hover {
    color: var(--stream-ink);
}

#stream-example-cs2:checked ~ .stream-options label[for="stream-example-cs2"],
#stream-example-rust:checked ~ .stream-options label[for="stream-example-rust"] {
    background: var(--stream-accent);
    color: var(--stream-code);
}

#stream-example-cs2:focus-visible ~ .stream-options label[for="stream-example-cs2"],
#stream-example-rust:focus-visible ~ .stream-options label[for="stream-example-rust"] {
    outline: 2px solid var(--stream-ink);
    outline-offset: 3px;
}

.stream-sample {
    display: none;
}

#stream-example-cs2:checked ~ .stream-sample-cs2,
#stream-example-rust:checked ~ .stream-sample-rust {
    display: block;
}

.stream-sample p,
.stream-page .stream-example-note {
    font-size: .875rem;
}

.stream-sample pre,
.stream-command pre {
    background: var(--stream-code);
    color: var(--stream-ink);
    margin: .625rem 0 0;
    padding: 1rem;
    overflow: auto;
    font-size: .875rem;
    line-height: 1.65;
}

.stream-sample p {
    color: var(--stream-accent);
}

.stream-page .stream-example-note {
    margin-top: .875rem;
}

.stream-flow {
    background: var(--stream-field);
    padding-block: clamp(3.75rem, 7vw, 6rem);
}

.stream-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 1.75rem 0 0;
    padding: 0;
}

.stream-steps li {
    list-style: none;
    background: var(--stream-panel);
    padding: clamp(1rem, 2.3vw, 1.75rem);
}

.stream-steps li:nth-child(even) {
    background: var(--stream-code);
}

.stream-steps p,
.stream-quickstart p,
.stream-faq p {
    margin-top: .875rem;
}

.stream-quickstart {
    scroll-margin-top: 6rem;
}

.stream-faq {
    align-items: start;
    padding-top: 0;
}

.stream-answers {
    display: grid;
    gap: .375rem;
}

.stream-answers details {
    padding: 1rem 1.25rem;
    background: var(--stream-field);
}

.stream-answers details[open] {
    background: var(--stream-panel);
}

.stream-answers summary {
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
}

.stream-markdown {
    max-width: 800px;
    padding-block: clamp(2rem, 6vw, 5rem);
    overflow-wrap: anywhere;
}

.stream-markdown h1 {
    max-width: unset;
    margin: 1.25rem 0;
    font-size: clamp(2rem, 4.5vw, 4.125rem);
}

.stream-markdown h2,
.stream-markdown h3 {
    margin: 2.25rem 0 .9rem;
    scroll-margin-top: 6rem;
}

.stream-markdown p,
.stream-markdown ol,
.stream-markdown ul {
    margin-block: .75rem;
}

.stream-markdown ol,
.stream-markdown ul {
    padding-left: 1.5rem;
}

.stream-markdown ol {
    list-style: decimal;
}

.stream-markdown ul {
    list-style: disc;
}

.stream-markdown li + li {
    margin-top: .45rem;
}

.stream-markdown a {
    color: var(--stream-accent);
    text-decoration-line: underline;
}

.stream-markdown pre,
.stream-markdown table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    margin-block: 1.15rem;
    background: var(--stream-code);
}

.stream-markdown pre {
    padding: 1rem;
    font-size: .875rem;
    line-height: 1.65;
}

.stream-markdown th,
.stream-markdown td {
    padding: .65rem .9rem;
    text-align: left;
    vertical-align: top;
}

.stream-markdown tr:nth-child(even),
.stream-markdown thead {
    background: var(--stream-field);
}

@media (max-width: 800px) {
    .stream-hero,
    .stream-quickstart,
    .stream-faq {
        grid-template-columns: minmax(0, 1fr);
    }

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

    .stream-hero h1 {
        max-width: unset;
    }
}

@media (max-width: 470px) {
    .stream-hero {
        padding-top: 3rem;
    }

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

    .stream-sample pre,
    .stream-command pre {
        white-space: pre-wrap;
        overflow-wrap: anywhere;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .stream-intro > *,
    .stream-example,
    .stream-steps li,
    .stream-command {
        animation: stream-enter .42s ease-out both;
    }

    .stream-intro > :nth-child(2),
    .stream-steps li:nth-child(2) {
        animation-delay: .06s;
    }

    .stream-intro > :nth-child(3),
    .stream-steps li:nth-child(3) {
        animation-delay: .12s;
    }

    .stream-intro > :nth-child(4),
    .stream-steps li:nth-child(4) {
        animation-delay: .18s;
    }

    .stream-sample {
        animation: stream-crossfade .2s ease-out;
    }

    @keyframes stream-enter {
        from { opacity: .85; transform: translateY(7px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @keyframes stream-crossfade {
        from { opacity: .72; }
        to { opacity: 1; }
    }
}
