:root {
    --bg: #04050a;
    --bg-panel: #0e1120;
    --bg-elev: #141936;
    --txt: #edf1ff;
    --muted: #97a2c6;
    --line: rgba(255, 255, 255, 0.14);
    --brand: #4f7cff;
    --brand-2: #53d8ff;
    --ok: #36d988;
    --warn: #ff8a55;
    --danger: #ff5d74;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    color: var(--txt);
    background: radial-gradient(circle at 5% 5%, #1b2455 0, transparent 35%), var(--bg);
    min-height: 100vh;
}

.hero-video {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: .14;
    z-index: 0;
    pointer-events: none;
}

.hero-video-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(4,5,10,.1), rgba(4,5,10,.75));
    z-index: 0;
    pointer-events: none;
}

.bg-orb {
    position: fixed;
    pointer-events: none;
    width: 26rem;
    height: 26rem;
    border-radius: 999px;
    filter: blur(80px);
    opacity: .26;
    z-index: 0;
    animation: drift 11s ease-in-out infinite alternate;
}

.orb-1 { background: var(--brand); top: -8rem; right: -8rem; }
.orb-2 { background: var(--brand-2); bottom: -10rem; left: -6rem; animation-delay: 1.3s; }

@keyframes drift {
    from { transform: translateY(0) translateX(0); }
    to { transform: translateY(20px) translateX(12px); }
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(4, 7, 16, .7);
    border-bottom: 1px solid var(--line);
    padding: .85rem 1.25rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .8rem;
    color: inherit;
    text-decoration: none;
}

.brand img { width: 44px; height: 44px; border-radius: 10px; }
.brand strong { display: block; font-size: .95rem; }
.brand span { display: block; font-size: .72rem; color: var(--muted); }

.brand--logo-only img {
    width: 68px;
    height: 68px;
    object-fit: contain;
    border-radius: 0;
    background: transparent;
}

.brand--logo-only .brand-copy {
    display: none;
}

.nav-links { display: flex; flex-wrap: wrap; gap: .4rem; }
.nav-links a {
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    padding: .5rem .8rem;
    border-radius: 10px;
    border: 1px solid transparent;
    transition: .2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--txt);
    border-color: var(--line);
    background: rgba(255, 255, 255, .04);
}

main {
    position: relative;
    z-index: 1;
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.2rem;
}

.panel {
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .28);
}

.panel:hover {
    border-color: rgba(83, 216, 255, .35);
    box-shadow: 0 14px 42px rgba(41, 106, 255, .18);
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 1rem;
    align-items: center;
}

.eyebrow {
    margin: 0;
    color: var(--brand-2);
    font-size: .78rem;
    letter-spacing: .08em;
    font-weight: 700;
}

h1 { margin: .6rem 0; font-size: clamp(1.9rem, 3.8vw, 3.2rem); line-height: 1.08; }
h2 { margin: .2rem 0 1rem; font-size: 1.5rem; }

.sub { color: var(--muted); max-width: 62ch; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .65rem; margin-top: 1rem; }

.btn {
    text-decoration: none;
    border: none;
    border-radius: 12px;
    padding: .72rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: .18s ease;
}

.btn-primary {
    background: linear-gradient(90deg, var(--brand), var(--brand-2));
    color: #041026;
}

.btn-secondary {
    background: transparent;
    color: var(--txt);
    border: 1px solid var(--line);
}

.btn:hover { transform: translateY(-1px); }

.hero-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.kpi {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: .85rem;
}

.kpi label { display: block; font-size: .75rem; color: var(--muted); margin-bottom: .3rem; }
.kpi strong { font-family: "JetBrains Mono", monospace; font-size: 1.08rem; }

.status-ok { color: var(--ok); }
.status-warn { color: var(--warn); }
.status-danger { color: var(--danger); }

.feature-grid,
.quick-grid,
.metrics-grid,
.ops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: .75rem;
}

.feature-grid article,
.quick-card,
.metric,
.ops-card {
    background: var(--bg-panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: .95rem;
}

.feature-grid p,
.quick-card small,
.ops-card p { color: var(--muted); margin: .35rem 0 0; }

.quick-card { text-decoration: none; color: inherit; display: block; }

.exchange-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .9rem;
}

.field { margin-bottom: .75rem; }
.field label { display: block; margin-bottom: .3rem; font-size: .82rem; color: var(--muted); }

input, textarea {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #0a0d1c;
    color: var(--txt);
    padding: .64rem .72rem;
}

.mono { font-family: "JetBrains Mono", monospace; }
.result { margin-top: .5rem; color: var(--muted); min-height: 1.2rem; }

.metric strong { display: block; font-family: "JetBrains Mono", monospace; font-size: 1.06rem; }
.metric label { color: var(--muted); font-size: .76rem; }

.raw-box {
    margin-top: .75rem;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #0a0d1a;
    color: #bcc8ef;
    font-family: "JetBrains Mono", monospace;
    font-size: .78rem;
    max-height: 220px;
    overflow: auto;
}

.checklist { margin: 0; padding-left: 1rem; color: var(--muted); }
.checklist li { margin: .35rem 0; }

.footer {
    text-align: center;
    color: var(--muted);
    font-size: .84rem;
    padding: 1rem;
}

canvas#tps-chart {
    width: 100%;
    height: 220px;
    display: block;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: #0a0d1a;
}

.fade-up { animation: fadeUp .55s ease both; }
.delay-1 { animation-delay: .12s; }
.delay-2 { animation-delay: .24s; }
.delay-3 { animation-delay: .36s; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
    .hero,
    .exchange-layout { grid-template-columns: 1fr; }
}
