/* =========================================
   1. GLOBAL RESET & VARS
   ========================================= */
:root {
    
    /* Deep Space Gray Base */
    --bg-base: #0d0d12; 
    --bg-panel: rgba(255, 255, 255, 0.02); 
    --border-subtle: rgba(255, 255, 255, 0.06);
    
    /* StudioOne Brand Accents */
    --accent-purple: #8b5cf6; 
    --accent-teal: #2dd4bf;   
    --text-main: #f8fafc;
    --text-muted: #94a3b8;

    /* Harmonized Alert Colors */
    --online-green: #10b981;
    --warning-orange: #fbbf24; /* Soft Amber */
    --app-red: #fb7185; /* Vibrant Coral */
    
    /* Layout Variables */
    --nav-height: 70px;
}

/* Replace your '*' block with this */
* { box-sizing: border-box; }

a { 
    color: inherit; 
    text-decoration: none; 
    transition: all 0.2s ease;
}

body { 
    margin: 0; 
    background-color: var(--bg-base); 
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.20) 0%, transparent 45%),
        radial-gradient(circle at 90% 80%, rgba(45, 212, 191, 0.15) 0%, transparent 45%);
    background-attachment: fixed;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom Scrollbars */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* =========================================
   2. TOP NAVIGATION (Global Anchor)
   ========================================= */
.top-nav {
    position: fixed; top: 0; left: 0; width: 100%; height: var(--nav-height);
    background: rgba(13, 13, 18, 0.8); 
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 40px; z-index: 100;
}

.nav-logo img { height: 35px; opacity: 0.9; transition: opacity 0.2s; }
.nav-logo:hover img { opacity: 1; }

/* The Search Container in the Nav Bar */
.nav-search { position: relative; width: 300px; }
.nav-search input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 10px 16px 10px 40px;
    border-radius: 20px; 
    font-size: 15px; /* Bumped up */
    outline: none;
}
.nav-search input:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(139, 92, 246, 0.5); 
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.15);
}
.nav-search i { position: absolute; left: 14px; top: 12px; color: var(--text-muted); font-size: 14px; }

.shortcut-badge {
    position: absolute; right: 10px; top: 8px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-muted); font-size: 11px; font-weight: 600;
    padding: 2px 6px; border-radius: 4px; pointer-events: none;
}

.nav-links { display: flex; gap: 24px; align-items: center; }
.nav-link { 
    color: var(--text-muted) !important; 
    font-size: 15px; /* Bumped up */
    font-weight: 500; 
}
.nav-link:hover { color: var(--text-main); }
.nav-btn { 
    background: rgba(139, 92, 246, 0.15); 
    color: #c4b5fd !important; 
    padding: 10px 20px; 
    border-radius: 30px; 
    font-size: 15px; /* Bumped up */
    font-weight: 600; 
    border: 1px solid rgba(139, 92, 246, 0.3); 
}
.nav-btn:hover { background: var(--accent-purple); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }

/* =========================================
   3. SEARCH RESULTS DROPDOWN (Live Search)
   ========================================= */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: 15px;
    margin-top: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none; /* Controlled by JS */
}

.result-item {
    padding: 15px 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    text-decoration: none;
    transition: background 0.2s;
}

.result-item:last-child { border-bottom: none; }

.result-item:hover, .result-item.selected {
    background: rgba(139, 92, 246, 0.1);
}

.result-title {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
}

.result-cat {
    color: var(--accent-teal);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* =========================================
   4. THE HOLY GRAIL 3-COLUMN GRID
   ========================================= */
.layout-wrapper {
    display: grid;
    /* Slimmed Sidebar (250px) and maximized center (1.2fr) */
    grid-template-columns: 250px minmax(0, 1.2fr) 240px; 
    gap: 30px;
    max-width: 1800px;
    margin: var(--nav-height) auto 0 auto; 
    padding: 0 20px;
}

.left-sidebar {
    position: sticky; top: var(--nav-height); height: calc(100vh - var(--nav-height));
    overflow-y: auto; padding: 40px 15px 40px 0;
    border-right: 1px solid var(--border-subtle);
}

.category-title { 
    font-size: 13px; /* Bumped up */
    text-transform: uppercase; 
    letter-spacing: 1px; 
    color: var(--text-muted); 
    margin: 30px 0 12px 0; 
    font-weight: 700; 
}

/* Force Sidebar links to stay gray/teal and ignore browser defaults */
.dir-link { 
    display: block; 
    color: var(--text-muted) !important; 
    font-size: 15px; /* Bumped up */
    padding: 10px 14px; 
    border-radius: 8px; 
    margin-bottom: 4px; 
}
.dir-link:hover { background: rgba(255,255,255,0.03); color: var(--text-main) !important; }
.dir-link.active { background: rgba(139, 92, 246, 0.1); color: #c4b5fd !important; border-left: 2px solid var(--accent-purple); }

.main-content {
    padding: 80px 40px 100px 40px; 
    animation: fadeIn 0.6s ease-out;
}

.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }
.breadcrumb a { color: var(--text-muted) !important; }
.breadcrumb a:hover { color: var(--text-main) !important; }
.breadcrumb span { color: var(--accent-teal); }

.right-sidebar {
    position: sticky; top: var(--nav-height); height: calc(100vh - var(--nav-height));
    padding: 80px 0 40px 20px;
}
.toc-title { 
    font-size: 13px; /* Bumped up */
    font-weight: 700; 
    color: var(--text-main); 
    margin-bottom: 20px; 
    letter-spacing: 1px; 
}

.toc-link { 
    display: block; 
    color: var(--text-muted) !important; 
    font-size: 14px; /* Bumped up */
    padding: 8px 0; 
    border-left: 1px solid var(--border-subtle); 
    padding-left: 16px; 
    margin-left: 4px; 
}
.toc-link:hover, .toc-link.active { color: var(--accent-teal) !important; border-left-color: var(--accent-teal); }

/* =========================================
   5. TYPOGRAPHY & COMPONENTS
   ========================================= */

/* 5a. Layout Spacing */
.doc-section { 
    margin-bottom: 100px; 
}

/* 5b. Header Lockups (Eyebrow + Title) */
.gradText { 
    display: block; /* Forces it to its own line */
    margin-bottom: 0px; 
    background: linear-gradient(90deg, var(--accent-purple), var(--accent-teal)); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
    font-weight: 900;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
}

h1 { 
    font-size: 52px; 
    font-weight: 800; 
    margin: 5px 0 25px 0; /* Hugs the eyebrow text */
    letter-spacing: -1.5px; 
    color: var(--text-main); 
}

h2 { 
    font-size: 28px; 
    font-weight: 600; 
    padding-bottom: 12px; 
    border-bottom: 1px solid var(--border-subtle); 
    margin: 5px 0 24px 0; /* Hugs the eyebrow text */
    color: var(--text-main); 
}

h3 { font-size: 20px; font-weight: 600; color: var(--text-main); margin-top: 0; }

/* 5c. Body Text & Inline Elements */
p, li { color: var(--text-muted); line-height: 1.8; font-size: 16px; }

code { 
    background: rgba(255,255,255,0.06); 
    padding: 3px 8px; 
    border-radius: 6px; 
    font-family: monospace; 
    font-size: 0.85em; 
    color: var(--text-main); 
}

mark { 
    background: rgba(139, 92, 246, 0.2); 
    color: #c4b5fd; 
    border-radius: 6px; 
    padding: 2px 6px; 
}

/* 5d. Cards & Alerts */
.spec-card, .faq-item {
    background: var(--bg-panel);
    padding: 30px; 
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background 0.3s ease;
    margin-bottom: 24px;
}
.spec-card:hover, .faq-item:hover { background: rgba(255, 255, 255, 0.03); }

.alert-box {
    background: rgba(251, 191, 36, 0.05); 
    padding: 24px; 
    border-radius: 16px; 
    margin: 30px 0;
    border-left: 4px solid var(--warning-orange);
}

.pro-tip {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.1);
    padding: 24px; 
    border-radius: 20px; 
    margin: 30px 0;
}

/* 5e. Images & Media */
.hero-img { 
    max-width: 90%; 
    display: block; 
    margin: 0 auto; 
    filter: drop-shadow(0 20px 30px rgba(0,0,0,0.4)); 
}

.diagram-img { 
    max-width: 100%; 
    border-radius: 12px; 
    border: 1px solid var(--border-subtle); 
    box-shadow: 0 10px 40px rgba(0,0,0,0.3); 
}

/* Product Card Image Handling (4:3 Ratio) */
.card-img-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3; /* Perfect lock for 700x525px */
    overflow: hidden;
    background: #000;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: transform 0.5s ease, opacity 0.3s ease;
}

/* This creates the zoom effect when you hover over the product card */
.spec-card:hover .card-img {
    transform: scale(1.05);
    opacity: 1;
}

/* 5f. Buttons & Pills */
.home-btn {
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px;
    padding: 14px; 
    background: var(--accent-purple); 
    border: none;
    border-radius: 30px; 
    color: #ffffff !important; 
    text-decoration: none !important;
    font-size: 15px; 
    font-weight: 600; 
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}
.home-btn:hover { background: #7c3aed; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4); }

.social-pill {
    border: 1px solid var(--border-subtle); 
    background: transparent; 
    color: var(--text-main) !important; 
    padding: 12px 24px; 
    border-radius: 30px; 
    text-decoration: none !important; 
    font-size: 14px; 
    font-weight: 500; 
    display: inline-flex; 
    align-items: center; 
    gap: 10px; 
    transition: all 0.2s ease;
}
.social-pill:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); }

/* 5g. Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Update Log Timeline */
.timeline-container {
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
}

/* The vertical stem */
.timeline-container::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 5px;
    bottom: 5px;
    width: 2px;
    background: var(--border-subtle);
}

.log-item {
    position: relative;
    margin-bottom: 25px;
}

/* The glowing dot */
.log-dot {
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--accent-purple);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-purple);
    border: 2px solid var(--bg-base);
    z-index: 2;
}

/* Style for the "Latest" update dot (like the red one in your image) */
.log-item:first-child .log-dot {
    background: var(--app-red);
    box-shadow: 0 0 10px var(--app-red);
}

.log-version {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-main);
    display: block;
}

.log-date {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 8px;
}

.log-notes {
    margin: 0;
    padding-left: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.log-notes li {
    margin-bottom: 4px;
    line-height: 1.4;
}

/* =========================================
   6. RESPONSIVE DESIGN
   ========================================= */
@media (max-width: 1200px) {
    .layout-wrapper { grid-template-columns: 260px minmax(0, 1fr); gap: 40px; }
    .right-sidebar { display: none; }
}

@media (max-width: 900px) {
    .layout-wrapper { grid-template-columns: 1fr; padding: 0 20px; }
    .left-sidebar { display: none; }
    .nav-search { display: none; }
    .nav-links .nav-link { display: none; } 
    .main-content { padding-top: 30px; }
    h1 { font-size: 36px; }
}