/* =========================================================
   GLOBAL TYPOGRAPHY & LAYOUT
   ========================================================= */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    color: #2d3748;
    background-color: #f9f9f9;
}

h1, h2, h3, h4 {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    color: #004080;
    letter-spacing: -0.02em;
}

.hero { background-color: #ffffff; padding: 3rem 2rem; text-align: center; border-bottom: 2px solid #eaeaea; }
.hero h1 { font-size: 2.8rem; margin-bottom: 0.5rem; }
.container { max-width: 900px; margin: 2rem auto; padding: 0 2rem; }
.section-card { background: #fff; padding: 2.5rem; margin-bottom: 2rem; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.section-card h2 { border-bottom: 2px solid #004080; padding-bottom: 0.5rem; margin-top: 0; }
.section-card h3 { color: #0059b3; margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.4rem; }
footer { background-color: #333; color: white; text-align: center; padding: 1.5rem; margin-top: 3rem; }
footer p { margin: 0; font-size: 0.9rem; }

/* Shared List Styling */
ul { padding-left: 1.5rem; }
li { margin-bottom: 0.8rem; }

/* =========================================================
   HEADERS & NAVIGATION
   ========================================================= */
header {
    background-color: #004080;
    color: white;
    border-bottom: 4px solid #00264d;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Homepage Header Specifics */
header.home-header { padding: 4rem 1rem 2rem 1rem; }
.causal-helix-wrap { position: relative; z-index: 1; line-height: 0; width: 350px; height: 350px; margin-bottom: 2rem; display: flex; justify-content: center; align-items: center; }
.causal-helix-wrap img { height: 350px; width: auto; position: relative; z-index: 2; }
.motto { 
    font-family: 'Merriweather', serif; 
    font-style: italic; 
    font-size: 1.4rem; 
    color: #e6c55e; 
    margin-top: -1.5rem; 
    margin-bottom: 2rem; 
    letter-spacing: 0.05em; 
    opacity: 0; 
    position: relative;
    z-index: 2; 
    /* We removed the animation from here so it stays hidden initially! */
}

/* We added this new trigger class */
.motto.play-animation {
    /* The 1.8s delay forces it to wait for the logo to finish resolving */
    animation: mottoResolve 1.5s ease-out 1.8s forwards; 
}

/* Subpage Header Specifics */
.header-container { 
    width: 100%;             
    box-sizing: border-box;  
    max-width: 1200px;       
    margin: 0 auto; 
    padding: 2.5rem 2rem; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    gap: 2rem; 
    position: relative; 
}

.subpage-logo-wrapper { 
    position: relative; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    width: 170px; /* Increased from 140px */
    height: 170px; /* Increased from 140px */
}

.subpage-logo-wrapper img.logo { 
    height: 150px; /* Increased from 120px */
    width: auto; 
    object-fit: contain; 
    position: relative; 
    z-index: 1; 
    opacity: 0; 
    animation: subpageFadeIn 0.8s ease-out forwards; 
}

/* Desktop Navigation */
nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; justify-content: center; width: 100%; }
nav a { color: white; text-decoration: none; font-family: 'Inter', sans-serif; font-weight: 700; text-transform: uppercase; font-size: 0.85rem; letter-spacing: 0.03em; transition: color 0.3s ease; }
nav a:hover { color: #4da6ff; }

/* Sticky Navigation */
#scrolled-nav { position: fixed; top: -100px; left: 0; width: 100%; background-color: rgba(0, 64, 128, 0.98); box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 9999; display: flex; justify-content: center; align-items: center; min-height: 70px; padding: 0; transition: top 0.4s cubic-bezier(0.165, 0.84, 0.44, 1); }
#scrolled-nav.visible { top: 0; }
#scrolled-nav a { color: white; text-decoration: none; font-family: 'Inter', sans-serif; font-weight: 700; text-transform: uppercase; font-size: 0.85rem; margin: 0 0.75rem; transition: color 0.3s ease; }
#scrolled-nav a:hover { color: #4da6ff; }

/* =========================================================
   ANIMATIONS & AURORA
   ========================================================= */
/* Homepage Aurora */
.aurora-bg { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 600px; height: 600px; z-index: -1; opacity: 0; filter: blur(55px); pointer-events: none; transition: opacity 3s ease-in; }
.aurora-bg span { position: absolute; top: 10%; left: 10%; width: 80%; height: 80%; border-radius: 50%; mix-blend-mode: screen; }

/* Subpage Aurora */
.aurora-bg-subpage { position: absolute; top: 50%; left: 50%; width: 280px; height: 280px; transform: translate(-50%, -50%); z-index: 0; pointer-events: none; filter: blur(20px); }
.aurora-bg-subpage span { position: absolute; top: 0; left: 0; right: 0; bottom: 0; border-radius: 50%; mix-blend-mode: screen; }

/* Shared Aurora Colors */
.aurora-bg span:nth-child(1), .aurora-bg-subpage span:nth-child(1) { background: radial-gradient(circle, rgba(46, 204, 113, 0.55) 0%, transparent 70%); animation: aurora-dance 8s ease-in-out infinite alternate; }
.aurora-bg span:nth-child(2), .aurora-bg-subpage span:nth-child(2) { background: radial-gradient(circle, rgba(155, 89, 182, 0.55) 0%, transparent 70%); animation: aurora-dance 12s ease-in-out infinite alternate-reverse; animation-delay: -3s; }
.aurora-bg span:nth-child(3), .aurora-bg-subpage span:nth-child(3) { background: radial-gradient(circle, rgba(231, 76, 60, 0.45) 0%, transparent 60%); animation: aurora-dance 15s ease-in-out infinite alternate; animation-delay: -5s; }
.aurora-bg span:nth-child(4), .aurora-bg-subpage span:nth-child(4) { background: radial-gradient(circle, rgba(26, 188, 156, 0.45) 0%, transparent 60%); animation: aurora-dance 10s ease-in-out infinite alternate-reverse; animation-delay: -1s; }
.aurora-bg span:nth-child(5), .aurora-bg-subpage span:nth-child(5) { background: radial-gradient(circle, rgba(142, 68, 173, 0.35) 0%, transparent 50%); animation: aurora-flicker 4s linear infinite; }

/* Homepage Logo Transitions */
.causal-helix-wrap::before { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 180px; height: 180px; background: radial-gradient(circle, rgba(230,190,70,0.8) 0%, rgba(200,160,50,0) 70%); border-radius: 50%; filter: blur(15px); opacity: 0; z-index: 1; }
.causal-helix-wrap.play-animation::before { animation: causalPotential 1.2s ease-out forwards; }
.causal-helix-wrap.play-animation img { filter: blur(20px); opacity: 0; animation: resolveCausalMechanism 1s ease-out 0.8s forwards; }
.causal-helix-wrap::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0); width: 200px; height: 200px; background: transparent; border: 3px solid rgba(255, 255, 255, 0.5); border-radius: 50%; opacity: 0; z-index: 3; }
.causal-helix-wrap.play-animation::after { animation: causalRippleEffect 0.7s ease-out 0.8s forwards; }

/* Homepage Intro Overlay */
#motto-intro { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background-color: #000000; z-index: 99999; display: flex; justify-content: center; align-items: center; animation: hideIntro 0.5s ease-out forwards 3.0s; overflow: hidden; }

/* Base wrapper holds the letters and gets sucked into the singularity at the end */
.intro-text { 
    font-family: 'Merriweather', serif; 
    font-style: italic; 
    color: #e6c55e; 
    font-size: 3.5rem; 
    position: relative; 
    z-index: 2; 
    white-space: nowrap;
    will-change: transform, opacity, filter; /* Hardware acceleration for smoothness */
    animation: wordCollapse 3.0s forwards;
}

/* Each individual letter handles its own chaos animation */
.intro-text span {
    display: inline-block;
    will-change: transform, opacity, filter;
    animation: letterChaos 3.0s forwards;
}
body.intro-running header span { animation-play-state: paused !important; }

/* Keyframes */
@keyframes aurora-dance { 0% { transform: scale(1) translate(-8%, -8%); opacity: 0.4; } 50% { transform: scale(1.3) translate(8%, 8%); opacity: 0.85; } 100% { transform: scale(0.85) translate(-4%, 12%); opacity: 0.35; } }
@keyframes aurora-flicker { 0%, 100% { opacity: 0.2; } 30% { opacity: 0.5; } 50% { opacity: 0.25; } 80% { opacity: 0.6; } }
@keyframes causalPotential { 0% { opacity: 0; filter: blur(25px) scale(0.9); } 30% { opacity: 1; filter: blur(20px) scale(1.1); } 100% { opacity: 0; filter: blur(5px) scale(0.8); } }
@keyframes causalRippleEffect { 0% { transform: translate(-50%, -50%) scale(0); opacity: 0; } 40% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; } }
@keyframes resolveCausalMechanism { 0% { filter: blur(20px); opacity: 0; transform: scale(0.95); } 100% { filter: blur(0px); opacity: 1; transform: scale(1); } }
@keyframes mottoResolve { 0% { opacity: 0; filter: blur(4px); transform: translateY(5px); } 100% { opacity: 1; filter: blur(0px); transform: translateY(0); } }
@keyframes subpageFadeIn { 0% { opacity: 0; transform: translateY(10px); } 100% { opacity: 1; transform: translateY(0); } }

/* The Smooth Collapse and Chaos animations */
@keyframes wordCollapse {
    0%, 75% { 
        transform: scale(1); 
        opacity: 1; 
        filter: blur(0px);
        animation-timing-function: cubic-bezier(0.55, 0.085, 0.68, 0.53); /* Accelerates into the vortex */
    }
    100% { 
        transform: scale(0); 
        opacity: 0; 
        filter: blur(15px); 
    }
}

@keyframes letterChaos {
    0% { 
        opacity: 0; 
        filter: blur(20px); 
        transform: translate(var(--rx), var(--ry)) rotate(var(--rrot)) scale(2.5);
        animation-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1); /* Beautiful, smooth deceleration */
    }
    75% { 
        opacity: 1; 
        filter: blur(0px); 
        transform: translate(0px, 0px) rotate(0deg) scale(1); 
        text-shadow: 0 0 30px rgba(230, 190, 70, 1); 
    }
    100% { 
        opacity: 1; 
        transform: translate(0px, 0px) rotate(0deg) scale(1); 
    } 
}

@keyframes hideIntro { to { opacity: 0; visibility: hidden; } }

/* =========================================================
   PAGE SPECIFIC (About)
   ========================================================= */
.profile-container { display: flex; align-items: center; gap: 2rem; margin-top: 1.5rem; margin-bottom: 2rem; }
.profile-img-large { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; border: 4px solid #004080; box-shadow: 0 4px 10px rgba(0,0,0,0.1); flex-shrink: 0; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; margin-top: 2rem; }
.team-member { text-align: center; }
.team-member img { width: 130px; height: 130px; object-fit: cover; border-radius: 50%; border: 3px solid #004080; margin-bottom: 1rem; }
.team-member h4 { color: #004080; margin: 0 0 0.3rem 0; font-size: 1.1rem; }
.team-member p { color: #555; margin: 0; font-size: 0.95rem; }

/* =========================================================
   MOBILE NAVIGATION & SIDE DRAWER
   ========================================================= */
.mobile-toggle { display: none; color: white; font-size: 2rem; cursor: pointer; z-index: 10000; }
.drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100vh; background: rgba(0,0,0,0.6); z-index: 100000; opacity: 0; visibility: hidden; transition: opacity 0.3s ease; }
.drawer-overlay.open { opacity: 1; visibility: visible; }
.mobile-drawer { position: fixed; top: 0; right: -280px; width: 260px; height: 100vh; background-color: #00264d; z-index: 100001; display: flex; flex-direction: column; transition: right 0.3s cubic-bezier(0.165, 0.84, 0.44, 1); box-shadow: -5px 0 15px rgba(0,0,0,0.3); overflow-y: auto; padding-top: 70px; padding-bottom: 3rem; box-sizing: border-box;}
.mobile-drawer.open { right: 0; }
.mobile-drawer a { color: white; text-decoration: none; padding: 1.2rem 1.5rem; border-bottom: 1px solid rgba(255,255,255,0.08); font-family: 'Inter', sans-serif; font-weight: 700; text-transform: uppercase; font-size: 0.85rem; transition: background-color 0.2s; }
.mobile-drawer a:hover { background-color: rgba(255,255,255,0.05); color: #4da6ff; }
.drawer-close { position: absolute; top: 20px; right: 25px; color: white; font-size: 2rem; cursor: pointer; }

@media (max-width: 850px) { 
    header { position: relative; }
    nav { display: none !important; }
    .mobile-toggle { display: block; position: absolute; right: 25px; top: 25px; }
    #scrolled-nav .mobile-toggle { top: 50%; transform: translateY(-50%); }
    .profile-container { flex-direction: column; text-align: center; }
}

/* =========================================================
   PAGE SPECIFIC (Events)
   ========================================================= */
.event-details {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eaeaea;
}
.event-details:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.event-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #0059b3;
    font-weight: bold;
    text-decoration: none;
}
.event-link:hover { 
    text-decoration: underline; 
}

/* =========================================================
   PAGE SPECIFIC (Contact)
   ========================================================= */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}
@media (max-width: 768px) {
    .contact-grid { grid-template-columns: 1fr; }
}

#contactForm .form-group { margin-bottom: 1.2rem; }
#contactForm label { display: block; margin-bottom: 0.4rem; font-weight: bold; font-family: 'Inter', sans-serif; }
#contactForm input[type="text"], 
#contactForm input[type="email"], 
#contactForm textarea {
    width: 100%; padding: 0.8rem; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; font-family: inherit;
}
#contactForm textarea { resize: vertical; height: 150px; }
#contactForm button {
    background-color: #004080; color: white; padding: 1rem; border: none; border-radius: 4px; cursor: pointer; font-size: 1.1rem; font-weight: bold; transition: background-color 0.3s ease; width: 100%; font-family: 'Inter', sans-serif; text-transform: uppercase;
}
#contactForm button:hover { background-color: #0059b3; }

.contact-info p { margin-bottom: 1.5rem; }
.contact-info strong { display: block; color: #004080; margin-bottom: 0.2rem; }
.contact-info a { color: #004080; text-decoration: none; }
.contact-info a:hover { text-decoration: underline; }

/* =========================================================
   PAGE SPECIFIC (Methodology & Citations)
   ========================================================= */
.citations {
    background-color: #f4f7f6;
    padding: 1.5rem;
    border-radius: 6px;
    border-left: 4px solid #4da6ff;
    margin-top: 2rem; 
}
.citations h3 {
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    color: #004080;
    margin-top: 0;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.citations ul { 
    list-style-type: none; 
    padding: 0; 
    margin: 0; 
}
.citations li {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: #4a5568;
}
.citations li:last-child { 
    margin-bottom: 0; 
}

/* =========================================================
   PAGE SPECIFIC (Policy Impact)
   ========================================================= */
.featured-box {
    background-color: #f0f7ff;
    border-left: 4px solid #004080;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 0 4px 4px 0;
}
.featured-box h4 {
    margin-top: 0;
    color: #004080;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

/* =========================================================
   PAGE SPECIFIC (Heroes)
   ========================================================= */
.container-wide { 
    max-width: 1100px; 
}

.heroes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.hero-card {
    background: #fff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    border-top: 4px solid #004080;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease;
}
.hero-card:hover { 
    transform: translateY(-5px); 
}

.hero-card img.hero-portrait {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid #004080;
    box-shadow: 0 6px 10px rgba(0,0,0,0.15);
    margin-bottom: 1.5rem;
}

.hero-card h2 {
    font-size: 1.4rem;
    margin-top: 0;
    margin-bottom: 0.2rem;
}

.hero-card h3 {
    color: #666;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 1rem;
    font-style: italic;
    text-transform: none;
    letter-spacing: 0;
    line-height: 1.3;
}

.hero-card p {
    font-size: 0.95rem;
    color: #4a5568;
    text-align: left;
    margin-bottom: 0;
}

/* =========================================================
   PAGE SPECIFIC (Membership)
   ========================================================= */
.coming-soon-container {
    max-width: 600px;
    margin: 4rem auto;
    padding: 0 2rem;
    text-align: center;
}
.coming-soon-container .section-card {
    padding: 3.5rem 2.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-top: 5px solid #4da6ff;
}
.coming-soon-container .section-card h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.coming-soon-container .section-card p {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

#membershipForm .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}
#membershipForm input[type="email"] {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 1rem;
}
#membershipForm button {
    background-color: #004080;
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    transition: background-color 0.3s ease;
    width: 100%;
}
#membershipForm button:hover {
    background-color: #0059b3;
}

/* =========================================================
   PAGE SPECIFIC (Journal)
   ========================================================= */
.journal-box {
    border: 2px dashed #cbd5e0;
    padding: 3rem;
    border-radius: 8px;
    background-color: #f8fafc;
}