
:root {
    --bg-body: #f8fafc; --bg-nav: #ffffff; --bg-surface: #ffffff;
    --text-pri: #0f172a; --text-sec: #475569;
    --accent: #2563eb; --accent-hov: #1d4ed8; --accent-light: #eff6ff;
    --border: #e2e8f0; --shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1);
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --sidebar-w: 260px;
    --radius: 12px;
}
[data-theme="dark"] {
    --bg-body: #0b1120; --bg-nav: #1e293b; --bg-surface: #1e293b;
    --text-pri: #f8fafc; --text-sec: #94a3b8;
    --accent: #3b82f6; --accent-hov: #60a5fa; --accent-light: #1e3a8a;
    --border: #334155; --shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
}

/* Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; outline: none; }
body { font-family: var(--font-main); background: var(--bg-body); color: var(--text-pri); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { font-weight: 700; line-height: 1.2; color: var(--text-pri); }

/* Layout Structure */
.layout-container { display: flex; min-height: 100vh; }
.main-wrapper { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.main { padding: 2rem 3rem; flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; }

/* Sidebar */
.sidebar { 
    width: var(--sidebar-w); background: var(--bg-nav); border-right: 1px solid var(--border); 
    position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; 
    padding: 1.5rem; flex-shrink: 0; scrollbar-width: thin;
}
.sidebar-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: var(--text-pri); }
.dot { color: var(--accent); }
.menu-close { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-sec); }

/* Search in Sidebar */
.search-wrapper { position: relative; margin-bottom: 2rem; }
.search-input { width: 100%; padding: 0.75rem; border-radius: 8px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-pri); font-size: 0.9rem; transition: border 0.2s; }
.search-input:focus { border-color: var(--accent); }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; margin-top: 5px; box-shadow: var(--shadow); z-index: 50; max-height: 300px; overflow-y: auto; display: none; }
.search-results a { display: block; padding: 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.search-results a:hover { background: var(--bg-body); color: var(--accent); }

/* Sidebar Navigation */
.nav-section { margin-bottom: 1.5rem; }
.nav-header { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; color: var(--text-sec); margin-bottom: 0.8rem; display: flex; align-items: center; gap: 0.5rem; letter-spacing: 0.05em; }
.nav-link { display: block; padding: 0.5rem 0.75rem; font-size: 0.9rem; color: var(--text-pri); border-radius: 6px; margin-bottom: 2px; }
.nav-link:hover { background: var(--bg-body); color: var(--accent); }
.view-all { color: var(--accent); font-weight: 600; font-size: 0.85rem; margin-top: 0.25rem; }

/* Main Header (Top Bar) */
.main-header { 
    height: 70px; background: var(--bg-body); 
    border-bottom: 1px solid var(--border); 
    display: flex; align-items: center; 
    padding: 0 3rem; 
    position: sticky; top: 0; z-index: 90;
    backdrop-filter: blur(10px);
    background: rgba(var(--bg-body), 0.9);
}
[data-theme="dark"] .main-header { background: rgba(11, 17, 32, 0.9); }

.header-content { width: 100%; display: flex; justify-content: space-between; align-items: center; max-width: 1400px; margin: 0 auto; }
.mobile-only { display: none; }
.header-actions { display: flex; gap: 1rem; }

/* Breadcrumbs */
.breadcrumb { font-size: 0.9rem; color: var(--text-sec); display: flex; align-items: center; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.sep { margin: 0 0.5rem; opacity: 0.5; }
.current { color: var(--text-pri); font-weight: 500; }

/* Theme Toggle */
.btn-theme { background: transparent; border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 8px; color: var(--text-sec); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.btn-theme:hover { border-color: var(--text-sec); color: var(--text-pri); background: var(--bg-surface); }
[data-theme="light"] .moon { display: none; }
[data-theme="dark"] .sun { display: none; }

/* Hero */
.hero { margin-bottom: 3rem; text-align: center; max-width: 700px; margin-left: auto; margin-right: auto; padding-top: 2rem; }
.hero h1 { font-size: 2.75rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; letter-spacing: -0.02em; }
.highlight { color: var(--accent); }
.hero p { color: var(--text-sec); font-size: 1.15rem; }

/* Grids */
.grid-container { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.cat-card { background: var(--bg-surface); padding: 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); display: flex; align-items: center; gap: 1rem; transition: transform 0.2s, border-color 0.2s; }
.cat-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.cat-icon { font-size: 2rem; background: var(--bg-body); width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 8px; }
.count { font-size: 0.8rem; color: var(--text-sec); }

.device-card { background: var(--bg-surface); padding: 1.25rem; border-radius: var(--radius); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; transition: all 0.2s; }
.device-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.d-info { display: flex; flex-direction: column; }
.d-info strong { font-size: 0.95rem; margin-bottom: 2px; }
.d-meta { font-size: 0.75rem; color: var(--text-sec); }
.d-res { font-family: 'Fira Code', monospace; font-size: 0.85rem; font-weight: 600; background: var(--bg-body); padding: 0.25rem 0.5rem; border-radius: 4px; color: var(--accent); }

/* Device Detail Page */
.content-grid { display: grid; grid-template-columns: 350px 1fr; gap: 4rem; align-items: start; margin-bottom: 3rem; }
.viz-container { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 16px; padding: 3rem; display: flex; justify-content: center; align-items: center; min-height: 300px; position: relative; }
.device-shape { background: var(--bg-surface); border: 8px solid var(--text-pri); border-radius: 24px; position: relative; width: 100%; box-shadow: 0 20px 40px -5px rgba(0,0,0,0.2); transition: transform 0.3s; }
.shape-inner { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: white; border-radius: 14px; overflow: hidden; }
[data-theme="dark"] .shape-inner { background: #0f172a; }
.dim-label { font-weight: 700; font-family: 'Fira Code', monospace; color: var(--accent); font-size: 1.1rem; }

.data-grid-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.data-card { background: var(--accent); color: white; padding: 1rem; border-radius: 12px; text-align: center; }
.data-card .lbl { display: block; font-size: 0.7rem; text-transform: uppercase; opacity: 0.8; margin-bottom: 0.25rem; }
.data-card .val { font-size: 1.25rem; font-weight: 700; font-family: 'Fira Code'; }

.device-title { font-size: 2.5rem; font-weight: 800; margin-bottom: 1rem; line-height: 1.1; letter-spacing: -0.02em; }
.device-title span { color: var(--accent); }
.intro-p { color: var(--text-sec); margin-bottom: 2rem; font-size: 1.05rem; line-height: 1.7; }
.intro-p strong { color: var(--text-pri); font-weight: 600; }

.specs-card { background: var(--bg-surface); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 2rem; }
.specs-card h3 { background: var(--bg-body); padding: 0.75rem 1.25rem; font-size: 0.9rem; border-bottom: 1px solid var(--border); margin: 0; font-weight: 600; }
.specs-card table { width: 100%; padding: 0.5rem 1.25rem; }
.specs-card th { text-align: left; padding: 0.75rem 0; color: var(--text-sec); font-weight: 500; font-size: 0.9rem; border-bottom: 1px solid var(--border); }
.specs-card tr:last-child th, .specs-card tr:last-child td { border-bottom: none; }
.specs-card td { text-align: right; font-weight: 600; font-family: 'Fira Code'; }

.code-section { background: #0b1120; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
.code-header { background: #1e293b; padding: 0.75rem 1rem; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #334155; }
.code-header span { color: #94a3b8; font-size: 0.8rem; font-weight: 600; text-transform: uppercase; }
.code-box { padding: 1.25rem; margin: 0; color: #38bdf8; font-family: 'Fira Code', monospace; font-size: 0.9rem; overflow-x: auto; white-space: pre; }
.btn-copy { background: #334155; color: white; border: none; padding: 0.3rem 0.8rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; transition: background 0.2s; }
.btn-copy:hover { background: var(--accent); }

/* FAQ FIXED Styles */
.faq-section { margin-top: 4rem; border-top: 1px solid var(--border); padding-top: 3rem; }
.faq-section h2 { margin-bottom: 2rem; font-size: 1.75rem; }
.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.faq-item h3 { font-size: 1.1rem; margin-bottom: 0.75rem; color: var(--text-pri); font-weight: 700; }
.faq-item p { font-size: 1rem; color: var(--text-sec); line-height: 1.6; }
.faq-item code { background: var(--bg-body); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: 'Fira Code'; font-size: 0.85em; border: 1px solid var(--border); }

/* Footer */
.site-footer { border-top: 1px solid var(--border); margin-top: auto; background: var(--bg-surface); padding: 4rem 3rem 2rem; }
.footer-cols { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; max-width: 1400px; margin-left: auto; margin-right: auto; }
.footer-col strong { display: block; margin-bottom: 1.25rem; color: var(--text-pri); font-size: 1.1rem; }
.footer-col p { font-size: 0.95rem; color: var(--text-sec); line-height: 1.6; max-width: 300px; }
.footer-list { list-style: none; }
.footer-list li { margin-bottom: 0.75rem; }
.footer-list a { font-size: 0.95rem; color: var(--text-sec); }
.footer-list a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 2rem; text-align: center; color: var(--text-sec); font-size: 0.9rem; }

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { position: fixed; left: -100%; transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1); z-index: 1000; width: 280px; box-shadow: 20px 0 50px rgba(0,0,0,0.1); }
    .sidebar.active { left: 0; }
    .menu-close { display: block; }
    
    .mobile-only { display: block; background: none; border: none; padding: 0; color: var(--text-pri); }
    .main-header { padding: 0 1.5rem; }
    .main { padding: 2rem 1.5rem; }
    
    .content-grid { grid-template-columns: 1fr; gap: 2rem; }
    .viz-container { min-height: 250px; padding: 2rem; }
    .faq-grid { grid-template-columns: 1fr; gap: 2rem; }
    
    .footer-cols { grid-template-columns: 1fr; gap: 2rem; }
    .hero h1 { font-size: 2rem; }
}
