:root {
    --bg: #0b1220;
    --panel: #111a2e;
    --border: #1f2b45;
    --text: #e6ecf7;
    --muted: #93a1bd;
    --accent: #3b8cff;
    --accent-2: #2160e0;
    --mono: "Geist Mono", ui-monospace, monospace;
    color-scheme: dark;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font:
        16px / 1.6 "Geist",
        system-ui,
        sans-serif;
}
a {
    color: var(--accent);
}
code,
pre {
    font-family: var(--mono);
    font-size: 0.9em;
}
pre {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    tab-size: 4;
}
:not(pre) > code {
    overflow-wrap: anywhere;
    background: var(--panel);
    padding: 1px 5px;
    border-radius: 4px;
}
.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 16px;
}

header {
    border-bottom: 1px solid var(--border);
}
header .wrap {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 60px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    margin-right: auto;
}
header nav a {
    color: var(--muted);
    text-decoration: none;
}
header nav a:hover {
    color: var(--text);
}
header nav {
    display: flex;
    gap: 20px;
}

.hero {
    text-align: center;
    padding: 80px 0 56px;
}
.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    line-height: 1.15;
    margin: 20px 0 16px;
    letter-spacing: -0.02em;
}
.hero p {
    color: var(--muted);
    font-size: 1.15rem;
    max-width: 640px;
    margin: 0 auto 32px;
}
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    margin: 4px;
    border: 1px solid var(--border);
    color: var(--text);
}
.btn.primary {
    background: linear-gradient(var(--accent), var(--accent-2));
    border-color: transparent;
    color: #fff;
}

.term {
    max-width: 720px;
    margin: 0 auto;
    text-align: left;
}
.term pre {
    margin: 0;
    line-height: 1.7;
}
.term .g {
    color: #5fd38d;
}

section {
    padding: 48px 0;
}
section h2 {
    font-size: 1.6rem;
    margin: 0 0 24px;
}
.grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
    transition:
        border-color 0.2s,
        transform 0.2s;
}
.card:hover {
    border-color: #2c3b5c;
    transform: translateY(-2px);
}
.card h3,
.step h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}
.card p,
.step p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}
.icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgb(59 140 255 / 0.12);
    border: 1px solid rgb(59 140 255 / 0.25);
}
.icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
}
.step {
    position: relative;
}
.step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: 52px;
    right: -28px;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent);
}
.step-n {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-bottom: 16px;
    border-radius: 50%;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(var(--accent), var(--accent-2));
    box-shadow: 0 0 0 4px rgb(59 140 255 / 0.15);
}
@media (max-width: 860px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .grid,
    .flow {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }
    .step:not(:last-child)::after {
        display: none;
    }
}
footer {
    border-top: 1px solid var(--border);
    color: var(--muted);
    padding: 24px 0;
    margin-top: 48px;
    font-size: 0.9rem;
}

.docs {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 40px;
    padding-top: 32px;
}
.docs aside {
    position: sticky;
    top: 24px;
    align-self: start;
}
.docs aside a {
    display: block;
    color: var(--muted);
    text-decoration: none;
    padding: 3px 0;
}
.docs aside a:hover {
    color: var(--text);
}
.docs article h1 {
    margin-top: 0;
}
.docs article h2 {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}
.docs table {
    border-collapse: collapse;
    width: 100%;
    display: block;
    overflow-x: auto;
}
.docs th,
.docs td {
    border: 1px solid var(--border);
    padding: 6px 10px;
    text-align: left;
}
.docs blockquote {
    margin: 0;
    padding: 4px 16px;
    border-left: 3px solid var(--accent);
    background: var(--panel);
    color: var(--muted);
}
@media (max-width: 720px) {
    .docs {
        grid-template-columns: minmax(0, 1fr);
    }
    .docs aside {
        display: none;
    }
}

.setup-head {
    padding: 48px 0 32px;
}
.setup-title {
    font-size: 2.2rem;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
}
.lead {
    color: var(--muted);
    margin: 0;
}
.setup-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}
.panel {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px;
}
.field {
    display: grid;
    gap: 8px;
}
.field[hidden] {
    display: none;
}
.field-label {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
}
.hint {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.45;
}
.field input {
    height: 40px;
    padding: 0 12px;
    font: 14px var(--mono);
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    outline: none;
    transition:
        border-color 0.15s,
        box-shadow 0.15s;
}
.field input::placeholder {
    color: #4f5d7a;
}
.field input:hover {
    border-color: #2c3b5c;
}
.field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgb(59 140 255 / 0.2);
}

.seg {
    display: flex;
    padding: 3px;
    gap: 3px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
}
.seg label {
    flex: 1;
    position: relative;
}
.seg input {
    position: absolute;
    opacity: 0;
}
.seg span {
    display: block;
    text-align: center;
    padding: 7px 8px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}
.seg span:hover {
    color: var(--text);
}
.seg input:checked + span {
    background: linear-gradient(var(--accent), var(--accent-2));
    color: #fff;
    box-shadow: 0 1px 3px rgb(0 0 0 / 0.3);
}
.seg input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.switch {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    font-size: 0.95rem;
}
.switch strong {
    font-weight: 500;
}
.switch input {
    appearance: none;
    flex: none;
    width: 36px;
    height: 20px;
    margin: 2px 0 0;
    border-radius: 999px;
    background: var(--border);
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
}
.switch input::before {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s;
}
.switch input:checked {
    background: var(--accent);
}
.switch input:checked::before {
    transform: translateX(16px);
}
.switch input:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.seg-sm {
    margin: 0 auto 0 12px;
}
.window-title:has(+ .seg-sm) {
    margin-right: 0;
}
.seg.seg-sm label span {
    white-space: nowrap;
    padding: 4px 10px;
    font-size: 0.8rem;
}
.window pre.scroll {
    max-height: 420px;
    overflow-y: auto;
}
.output {
    display: grid;
    gap: 20px;
}
.window {
    background: #0d1526;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}
.window-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px 0 14px;
    min-height: 46px;
    background: var(--panel);
    border-bottom: 1px solid var(--border);
}
.window-title {
    font-weight: 600;
    margin-right: auto;
}
.window pre {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: none;
    padding: 16px 18px;
    font-size: 13px;
    line-height: 1.65;
}
.tabs {
    display: flex;
    align-self: stretch;
    margin-right: auto;
    overflow-x: auto;
}
.tabs button {
    font: 13px var(--mono);
    color: var(--muted);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0 12px;
    cursor: pointer;
    white-space: nowrap;
}
.tabs button:hover {
    color: var(--text);
}
.tabs button[aria-selected="true"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}
.icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    font:
        500 13px "Geist",
        system-ui,
        sans-serif;
    color: var(--muted);
    background: none;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    transition:
        background 0.15s,
        color 0.15s;
}
.icon-btn:hover {
    color: var(--text);
    background: var(--bg);
    border-color: var(--border);
}
.tok-c {
    color: #64748f;
    font-style: italic;
}
.tok-k {
    color: #7cc4ff;
}
.tok-s {
    color: #a6e3a1;
}
.tok-v {
    color: #f5b971;
}
.tok-cmd {
    color: #c4a7ff;
}

@media (max-width: 860px) {
    .setup-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .panel {
        position: static;
    }
    .icon-btn span {
        display: none;
    }
}
