/* ==========================================================================
   SPIF MASTER DESIGN SYSTEM & GRAPHICS ENGINE v4.2
   ========================================================================== */

/* --- 01. DESIGN TOKENS (CSS VARIABLES) --- */
:root {
    /* Color Palette: Light Mode */
    --bg-base: #fafaf9;          
    --bg-surface: #ffffff;       
    --bg-subtle: #f5f5f4;        
    --bg-overlay: rgba(250, 250, 249, 0.85);
    
    --text-primary: #1c1917;     
    --text-secondary: #57534e;   
    --text-muted: #78716c; /* Changed from #a8a29e */
    --text-inverse: #ffffff;
    
    /* Brand Colors */
    --brand-primary: #0369a1; /* Changed from #0284c7 to improve contrast */;    
    --brand-primary-hover: #075985; /* Changed from #0369a1 */
    --brand-accent: #0d9488;     
    --brand-emergency: #e11d48;  
    --brand-emergency-hover: #be123c;
    --brand-gradient: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));

    /* Typography Scale (Fluid) */
    --text-xs: clamp(0.75rem, 0.7rem + 0.2vw, 0.85rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.25vw, 0.95rem);
    --text-base: clamp(1rem, 0.9rem + 0.35vw, 1.125rem);
    --text-md: clamp(1.125rem, 1rem + 0.4vw, 1.25rem);
    --text-lg: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
    --text-xl: clamp(1.5rem, 1.3rem + 0.8vw, 2.25rem);
    --text-2xl: clamp(2rem, 1.8rem + 1.2vw, 2.75rem);
    --text-display: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);

    /* Spacing Scale */
    --space-xxs: 0.25rem;
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-2xl: 6rem;

    /* Borders & Geometry */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 999px;
    
    /* Shadows & Elevation */
    --shadow-sm: 0 4px 12px rgba(28, 25, 23, 0.04);
    --shadow-subtle: 0 8px 24px rgba(28, 25, 23, 0.06);
    --shadow-premium: 0 16px 40px rgba(28, 25, 23, 0.08), 0 4px 12px rgba(28, 25, 23, 0.04);
    --shadow-hover: 0 24px 48px rgba(28, 25, 23, 0.12), 0 8px 16px rgba(28, 25, 23, 0.04);

    /* Animation Timing */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 0.2s var(--ease-out-expo);
    --transition-base: 0.4s var(--ease-out-expo);
    --transition-slow: 0.8s var(--ease-out-expo);

    --border-subtle: rgba(150,150,150,0.1);
}

/* Color Palette: Dark Mode */
[data-theme="dark"] {
    --bg-base: #0f172a;          
    --bg-surface: #1e293b;       
    --bg-subtle: #151e2e;      
    --bg-overlay: rgba(15, 23, 42, 0.85);

    --text-primary: #f8fafc;     
    --text-secondary: #cbd5e1;   
    --text-muted: #64748b;       
    --text-inverse: #f8fafc;

    --brand-primary: #38bdf8;    
    --brand-primary-hover: #7dd3fc;
    --brand-accent: #2dd4bf;     
    --brand-emergency: #fb7185;  
    --brand-emergency-hover: #fda4af;

    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-subtle: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-premium: 0 16px 40px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 24px 48px rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .theme-icon-dark,
[data-theme="dark"] .theme-icon-light {
    display: none !important;
}

/* --- 02. RESET & NORMALIZATION --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { 
    font-family: 'Inter', system-ui, -apple-system, sans-serif; 
    background-color: var(--bg-base); 
    color: var(--text-primary); 
    line-height: 1.6; 
    overflow-x: hidden; 
    transition: background-color var(--transition-base), color var(--transition-base); 
}
img, svg, video { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; transition: all var(--transition-fast); }
button, input, textarea { font-family: inherit; color: inherit; border: none; background: none; outline: none; }
button { cursor: pointer; }
ul, ol { list-style: none; }

/* Focus Accessibility */
/* Update this block */
:focus-visible { 
    outline: 2px solid var(--text-primary); /* Changed from --brand-primary */
    outline-color: var(--brand-primary);
    outline-offset: 4px; 
    border-radius: 2px; 
}

/* --- 03. LAYOUT & UTILITIES --- */
.container { width: 90%; max-width: 1200px; margin: 0 auto; }
.max-w-xs { max-width: 320px; }
.max-w-sm { max-width: 480px; }
.max-w-md { max-width: 768px; }
.max-w-prose { max-width: 65ch; } 
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }

.section-header { max-width: 800px; margin-left: auto; margin-right: auto; }

/* Grid & Flexbox */
.grid { display: grid; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-between { display: flex; justify-content: space-between; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.self-start { align-self: flex-start; }

/* Spacing Engine */
.gap-xxs { gap: var(--space-xxs); }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.pb-0 { padding-bottom: 0; }

.m-0 { margin: 0; }
.mt-auto { margin-top: auto; }
.mt-xs { margin-top: var(--space-xs); }
.mb-0 { margin-bottom: 0; }
.mb-xxs { margin-bottom: var(--space-xxs); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }
.px-md { padding-left: var(--space-md); padding-right: var(--space-md); }
.px-lg { padding-left: var(--space-lg); padding-right: var(--space-lg); }
.py-xxs { padding-top: var(--space-xxs); padding-bottom: var(--space-xxs); }
.py-sm { padding-top: var(--space-sm); padding-bottom: var(--space-sm); }
.py-md { padding-top: var(--space-md); padding-bottom: var(--space-md); }
.py-lg { padding-top: var(--space-lg); padding-bottom: var(--space-lg); }
.py-xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }

/* Colors & Backgrounds */
.bg-base { background-color: var(--bg-base); }
.bg-surface { background-color: var(--bg-surface); }
.bg-subtle { background-color: var(--bg-subtle); }
.surface-soft { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* Borders & Geometry */
.border-y-subtle { border-top: 1px solid rgba(150,150,150,0.08); border-bottom: 1px solid rgba(150,150,150,0.08); }
.border-t-subtle { border-top: 1px solid rgba(150,150,150,0.08); }
.border-subtle { border: 1px solid rgba(150,150,150,0.1); }
.border-none { border: none; }
.border-radius-sm { border-radius: var(--radius-sm); }
.border-radius-md { border-radius: var(--radius-md); }
.border-radius-lg { border-radius: var(--radius-lg); }
.border-radius-xl { border-radius: var(--radius-xl); }
.border-radius-pill { border-radius: var(--radius-pill); }
.object-cover { object-fit: cover; }
.border-b-subtle { border-bottom: 1px solid rgba(150,150,150,0.08); }

/* Elevation & Effects */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-premium { box-shadow: var(--shadow-premium); border: 1px solid rgba(150, 150, 150, 0.05); }
.hover-lift { transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-fast); }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.opacity-5 { opacity: 0.05; }
.relative { position: relative; }
.absolute { position: absolute; }
.z-10 { z-index: 10; }
.overflow-hidden { overflow: hidden; }
.stretched-link::after { content: ''; position: absolute; inset: 0; z-index: 1; }

/* Rich Text / Prose Container */
.prose { color: var(--text-secondary); line-height: 1.7; }
.prose p { margin-bottom: 1.5em; }
.prose h2, .prose h3 { color: var(--text-primary); margin-top: 2em; margin-bottom: 1em; }
.prose ul, .prose ol { margin-bottom: 1.5em; padding-left: 1.5em; }
.prose li { margin-bottom: 0.5em; }

/* Responsive Video Embeds */
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-lg); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- 04. TYPOGRAPHY ENGINE --- */
.display-text { font-size: var(--text-display); font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.heading-secondary { font-size: var(--text-xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.lead-text { font-size: var(--text-lg); line-height: 1.6; font-weight: 400; }
.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-md { font-size: var(--text-md); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-newsreader { font-family: 'Newsreader', Georgia, serif; }
.italic { font-style: italic; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.05em; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.7; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand-primary { color: var(--brand-primary); }
.text-brand-emergency { color: var(--brand-emergency); }
.text-brand-accent { color: var(--brand-accent); }
.text-gradient { background: var(--brand-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.block { display: block; }
.inline-block { display: inline-block; }

/* --- 05. EDITORIAL & BLOG STYLES --- */

/* Section subtitle — smaller and calmer than lead-text */
.section-subtitle { font-size: var(--text-base); line-height: 1.6; font-weight: 400; color: var(--text-secondary); }

/* Blog section header row — use align-items: flex-end to baseline-align heading+subtitle stack with the button */
.section-blog .blog-header { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem; margin-bottom: var(--space-xl); }
.section-blog .blog-header-text { display: flex; flex-direction: column; gap: 0.25rem; }

/* Blog cards — consistent height, description flows naturally from title */
.blog-card { display: flex; flex-direction: column; height: 100%; }
.blog-card .meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.blog-card h3 { flex-grow: 0; }
.blog-card p { margin-top: 0.5rem; }
.editorial-content h2 { font-size: var(--text-xl); font-weight: 800; margin: 2.5rem 0 1rem; color: var(--text-primary); letter-spacing: -0.01em; }
.editorial-content h3 { font-size: var(--text-lg); font-weight: 700; margin: 2rem 0 0.75rem; color: var(--text-primary); }
.editorial-content p { margin-bottom: 1.5rem; color: var(--text-secondary); }
.editorial-content ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 1.5rem; color: var(--text-secondary); }
.editorial-content li { margin-bottom: 0.5rem; }
.editorial-content a { color: var(--brand-primary); text-decoration: underline; text-underline-offset: 2px; }
.editorial-content a:hover { color: var(--brand-primary-hover); }
.editorial-content blockquote { border-left: 3px solid var(--brand-accent); padding-left: 1.5rem; margin: 2rem 0; }

/* --- 06. UI COMPONENTS --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.85rem 1.75rem; border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 600; letter-spacing: 0.01em; transition: all var(--transition-fast); cursor: pointer; text-decoration: none; width: fit-content; }
.btn--primary { background: var(--brand-primary); color: #ffffff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--brand-primary-hover); transform: translateY(-2px); box-shadow: var(--shadow-premium); color: #ffffff; }
.btn--ghost { background: transparent; color: var(--text-primary); border: 1px solid rgba(150, 150, 150, 0.3); }
.btn--ghost:hover { background: var(--bg-subtle); transform: translateY(-2px); border-color: var(--text-primary); }
.btn--emergency { 
    background: var(--brand-emergency); 
    color: var(--text-inverse); 
    box-shadow: var(--shadow-sm);
    /* FIX: Changed undefined var(--background-fast) to var(--transition-fast) */
    transition: transform var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast); 
}
.btn--emergency:hover { 
    background: var(--brand-emergency-hover) !important; 
    transform: scale(1.05); 
    box-shadow: 0 0 20px rgba(225, 29, 72, 0.4); 
    color: var(--text-inverse);
}

.btn--sm { padding: 0.6rem 1.25rem; font-size: var(--text-xs); }
.btn--lg { padding: 1.1rem 2.5rem; font-size: var(--text-base); }

.badge-pill { display: inline-flex; align-items: center; width: fit-content; max-width: 100%; }
.badge-minimal { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; color: var(--brand-accent); display: block; letter-spacing: 0.05em; }

/* --- 07. SPECIFIC LAYOUTS & SECTIONS --- */
.site-header { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background-color: var(--bg-overlay); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(150, 150, 150, 0.08); transition: transform var(--transition-base), background-color var(--transition-base); }
.site-header.is-hidden { transform: translateY(-100%); }
.main-offset { padding-top: 76px; }

.header-grid { display: flex; justify-content: space-between; align-items: center; height: 76px; }

.brand-logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; flex-shrink: 0; }
.nav-mark { display: block; height: 42px; width: auto; object-fit: contain; flex-shrink: 0; }
.nav-text { display: flex; flex-direction: column; justify-content: center; text-align: left; white-space: nowrap; }
.nav-text-main { font-size: 1.15rem; font-weight: 800; line-height: 1; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 2px; }
.nav-text-sub { font-size: 0.85rem; font-weight: 500; line-height: 1; color: var(--text-secondary); }

@media (max-width: 950px) { .site-header .nav-text { display: none; } }
@media (max-width: 400px) { .btn--emergency span:last-child { display: none; } .btn--emergency { padding: 0.6rem 0.8rem; } }

.nav-link { color: var(--text-secondary); transition: color var(--transition-fast); font-size: var(--text-sm); }
.nav-link:hover { color: var(--text-primary); }
.theme-toggle-btn { color: var(--text-secondary); transition: background var(--transition-fast), color var(--transition-fast); border-radius: var(--radius-sm); }
.theme-toggle-btn:hover { background: var(--bg-subtle); color: var(--brand-primary); }
.menu-toggle-btn { display: none; align-items: center; justify-content: center; padding: 0.5rem; color: var(--text-secondary); border-radius: var(--radius-sm); transition: background var(--transition-fast), color var(--transition-fast); }
.menu-toggle-btn:hover { background: var(--bg-subtle); color: var(--brand-primary); }
.header-actions { flex-shrink: 0; display: flex; align-items: center; gap: var(--space-sm); }

.image-mask-wrapper { aspect-ratio: 4/3; }
.impact-stat--divided { border-left: 1px solid rgba(150, 150, 150, 0.12); padding-left: 2rem; }

footer.site-footer { padding-bottom: 0 !important; }
.impact-stat .display-text { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); line-height: 1; margin-bottom: 0.5rem; }

/* Bento cards — icon/label/title centred, description left-anchored below title */
.bento-cell { padding: 2.5rem 2rem; position: relative; min-height: 220px; }
.bento-icon { font-size: 2.75rem; flex-shrink: 0; }
.icon-bg-large { font-size: 200px; opacity: 0.05; transition: transform var(--transition-slow); }
.initiative-card:hover .icon-bg-large { transform: scale(1.1) rotate(-5deg); }
.icon-foreground { font-size: 4rem; z-index: 1; }
.card-action { display: flex; flex-direction: column; }
.icon-bg { font-size: 160px; top: -20px; right: -20px; z-index: 0; pointer-events: none; transition: transform var(--transition-slow); }
.card-action:hover .icon-bg { transform: scale(1.1) rotate(-5deg); }

.card-action .icon-bg { opacity: 0.12 !important; }
[data-theme="dark"] .card-action .icon-bg { opacity: 0.04 !important; }

/* FIX: Hide default HTML dropdown arrows */
details.accordion-item > summary, details.footer-col > summary { list-style: none; }
details.accordion-item > summary::-webkit-details-marker, details.footer-col > summary::-webkit-details-marker { display: none; }

/* Grid Systems */
.hero-grid { grid-template-columns: 1.1fr 0.9fr; }
.bento-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.action-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.blog-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.metrics-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); row-gap: 3rem; }
.initiative-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.metrics-extra { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.cues-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: stretch; }
.protective-factors-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.border-l-accent { border-left: 2px solid var(--brand-accent); }
.testimonial-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Reveal Animations */
/* FIX: Added :where() selector so the noscript override in HTML takes precedence without !important wars */
[data-reveal] { opacity: 0; transform: translateY(30px); transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo); will-change: opacity, transform; }
[data-reveal].is-revealed { opacity: 1; transform: translateY(0); }

.logo-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 2rem 3rem;
    padding: 1rem;
}

.logo-grid img {
    height: 48px;
    width: auto;
    max-width: 140px;
    object-fit: contain;
    filter: grayscale(100%) opacity(0.7);
    transition: filter var(--transition-fast), transform var(--transition-fast);
}

.logo-grid img:hover {
    filter: grayscale(0%) opacity(1);
    transform: translateY(-2px);
}

/* --- 08. MASTER RESPONSIVE ENGINE --- */
@media (min-width: 1025px) {
    .hidden-desktop { display: none !important; }
    .footer-grid { grid-template-columns: 2fr 1.5fr 1fr 1fr; }
    details.footer-col > summary { pointer-events: none; cursor: default; }
}

@media (max-width: 1024px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-content { display: flex; flex-direction: column; align-items: center; }
    .hero-actions { justify-content: center; }
    .image-mask-wrapper { aspect-ratio: 16/9; max-height: 450px; }
    .initiative-grid { grid-template-columns: 1fr; }
    .initiative-media { min-height: 250px; }
    .footer-grid { grid-template-columns: repeat(2, 1fr); }
    .impact-stat--divided { border-left: none; padding-left: 0; }
}

@media (max-width: 768px) {
    .hidden-mobile { display: none !important; }
    .menu-toggle-btn { display: flex !important; }
    
    :root { --space-xl: 3.5rem; --space-2xl: 4.5rem; }

    .bento-grid, .action-grid, .blog-grid, .metrics-grid { grid-template-columns: 1fr !important; }
    
    .hero-actions { flex-direction: column; width: 100%; }
    .hero-actions .btn { width: 100%; }
    
    .metrics-grid { gap: 0 !important; }
    .impact-stat { padding: 1.5rem 0; border-bottom: 1px solid rgba(150,150,150,0.1); }
    .impact-stat:last-child { border-bottom: none; }

    .footer-grid { grid-template-columns: 1fr; gap: 1rem; }
    .footer-brand { margin-bottom: 1.5rem; text-align: center; align-items: center; }
    .footer-brand .brand-logo { justify-content: center; }
    .footer-brand .social-links { justify-content: center; }
    
    details.footer-col { background: var(--bg-surface); border-radius: var(--radius-md); border: 1px solid rgba(150,150,150,0.1); margin-bottom: 0.5rem; }
    details.footer-col > summary { padding: 1rem; margin: 0; display: flex; justify-content: space-between; align-items: center; }
    details.footer-col > summary::after { content: 'expand_more'; font-family: 'Material Symbols Rounded'; transition: transform var(--transition-fast); }
    details.footer-col[open] > summary::after { transform: rotate(180deg); }
    details.footer-col > .footer-links { padding: 0 1rem 1rem 1rem; }
    
    .nav-menu { 
        display: none; position: absolute; top: 86px; left: 1rem; right: 1rem; width: auto; height: auto; 
        max-height: calc(100vh - 110px); background: var(--bg-surface); flex-direction: column; padding: 0.5rem 1.5rem; 
        gap: 0; border-radius: var(--radius-xl); border: 1px solid rgba(150,150,150,0.1); box-shadow: var(--shadow-hover); 
        overflow-y: auto; z-index: 999; 
    }
    .body-nav-open .nav-menu { display: flex; }
    .body-nav-open .hidden-mobile { display: flex !important; }

    .nav-menu .nav-item { width: 100%; border-bottom: 1px solid rgba(150,150,150,0.1); }
    .nav-menu .nav-item:last-child { border-bottom: none; }
    .nav-menu .nav-link { display: flex; width: 100%; justify-content: space-between; padding: 1.25rem 0; font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
    [data-reveal] { opacity: 1; transform: none; transition: none; }
    .marquee-track { animation-play-state: paused; }
}

/* ==========================================================================
   09. HEADER DROPDOWN NAVIGATION
   ========================================================================== */
.has-dropdown { position: relative; }
.nav-link { display: flex; align-items: center; gap: 4px; background: none; border: none; cursor: pointer; padding: 0.5rem 0; font-size: var(--text-sm); color: var(--text-secondary); font-weight: 500; transition: color var(--transition-fast); }
.nav-link:hover, .nav-link.is-active { color: var(--brand-primary); }
.drop-icon { font-size: 1.25rem; transition: transform var(--transition-fast); }

@media (min-width: 769px) {
    .dropdown-wrapper { position: absolute; top: 100%; left: -1rem; background: var(--bg-surface); border: 1px solid rgba(150,150,150,0.1); border-radius: var(--radius-md); box-shadow: var(--shadow-premium); padding: 0.5rem 0; min-width: 240px; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all var(--transition-fast); z-index: 50; }
    .has-dropdown:hover .dropdown-wrapper, .has-dropdown:focus-within .dropdown-wrapper { opacity: 1; visibility: visible; transform: translateY(0); }
    .has-dropdown:hover .drop-icon, .has-dropdown:focus-within .drop-icon { transform: rotate(180deg); }
}

@media (max-width: 768px) {
    .has-dropdown { flex-direction: column; align-items: flex-start; }
    .drop-icon { display: block !important; }
    .dropdown-wrapper { display: none; padding-left: 1rem; margin-bottom: 1rem; border-left: 2px solid var(--brand-primary); width: 100%; }
    .has-dropdown.is-expanded .dropdown-wrapper { display: block; }
    .has-dropdown.is-expanded > .nav-link { color: var(--brand-primary); }
    .has-dropdown.is-expanded .drop-icon { transform: rotate(180deg); color: var(--brand-primary); }
    .dropdown-menu a { padding: 0.6rem 1rem; font-size: 1rem; }
}

.dropdown-menu { display: flex; flex-direction: column; margin: 0; padding: 0; }
.dropdown-menu a { display: block; padding: 0.75rem 1.5rem; font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); transition: background var(--transition-fast), color var(--transition-fast); }
.dropdown-menu a:hover, .dropdown-menu a.is-active { background: var(--bg-subtle); color: var(--brand-primary); }

.page-crisis .main-offset { padding-top: 130px; }
@media (max-width: 768px) { .page-crisis .main-offset { padding-top: 160px; } }

/* ==========================================================================
   AUTO-SCROLL MARQUEE
   ========================================================================== */
.marquee-wrapper { position: relative; width: 100%; overflow: hidden; display: flex; padding: 2rem 0; }
.marquee-wrapper::before, .marquee-wrapper::after { content: ""; position: absolute; top: 0; width: 100px; height: 100%; z-index: 2; pointer-events: none; }
.marquee-wrapper::before { left: 0; background: linear-gradient(to right, var(--bg-base), transparent); }
.marquee-wrapper::after { right: 0; background: linear-gradient(to left, var(--bg-base), transparent); }
.marquee-track { display: flex; width: fit-content; animation: scroll-marquee 40s linear infinite; }
.marquee-track:hover { animation-play-state: paused; }
.marquee-items { display: flex; align-items: center; gap: 3rem; padding-right: 3rem; }
.marquee-items img { height: 56px; width: auto; max-width: 180px; object-fit: contain; background-color: #ffffff; padding: 0.5rem 1rem; border-radius: var(--radius-sm); border: 1px solid rgba(150,150,150,0.1); box-shadow: var(--shadow-sm); filter: grayscale(100%) opacity(0.7); transition: filter var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast); }
.marquee-items img:hover { filter: grayscale(0%) opacity(1); transform: translateY(-2px); box-shadow: var(--shadow-premium); }
@keyframes scroll-marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ==========================================================================
   10. ABOUT PAGE SPECIFICS
   ========================================================================== */
.founder-card { display: flex; flex-direction: column; gap: var(--space-lg); text-align: center; }
.founder-image-wrapper { flex-shrink: 0; width: 180px; height: 180px; margin: 0 auto; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-sm); border: 4px solid var(--bg-subtle); }
.founder-content .badge-minimal { display: flex; justify-content: center; }
@media (min-width: 768px) { .founder-card { flex-direction: row; text-align: left; align-items: center; } .founder-image-wrapper { width: 220px; height: 220px; margin: 0; border-radius: var(--radius-xl); border-width: 1px; border-color: rgba(150,150,150,0.1); } .founder-content .badge-minimal { justify-content: flex-start; } .md-col-span-full { grid-column: 1 / -1; } }

/* ==========================================================================
   11. LEGAL & DOCUMENTATION PAGES
   ========================================================================== */
.legal-layout { grid-template-columns: 1fr; gap: 2rem; align-items: start; }
.sticky-sidebar { position: sticky; top: 100px; z-index: 10; }
.scroll-offset { scroll-margin-top: 130px; }
.nav-indicator { color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; transition: all var(--transition-fast); }
.nav-indicator.is-active-spy { color: var(--brand-primary); font-weight: 700; border-bottom-color: var(--brand-primary); }
@media (min-width: 900px) { .legal-layout { grid-template-columns: 250px 1fr; gap: 4rem; } .sticky-sidebar { top: 120px; } .nav-indicator { border-bottom: none; border-left: 2px solid transparent; } .nav-indicator.is-active-spy { border-left-color: var(--brand-primary); border-bottom-color: transparent; } }
@media (max-width: 899px) { .disclaimer-sidebar-nav { flex-direction: row; overflow-x: auto; white-space: nowrap; padding-bottom: 0.5rem; background: var(--bg-subtle); margin-left: -5vw; margin-right: -5vw; padding-left: 5vw; padding-right: 5vw; } }

/* ==========================================================================
   12. EDITORIAL & LONG-FORM READING (BLOG)
   ========================================================================== */
.editorial-body { font-family: 'Inter', system-ui, sans-serif; font-size: clamp(1.125rem, 1vw + 1rem, 1.25rem); line-height: 1.8; color: var(--text-secondary); max-width: 65ch; margin: 0 auto; }
.editorial-body p { margin-bottom: 2rem; }
.editorial-body strong { color: var(--text-primary); font-weight: 700; }
.editorial-lead { font-size: clamp(1.25rem, 1.5vw + 1rem, 1.35rem); line-height: 1.6; color: var(--text-primary); font-weight: 500; margin-bottom: 2.5rem; }
.editorial-title { font-family: 'Inter', system-ui, sans-serif; font-size: clamp(2.5rem, 4vw + 1.5rem, 4rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; color: var(--text-primary); margin-bottom: 1.5rem; }
.editorial-hero-icon { display: flex; justify-content: center; align-items: center; width: 80px; height: 80px; background: var(--bg-subtle); border-radius: var(--radius-xl); margin: 0 auto 2rem; color: var(--brand-primary); }
.editorial-hero-icon .material-symbols-rounded { font-size: 40px; }
.editorial-callout { position: relative; overflow: hidden; background: var(--bg-subtle); padding: 2.5rem 3rem; margin: 3.5rem 0; border-left: 4px solid var(--brand-primary); border-radius: 0 var(--radius-lg) var(--radius-lg) 0; font-size: var(--text-base); line-height: 1.7; color: var(--text-secondary); }
.editorial-callout-content { position: relative; z-index: 10; }
.editorial-callout-watermark { position: absolute; bottom: -30px; right: -20px; font-size: 160px !important; color: var(--brand-primary); opacity: 0.08; z-index: 0; pointer-events: none; user-select: none; transform: rotate(-5deg); }
[data-theme="dark"] .editorial-callout-watermark { opacity: 0.03; }
.editorial-callout-title { font-weight: 800; color: var(--text-primary); text-transform: uppercase; letter-spacing: 0.05em; font-size: var(--text-xs); display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.editorial-meta-divider { width: 60px; height: 2px; background: var(--brand-primary); margin: 2rem auto; }
.editorial-citations { border-top: 1px solid rgba(150, 150, 150, 0.15); padding-top: 4rem; margin-top: 4rem; }
.editorial-hero-image { width: 100%; border-radius: var(--radius-xl); overflow: hidden; border: 1px solid rgba(150, 150, 150, 0.1); box-shadow: var(--shadow-premium); margin-bottom: var(--space-xl); aspect-ratio: 16 / 9; max-height: 440px; }
.editorial-hero-image img { width: 100%; height: 100%; object-fit: cover; }

/* ==========================================================================
   CLINICAL CTA BOX ("Need to talk?")
   ========================================================================== */
.clinical-cta { background-color: var(--bg-surface); border-radius: var(--radius-lg); padding: var(--space-lg); box-shadow: var(--shadow-sm); border: 1px solid rgba(150, 150, 150, 0.1); text-align: center; max-width: 65ch; margin: var(--space-xl) auto 0 auto; }
.clinical-cta-title { font-size: var(--text-md); font-weight: 700; color: var(--text-primary); margin-bottom: var(--space-xs); }
.clinical-cta-desc { font-size: var(--text-sm); color: var(--text-secondary); margin-bottom: var(--space-md); max-width: 500px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.clinical-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-sm); }

/* ==========================================================================
   Author Profile Pages
   ========================================================================== */
.page-author-profile .profile-hero-grid { display: flex; flex-direction: column; align-items: center; gap: 2rem; text-align: center; }
.page-author-profile .author-avatar-img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; box-shadow: var(--shadow-sm); border: 4px solid var(--bg-surface); }
.page-author-profile .tech-badge-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.page-author-profile .tech-pill { background: var(--bg-subtle); border: 1px solid var(--border-subtle); padding: 0.25rem 0.75rem; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); }
.page-author-profile .social-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: #0a66c2; color: #ffffff; border-radius: var(--radius-pill); font-size: 0.8rem; font-weight: 600; text-decoration: none; transition: all 0.2s; }
.page-author-profile .social-pill:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(10, 102, 194, 0.3); color: #ffffff; }
.page-author-profile .social-pill .material-symbols-rounded { font-size: 1.1rem; }
.page-author-profile .article-card { display: flex; flex-direction: column; gap: var(--space-xs); padding: var(--space-md); background: var(--bg-surface); border: 1px solid rgba(150,150,150,0.1); border-radius: var(--radius-lg); transition: all 0.2s; text-decoration: none; }
.page-author-profile .article-card:hover { border-color: var(--brand-primary); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.page-author-profile .article-card h3 { color: var(--text-primary); font-size: 1.1rem; font-weight: 700; margin: 0; line-height: 1.3; }
.page-author-profile .article-card p { color: var(--text-secondary); font-size: 0.9rem; margin: 0; line-height: 1.5; }
@media (min-width: 768px) { .page-author-profile .profile-hero-grid { flex-direction: row; text-align: left; align-items: center; gap: 3rem; } .page-author-profile .tech-badge-grid { justify-content: flex-start; } .page-author-profile .md-mx-0 { margin-left: 0; margin-right: 0; } .page-author-profile .md-items-start { align-items: flex-start; } }

/* ==========================================================================
   HEADER COLLISION FIX (Tablets & Small Laptops)
   ========================================================================== */

/* Unbreakable forcefield so elements can never physically touch */
.header-grid {
    gap: 1rem; 
}

/* Compress wide menu gaps and text size on medium screens */
@media (max-width: 1100px) and (min-width: 769px) {
    .site-header .nav-menu { 
        gap: 1rem !important; 
    }
    .site-header .nav-link { 
        font-size: 0.85rem; 
    }
}

/* ==========================================================================
   ACCORDION ANIMATION & SCROLL GLITCH FIX
   ========================================================================== */
details.accordion-item, 
details.footer-col {
    /* Forces hardware acceleration (GPU) to stop the screen flashing */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
    
    /* Tells the browser to optimise this specific element for size changes */
    will-change: height;
}

/* ==========================================================================
   SPIF MAIN.CSS PATCH — Blog & Author Page Additions
   Append these rules to the bottom of assets/css/main.css
   ========================================================================== */



/* ==========================================================================
   BREADCRUMB LINKS
   Replaced hover-lift (translateY) with a simple colour transition —
   jumping breadcrumb text upward on hover is visually jarring.
   ========================================================================== */
.breadcrumb-link {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}
.breadcrumb-link:hover {
    color: var(--brand-primary);
}


/* ==========================================================================
   AUTHOR BACK PILL
   The "Back to Resources" pill on author pages previously used hover-lift
   (translateY). Replaced with a border + colour transition more appropriate
   for a pill-shaped inline element.
   ========================================================================== */
.author-back-pill {
    transition: border-color var(--transition-fast), color var(--transition-fast);
}
.author-back-pill:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}

/* ==========================================================================
   PRINT & PDF EXPORT STYLES (1-Page Compact)
   ========================================================================== */
@media print {
    /* 1. Hide all website UI and distracting CTAs */
    .site-header, 
    .site-footer, 
    .skip-link, 
    .print-btn,
    .clinical-cta, 
    nav[aria-label="Breadcrumb"],
    .editorial-hero-icon { 
        display: none !important;
    }

    /* 2. Force white background and black text */
    body, main, article, .bg-base, .bg-subtle, .bg-surface {
        background-color: #ffffff !important;
        color: #000000 !important;
    }

    /* 3. AGGRESSIVELY remove web padding/margins to fit on one page */
    .py-xl, .py-lg, .py-md, .mb-xl, .mb-lg, .mb-md, .mt-xl, .mt-lg {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 15px !important;
    }
    .main-offset { padding-top: 0 !important; }
    * { box-shadow: none !important; }

    /* 4. Shrink typography for paper */
    body {
        font-size: 11pt !important;
        line-height: 1.4 !important;
    }
    .heading-secondary {
        font-size: 18pt !important;
        margin-top: 0.5in !important; 
        margin-bottom: 15px !important;
    }
    .lead-text {
        font-size: 12pt !important;
        margin-bottom: 15px !important;
    }

    /* 5. Compact the lists so they flow perfectly */
    .prose ul {
        margin-bottom: 10px !important;
    }
    .prose li {
        margin-bottom: 6px !important;
        page-break-inside: auto !important; 
    }

    /* 6. Prevent tables from breaking awkwardly across pages */
    tr, td, th { 
        page-break-inside: avoid !important; 
    }
}
/* ==========================================================================
   SPIF DESIGN PATCH v4.3 — Glassmorphism, Mobile CTA fix, Social Icons
   ========================================================================== */

/* --- GLASSMORPHISM HEADER (replaces opaque overlay) --- */
.site-header {
    background: rgba(250, 250, 249, 0.72) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25) !important;
}
[data-theme="dark"] .site-header {
    background: rgba(15, 23, 42, 0.72) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
}

/* --- GLASSMORPHISM DROPDOWN MENUS --- */
@media (min-width: 769px) {
    .dropdown-wrapper {
        background: rgba(255, 255, 255, 0.85) !important;
        backdrop-filter: blur(24px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
        border: 1px solid rgba(255, 255, 255, 0.4) !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.1), 0 4px 16px rgba(0,0,0,0.06) !important;
    }
    [data-theme="dark"] .dropdown-wrapper {
        background: rgba(30, 41, 59, 0.88) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 4px 16px rgba(0,0,0,0.2) !important;
    }
}

/* --- GLASSMORPHISM MOBILE NAV PANEL --- */
@media (max-width: 768px) {
    .nav-menu {
        background: rgba(255, 255, 255, 0.92) !important;
        backdrop-filter: blur(24px) saturate(160%) !important;
        -webkit-backdrop-filter: blur(24px) saturate(160%) !important;
        border: 1px solid rgba(255, 255, 255, 0.4) !important;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.12), 0 8px 24px rgba(0,0,0,0.06) !important;
    }
    [data-theme="dark"] .nav-menu {
        background: rgba(30, 41, 59, 0.95) !important;
        border: 1px solid rgba(255, 255, 255, 0.07) !important;
    }
}

/* --- MOBILE CALL BUTTON — fix height to match other header buttons --- */
.btn--call-mobile {
    padding: 0.6rem 1.1rem !important;
    font-size: var(--text-xs) !important;
    line-height: 1 !important;
    height: 36px !important;
    min-height: unset !important;
}
.btn--call-mobile .material-symbols-rounded {
    font-size: 1.1rem !important;
}
@media (max-width: 400px) {
    .btn--call-mobile span:last-child { display: none; }
    .btn--call-mobile { padding: 0.6rem 0.75rem !important; }
}

/* --- PREMIUM CARD GLASSMORPHISM (cards on subtle backgrounds) --- */
.shadow-premium {
    box-shadow: 0 16px 48px rgba(28,25,23,0.07), 0 4px 16px rgba(28,25,23,0.04), inset 0 1px 0 rgba(255,255,255,0.6) !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
}
[data-theme="dark"] .shadow-premium {
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.05) !important;
}

/* --- SOCIAL LINK ICONS — slightly larger, better hover --- */
.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-subtle);
    border: 1px solid rgba(150,150,150,0.15);
    color: var(--text-muted);
    transition: background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
    text-decoration: none;
}
.social-links a:hover {
    background: var(--bg-surface);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
    transform: translateY(-2px);
}
.social-links a .material-symbols-rounded {
    font-size: 1.1rem;
}

/* --- GLASSMORPHISM HERO SECTIONS (subtle frosted badge) --- */
.badge-pill {
    background: rgba(255,255,255,0.7) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.5) !important;
}
[data-theme="dark"] .badge-pill {
    background: rgba(30,41,59,0.7) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

/* --- CARD HOVER GLASS SHIMMER --- */
.hover-lift {
    background: var(--bg-surface);
}
.hover-lift:hover {
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 24px 64px rgba(28,25,23,0.1), 0 8px 24px rgba(28,25,23,0.05), inset 0 1px 0 rgba(255,255,255,0.8) !important;
}
[data-theme="dark"] .hover-lift:hover {
    background: rgba(30,41,59,0.95) !important;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.05) !important;
}

/* --- FOOTER GLASS PANEL (mobile) --- */
@media (max-width: 768px) {
    details.footer-col {
        background: rgba(255,255,255,0.75) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255,255,255,0.4) !important;
    }
    [data-theme="dark"] details.footer-col {
        background: rgba(30,41,59,0.75) !important;
        border: 1px solid rgba(255,255,255,0.05) !important;
    }
}

/* --- REMOVE RED from emergency brand color --- */
/* Replaced emergency palette with a deep teal/amber approach */
:root {
    --brand-emergency: #b45309;
    --brand-emergency-hover: #92400e;
}
[data-theme="dark"] {
    --brand-emergency: #fbbf24;
    --brand-emergency-hover: #fcd34d;
}
.btn--emergency {
    background: var(--brand-emergency) !important;
}
.btn--emergency:hover {
    background: var(--brand-emergency-hover) !important;
    box-shadow: 0 0 20px rgba(180, 83, 9, 0.35) !important;
}

/* --- ORG SCHEMA sameAs update (index.html inline patch placeholder) --- */

