/* Custom Global Variables & Themes */
:root[data-theme="dark"] {
    --bg-canvas: #020612;             /* Matches deep dark blue logo background */
    --bg-surface: #0b1120;            /* High-contrast surface color for cards */
    --bg-surface-elevated: #1e293b;   /* Clearly visible contrast for tab headers */
    --primary: #0088ff;
    --accent: #00ffaa;
    --text-main: #f8fafc;             /* Bright text for readability */
    --text-muted: #94a3b8;            /* Soft gray text */
    --border: #334155;                /* High-visibility borders */
    --asset-visibility-dark: block;
    --asset-visibility-light: none;
}

:root[data-theme="light"] {
    --bg-canvas: #fcfcfc;             /* Fixed: Calibrated flat white value matching logo core background */
    --bg-surface: #ffffff;            
    --bg-surface-elevated: #f1f5f9;   
    --primary: #0088ff;
    --accent: #00cc88;
    --text-main: #0f172a;             
    --text-muted: #475569;            
    --border: #cbd5e1;                
    --asset-visibility-dark: none;
    --asset-visibility-light: block;
}

/* Base Body Framework - Forces absolute max-width to protect 4K screens from horizontal overflow */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.5;
    overflow-x: hidden;
    width: 100vw;
    transition: background-color 0.2s, color 0.2s;
}

/* Global Navbar Alignment Fix: Locks elements safely inside the 1200px column boundary */
.global-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 2rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.mini-brand-link {
    height: 28px;
    display: flex;
    align-items: center;
}

.mini-logo-img {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.main-menu {
    display: none;
}

@media (min-width: 900px) {
    .main-menu { display: block; }
}

.menu-list {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

.menu-list a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}

.menu-list a:hover { color: var(--text-main); }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto; /* Aligns controls perfectly without spilling off 4K viewports */
}

/* Dynamic Asset Swapping Framework */
[data-theme="dark"] .dark-asset { display: var(--asset-visibility-dark); }
[data-theme="dark"] .light-asset { display: var(--asset-visibility-light); }
[data-theme="light"] .dark-asset { display: var(--asset-visibility-dark); }
[data-theme="light"] .light-asset { display: var(--asset-visibility-light); }

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.theme-toggle-btn:hover { background: var(--bg-surface-elevated); }

/* Interface Button Layout Controls */
.btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.15s, color 0.15s;
}

.btn-primary { background-color: var(--primary); color: white; border: none; }
.btn-primary:hover { background-color: #0072d6; }
.btn-secondary { background-color: var(--bg-surface-elevated); color: var(--text-main); border: 1px solid var(--border); }
.btn-secondary:hover { background-color: var(--border); }
.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--bg-surface-elevated); }

/* Unified Center Branding Block */
.brand-hero-block {
    text-align: center;
    padding: 5rem 1.5rem 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.main-logo-container {
    display: inline-block;
    width: 100%;
    max-width: 520px;
    margin-bottom: 2rem;
}

.main-logo-img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1.25rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 760px;
    margin: 0 auto;
}

/* Structural Layout Protection Sections */
.matrix-section { padding: 2rem 1.5rem; width: 100%; }
.section-constraints { max-width: 1200px; margin: 0 auto; width: 100%; }
.architecture-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; width: 100%; }

@media (min-width: 769px) {
    .architecture-grid { grid-template-columns: repeat(3, 1fr); }
}

.matrix-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; padding: 1.5rem; transition: background-color 0.2s; }
.matrix-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--text-main); }
.matrix-desc { font-size: 0.9rem; color: var(--text-muted); }

/* Sandbox Module and Fluid Responsive Grid Track Panel */
.workspace-sandbox { padding: 3rem 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.workspace-panel { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; width: 100%; }

.panel-nav {
    display: flex;
    background: var(--bg-surface-elevated);
    border-bottom: 1px solid var(--border);
    width: 100%;
}

.panel-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1.25rem 1rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--border);
    transition: all 0.15s;
    min-width: 0;
}

.panel-tab:last-child { border-right: none; }
.panel-tab.active { color: var(--text-main); background: var(--bg-surface); box-shadow: inset 0 -2px 0 var(--primary); }

@media (max-width: 500px) {
    .panel-tab { padding: 1rem 0.5rem; font-size: 0.75rem; }
}

.panel-viewport { padding: 2rem; min-height: 320px; width: 100%; background-color: var(--bg-surface); }
.tab-view-content { display: none; width: 100%; }
.tab-view-content.active { display: grid; grid-template-columns: 1fr; gap: 2rem; width: 100%; }

@media (min-width: 800px) {
    .tab-view-content.active { grid-template-columns: 1.2fr 0.8fr; }
}

.view-meta h2 { font-size: 1.35rem; margin-bottom: 0.5rem; letter-spacing: -0.25px; color: var(--text-main); }
.view-meta p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 1.5rem; }

.mock-console { background: var(--bg-canvas); border: 1px solid var(--border); border-radius: 6px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; justify-content: center; }
.mock-bar { height: 8px; background: var(--border); border-radius: 2px; width: 100%; }
.local-badge { padding: 0.5rem; border: 1px dashed var(--border); border-radius: 4px; color: var(--accent); text-align: center; font-size: 0.75rem; font-family: monospace; font-weight: 700; }

/* Connected Core Interconnection Graph Layout mapping */
.roadmap-section { padding: 4rem 1.5rem; max-width: 1200px; margin: 0 auto; text-align: center; width: 100%; }
.section-heading { font-size: 1.75rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: -0.5px; color: var(--text-main); }
.section-lead { font-size: 1.05rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 4rem auto; }

.dependency-graph {
    position: relative;
    min-height: 360px;
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

.graph-node {
    position: absolute;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 1rem;
    border-radius: 8px;
    z-index: 2;
    width: 180px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translate(-50%, -50%);
    color: var(--text-main);
}

.central-node { top: 50%; left: 50%; border: 1px solid var(--primary); }
.node-left { top: 50%; left: 15%; }
.node-right { top: 50%; left: 85%; }
.node-top { top: 15%; left: 50%; }
.node-bottom { top: 85%; left: 50%; }

@media (max-width: 680px) {
    .dependency-graph { display: flex; flex-direction: column; gap: 1rem; min-height: auto; align-items: center; }
    .graph-node { position: static; transform: none; width: 100%; max-width: 320px; }
    .graph-wires { display: none; }
}

.node-icon { font-size: 1.25rem; margin-bottom: 0.25rem; }
.node-title { font-size: 0.9rem; font-weight: 700; }
.node-sub { font-size: 0.75rem; color: var(--text-muted); }

.graph-wires {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1;
}

.wire-path { stroke: var(--border); stroke-width: 2; stroke-dasharray: 4 4; }

/* Call-to-Action Panel Area constraints */
.deployment-portal { padding: 2rem 1.5rem 6rem 1.5rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.portal-box { background: var(--bg-surface); border: 1px solid var(--border); padding: 3rem 2rem; border-radius: 8px; text-align: center; }
.portal-box h2 { font-size: 1.5rem; margin-bottom: 0.75rem; color: var(--text-main); }
.portal-box p { color: var(--text-muted); font-size: 1rem; max-width: 600px; margin: 0 auto 2rem auto; }
.portal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem; }

/* Sticky Global Footer Structure */
.system-footer { border-top: 1px solid var(--border); padding: 2rem 1.5rem; max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 1rem; width: 100%; }

@media (min-width: 769px) { .system-footer { flex-direction: row; gap: 0; } }

.footer-copyright { font-size: 0.8rem; color: var(--text-muted); text-align: center; }
.footer-links { display: flex; gap: 1.5rem; list-style: none; }
.footer-links a { color: var(--text-muted); text-decoration: none; font-size: 0.8rem; font-weight: 500; transition: color 0.15s; }
.footer-links a:hover { color: var(--text-main); }
