:root {
    --bg: #0a0c10;
    --surface: #111318;
    --border: #1e2330;
    --accent: #478CFF;
    --accent2: #00e5c0;
    --godot-blue: #478CFF;
    --text: #e8eaf2;
    --muted: #6b7289;
    --code-bg: #0d0f14;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* GRID BACKGROUND */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
    linear-gradient(rgba(71,140,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71,140,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* NAV */
nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2.5rem;
    background: rgba(10,12,16,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.nav-logo {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
}

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

/* HERO */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem 4rem;
    text-align: center;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 700px;
    height: 700px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(71,140,255,0.12) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.badge-row {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeUp 0.6s ease both;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(71,140,255,0.1);
    border: 1px solid rgba(71,140,255,0.25);
    color: var(--accent);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    border-radius: 2px;
    letter-spacing: 0.08em;
}

.badge.green {
    background: rgba(0,229,192,0.08);
    border-color: rgba(0,229,192,0.2);
    color: var(--accent2);
}

.hero h1 {
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.5rem;
    animation: fadeUp 0.6s 0.1s ease both;
}

.hero h1 span {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: var(--muted);
    max-width: 560px;
    margin: 1.2rem auto 2.5rem;
    font-weight: 400;
    animation: fadeUp 0.6s 0.2s ease both;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    animation: fadeUp 0.6s 0.3s ease both;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: 2px;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 2px solid var(--accent);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent);
}

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

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* CODE PREVIEW */
.code-preview {
    position: relative;
    z-index: 1;
    margin: 0 auto;
    max-width: 680px;
    width: 100%;
    margin-top: 4rem;
    animation: fadeUp 0.6s 0.4s ease both;
}

.code-window {
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.code-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-red { background: #ff5f57; }
.dot-yellow { background: #febc2e; }
.dot-green { background: #28c840; }

.code-filename {
    margin-left: 0.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
}

.code-body {
    padding: 1.5rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    line-height: 1.8;
    overflow-x: auto;
}

.kw { color: #c792ea; }
.type { color: #82aaff; }
.fn { color: #82cfff; }
.str { color: #c3e88d; }
.cm { color: #546e7a; font-style: italic; }
.num { color: #f78c6c; }
.var { color: var(--text); }

/* SECTIONS */
section {
    position: relative;
    z-index: 1;
    max-width: 1100px;
    margin: 0 auto;
    padding: 5rem 2rem;
}

.section-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.section-desc {
    color: var(--muted);
    max-width: 540px;
    font-size: 1.05rem;
}

/* FEATURES GRID */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    margin-top: 3rem;
}

.feature-card {
    background: var(--bg);
    padding: 2rem;
    transition: background 0.2s;
}

.feature-card:hover { background: var(--surface); }

.feature-icon {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* API TABLE */
.api-block {
    margin-top: 3rem;
}

.api-group {
    margin-bottom: 3rem;
}

.api-group-title {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--accent2);
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    letter-spacing: 0.05em;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

th {
    text-align: left;
    padding: 0.6rem 1rem;
    background: var(--surface);
    color: var(--muted);
    font-family: 'Space Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(30,35,48,0.5);
    vertical-align: top;
}

tr:hover td { background: rgba(71,140,255,0.03); }

.prop { font-family: 'Space Mono', monospace; color: var(--accent); font-size: 0.82rem; }
.ttype { font-family: 'Space Mono', monospace; color: var(--accent2); font-size: 0.78rem; }
.desc { color: var(--muted); font-size: 0.85rem; }

/* INSTALL */
.install-tabs {
    display: flex;
    gap: 0;
    margin-top: 2rem;
    border-bottom: 1px solid var(--border);
}

.tab-btn {
    background: none;
    border: none;
    padding: 0.75rem 1.5rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all 0.2s;
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

.install-steps {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.step {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
}

.step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(71,140,255,0.1);
    border: 1px solid rgba(71,140,255,0.25);
    color: var(--accent);
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

.step-text { color: var(--text); font-size: 0.95rem; }
.step-text code {
    background: var(--code-bg);
    border: 1px solid var(--border);
    padding: 0.15rem 0.4rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent2);
}

/* USE CASES */
.use-cases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 3rem;
}

.use-case {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 2px;
    transition: border-color 0.2s, transform 0.2s;
}

.use-case:hover {
    border-color: rgba(71,140,255,0.3);
    transform: translateY(-2px);
}

.use-case-icon { font-size: 1.5rem; margin-bottom: 0.75rem; }
.use-case h4 { font-size: 0.95rem; font-weight: 700; margin-bottom: 0.4rem; }
.use-case p { color: var(--muted); font-size: 0.85rem; }

/* FOOTER */
footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 2.5rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    font-family: 'Space Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
}

.footer-left strong { color: var(--accent); }

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}

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

/* DIVIDER */
.divider {
    position: relative;
    z-index: 1;
    height: 1px;
    background: var(--border);
    max-width: 1100px;
    margin: 0 auto;
}

/* ANIMATIONS */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

@media (max-width: 640px) {
    nav { padding: 1rem 1.25rem; }
    .nav-links { gap: 1rem; }
    section { padding: 3.5rem 1.25rem; }
    footer { padding: 2rem 1.25rem; flex-direction: column; align-items: flex-start; }
}