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

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(124, 110, 247, 0.3);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 110, 247, 0.6);
}

* {
    scrollbar-width: thin;
    scrollbar-color: rgba(124, 110, 247, 0.3) transparent;
}

:root {
    --bg: #0f0f13;
    --surface: #16161d;
    --border: rgba(255, 255, 255, 0.07);
    --accent: #7c6ef7;
    --accent2: #5eead4;
    --text: #e4e4ef;
    --muted: #6b6b80;
    --code-bg: #1a1a24;
    --radius: 12px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 40% at 20% 10%, rgba(124, 110, 247, 0.12) 0%, transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 30%, rgba(94, 234, 212, 0.08) 0%, transparent 55%),
        radial-gradient(ellipse 70% 40% at 50% 80%, rgba(124, 110, 247, 0.07) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Hero ── */
.hero {
    padding: 96px 24px 80px;
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(124, 110, 247, 0.12);
    border: 1px solid rgba(124, 110, 247, 0.3);
    color: #a89cf8;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 100px;
    margin-bottom: 28px;
}

.badge::before {
    content: "●";
    color: var(--accent2);
    font-size: 8px;
}

h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fff 40%, #a89cf8 70%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 580px;
    margin: 0 auto 40px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        opacity 0.15s,
        transform 0.15s;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #6057e0);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

/* ── Layout ── */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

section {
    padding: 64px 0;
}

.section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 12px;
}

.section-title {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 40px;
}

/* ── Features grid ── */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s;
}

.card:hover {
    border-color: rgba(124, 110, 247, 0.35);
}

.card-icon {
    margin-bottom: 14px;
    color: var(--accent);
}

.card-icon svg {
    display: block;
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 0.875rem;
    color: var(--muted);
    line-height: 1.55;
}

/* ── Code block ── */
.code-wrap {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border);
}

pre {
    padding: 20px;
    overflow-x: auto;
    font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    color: #c9d1d9;
}

.t-purple {
    color: #a89cf8;
}

.t-green {
    color: var(--accent2);
}

.t-yellow {
    color: #f1c55a;
}

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

/* ── Endpoints ── */
.endpoints {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.endpoint {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 18px;
    text-decoration: none;
    color: var(--text);
    transition:
        border-color 0.2s,
        background 0.2s;
}

.endpoint:hover {
    border-color: rgba(124, 110, 247, 0.35);
    background: rgba(124, 110, 247, 0.05);
}

.method {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 4px;
    min-width: 42px;
    text-align: center;
}

.get {
    background: rgba(94, 234, 212, 0.12);
    color: var(--accent2);
}

.post {
    background: rgba(124, 110, 247, 0.15);
    color: #a89cf8;
}

.ep-path {
    font-family: monospace;
    font-size: 0.88rem;
    color: var(--text);
    flex: 1;
}

.ep-desc {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── Status ── */
.status-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    background: var(--muted);
    transition: background 0.3s;
    animation: pulse 2s ease-in-out infinite;
}

.status-indicator.healthy {
    background: var(--accent2);
    box-shadow: 0 0 8px rgba(94, 234, 212, 0.5);
}

.status-indicator.degraded {
    background: #f1c55a;
    box-shadow: 0 0 8px rgba(241, 197, 90, 0.5);
}

.status-indicator.unhealthy {
    background: #f87171;
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.status-label {
    font-weight: 700;
    font-size: 0.95rem;
}

.status-label.healthy {
    color: var(--accent2);
}

.status-label.degraded {
    color: #f1c55a;
}

.status-label.unhealthy {
    color: #f87171;
}

.status-uptime {
    font-size: 0.82rem;
    color: var(--muted);
    margin-left: auto;
}

.components-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.component-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.component-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
    background: var(--muted);
    transition: background 0.3s;
    animation: pulse 2s ease-in-out infinite;
}

.component-dot.healthy {
    background: var(--accent2);
}

.component-dot.degraded {
    background: #f1c55a;
}

.component-dot.unhealthy {
    background: #f87171;
}

.component-name {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.component-msg {
    font-size: 0.78rem;
    line-height: normal;
    color: var(--muted);
}

/* ── Metrics ── */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.metric-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text);
    line-height: 1;
}

.metric-value.accent {
    color: var(--accent);
}

.metric-value.accent2 {
    color: var(--accent2);
}

.metric-value.warn {
    color: #f1c55a;
}

.metric-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 6px;
}

.metrics-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.metrics-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent2);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%,
    100% {
        opacity: 1;
        scale: 1;
    }
    50% {
        opacity: 0.3;
        scale: 0.7;
    }
}

/* ── Footer ── */
footer {
    border-top: 1px solid var(--border);
    padding: 28px 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--muted);
}

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

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

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

.link-muted:hover {
    color: var(--text);
}

@media (max-width: 600px) {
    .hero {
        padding: 72px 16px 56px;
    }

    section {
        padding: 48px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .ep-desc {
        display: none;
    }
}

/* ── Grid background ── */
.grid-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(124, 110, 247, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(124, 110, 247, 0.07) 1px, transparent 1px);
    background-size: 70px 70px;
    animation: grid-drift 22s linear infinite;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 40%, black 30%, transparent 100%);
}

@keyframes grid-drift {
    0% {
        background-position: 0 0;
        transform: translate(0, 0);
    }
    100% {
        background-position: 70px 70px;
        transform: translate(0, 0);
    }
}

body > *:not(.grid-bg) {
    position: relative;
    z-index: 1;
}

/* ── Particles canvas ── */
#particles {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero {
    position: relative;
}

.hero > *:not(#particles) {
    position: relative;
    z-index: 1;
}

/* ── Typewriter cursor ── */
.cursor {
    display: inline-block;
    color: var(--accent);
    font-weight: 300;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* ── Interactive card base ── */
.interactive-card {
    position: relative;
    overflow: hidden;
}

.interactive-card > * {
    position: relative;
    z-index: 1;
}

/* Cursor glow */
.interactive-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(124, 110, 247, 0.18),
        rgba(94, 234, 212, 0.08),
        transparent 65%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

.interactive-card.glow-active::before {
    opacity: 1;
}

/* Animated gradient border */
@property --border-angle {
    syntax: "<angle>";
    initial-value: 0deg;
    inherits: false;
}

@keyframes border-spin {
    to {
        --border-angle: 360deg;
    }
}

.interactive-card.border-spin::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(
        from var(--border-angle),
        transparent 70%,
        rgba(124, 110, 247, 0.9) 82%,
        rgba(94, 234, 212, 0.9) 91%,
        transparent
    );
    z-index: -1;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.interactive-card.border-spin:hover::after {
    opacity: 1;
    animation: border-spin 5s linear infinite;
}
