/* =========================================
   SDG 2030 SCIENCE - CORE STYLES
   ========================================= */

:root {
    /* Color Palette - Un Blue & Institutional Greys */
    --un-blue: #005bbb;
    --un-blue-light: #418fde;
    --un-blue-dark: #003b7a;
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-quote: #334155;
    
    --surface: #ffffff;
    --surface-alt: #f8f9fc;
    
    /* Typography System 
       Inter: Technical, objective.
       Playfair: Editorial, legacy, humanistic. */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-secondary: 'Playfair Display', serif;
    --font-accent: 'Outfit', sans-serif;
    
    --sdg-gradient: linear-gradient(90deg, 
        #E5243B 0%, #DDA63A 6%, #4C9F38 12%, #C5192D 18%, 
        #FF3A21 24%, #26BDE2 30%, #FCC30B 36%, #A21942 42%, 
        #FD6925 48%, #DD1367 54%, #FD9D24 60%, #BF8B2E 66%, 
        #3F7E44 72%, #0A97D9 78%, #56C02B 84%, #00689D 90%, #19486A 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    color: var(--text-primary);
    background-color: var(--surface);
    line-height: 1.6;
    overflow-x: hidden;
}

/* =========================================
   STRUCTURAL LAYOUT
   ========================================= */

/* The top progress bar of 17 colors */
.sdg-gradient-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: var(--sdg-gradient);
    z-index: 100;
}

.editorial-layout {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100%;
    overflow: hidden; /* Force zero scroll on desktop */
}

/* Left Panel - Typography and Copy */
.content-panel {
    flex: 0 0 50%; /* Exact half on desktop */
    height: 100vh;
    padding: clamp(1rem, 5vh, 6rem) clamp(2rem, 5vw, 6rem);
    background-color: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    z-index: 10;
    box-shadow: 20px 0 50px rgba(0,0,0,0.02); /* Very subtle lateral shadow over the WebGL panel */
}

/* Right Panel - Visual Canvas */
.visual-panel {
    flex: 1;
    position: sticky;
    top: 0;
    height: 100vh; /* Locks the WebGL canvas to the full screen height */
    background-color: var(--surface-alt);
    overflow: hidden;
}

/* =========================================
   TYPOGRAPHY & CONTENT
   ========================================= */

.hero-content {
    margin: auto 0; /* Vertically centered via flex auto-margins */
    max-width: 600px;
}

.eyebrow {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--un-blue);
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding: 0.4rem 1rem;
    background: rgba(0, 91, 187, 0.05);
    border-radius: 4px;
}

.headline {
    font-family: var(--font-primary);
    /* Fluid scaling: doesn't break on mobile, scales smartly based on screen height and width */
    font-size: clamp(2rem, min(4.5vw, 8vh), 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 300;
    margin-bottom: clamp(1rem, 3vh, 2.5rem); /* Compresses gracefully on short screens */
    color: #0f172a; /* Near black */
}

.headline br {
    display: block;
}

.body-text {
    font-size: clamp(1rem, min(1.3vw, 2.5vh), 1.2rem);
    color: var(--text-secondary);
    margin-bottom: clamp(1rem, 2vh, 1.5rem);
    max-width: 90%;
}

.body-text strong {
    color: var(--un-blue-dark);
    font-weight: 600;
}

.body-text.secondary {
    font-size: clamp(0.9rem, min(1vw, 2vh), 1rem);
    color: #94a3b8;
    margin-bottom: 0;
}

/* Footer Tag */
.panel-footer {
    margin-top: auto; /* Push to bottom */
    padding-top: clamp(1rem, 3vh, 3rem); /* Compresses on shorter viewports */
}

.panel-footer p {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: #cbd5e1;
    font-weight: 300;
}

/* =========================================
   WEBGL CANVAS
   ========================================= */

.webgl-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.webgl-container canvas {
    display: block;
    width: 100%;
    height: 100%;
    outline: none;
}

/* =========================================
   REDESIGNED QUOTE CARD
   ========================================= */

/* The quote card floats elegantly over the visual panel */
.quote-card {
    position: absolute;
    bottom: clamp(2rem, 5vw, 4rem);
    left: clamp(2rem, 5vw, 4rem);
    max-width: 65%;
    display: flex;
    gap: 1.5rem;
    
    /* Elegant glassmorphism backing for legibility */
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
}

.quote-line {
    width: 3px;
    background: var(--un-blue-light);
    border-radius: 3px;
    flex-shrink: 0;
}

.quote-content blockquote {
    font-family: var(--font-secondary);
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.4;
    color: var(--text-quote);
    font-style: italic;
    margin: 0;
}

/* =========================================
   MOBILE RESPONSIVENESS (SMART STACK)
   ========================================= */

@media (max-width: 900px) {
    .editorial-layout {
        flex-direction: column;
        height: auto;
        overflow: visible;
    }
    
    .content-panel {
        flex: auto;
        width: 100vw;
        height: auto;
        overflow-y: visible;
        /* Reduced padding on mobile for comfortable reading */
        padding: 5rem 1.5rem 3rem 1.5rem; 
        box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    }
    
    .headline {
        margin-bottom: 2rem;
        /* Line breaks re-evaluated by browser on small screens */
    }
    
    .body-text {
        max-width: 100%;
    }
    
    .panel-footer {
        padding-top: 2rem;
    }

    .visual-panel {
        /* On mobile: WebGL becomes a full-width block displayed below the text content */
        width: 100vw;
        height: 60vh; 
        min-height: 400px;
    }
    
    .quote-card {
        max-width: 90%;
        left: 50%;
        transform: translateX(-50%);
        bottom: 2rem;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .quote-content blockquote {
        font-size: 1.15rem;
    }
}

@media (max-width: 480px) {
    .visual-panel {
        height: 50vh;
    }
    
    .quote-card {
        width: calc(100% - 2rem); /* 1rem margin on each side for edge breathing room */
    }
}
