:root {
    /* DEFAULT DARK THEME (#0D1017) */
    --bg-main: #0D1017;
    --bg-surface: #161b22;
    --bg-card: #1c212b;
    --text-main: #ffffff;
    --text-muted: #8b949e;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border: rgba(255, 255, 255, 0.1);
    --code-bg: #090b0f;
    --glow: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%);
}

[data-theme="light"] {
    /* LIGHT THEME */
    --bg-main: #f8fafc;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --border: rgba(0, 0, 0, 0.1);
    --code-bg: #1e293b; /* Keep code dark for readability */
    --glow: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    background-image: radial-gradient(var(--border) 1px, transparent 1px);
    background-size: 30px 30px;
}

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

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

.text-center { text-align: center; }
.relative { position: relative; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-4 { margin-bottom: 2rem; }
.max-w-md { max-width: 800px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.text-muted { color: var(--text-muted); }

/* Typography */
h1, h2, h3 { line-height: 1.2; margin-bottom: 1rem; font-weight: 700; }
.section-title { font-size: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; margin-bottom: 1.5rem; }

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(var(--bg-main), 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.nav-logo-container { z-index: 101; }
.nav-logo { font-weight: 700; font-size: 1.3rem; letter-spacing: -0.5px; color: var(--text-main); text-decoration: none; }
.nav-logo:hover { color: var(--text-main); text-decoration: none; }

/* Desktop Navigation Wrapper */
.nav-wrapper {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: space-between;
}

/* Centered Links */
.nav-menu { display: flex; gap: 2rem; margin: 0 auto; }
.nav-menu-link { color: var(--text-muted); font-size: 0.95rem; font-weight: 600; transition: color 0.2s; text-decoration: none; }
.nav-menu-link:hover { color: var(--text-main); text-decoration: none; }

/* Right Icons */
.nav-links { display: flex; align-items: center; gap: 1.5rem; flex-wrap: nowrap; }

/* Override global link color for icons */
.icon-link { display: flex; align-items: center; color: var(--text-muted) !important; transition: color 0.2s; }
.icon-link:hover { color: var(--text-main) !important; }

/* Theme Toggle */
.theme-toggle { display: flex; align-items: center; }
.theme-toggle button {
    background: none; border: none; padding: 0; margin: 0;
    line-height: 0; cursor: pointer; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s;
}
.theme-toggle button:hover { color: var(--text-main); }

/* Hamburger Menu */
.hamburger {
    display: none;
    background: none; border: none; padding: 0;
    cursor: pointer; color: var(--text-main);
    z-index: 101;
}

/* Responsive Tablet/Mobile */
@media (max-width: 768px) {
    .hamburger { display: block; }
    
    .nav-wrapper {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-surface);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        align-items: flex-start;
        padding: 1.5rem 20px;
        gap: 1.5rem;
        display: none; /* Hidden on mobile by default */
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    
    .nav-wrapper.active { display: flex; } /* Toggled by JS */

    .nav-menu { flex-direction: column; gap: 1.2rem; margin: 0; width: 100%; }
    .nav-menu-link { font-size: 1.1rem; display: block; }

    .nav-links {
        width: 100%;
        justify-content: flex-start;
        padding-top: 1rem;
        border-top: 1px solid var(--border);
    }
}

.theme-toggle { display: flex; align-items: center; }
.theme-toggle button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    line-height: 0;
    cursor: pointer;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}
.theme-toggle button:hover { color: var(--text-main); }
.hidden { display: none !important; }

/* Hero Section */
.hero {
    padding: 100px 0 60px;
    position: relative;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: var(--glow);
    z-index: -1;
}

.hero-title { font-size: 4rem; letter-spacing: -2px; margin-bottom: 0.5rem; }
.hero-subtitle { font-size: 1.5rem; color: var(--text-muted); margin-bottom: 2rem; font-weight: 300; }
.hero-description { max-width: 800px; margin: 0 auto 2.5rem; font-size: 1.1rem; color: var(--text-muted); }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s;
    border: 1px solid transparent;
}
.btn-primary { background-color: var(--accent); color: #fff; }
.btn-primary:hover { background-color: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn-secondary { background-color: transparent; border-color: var(--border); color: var(--text-main); margin-left: 10px; }
.btn-secondary:hover { background-color: var(--bg-surface); color: var(--text-main); }

/* Layouts */
.section { padding: 60px 0; }
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* Cards */
.cards { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-2px); border-color: var(--text-muted); }
.card h3 { margin-bottom: 0.5rem; font-size: 1.2rem; }
.card p { color: var(--text-muted); font-size: 0.95rem; }

/* Quote */
.highlight-quote {
    border-left: 4px solid var(--accent);
    padding: 1rem 1.5rem;
    margin: 2rem 0;
    background: var(--bg-surface);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Lists */
.feature-list { list-style: none; }
.feature-list li { margin-bottom: 1rem; position: relative; padding-left: 1.5rem; color: var(--text-muted); }
.feature-list li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: bold; }
.feature-list strong { color: var(--text-main); }

/* Code Blocks */
.code-wrapper {
    position: relative;
    background: var(--code-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.code-wrapper pre {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: monospace;
    font-size: 0.9rem;
    color: #e2e8f0; /* Always light text in code block */
}
.copy-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}
.copy-btn:hover { background: rgba(255,255,255,0.2); }

/* Badges Table */
.badge-table {
    border-collapse: collapse;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}
.badge-table th, .badge-table td { padding: 1rem; border: 1px solid var(--border); }
.badge-table img { max-width: 100%; height: auto; display: block; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 2rem 0; margin-top: 4rem; background: var(--bg-surface); }

/* Responsive */
@media (max-width: 768px) {
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .btn-secondary { margin-left: 0; margin-top: 10px; display: block; }
}