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

:root {
    --bg: #0a0a0f;
    --bg2: #111118;
    --bg3: #18181f;
    --surface: #1e1e28;
    --surface-soft: rgba(30, 30, 40, 0.82);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.16);
    --accent: #f5c842;
    --accent-strong: #ffd95a;
    --accent2: #ff7043;
    --accent3: #64d8a0;
    --text: #f0efe8;
    --muted: #888890;
    --muted-soft: #b3b3bd;
    --danger: #ff8b7f;
    --font-display: 'Unbounded', sans-serif;
    --font-body: 'DM Sans', sans-serif;
    --shadow-lg: 0 32px 90px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 18px 40px rgba(0, 0, 0, 0.24);
}

html {
    color-scheme: dark;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    background:
        radial-gradient(circle at top, rgba(245, 200, 66, 0.12), transparent 30%),
        radial-gradient(circle at 85% 15%, rgba(255, 112, 67, 0.1), transparent 24%),
        linear-gradient(180deg, var(--bg2), var(--bg));
    color: var(--text);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.5), transparent 80%);
}

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

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 18px 24px;
    background: rgba(10, 10, 15, 0.84);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: center;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.brand-mark {
    width: 44px;
    height: 44px;
    object-fit: contain;
    border-radius: 14px;
    padding: 6px;
    background: linear-gradient(180deg, rgba(245, 200, 66, 0.12), rgba(245, 200, 66, 0.03));
    border: 1px solid rgba(245, 200, 66, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.brand-copy {
    display: grid;
    gap: 3px;
}

.brand-copy strong,
.panel h1,
.panel h2 {
    font-family: var(--font-display);
    letter-spacing: -0.04em;
}

.brand-copy strong {
    font-size: 1rem;
}

.topnav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px;
    align-items: center;
}

.topnav a,
.topnav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text);
    text-decoration: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, color 0.18s ease;
    cursor: pointer;
}

.topnav a:hover,
.topnav button:hover,
button:hover {
    transform: translateY(-1px);
    border-color: rgba(245, 200, 66, 0.35);
    background: rgba(245, 200, 66, 0.08);
}

.topnav form {
    margin: 0;
}

.page-shell {
    max-width: 1240px;
    margin: 0 auto;
    padding: 32px 24px 48px;
}

.panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(30, 30, 40, 0.96), rgba(17, 17, 24, 0.96));
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    box-shadow: var(--shadow-md);
}

.panel::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(245, 200, 66, 0.35), transparent 45%);
}

.panel + .panel,
.grid + .panel,
.panel + .grid,
.grid + .grid {
    margin-top: 24px;
}

.narrow {
    max-width: 480px;
    margin: 8vh auto 0;
}

.grid.two {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.stack {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--muted-soft);
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(245, 200, 66, 0.45);
    box-shadow: 0 0 0 4px rgba(245, 200, 66, 0.08);
}

button {
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid rgba(245, 200, 66, 0.32);
    background: linear-gradient(180deg, var(--accent), #e9b72f);
    color: #0a0a0f;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(245, 200, 66, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
    box-shadow: 0 18px 36px rgba(245, 200, 66, 0.24);
    filter: saturate(1.05);
}

button[type="submit"] {
    justify-self: start;
}

.panel h1,
.panel h2 {
    margin: 0 0 16px;
    line-height: 1.08;
}

.panel h1 {
    font-size: clamp(1.4rem, 2vw, 2rem);
}

.panel h2 {
    font-size: clamp(1.15rem, 1.6vw, 1.5rem);
}

table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
}

pre {
    margin: 0;
    white-space: pre-wrap;
}

thead th {
    color: var(--muted-soft);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

th,
td {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    text-align: left;
    vertical-align: top;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.button-row form {
    margin: 0;
}

.metric {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 5vw, 4rem);
    margin: 10px 0 18px;
    font-weight: 900;
    letter-spacing: -0.06em;
    color: var(--accent);
}

.error {
    margin: 0 0 12px;
    color: var(--danger);
}

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

.hint {
    margin: -4px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
    line-height: 1.55;
}

.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    word-break: break-all;
}

.code-block {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    max-height: 480px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    line-height: 1.6;
}

.pill {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border: 1px solid transparent;
}

.pill-live {
    background: rgba(100, 216, 160, 0.12);
    border-color: rgba(100, 216, 160, 0.2);
    color: var(--accent3);
}

.pill-test {
    background: rgba(255, 112, 67, 0.12);
    border-color: rgba(255, 112, 67, 0.24);
    color: #ffb39a;
}

@media (max-width: 860px) {
    .topbar {
        padding: 16px;
    }

    .topbar-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .topnav {
        justify-content: flex-start;
    }

    .page-shell {
        padding: 24px 16px 40px;
    }

    .panel {
        padding: 22px;
        border-radius: 20px;
    }

    th,
    td {
        padding: 12px 8px;
    }
}

@media (max-width: 560px) {
    .brand-copy strong {
        font-size: 0.92rem;
    }

    .topnav a,
    .topnav button,
    button {
        width: 100%;
    }

    .topnav form {
        width: 100%;
    }
}
