:root {
    /* Brand Colors & Tokens (Inherited & Extended) */
    --bg-color: #050508;
    --bg-secondary: #0a0b12;
    --text-primary: #ffffff;
    --text-secondary: #a0a5b8;
    --accent-primary: #00d2ff;
    --accent-secondary: #3a7bd5;
    
    --glass-bg: rgba(255, 255, 255, 0.02);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glow-color: rgba(0, 210, 255, 0.15);

    /* Layout Dimensions */
    --navbar-height: 70px;
    --sidebar-width: 280px;
    --toc-width: 240px;

    /* Typography */
    --font-main: 'Outfit', sans-serif;
    --font-mono: 'Roboto Mono', monospace;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Styles & Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--navbar-height) + 20px);
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

h1,
h2,
h3,
h4 {
    line-height: 1.2;
    font-weight: 800;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Header Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: var(--navbar-height);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
    color: #fff;
}

.logo-accent {
    color: var(--accent-primary);
}

.logo-light {
    font-weight: 300;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.navbar nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.nav-link:hover {
    color: var(--accent-primary);
}

/* Buttons */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-medium);
    display: inline-block;
    border: none;
    font-family: var(--font-main);
    font-size: 0.9rem;
}

.btn-tool {
    background: rgba(0, 210, 255, 0.08);
    border: 1px solid rgba(0, 210, 255, 0.3);
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
}

.btn-tool:hover {
    background: rgba(0, 210, 255, 0.18);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.25);
    transform: translateY(-1px);
}

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

.btn-outline:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 210, 255, 0.05);
}

/* Mobile Sidebar Burger Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.mobile-menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition-fast);
    border-radius: 2px;
}

/* Main Container Layout */
.wiki-container {
    display: flex;
    margin-top: var(--navbar-height);
    min-height: calc(100vh - var(--navbar-height));
    position: relative;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
}

/* Left Sidebar */
.sidebar {
    width: var(--sidebar-width);
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    left: max(0px, calc((100vw - 1440px) / 2));
    background: rgba(10, 11, 18, 0.6);
    border-right: 1px solid var(--glass-border);
    padding: 1.5rem;
    overflow-y: auto;
    z-index: 90;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-container {
    position: relative;
    margin-bottom: 2rem;
}

#search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-fast);
}

#search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px var(--glow-color);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    opacity: 0.5;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nav-group h4 {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

.nav-group ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.sidebar-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    border-left: 2px solid transparent;
    transition: var(--transition-fast);
}

.sidebar-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.02);
    padding-left: 0.9rem;
}

.sidebar-link.active {
    color: var(--accent-primary);
    background: rgba(0, 210, 255, 0.05);
    border-left-color: var(--accent-primary);
    font-weight: 600;
}

/* Center Content Area */
.content-area {
    margin-left: var(--sidebar-width);
    margin-right: var(--toc-width);
    flex: 1;
    padding: 3rem 4rem;
    max-width: 900px;
}

.wiki-section {
    padding-top: 1rem;
    margin-bottom: 1.5rem;
}

.wiki-section h1 {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #a0a5b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.wiki-section h2 {
    font-size: 1.8rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.wiki-section h3 {
    font-size: 1.3rem;
    margin-top: 2rem;
    margin-bottom: 0.8rem;
    color: var(--accent-primary);
}

.wiki-section p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1.12rem;
    line-height: 1.7;
}

.wiki-section p strong {
    color: #fff;
}

.section-divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border) 0%, transparent 100%);
    margin: 4rem 0;
}

/* List Styling */
.feature-bullets,
.bullet-list {
    list-style: none;
    margin-bottom: 1.5rem;
}

.feature-bullets li,
.bullet-list li {
    position: relative;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.feature-bullets li::before {
    content: "•";
    color: var(--accent-primary);
    font-size: 1.4rem;
    position: absolute;
    left: 0.2rem;
    top: -0.2rem;
}

.bullet-list li::before {
    content: "-";
    color: var(--text-secondary);
    position: absolute;
    left: 0.2rem;
}

.ordered-list {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.ordered-list li {
    margin-bottom: 0.75rem;
    padding-left: 0.5rem;
    font-size: 1.1rem;
}

/* Code Blocks */
pre {
    background: rgba(10, 11, 18, 0.8);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin-bottom: 2rem;
    position: relative;
}

code {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: #e2e8f0;
}

.code-header {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: block;
}

/* Callout Boxes */
.callout {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    border: 1px solid transparent;
}

.callout-emoji {
    font-size: 1.5rem;
    line-height: 1;
}

.callout-text {
    font-size: 0.98rem;
    color: var(--text-secondary);
}

.callout-text strong {
    color: #fff;
    display: block;
    margin-bottom: 0.25rem;
}

.callout.note {
    background: rgba(0, 210, 255, 0.03);
    border-color: rgba(0, 210, 255, 0.15);
}

.callout.warning {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.15);
}

/* Tables */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.01);
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 1.02rem;
}

.wiki-table th,
.wiki-table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--glass-border);
}

.wiki-table th {
    background: rgba(255, 255, 255, 0.02);
    font-weight: 600;
    color: #fff;
}

.wiki-table tr:last-child td {
    border-bottom: none;
}

.wiki-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.01);
}

/* Wiring Steps Visuals */
.wiring-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.step-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: var(--transition-medium);
}

.step-card:hover {
    border-color: var(--accent-primary);
    background: rgba(0, 210, 255, 0.01);
}

.step-num {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(0, 210, 255, 0.2);
}

.step-details h4 {
    font-size: 1.1rem;
    margin-bottom: 0.35rem;
    color: #fff;
}

.step-details p {
    margin-bottom: 0;
    font-size: 0.98rem;
}

/* Right Table of Contents (TOC) */
.toc-container {
    width: var(--toc-width);
    position: fixed;
    top: var(--navbar-height);
    bottom: 0;
    right: max(0px, calc((100vw - 1440px) / 2));
    padding: 2.5rem 1.5rem;
    overflow-y: auto;
    z-index: 80;
}

.toc-wrapper h4 {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#toc-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

#toc-list a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition-fast);
    display: block;
    line-height: 1.4;
}

#toc-list a:hover {
    color: var(--accent-primary);
}

#toc-list li.toc-item-h3 {
    padding-left: 0.75rem;
}

#toc-list a.active {
    color: var(--accent-primary);
    font-weight: 600;
}

/* Footer styling */
footer {
    border-top: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    padding: 1.5rem 5%;
    text-align: center;
    position: relative;
    z-index: 91;
    margin-top: auto;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* Responsive Design & Breakpoints */
@media (max-width: 1200px) {
    .content-area {
        margin-right: 0;
    }
    .toc-container {
        display: none;
    }
}

@media (max-width: 768px) {
    /* Navbar adjust */
    .mobile-menu-toggle {
        display: flex;
    }
    .navbar nav a:not(.btn) {
        display: none;
    }
    
    /* Toggle animation for burger */
    .mobile-menu-toggle.open .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle.open .bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle.open .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Sidebar shifts offscreen */
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-medium);
        width: 100%;
        max-width: 300px;
        left: 0;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Content expands to full width */
    .content-area {
        margin-left: 0;
        padding: 2rem 1.5rem;
        width: 100%;
    }

    .wiki-section h1 {
        font-size: 1.8rem;
    }

    .wiki-section h2 {
        font-size: 1.4rem;
    }

    .step-card {
        flex-direction: column;
        gap: 0.75rem;
    }
}

/* Backdrop for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 89;
}

.sidebar-overlay.active {
    display: block;
}

/* Footer Styles copied from main landing page */
footer {
    padding: 5rem 5% 3rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    bottom: -10%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.05) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    gap: 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-brand {
    flex: 1.5;
    max-width: 360px;
}

.footer-logo {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.footer-logo .logo-accent {
    color: var(--accent-primary);
}

.footer-logo .logo-light {
    color: var(--text-secondary);
    font-weight: 300;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-socials {
    display: flex;
    gap: 1rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: var(--transition-medium);
}

.social-link svg {
    transition: transform var(--transition-fast);
}

.social-link:hover {
    color: #fff;
    transform: translateY(-3px);
}

.social-link.reddit:hover {
    background: rgba(255, 87, 0, 0.1);
    border-color: #ff5700;
    color: #ff5700;
    box-shadow: 0 0 15px rgba(255, 87, 0, 0.35);
}

.social-link.youtube:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff0000;
    color: #ff0000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.35);
}

.social-link:hover svg {
    transform: scale(1.1);
}

.footer-links-group {
    flex: 2.5;
    display: flex;
    justify-content: flex-end;
    gap: clamp(2rem, 5vw, 4rem);
}

.footer-links-col {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links-col h4 {
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.footer-links-col a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
    text-decoration: none;
}

.footer-links-col a:hover {
    color: var(--accent-primary);
    transform: translateX(3px);
}

.footer-bottom {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .footer-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2.5rem;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-links-group {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
        width: 100%;
    }

    .footer-links-col {
        align-items: center;
    }
}

@media (max-width: 480px) {
    .navbar {
        padding: 0.8rem 3%;
    }

    .navbar nav a.btn-outline {
        display: none; /* Hide duplicate waitlist button in mobile header, keeping the vital Launch Tool CTA visible */
    }

    .btn-tool {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }
}
