:root {
    color-scheme: dark;
    --bg: #0b0d12;
    --panel: #12151d;
    --panel-strong: #171b25;
    --border: rgba(255, 255, 255, 0.08);
    --text: #e6e9ef;
    --muted: #98a2b3;
    --accent: #8b5cf6;
    --accent-2: #22d3ee;
    --radius: 14px;
    --max-width: 1040px;
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
}

body {
    margin: 0;
    background:
        radial-gradient(1100px 520px at 12% -12%, rgba(139, 92, 246, 0.22), transparent 60%),
        radial-gradient(900px 460px at 92% 4%, rgba(34, 211, 238, 0.14), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

/* Top bar ---------------------------------------------------------------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(11, 13, 18, 0.78);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
    color: var(--text);
}

.brand:hover {
    text-decoration: none;
    color: var(--text);
}

.nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--text);
    text-decoration: none;
}

.lang-toggle {
    padding: 0.28rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.lang-toggle:hover {
    color: var(--text);
    border-color: rgba(255, 255, 255, 0.22);
    background: var(--panel-strong);
}

.lang-toggle:focus-visible {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 2px;
}

/* Page shell ------------------------------------------------------------- */

.page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 4rem 1.5rem 5rem;
    display: flex;
    flex-direction: column;
    gap: 4.5rem;
}

/* Hero ------------------------------------------------------------------- */

.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.1rem;
    padding: 2rem 0 0.5rem;
}

.kicker {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--accent-2);
    padding: 0.3rem 0.85rem;
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.08);
}

.hero h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.03em;
    /* background-clip: text only paints inside the element's box. Glyph ascenders and descenders
       overflow the tight line box, so pad the box until they fit. */
    padding: 0.18em 0;
    background: linear-gradient(100deg, #ffffff 15%, #c4b5fd 55%, #67e8f9 90%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.lead {
    margin: 0;
    max-width: 44rem;
    color: var(--muted);
    font-size: 1.06rem;
}

.actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 0.6rem;
}

/* Buttons ---------------------------------------------------------------- */

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.35rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.22);
}

.button.primary {
    background-image: linear-gradient(100deg, var(--accent), #6366f1 60%, var(--accent-2));
    /* The gradient tiles from the padding box by default, which repeats its end colour as a
       sliver in the transparent 1px border around the rounded caps. */
    background-origin: border-box;
    border-color: transparent;
    color: #0b0d12;
}

.button:disabled {
    opacity: 0.55;
    cursor: progress;
    transform: none;
}

/* Sections --------------------------------------------------------------- */

.section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.section-head h2 {
    margin: 0 0 0.4rem;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
}

.muted {
    color: var(--muted);
    margin: 0;
    font-size: 0.925rem;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Icon grid and rows ----------------------------------------------------- */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.9rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
}

.card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-direction: column;
    padding: 1.4rem 1rem 1.1rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.row .card {
    min-width: 128px;
}

.card:hover {
    transform: translateY(-3px);
    border-color: rgba(139, 92, 246, 0.45);
    background: var(--panel-strong);
}

.card iconify-icon {
    color: var(--text);
}

.card-name {
    font-family: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
    word-break: break-word;
}

.inline-demo {
    margin: 0;
    color: var(--muted);
    line-height: 2;
}

.inline-demo iconify-icon {
    color: #f472b6;
    margin: 0 0.15rem;
}

/* Output ----------------------------------------------------------------- */

.output {
    margin: 0;
    padding: 1rem 1.1rem;
    background: #080a0f;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.7;
    color: #c3c9d6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Loader ---------------------------------------------------------------- */

.loader {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.loader-input {
    flex: 1 1 16rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    font-size: 0.9rem;
    font-family: "JetBrains Mono", "Cascadia Code", ui-monospace, SFMono-Regular, Menlo, monospace;
}

.loader-input:focus {
    outline: 2px solid rgba(139, 92, 246, 0.55);
    outline-offset: 1px;
    border-color: transparent;
}

.loader-output {
    display: flex;
    align-items: center;
    min-height: 3.5rem;
    padding: 0.75rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

/* Footer ---------------------------------------------------------------- */

.footer {
    border-top: 1px solid var(--border);
    background: rgba(11, 13, 18, 0.6);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1.6rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    font-size: 0.82rem;
}

.footer .muted {
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .page {
        padding-top: 2.5rem;
        gap: 3.25rem;
    }

    .topbar-inner {
        padding: 0.7rem 1rem;
    }

    .nav {
        gap: 0.9rem;
    }

    .footer-inner {
        padding: 1.4rem 1rem;
    }
}
