/* ==========================================================================
   1. CORE VARIABLES & RESET ENGINE
   ========================================================================== */
:root {
    --bg-dark: #0f172a;
    --bg-light: #f8fafc;
    --text-main: #334155;
    --text-light: #64748b;
    --accent: #0284c7;
    --accent-hover: #0369a1;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(226, 232, 240, 0.8);
    --font-stack: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --max-width: 1280px;
    --header-height: 70px;
}

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

body {
    font-family: var(--font-stack);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    padding-top: var(--header-height);
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================================================
   2. GLOBAL NAVIGATION HEADER LAYOUT
   ========================================================================== */
.global-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
}

.nav-container {
    max-width: var(--max-width);
    height: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--bg-dark);
}

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

.desktop-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    align-items: center;
}

.desktop-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    transition: color 0.2s ease;
}

.desktop-nav a:hover {
    color: var(--accent);
}

.desktop-nav a.nav-cta {
    background-color: var(--accent);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
}

.desktop-nav a.nav-cta:hover {
    background-color: var(--accent-hover);
}

/* Mobile Hamburger Toggle */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1100;
}

.mobile-toggle .bar {
    width: 26px;
    height: 3px;
    background-color: var(--bg-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ==========================================================================
   3. MOBILE NAVIGATION DRAWER
   ========================================================================== */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    padding: calc(var(--header-height) + 2rem) 2rem 2rem 2rem;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
}

.mobile-drawer.active {
    right: 0;
}

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

.mobile-nav a {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    display: block;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Hamburger Transformations */
.mobile-toggle.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.mobile-toggle.active .bar:nth-child(2) { opacity: 0; }
.mobile-toggle.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ==========================================================================
   4. SEMANTIC LAYOUT HOOKS & SECTOR WORKSPACES
   ========================================================================== */
#main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 3rem 2rem;
    min-height: calc(100vh - var(--header-height) - 200px);
}

/* Glassmorphism Structural Cards */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 2rem;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Double-Column Insulation Workspace Grid */
.workspace-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2.5rem;
    align-items: start;
}

/* Sub-Navigation Strip (Membrane View) */
.sub-nav-strip {
    position: sticky;
    top: var(--header-height);
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(5px);
    display: flex;
    gap: 1.5rem;
    padding: 1rem 0;
    border-bottom: 2px solid var(--glass-border);
    margin-bottom: 2rem;
    z-index: 100;
}

.sub-nav-strip a {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--accent);
}

/* Fluid Responsive Video Containers (Asset Protection) */
.fluid-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    margin: 1.5rem 0;
    border: 1px solid var(--glass-border);
}

.fluid-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   5. UTILITY STYLES FOR CORE BLOCKS
   ========================================================================== */
.material-selector-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.material-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    text-align: left;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.material-btn.active, .material-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.calculator-box {
    margin-top: 2rem;
    background: #fff;
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-light);
}

.form-group select, .form-group input {
    width: 100%;
    padding: 0.6rem;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    font-family: inherit;
}

.calc-result {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 1rem;
}

/* Global Footer Layouts */
.global-footer {
    background-color: var(--bg-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 4rem 2rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-grid {
    max-width: var(--max-width);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: #fff;
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    text-align: center;
}

/* ==========================================================================
   6. RESPONSIVE MEDIA BREAKPOINTS
   ========================================================================== */
@media (max-width: 992px) {
    .workspace-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-toggle {
        display: flex;
    }
    
    #main-content {
        padding: 2rem 1rem;
    }
}
