/* ============================================
   CSS Custom Properties & Base
   ============================================ */
:root {
    /* Colors - Military dark green/yellow theme */
    --bg-primary: #1a1f1a;
    --bg-secondary: #232b23;
    --bg-tertiary: #2d362d;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b5b0;
    --text-muted: #707570;
    --accent: #f4d03f;
    --accent-glow: rgba(244, 208, 63, 0.3);
    --accent-secondary: #3a5a2a;
    --accent-tertiary: #f4d03f;
    
    /* Typography */
    --font-display: 'Playfair Display', Georgia, serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 8rem;
    
    /* Animation */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-timeline: --page-scroll block;
}

body {
    font-family: var(--font-mono);
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ============================================
   ML Background Visualizations - Deep Neural Network
   ============================================ */
.ml-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.5;
}

.dnn-network {
    width: 100%;
    height: 100%;
    opacity: 0.7;
}

/* Static background network structure */
.dnn-static-connections .static-conn {
    stroke: #5a7a4a;
    stroke-width: 0.8;
    opacity: 0.35;
    stroke-dasharray: 2 3;
}

/* Active DNN Network Connections */
.dnn-connections .conn {
    stroke: var(--accent-secondary);
    stroke-width: 0.5;
    opacity: 0;
    stroke-dasharray: 3 3;
    animation: connection-activate linear both;
    animation-timeline: --page-scroll;
    fill: none;
}

/* Create different activation pathways through the network */
/* Path 1: Top route (early scroll) */
.conn-1, .conn-2 { animation-range: 0% 25%; animation-name: connection-activate-path1; }
.conn-13, .conn-14 { animation-range: 12% 37%; animation-name: connection-activate-path1; }
.conn-29, .conn-30 { animation-range: 24% 49%; animation-name: connection-activate-path1; }
.conn-41 { animation-range: 36% 61%; animation-name: connection-activate-path1; }

/* Path 2: Middle route (mid scroll) */
.conn-6, .conn-7 { animation-range: 15% 40%; animation-name: connection-activate-path2; }
.conn-18, .conn-19 { animation-range: 27% 52%; animation-name: connection-activate-path2; }
.conn-33, .conn-34 { animation-range: 39% 64%; animation-name: connection-activate-path2; }
.conn-43, .conn-44 { animation-range: 51% 76%; animation-name: connection-activate-path2; }

/* Path 3: Bottom route (late scroll) */
.conn-9, .conn-12 { animation-range: 30% 55%; animation-name: connection-activate-path3; }
.conn-25, .conn-28 { animation-range: 42% 67%; animation-name: connection-activate-path3; }
.conn-38, .conn-40 { animation-range: 54% 79%; animation-name: connection-activate-path3; }
.conn-46 { animation-range: 66% 91%; animation-name: connection-activate-path3; }

/* Weak connections (noise) */
.conn-3, .conn-4, .conn-5, .conn-8, .conn-10, .conn-11,
.conn-15, .conn-16, .conn-17, .conn-20, .conn-21, .conn-22, .conn-23, .conn-24,
.conn-26, .conn-27, .conn-31, .conn-32, .conn-35, .conn-36, .conn-37, .conn-39,
.conn-42, .conn-45 {
    animation-range: 20% 80%;
    animation-name: connection-noise;
}

@keyframes connection-activate-path1 {
    0% {
        opacity: 0;
        stroke-width: 0.5;
        stroke-dasharray: 3 3;
        stroke: var(--accent-secondary);
    }
    20% {
        opacity: 1;
        stroke-width: 2.5;
        stroke: var(--accent);
        stroke-dasharray: 0;
    }
    50% {
        opacity: 1;
        stroke-width: 2.5;
        stroke: var(--accent);
        stroke-dasharray: 0;
    }
    70% {
        opacity: 0.4;
        stroke-width: 0.8;
        stroke: var(--accent-secondary);
        stroke-dasharray: 3 3;
    }
    100% {
        opacity: 0;
        stroke-width: 0.5;
        stroke-dasharray: 3 3;
        stroke: var(--accent-secondary);
    }
}

@keyframes connection-activate-path2 {
    0% {
        opacity: 0;
        stroke-width: 0.5;
        stroke-dasharray: 3 3;
        stroke: var(--accent-secondary);
    }
    25% {
        opacity: 1;
        stroke-width: 2.8;
        stroke: #e6c13f;
        stroke-dasharray: 0;
    }
    55% {
        opacity: 1;
        stroke-width: 2.8;
        stroke: #e6c13f;
        stroke-dasharray: 0;
    }
    75% {
        opacity: 0.35;
        stroke-width: 0.8;
        stroke: var(--accent-secondary);
        stroke-dasharray: 3 3;
    }
    100% {
        opacity: 0;
        stroke-width: 0.5;
        stroke-dasharray: 3 3;
        stroke: var(--accent-secondary);
    }
}

@keyframes connection-activate-path3 {
    0% {
        opacity: 0;
        stroke-width: 0.5;
        stroke-dasharray: 3 3;
        stroke: var(--accent-secondary);
    }
    30% {
        opacity: 1;
        stroke-width: 2.4;
        stroke: #d4af37;
        stroke-dasharray: 0;
    }
    60% {
        opacity: 1;
        stroke-width: 2.4;
        stroke: #d4af37;
        stroke-dasharray: 0;
    }
    80% {
        opacity: 0.3;
        stroke-width: 0.8;
        stroke: var(--accent-secondary);
        stroke-dasharray: 3 3;
    }
    100% {
        opacity: 0;
        stroke-width: 0.5;
        stroke-dasharray: 3 3;
        stroke: var(--accent-secondary);
    }
}

@keyframes connection-noise {
    0%, 100% {
        opacity: 0.05;
        stroke-width: 0.5;
        stroke-dasharray: 4 4;
    }
    50% {
        opacity: 0.15;
        stroke-width: 0.8;
        stroke: var(--accent-secondary);
        stroke-dasharray: 2 4;
    }
}

/* DNN Neurons */
.dnn-neurons .neuron {
    fill: transparent;
    stroke: var(--accent-secondary);
    stroke-width: 1.5;
    opacity: 0.5;
}

/* Input neurons - different activation times */
.n-1 {
    animation: neuron-fire-path1 linear both;
    animation-timeline: --page-scroll;
    animation-range: 0% 20%;
}

.n-2 {
    animation: neuron-fire-path2 linear both;
    animation-timeline: --page-scroll;
    animation-range: 10% 35%;
}

.n-3 {
    animation: neuron-fire-path3 linear both;
    animation-timeline: --page-scroll;
    animation-range: 25% 50%;
}

/* Hidden layer 1 neurons */
.n-4, .n-5 {
    animation: neuron-fire-path1 linear both;
    animation-timeline: --page-scroll;
    animation-range: 8% 30%;
}

.n-6 {
    animation: neuron-fire-path2 linear both;
    animation-timeline: --page-scroll;
    animation-range: 20% 45%;
}

.n-7 {
    animation: neuron-fire-path3 linear both;
    animation-timeline: --page-scroll;
    animation-range: 35% 58%;
}

/* Hidden layer 2 neurons */
.n-8, .n-9 {
    animation: neuron-fire-path1 linear both;
    animation-timeline: --page-scroll;
    animation-range: 18% 42%;
}

.n-10 {
    animation: neuron-fire-path2 linear both;
    animation-timeline: --page-scroll;
    animation-range: 32% 57%;
}

.n-11 {
    animation: neuron-fire-path3 linear both;
    animation-timeline: --page-scroll;
    animation-range: 48% 70%;
}

/* Hidden layer 3 neurons */
.n-12 {
    animation: neuron-fire-path1 linear both;
    animation-timeline: --page-scroll;
    animation-range: 30% 55%;
}

.n-13 {
    animation: neuron-fire-path2 linear both;
    animation-timeline: --page-scroll;
    animation-range: 44% 68%;
}

.n-14 {
    animation: neuron-fire-path3 linear both;
    animation-timeline: --page-scroll;
    animation-range: 60% 82%;
}

/* Output neurons */
.n-15 {
    animation: neuron-output-fire linear both;
    animation-timeline: --page-scroll;
    animation-range: 42% 95%;
}

.n-16 {
    animation: neuron-output-fire linear both;
    animation-timeline: --page-scroll;
    animation-range: 56% 95%;
}

@keyframes neuron-fire-path1 {
    0% {
        opacity: 0.3;
        fill: transparent;
        stroke: var(--accent-secondary);
        stroke-width: 1.5;
    }
    25% {
        opacity: 1;
        fill: var(--accent);
        stroke: var(--accent);
        stroke-width: 2.5;
        filter: drop-shadow(0 0 8px var(--accent));
    }
    75% {
        opacity: 0.7;
        fill: var(--accent);
        stroke: var(--accent);
        stroke-width: 2;
    }
    100% {
        opacity: 0.4;
        fill: transparent;
        stroke: var(--accent);
        stroke-width: 1.5;
    }
}

@keyframes neuron-fire-path2 {
    0% {
        opacity: 0.3;
        fill: transparent;
        stroke: var(--accent-secondary);
        stroke-width: 1.5;
    }
    30% {
        opacity: 1;
        fill: #e6c13f;
        stroke: #e6c13f;
        stroke-width: 2.5;
        filter: drop-shadow(0 0 10px rgba(230, 193, 63, 0.5));
    }
    70% {
        opacity: 0.75;
        fill: #e6c13f;
        stroke: #e6c13f;
        stroke-width: 2;
    }
    100% {
        opacity: 0.35;
        fill: transparent;
        stroke: #e6c13f;
        stroke-width: 1.5;
    }
}

@keyframes neuron-fire-path3 {
    0% {
        opacity: 0.3;
        fill: transparent;
        stroke: var(--accent-secondary);
        stroke-width: 1.5;
    }
    35% {
        opacity: 0.95;
        fill: #d4af37;
        stroke: #d4af37;
        stroke-width: 2.3;
        filter: drop-shadow(0 0 9px rgba(212, 175, 55, 0.5));
    }
    65% {
        opacity: 0.7;
        fill: #d4af37;
        stroke: #d4af37;
        stroke-width: 2;
    }
    100% {
        opacity: 0.3;
        fill: transparent;
        stroke: #d4af37;
        stroke-width: 1.5;
    }
}

@keyframes neuron-output-fire {
    0% {
        opacity: 0.3;
        fill: transparent;
        stroke: var(--accent-secondary);
        stroke-width: 1.5;
    }
    40% {
        opacity: 1;
        fill: var(--accent);
        stroke: var(--accent);
        stroke-width: 3;
        filter: drop-shadow(0 0 12px var(--accent));
    }
    100% {
        opacity: 1;
        fill: var(--accent);
        stroke: var(--accent);
        stroke-width: 3;
        filter: drop-shadow(0 0 15px var(--accent));
    }
}

/* DNN Activation Signals */
.dnn-activations .activation {
    fill: var(--accent);
    opacity: 0;
    animation: activation-flow linear infinite;
    animation-timeline: --page-scroll;
}

.act-1 { animation-range: 5% 95%; animation-duration: 3s; }
.act-2 { animation-range: 8% 98%; animation-duration: 3.5s; }
.act-3 { animation-range: 15% 95%; animation-duration: 4s; }
.act-4 { animation-range: 20% 98%; animation-duration: 3.2s; }
.act-5 { animation-range: 30% 95%; animation-duration: 3.8s; }
.act-6 { animation-range: 35% 98%; animation-duration: 4.2s; }
.act-7 { animation-range: 50% 95%; animation-duration: 3.5s; }
.act-8 { animation-range: 55% 98%; animation-duration: 4s; }

@keyframes activation-flow {
    0%, 100% {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1.5);
        filter: drop-shadow(0 0 10px var(--accent));
    }
}

/* DNN Labels */
.dnn-labels .layer-label {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    text-anchor: middle;
    opacity: 0;
    animation: label-appear linear both;
    animation-timeline: --page-scroll;
    animation-range: 20% 50%;
}

@keyframes label-appear {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 0.6;
        transform: translateY(0);
    }
}

/* ============================================
   Decision Tree Scatter Plot Visualization
   ============================================ */
.dt-scatter {
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: dt-fade-in linear both;
    animation-timeline: --page-scroll;
    animation-range: 0% 15%;
}

@keyframes dt-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.7;
    }
}

/* Scatter plot points */
.scatter-points .point {
    opacity: 0.4;
}

.scatter-points .class-1 {
    fill: var(--accent);
    stroke: var(--accent-secondary);
    stroke-width: 0.5;
}

.scatter-points .class-2 {
    fill: rgba(255, 255, 255, 0.6);
    stroke: var(--text-secondary);
    stroke-width: 0.5;
}

/* Decision boundaries - animated on scroll */
.decision-boundaries .boundary {
    stroke: var(--accent-secondary);
    stroke-width: 2;
    stroke-dasharray: 8 4;
    opacity: 0;
    animation: boundary-draw linear both;
    animation-timeline: --page-scroll;
}

/* Progressive boundary appearance */
.boundary-1 {
    animation-range: 10% 30%;
}

.boundary-2 {
    animation-range: 25% 45%;
}

.boundary-3 {
    animation-range: 25% 45%;
}

.boundary-4 {
    animation-range: 40% 60%;
}

.boundary-5 {
    animation-range: 55% 75%;
}

.boundary-6 {
    animation-range: 70% 90%;
}

.boundary-7 {
    animation-range: 70% 90%;
}

/* Region labels */
.region-labels .label {
    fill: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    opacity: 0;
    animation: region-label-appear linear both;
    animation-timeline: --page-scroll;
}

.label-1 { animation-range: 35% 50%; }
.label-2 { animation-range: 50% 65%; }
.label-3 { animation-range: 50% 65%; }
.label-4 { animation-range: 65% 80%; }
.label-5 { animation-range: 80% 95%; }
.label-6 { animation-range: 80% 95%; }
.label-7 { animation-range: 80% 95%; }

/* Region highlights */
.region-highlights .region-fill {
    opacity: 0;
    animation: region-highlight linear both;
    animation-timeline: --page-scroll;
}

.gamma-fill {
    fill: var(--accent);
    animation-range: 45% 60%;
}

/* Animation keyframes */
@keyframes boundary-draw {
    from {
        opacity: 0;
        stroke-dashoffset: 100;
    }
    to {
        opacity: 0.7;
        stroke-dashoffset: 0;
    }
}

@keyframes region-label-appear {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.5;
    }
}

@keyframes region-highlight {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.15;
    }
}

/* ============================================
   Bayesian Network Visualization (News Page)
   ============================================ */
.bayesian-viz {
    pointer-events: none;
}

.bayesian-network {
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: bayes-fade-in linear both;
    animation-timeline: --page-scroll;
    animation-range: 0% 15%;
}

@keyframes bayes-fade-in {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

/* Network edges with arrows */
.network-edges .edge {
    stroke: var(--accent-secondary);
    stroke-width: 2;
    opacity: 0;
    animation: edge-appear linear both;
    animation-timeline: --page-scroll;
    animation-range: 15% 30%;
}

/* Arrow heads */
.arrow-head {
    fill: var(--accent-secondary);
    opacity: 0;
    animation: arrow-appear linear both;
    animation-timeline: --page-scroll;
    animation-range: 15% 30%;
}

@keyframes edge-appear {
    from {
        opacity: 0;
        stroke-dasharray: 200;
        stroke-dashoffset: 200;
    }
    to {
        opacity: 0.35;
        stroke-dasharray: 200;
        stroke-dashoffset: 0;
    }
}

@keyframes arrow-appear {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.35;
    }
}

/* Node circles */
.bayes-node .node-circle {
    fill: var(--bg-secondary);
    stroke: var(--accent);
    stroke-width: 2;
    opacity: 0.5;
}

/* Probability bars */
.prob-bar {
    fill: var(--accent);
    opacity: 0.4;
}

/* Input Node 1 - Shifting distribution */
.input-node-1 .bar-1-1 {
    animation: bar-1-1-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

.input-node-1 .bar-1-2 {
    animation: bar-1-2-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

.input-node-1 .bar-1-3 {
    animation: bar-1-3-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

.input-node-1 .bar-1-4 {
    animation: bar-1-4-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

/* Shift distribution to the right */
@keyframes bar-1-1-shift {
    from { height: 40px; y: -20px; }
    to { height: 16px; y: -8px; }
}

@keyframes bar-1-2-shift {
    from { height: 24px; y: -12px; }
    to { height: 40px; y: -20px; }
}

@keyframes bar-1-3-shift {
    from { height: 16px; y: -8px; }
    to { height: 24px; y: -12px; }
}

@keyframes bar-1-4-shift {
    from { height: 8px; y: -4px; }
    to { height: 16px; y: -8px; }
}

/* Input Node 2 - Collapse to single bar */
.input-node-2 .bar-2-1 {
    animation: bar-2-1-collapse linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

.input-node-2 .bar-2-2 {
    animation: bar-2-2-collapse linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

.input-node-2 .bar-2-3 {
    animation: bar-2-3-collapse linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

.input-node-2 .bar-2-4 {
    animation: bar-2-4-collapse linear both;
    animation-timeline: --page-scroll;
    animation-range: 40% 70%;
}

/* Collapse all bars except the second one to same height */
@keyframes bar-2-1-collapse {
    from { height: 32px; y: -16px; opacity: 0.4; }
    to { height: 4px; y: -2px; opacity: 0.2; }
}

@keyframes bar-2-2-collapse {
    from { height: 40px; y: -20px; opacity: 0.4; }
    to { height: 48px; y: -24px; opacity: 0.4; }
}

@keyframes bar-2-3-collapse {
    from { height: 36px; y: -18px; opacity: 0.4; }
    to { height: 4px; y: -2px; opacity: 0.2; }
}

@keyframes bar-2-4-collapse {
    from { height: 24px; y: -12px; opacity: 0.4; }
    to { height: 4px; y: -2px; opacity: 0.2; }
}

/* Output Node - Distribution shifts in response */
.output-node .bar-out-1 {
    animation: bar-out-1-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 50% 80%;
}

.output-node .bar-out-2 {
    animation: bar-out-2-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 50% 80%;
}

.output-node .bar-out-3 {
    animation: bar-out-3-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 50% 80%;
}

.output-node .bar-out-4 {
    animation: bar-out-4-shift linear both;
    animation-timeline: --page-scroll;
    animation-range: 50% 80%;
}

/* Output distribution shifts right */
@keyframes bar-out-1-shift {
    from { height: 20px; y: -10px; }
    to { height: 12px; y: -6px; }
}

@keyframes bar-out-2-shift {
    from { height: 36px; y: -18px; }
    to { height: 20px; y: -10px; }
}

@keyframes bar-out-3-shift {
    from { height: 28px; y: -14px; }
    to { height: 38px; y: -19px; }
}

@keyframes bar-out-4-shift {
    from { height: 16px; y: -8px; }
    to { height: 28px; y: -14px; }
}

/* ============================================
   Polynomial Curve Fitting Visualization (Foundation Page)
   ============================================ */
.polyfit-viz {
    pointer-events: none;
}

.polyfit-scatter {
    width: 100%;
    height: 100%;
    opacity: 0;
    animation: polyfit-fade-in linear both;
    animation-timeline: --page-scroll;
    animation-range: 0% 15%;
}

@keyframes polyfit-fade-in {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

/* Data points */
.data-points .data-point {
    fill: var(--accent);
    opacity: 0.6;
    stroke: var(--accent-secondary);
    stroke-width: 1;
}

/* Fitted curves - appear progressively */
.fit-curve {
    stroke-width: 3;
    opacity: 0;
    animation: curve-appear linear both;
    animation-timeline: --page-scroll;
}

/* Linear fit appears first (20-35%) */
.linear-fit {
    stroke: #ff6b6b;
    animation-range: 20% 35%;
}

/* Quadratic fit appears next (40-55%) */
.quadratic-fit {
    stroke: #ffd93d;
    animation-range: 40% 55%;
}

/* Cubic fit appears (60-75%) */
.cubic-fit {
    stroke: var(--accent);
    animation-range: 60% 75%;
}

/* Overfit curve appears last (80-95%) */
.overfit-curve {
    stroke: #6bcf7f;
    stroke-width: 2;
    animation-range: 80% 95%;
}

@keyframes curve-appear {
    from {
        opacity: 0;
        stroke-dasharray: 2000;
        stroke-dashoffset: 2000;
    }
    to {
        opacity: 0.7;
        stroke-dasharray: 2000;
        stroke-dashoffset: 0;
    }
}

/* Residual lines (error indicators) */
.residuals .residual-line {
    stroke: #ff6b6b;
    stroke-width: 1;
    stroke-dasharray: 3 3;
    opacity: 0;
    animation: residual-appear linear both;
    animation-timeline: --page-scroll;
    animation-range: 25% 40%;
}

@keyframes residual-appear {
    from { opacity: 0; }
    to { opacity: 0.4; }
}

/* Gradient Particles Background */
.gradient-particles,
.curve-fitting-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, var(--accent-glow) 2px, transparent 2px),
        radial-gradient(circle at 80% 20%, var(--accent-secondary) 1px, transparent 1px),
        radial-gradient(circle at 40% 70%, var(--accent-glow) 1.5px, transparent 1.5px),
        radial-gradient(circle at 60% 50%, var(--accent-secondary) 1px, transparent 1px);
    background-size: 300px 300px, 250px 250px, 350px 350px, 200px 200px;
    animation: particles-float 25s linear infinite;
    opacity: 0.3;
}

@keyframes particles-float {
    from {
        transform: translate(0, 0) rotate(0deg);
        background-position: 0 0, 50px 50px, 100px 100px, 25px 25px;
    }
    to {
        transform: translate(-50px, -300px) rotate(5deg);
        background-position: -300px -300px, -250px -250px, -350px -350px, -200px -200px;
    }
}

/* ============================================
   Navigation
   ============================================ */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(to bottom, var(--bg-primary), transparent);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-symbol {
    color: var(--accent);
    font-size: 1.5rem;
    font-weight: 300;
}

.nav-toggle {
    display: none;
}

.nav-toggle-label {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 101;
}

.nav-toggle-label span,
.nav-toggle-label span::before,
.nav-toggle-label span::after {
    display: block;
    background: var(--text-primary);
    height: 2px;
    width: 100%;
    border-radius: 2px;
    position: absolute;
    transition: all 0.3s var(--ease-out-expo);
}

.nav-toggle-label span { top: 50%; transform: translateY(-50%); }
.nav-toggle-label span::before { content: ''; top: -8px; }
.nav-toggle-label span::after { content: ''; top: 8px; }

.nav-links {
    display: flex;
    gap: var(--space-lg);
    list-style: none;
}

.nav-links a {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 700px;
    opacity: 1;
    transform: translateX(0);
    animation: hero-content-scroll linear both;
    animation-timeline: --page-scroll;
    animation-range: 0% 50%;
    position: relative;
    z-index: 2;
}

@keyframes hero-content-scroll {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0.3;
        transform: translateX(-30px);
    }
}

.hero-image {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 50%;
    min-width: 400px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.9;
    z-index: 1;
    animation: hero-image-scroll linear both;
    animation-timeline: --page-scroll;
    animation-range: 0% 50%;
}

@keyframes hero-image-scroll {
    from {
        opacity: 0.9;
        transform: translateY(-50%) translateX(0) scale(1);
    }
    to {
        opacity: 0.3;
        transform: translateY(-50%) translateX(30px) scale(0.99);
    }
}

.hero-portrait {
    max-width: 100%;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    animation: portrait-float linear both;
    animation-timeline: --page-scroll;
    animation-range: 10% 80%;
}

@keyframes portrait-float {
    0% {
        transform: translateY(0) rotate(0deg);
        filter: brightness(1);
    }
    50% {
        transform: translateY(-30px) rotate(2deg);
        filter: brightness(1.1);
    }
    100% {
        transform: translateY(-60px) rotate(-2deg);
        filter: brightness(0.9);
    }
}

.hero-tag {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-md);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: var(--space-md);
}

.gradient-text {
    background: repeating-linear-gradient(
        45deg,
        var(--accent) 0px,
        var(--accent) 10px,
        var(--accent-secondary) 10px,
        var(--accent-secondary) 20px
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-highlight {
    color: var(--accent);
}

#cycling-word {
    transition: opacity 0.3s ease-in-out;
    display: inline-block;
    position: absolute;
    white-space: nowrap;
    left: 0;
    top: 0;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 500px;
    margin-bottom: var(--space-lg);
    background: rgba(10, 15, 20, 0.7);
    padding: 4px 8px;
    border-radius: 4px;
}

.hero-cta {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.875rem 2rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-radius: 4px;
    transition: all 0.3s var(--ease-out-expo);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
}

.btn-primary:hover {
    background: repeating-linear-gradient(
        45deg,
        var(--accent) 0px,
        var(--accent) 8px,
        var(--accent-secondary) 8px,
        var(--accent-secondary) 16px
    );
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--text-muted);
}

.btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.scroll-indicator {
    position: absolute;
    bottom: calc(var(--space-lg) - 40px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    z-index: 2;
}

.scroll-indicator span {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.scroll-line {
    width: 1px;
    height: 60px;
    background: linear-gradient(to bottom, var(--accent), transparent);
    animation: scroll-pulse 2s ease-in-out infinite;
}

@keyframes scroll-pulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.5); opacity: 0.5; }
}

/* ============================================
   Page Headers
   ============================================ */
.page-header {
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    z-index: 1;
}

.header-content {
    max-width: 600px;
}

.page-tag {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    margin-bottom: var(--space-sm);
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* ============================================
   Sections
   ============================================ */
.section {
    padding: var(--space-xl) var(--space-lg);
    position: relative;
    z-index: 1;
}

.section-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.section-label {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.label-number {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
}

.label-text {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.section-content h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
}

.section-content p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.section-content .lead {
    font-size: 1.25rem;
    color: var(--text-primary);
}

/* ============================================
   Stats
   ============================================ */
.stats-row {
    display: flex;
    gap: var(--space-lg);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--bg-tertiary);
}

.stat {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   Timeline
   ============================================ */
.timeline {
    position: relative;
    padding-left: var(--space-lg);
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(to bottom, var(--accent), var(--bg-tertiary));
}

.timeline-item {
    position: relative;
    padding-bottom: var(--space-lg);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: calc(-1 * var(--space-lg) - 5px);
    top: 0;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--accent-glow);
}

.timeline-content {
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-sm);
}

.timeline-text {
    flex: 1;
}

.timeline-logo {
    height: 40px;
    width: auto;
    display: flex;
    align-items: center;
    margin-left: var(--space-md);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.timeline-logo img {
    height: 100%;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: brightness(0) saturate(100%) invert(79%) sepia(48%) saturate(417%) hue-rotate(10deg) brightness(102%) contrast(93%);
}

.timeline-item:hover .timeline-logo {
    opacity: 0.85;
}

.timeline-item:hover .timeline-logo img {
    filter: brightness(0) saturate(100%) invert(79%) sepia(48%) saturate(417%) hue-rotate(10deg) brightness(110%) contrast(95%);
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: var(--space-xs) 0;
}

.timeline-org {
    font-size: 0.875rem;
    color: var(--accent-secondary);
    margin-bottom: 0;
}

.timeline-content > p:last-of-type {
    margin-bottom: var(--space-md);
}

/* Timeline Toggle Button */
.timeline-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    margin-top: var(--space-md);
    background: var(--bg-tertiary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 6px;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timeline-toggle:hover {
    background: var(--bg-primary);
    border-color: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Expanded state styling (Less details) */
.timeline-details.expanded + .timeline-toggle,
.timeline-content:has(.timeline-details.expanded) .timeline-toggle {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}

.timeline-details.expanded + .timeline-toggle:hover,
.timeline-content:has(.timeline-details.expanded) .timeline-toggle:hover {
    background: repeating-linear-gradient(
        45deg,
        var(--accent) 0px,
        var(--accent) 8px,
        var(--accent-secondary) 8px,
        var(--accent-secondary) 16px
    );
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px var(--accent-glow);
}

.toggle-text {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toggle-arrows {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

/* Timeline Details Section */
.timeline-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 0;
}

.timeline-details.expanded {
    max-height: 2000px;
    opacity: 1;
    margin-top: var(--space-md);
}

.details-content {
    padding: var(--space-md);
    background: var(--bg-primary);
    border-radius: 6px;
    border: 1px solid var(--bg-tertiary);
}

.details-content h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.details-content ul {
    list-style: none;
    padding: 0;
    margin-bottom: var(--space-md);
}

.details-content ul li {
    padding: var(--space-xs) 0;
    padding-left: var(--space-md);
    position: relative;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.details-content ul li::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-size: 1.2rem;
}

.details-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.details-images img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid var(--bg-tertiary);
    transition: all 0.3s ease;
}

.details-images img:hover {
    transform: scale(1.02);
    border-color: var(--accent-secondary);
}

/* ============================================
   Achievements Grid
   ============================================ */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--space-md);
}

.achievement-card {
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
    text-align: center;
    transition: all 0.3s var(--ease-out-expo);
}

.achievement-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.achievement-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
}

.achievement-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: var(--space-xs);
}

.achievement-card p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ============================================
   Academic Background
   ============================================ */
.education-card {
    background: var(--bg-secondary);
    padding: var(--space-md) var(--space-lg);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
}

.education-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--bg-tertiary);
}

.education-info h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
}

.education-institution {
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 500;
}

.education-logo,
.thesis-logo {
    opacity: 1;
    transition: all 0.3s ease;
}

.education-card:hover .education-logo,
.education-card:hover .thesis-logo {
    transform: translateY(-2px);
}

.institution-logo {
    height: 32px;
    width: auto;
    display: flex;
    align-items: center;
}

/* KIT Logo - convert to monochrome yellow using CSS filters */
.education-logo .institution-logo img {
    height: 100%;
    width: auto;
    filter: brightness(0) saturate(100%) invert(79%) sepia(48%) saturate(417%) hue-rotate(10deg) brightness(102%) contrast(93%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* SAP Logo - show original colors (green background, white text) */
.thesis-logo .institution-logo img {
    height: 100%;
    width: auto;
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* SVG logos (if any inline SVGs are used) */
.institution-logo svg {
    color: var(--accent);
    opacity: 0.6;
    height: 100%;
    width: auto;
    transition: opacity 0.3s ease;
}

.education-card:hover .education-logo .institution-logo img {
    opacity: 0.85;
    filter: brightness(0) saturate(100%) invert(79%) sepia(48%) saturate(417%) hue-rotate(10deg) brightness(110%) contrast(95%);
}

.education-card:hover .thesis-logo .institution-logo img {
    opacity: 0.85;
}

.education-card:hover .institution-logo svg {
    opacity: 0.85;
}

.focus-fields {
    margin-bottom: var(--space-md);
}

.focus-fields h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-sm);
}

.field-item {
    display: flex;
    align-items: center;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: 4px;
    border-left: 2px solid var(--accent-secondary);
    transition: all 0.3s ease;
}

.field-item:hover {
    background: var(--bg-primary);
    border-left-color: var(--accent);
    transform: translateX(4px);
}

.field-name {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.thesis-section {
    padding-top: var(--space-sm);
    border-top: 1px solid var(--bg-tertiary);
}

.thesis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xs);
}

.thesis-header h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
}

.thesis-logo .institution-logo {
    height: 36px;
    margin-right: -10px;
}

.thesis-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.thesis-location {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ============================================
   Contact
   ============================================ */
.office-contact {
    margin: var(--space-lg) 0;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
}

.office-contact p {
    margin: var(--space-xs) 0;
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.office-contact strong {
    color: var(--text-primary);
    font-weight: 600;
    margin-right: var(--space-xs);
}

.office-contact a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

.office-contact a:hover {
    color: var(--accent-secondary);
    text-decoration: underline;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
}

.contact-item:hover {
    border-color: var(--accent);
    transform: translateX(4px);
}

.contact-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-value {
    color: var(--text-primary);
    font-size: 1rem;
}

/* ============================================
   Blog Components
   ============================================ */
.featured-section {
    max-width: 800px;
    margin: 0 auto;
}

.featured-post {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--bg-tertiary);
}

.post-meta {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.post-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    background: var(--accent-glow);
    border-radius: 4px;
}

.post-date {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.post-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
}

.post-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.read-more {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.read-more:hover {
    letter-spacing: 0.05em;
}

/* Blog Filters */
.blog-filters {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-lg);
    padding: 0 var(--space-lg);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.filter-btn {
    padding: 8px 20px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: transparent;
    border: 1px solid var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-md);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.blog-card {
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
    transition: all 0.3s var(--ease-out-expo);
}

.blog-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.blog-card h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.blog-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h3 a:hover {
    color: var(--accent);
}

.blog-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.card-footer {
    padding-top: var(--space-sm);
    border-top: 1px solid var(--bg-tertiary);
}

.read-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
}

.page-current,
.page-link,
.page-dots {
    padding: 8px 14px;
    font-size: 0.875rem;
}

.page-current {
    background: var(--accent);
    color: var(--bg-primary);
    border-radius: 4px;
}

.page-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.page-link:hover {
    color: var(--accent);
}

.page-dots {
    color: var(--text-muted);
}

.page-next {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

/* Newsletter */
.newsletter-section {
    display: flex;
    justify-content: center;
}

.newsletter-box {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--bg-tertiary);
    text-align: center;
    max-width: 500px;
}

.newsletter-box h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.newsletter-box p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.newsletter-form {
    display: flex;
    gap: var(--space-sm);
}

.newsletter-form input {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    background: var(--bg-primary);
    border: 1px solid var(--bg-tertiary);
    border-radius: 4px;
    color: var(--text-primary);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--accent);
}

.newsletter-form input::placeholder {
    color: var(--text-muted);
}

/* ============================================
   Events & Calendar
   ============================================ */
.events-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.event-card {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: var(--space-md);
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
    transition: all 0.3s var(--ease-out-expo);
}

.event-card:hover {
    border-color: var(--accent);
}

.event-card.upcoming {
    border-left: 3px solid var(--accent);
}

.event-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.date-month {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.date-day {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.date-year {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.event-type {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.event-details h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: var(--space-xs) 0;
}

.event-venue {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.event-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.event-link {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Press Grid */
.press-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-md);
}

.press-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--bg-tertiary);
    text-decoration: none;
    transition: all 0.3s var(--ease-out-expo);
}

.press-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.press-outlet {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.press-card h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.press-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Announcements */
.announcements-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.announcement {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--bg-tertiary);
}

.announcement:last-child {
    border-bottom: none;
}

.announcement-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    padding-top: 4px;
}

.announcement-content h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.announcement-content p {
    font-size: 0.875rem;
    margin-bottom: 0;
}

/* ============================================
   Nonprofit Components
   ============================================ */
.mission-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.value {
    text-align: center;
    padding: var(--space-md);
}

.value-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: var(--space-sm);
    display: block;
}

.value h3 {
    font-family: var(--font-display);
    font-size: 1.125rem;
    margin-bottom: var(--space-xs);
}

.value p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0;
}

/* Impact Stats */
.impact-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-lg);
}

.impact-stat {
    text-align: center;
}

.impact-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    display: block;
}

.impact-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Programs Grid */
.programs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-md);
}

.program-card {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--bg-tertiary);
    transition: all 0.3s var(--ease-out-expo);
}

.program-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
}

.program-icon {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: var(--space-md);
}

.program-card h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin-bottom: var(--space-sm);
}

.program-card p {
    font-size: 0.875rem;
}

.program-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Stories */
.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-md);
}

.story-card {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--bg-tertiary);
}

.story-quote {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    position: relative;
    padding-left: var(--space-md);
}

.story-quote::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -10px;
    font-size: 3rem;
    color: var(--accent);
    line-height: 1;
}

.story-author {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
}

.author-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Support Options */
.support-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
}

.support-card {
    background: var(--bg-secondary);
    padding: var(--space-lg);
    border-radius: 12px;
    border: 1px solid var(--bg-tertiary);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.support-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.support-card p {
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
    flex-grow: 1;
}

.support-card .btn {
    margin-top: auto;
}

/* ============================================
   Footer
   ============================================ */
.main-footer {
    padding: var(--space-xl) var(--space-lg);
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--bg-tertiary);
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--space-xs);
}

.footer-note {
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ============================================
   Mobile Responsive
   ============================================ */
@media (max-width: 768px) {
    :root {
        --space-lg: 2rem;
        --space-xl: 4rem;
    }
    
    /* Navigation Mobile */
    .nav-toggle-label {
        display: block;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 280px;
        flex-direction: column;
        background: var(--bg-secondary);
        padding: 100px var(--space-lg) var(--space-lg);
        gap: var(--space-md);
        transform: translateX(100%);
        transition: transform 0.3s var(--ease-out-expo);
    }
    
    .nav-toggle:checked ~ .nav-links {
        transform: translateX(0);
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span {
        background: transparent;
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span::before {
        top: 0;
        transform: rotate(45deg);
    }
    
    .nav-toggle:checked ~ .nav-toggle-label span::after {
        top: 0;
        transform: rotate(-45deg);
    }
    
    /* Section Grid */
    .section-grid {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }
    
    .section-label {
        flex-direction: row;
        gap: var(--space-sm);
        padding-bottom: var(--space-sm);
        border-bottom: 1px solid var(--bg-tertiary);
    }
    
    /* Stats */
    .stats-row {
        flex-wrap: wrap;
        gap: var(--space-md);
    }
    
    .stat {
        flex: 1 1 100px;
    }
    
    /* Blog Grid */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Events */
    .event-card {
        grid-template-columns: 1fr;
    }
    
    .event-date {
        flex-direction: row;
        gap: var(--space-sm);
        justify-content: flex-start;
    }
    
    /* Mission Values */
    .mission-values {
        grid-template-columns: 1fr;
    }
    
    /* Newsletter */
    .newsletter-form {
        flex-direction: column;
    }
    
    /* Hero */
    .hero {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        padding: var(--space-xl) var(--space-md);
    }

    .hero-content {
        order: 2;
    }

    .hero-image {
        order: 1;
        left: 0;
        right: auto;
    }

    .hero-portrait {
        max-width: 95%;
        clip-path: inset(0 0 15% 0);
    }

    .hero-cta {
        flex-direction: column;
    }

    .scroll-indicator {
        display: none;
    }
    
    /* ML Backgrounds - Simplified for mobile */
    .ml-background {
        opacity: 0.3;
    }

    .dnn-network {
        opacity: 0.5;
    }

    .dt-scatter {
        opacity: 0.5;
    }

    .gradient-particles {
        opacity: 0.2;
    }
}

/* ============================================
   Fallback for browsers without scroll-timeline
   ============================================ */
@supports not (animation-timeline: scroll()) {
    .dnn-connections .conn {
        opacity: 0.3;
        animation: connection-static 3s ease-in-out infinite;
    }

    @keyframes connection-static {
        0%, 100% {
            opacity: 0.2;
        }
        50% {
            opacity: 0.5;
            stroke: var(--accent);
        }
    }

    .dnn-neurons .neuron {
        opacity: 1;
        animation: neuron-static 4s ease-in-out infinite;
    }

    @keyframes neuron-static {
        0%, 100% {
            fill: var(--bg-tertiary);
        }
        50% {
            fill: var(--accent);
            filter: drop-shadow(0 0 10px var(--accent-glow));
        }
    }

    .output-neuron {
        fill: var(--accent);
        opacity: 1;
        filter: drop-shadow(0 0 15px var(--accent-glow));
    }

    .dnn-activations .activation {
        animation: activation-static 2s ease-in-out infinite;
    }

    @keyframes activation-static {
        0%, 100% {
            opacity: 0.3;
            transform: scale(0.8);
        }
        50% {
            opacity: 1;
            transform: scale(1.2);
        }
    }

    .dnn-labels .layer-label {
        opacity: 0.6;
    }

    /* Decision tree fallback */
    .decision-boundaries .boundary {
        opacity: 0.5;
        animation: boundary-static 5s ease-in-out infinite;
    }

    @keyframes boundary-static {
        0%, 100% {
            opacity: 0.3;
        }
        50% {
            opacity: 0.7;
            stroke: var(--accent);
        }
    }

    .region-labels .label {
        opacity: 0.4;
    }

    /* Bayesian network fallback */
    .bayesian-network {
        opacity: 0.4;
    }

    .network-edges .edge {
        opacity: 0.35;
        stroke-dasharray: 200;
        stroke-dashoffset: 0;
    }

    .arrow-head {
        opacity: 0.35;
    }

    .prob-bar {
        animation: bar-pulse 3s ease-in-out infinite;
    }

    @keyframes bar-pulse {
        0%, 100% {
            opacity: 0.5;
        }
        50% {
            opacity: 0.9;
        }
    }

    /* Polynomial curve fitting fallback */
    .polyfit-scatter {
        opacity: 0.4;
    }

    .data-points .data-point {
        opacity: 0.6;
    }

    .linear-fit {
        opacity: 0.3;
        stroke-dasharray: 2000;
        stroke-dashoffset: 0;
    }

    .quadratic-fit {
        opacity: 0.5;
        stroke-dasharray: 2000;
        stroke-dashoffset: 0;
    }

    .cubic-fit {
        opacity: 0.7;
        stroke-dasharray: 2000;
        stroke-dashoffset: 0;
    }

    .overfit-curve {
        opacity: 0.4;
        stroke-dasharray: 2000;
        stroke-dashoffset: 0;
    }

    .residuals .residual-line {
        opacity: 0.2;
    }
}

/* ============================================
   Blog Article Page Styles
   ============================================ */
.article-header {
    padding-bottom: var(--space-md);
}

.article-header .back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
    transition: color 0.3s ease;
}

.article-header .back-link:hover {
    color: var(--accent);
}

.article-title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.article-body {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-body p {
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.article-body p.lead {
    font-size: 1.25rem;
    color: var(--text-primary);
    border-left: 3px solid var(--accent);
    padding-left: var(--space-md);
    margin-bottom: var(--space-md);
}

.article-body h2 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-top: var(--space-lg);
    margin-bottom: var(--space-md);
    position: relative;
}

.article-body h2::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--accent);
}

.article-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.article-body a:hover {
    border-bottom-color: var(--accent);
}

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding-left: var(--space-md);
    margin: var(--space-md) 0;
    font-style: italic;
    color: var(--text-muted);
}

.article-body ul, .article-body ol {
    margin-bottom: 1.5rem;
    padding-left: var(--space-md);
}

.article-body li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.article-conclusion {
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--bg-tertiary);
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 768px) {
    .article-content {
        padding: var(--space-md) var(--space-sm);
    }

    .article-body {
        font-size: 1rem;
    }

    .article-body h2::before {
        display: none;
    }

    .article-body p.lead {
        font-size: 1.1rem;
    }
}
