:root {
    --bg: #0a0a0a;
    --surface: #111111;
    --surface-raised: #171717;
    --border: #262626;
    --border-strong: #333333;
    --text: #ededed;
    --muted: #a3a3a3;
    --dim: #737373;
    --accent: #ec4899;
    --accent-dim: rgba(236, 72, 153, 0.12);
    --radius: 12px;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 5.5rem;
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--text);
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}

a:hover {
    text-decoration-color: var(--accent);
}

::selection {
    background: var(--accent-dim);
}

.wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ------------------------------------------------------------------ header */

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 10, 10, 0.82);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar > .wrap {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    height: 60px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    margin-right: auto;
}

.brand svg {
    display: block;
}

.topbar nav {
    display: flex;
    gap: 1.25rem;
    font-size: 0.875rem;
}

.topbar nav a {
    color: var(--muted);
    text-decoration: none;
}

.topbar nav a:hover {
    color: var(--text);
}

@media (max-width: 720px) {
    .topbar nav a:not(.gh) {
        display: none;
    }
}

/* -------------------------------------------------------------------- hero */

.hero {
    position: relative;
    padding: 5rem 0 4rem;
    text-align: center;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -40% 0 auto;
    height: 460px;
    background: radial-gradient(ellipse at 50% 60%, rgba(236, 72, 153, 0.09), transparent 62%);
    pointer-events: none;
}

.hero > * {
    position: relative;
}

.hero h1 {
    font-size: clamp(2.5rem, 7vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.05;
}

.hero .tagline {
    margin: 1rem auto 0;
    max-width: 34rem;
    color: var(--muted);
    font-size: 1.125rem;
}

.hero-strip {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.875rem;
    margin-bottom: 2.5rem;
}

.hero-strip svg {
    filter: drop-shadow(0 6px 20px rgba(0, 0, 0, 0.55));
}

.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.copy {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    font-family: var(--mono);
    font-size: 0.875rem;
    color: var(--text);
    cursor: pointer;
}

.copy:hover {
    border-color: var(--border-strong);
}

.copy .prompt {
    color: var(--dim);
}

.copy .hint {
    color: var(--dim);
    font-family: var(--sans);
    font-size: 0.75rem;
    border-left: 1px solid var(--border);
    padding-left: 0.75rem;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: var(--muted);
    text-decoration: none;
}

.button:hover {
    color: var(--text);
    border-color: var(--border-strong);
}

/* ---------------------------------------------------------------- sections */

section {
    padding: 3.5rem 0;
}

.section-head {
    margin-bottom: 1.75rem;
}

.section-head h2 {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.section-head p {
    color: var(--dim);
    margin-top: 0.25rem;
}

.eyebrow {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--dim);
}

/* -------------------------------------------------------------- playground */

.playground {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

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

.controls {
    background: var(--surface);
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-content: start;
}

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

.control {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 0;
}

.control.wide {
    grid-column: 1 / -1;
}

.control label {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--dim);
}

.control input[type="text"],
.control input[type="number"],
.control select {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    font-size: 0.875rem;
    padding: 0.5rem 0.6875rem;
}

.control select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%);
    background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 2rem;
}

.control input:focus,
.control select:focus {
    outline: none;
    border-color: var(--accent);
}

.toggles {
    grid-column: 1 / -1;
    display: flex;
    gap: 1.5rem;
}

.toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--muted);
    cursor: pointer;
}

.toggle input {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
}

.stage {
    background: var(--surface-raised);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem 1.5rem;
    min-height: 260px;
    overflow: hidden;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 16px 16px;
}

/* Keep oversized previews inside the stage instead of blowing out the grid. */
.stage svg {
    max-width: 100%;
    height: auto;
}

.stage-meta {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--dim);
    text-align: center;
    word-break: break-all;
}

.snippet {
    margin-top: 1.25rem;
}

/* ----------------------------------------------------------------- avatars */

.grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.tile span {
    font-size: 0.75rem;
    color: var(--dim);
    font-family: var(--mono);
}

.showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.showcase > div {
    background: var(--surface);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.showcase .row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.showcase h3 {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text);
}

.showcase p {
    font-size: 0.8125rem;
    color: var(--dim);
    margin-top: -0.75rem;
}

/* -------------------------------------------------------------------- docs */

.docs {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
}

@media (max-width: 900px) {
    .docs {
        grid-template-columns: minmax(0, 1fr);
        gap: 1.5rem;
    }

    .toc {
        display: none;
    }
}

.toc {
    position: sticky;
    top: 5rem;
    font-size: 0.875rem;
    border-left: 1px solid var(--border);
}

.toc a {
    display: block;
    padding: 0.25rem 0 0.25rem 1rem;
    margin-left: -1px;
    border-left: 1px solid transparent;
    color: var(--dim);
    text-decoration: none;
}

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

.toc a.active {
    color: var(--text);
    border-left-color: var(--accent);
}

.prose h2 {
    font-size: 1.375rem;
    font-weight: 650;
    letter-spacing: -0.02em;
    margin: 3rem 0 1rem;
    padding-top: 0.5rem;
}

.prose > h2:first-child {
    margin-top: 0;
}

.prose h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 2rem 0 0.625rem;
}

.prose h3 code {
    font-size: 0.9375em;
    background: none;
    border: none;
    padding: 0;
    color: var(--accent);
}

.prose p,
.prose ul,
.prose ol {
    color: var(--muted);
    margin-bottom: 1rem;
}

.prose ul,
.prose ol {
    padding-left: 1.25rem;
}

.prose li {
    margin-bottom: 0.375rem;
}

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

.prose strong {
    color: var(--text);
    font-weight: 600;
}

code {
    font-family: var(--mono);
    font-size: 0.8125em;
    background: var(--surface-raised);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 0.1em 0.4em;
    color: var(--text);
}

pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1rem 1.125rem;
    overflow-x: auto;
    margin-bottom: 1.25rem;
    font-size: 0.8125rem;
    line-height: 1.7;
}

pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: inherit;
    color: #d4d4d4;
}

.tok-comment {
    color: var(--dim);
}

.tok-string {
    color: #6ee7b7;
}

.tok-keyword {
    color: #f0abfc;
}

.tok-var {
    color: #93c5fd;
}

.tok-fn {
    color: #fcd34d;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: block;
    overflow-x: auto;
}

th,
td {
    text-align: left;
    padding: 0.625rem 1rem 0.625rem 0;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

th {
    color: var(--dim);
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

td {
    color: var(--muted);
}

td:last-child {
    white-space: normal;
}

.note {
    border-left: 2px solid var(--accent);
    background: var(--accent-dim);
    border-radius: 0 8px 8px 0;
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--muted);
    margin-bottom: 1.25rem;
}

/* ------------------------------------------------------------------ footer */

footer {
    border-top: 1px solid var(--border);
    padding: 2.5rem 0 4rem;
    color: var(--dim);
    font-size: 0.875rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    justify-content: space-between;
}

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

    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
