/* ============================================
   EMERGENCE AND MEANING
   Cosmic/Particle/Consciousness Theme
   ============================================ */

/* ---------- Theme Colors ---------- */
:root {
    --em-purple: #9b59b6;
    --em-purple-dark: #8e44ad;
    --em-cosmic: #5b2c6f;
    --em-nebula: #1a0a2e;
    --em-gold: #f1c40f;
    --em-consciousness: #e74c3c;
    --em-hope: #2ecc71;
    --em-void: #0a0612;
}

[data-theme="light"] {
    --em-purple: #8e44ad;
    --em-purple-dark: #7d3c98;
    --em-cosmic: #e8daef;
    --em-nebula: #f4ecf7;
    --em-gold: #d4ac0d;
    --em-consciousness: #c0392b;
    --em-hope: #27ae60;
    --em-void: #f8f4fc;
}

/* ---------- HERO - Cosmic Particles ---------- */
.hero-emergence {
    background: linear-gradient(180deg, 
        var(--color-bg) 0%, 
        var(--em-nebula) 40%,
        var(--em-cosmic) 70%,
        var(--color-bg) 100%);
}

[data-theme="light"] .hero-emergence {
    background: linear-gradient(180deg, 
        var(--color-bg) 0%, 
        var(--em-nebula) 40%,
        var(--em-cosmic) 70%,
        var(--color-bg) 100%);
}

.cosmic-bg {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(155, 89, 182, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 60%, rgba(241, 196, 15, 0.1) 0%, transparent 35%),
        radial-gradient(ellipse at 50% 80%, rgba(231, 76, 60, 0.08) 0%, transparent 40%);
    animation: cosmicPulse 10s ease-in-out infinite;
}

@keyframes cosmicPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.particle-field {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.em-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--em-purple);
    opacity: 0.6;
    animation: particleDrift 20s infinite ease-in-out;
}

.em-particle.p1 { left: 10%; top: 20%; background: var(--em-purple); animation-delay: 0s; }
.em-particle.p2 { left: 25%; top: 60%; background: var(--em-gold); animation-delay: -3s; width: 4px; height: 4px; }
.em-particle.p3 { left: 40%; top: 30%; background: var(--em-consciousness); animation-delay: -6s; }
.em-particle.p4 { left: 60%; top: 70%; background: var(--em-hope); animation-delay: -9s; width: 8px; height: 8px; }
.em-particle.p5 { left: 75%; top: 40%; background: var(--em-purple); animation-delay: -12s; }
.em-particle.p6 { left: 85%; top: 25%; background: var(--em-gold); animation-delay: -15s; width: 5px; height: 5px; }
.em-particle.p7 { left: 15%; top: 75%; background: var(--em-consciousness); animation-delay: -18s; }
.em-particle.p8 { left: 55%; top: 15%; background: var(--em-hope); animation-delay: -5s; width: 4px; height: 4px; }

@keyframes particleDrift {
    0%, 100% { 
        transform: translate(0, 0) scale(1); 
        opacity: 0.4; 
    }
    25% { 
        transform: translate(40px, -60px) scale(1.5); 
        opacity: 0.8; 
    }
    50% { 
        transform: translate(-30px, 40px) scale(0.8); 
        opacity: 0.3; 
    }
    75% { 
        transform: translate(50px, 30px) scale(1.3); 
        opacity: 0.6; 
    }
}

.hero-title-emergence {
    font-size: clamp(3rem, 14vw, 10rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 0.95;
    text-align: center;
}

.hero-title-emergence .title-line {
    display: block;
    color: var(--color-text);
}

.accent-emergence {
    font-style: italic;
    font-weight: 300;
    background: linear-gradient(135deg, var(--em-purple) 0%, var(--em-gold) 50%, var(--em-consciousness) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 0.7em;
    filter: drop-shadow(0 0 30px rgba(155, 89, 182, 0.4));
}

/* ---------- SECTION 1: What is Emergence ---------- */
.section-emergence-intro {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-subtle) 50%, var(--color-bg) 100%);
    position: relative;
}

.emergence-visual {
    position: absolute;
    top: 15%;
    right: 5%;
    opacity: 0.15;
    pointer-events: none;
}

.cell-cluster {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
}

.cell {
    color: var(--em-purple);
    animation: cellPulse 2s ease-in-out infinite;
}

.cell.c1 { animation-delay: 0s; }
.cell.c2 { animation-delay: 0.2s; }
.cell.c3 { animation-delay: 0.4s; }

@keyframes cellPulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
}

.cell-arrow {
    color: var(--em-gold);
    animation: arrowPulse 1.5s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% { transform: translateX(0); opacity: 0.5; }
    50% { transform: translateX(5px); opacity: 1; }
}

.cell-result {
    font-size: 3rem;
    animation: resultGlow 3s ease-in-out infinite;
}

@keyframes resultGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(155, 89, 182, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(155, 89, 182, 0.6)); }
}

.section-title-text {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.emergence-image-container {
    margin: 2rem 0 3rem;
    text-align: center;
}

.image-placeholder {
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-text-dim);
}

.emergence-img {
    width: 100%;
    height: auto;
    display: block;
}

.image-caption {
    margin-top: 1rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-text-dim);
    font-style: italic;
}

.emergence-definition {
    background: var(--color-bg-elevated);
    border-left: 4px solid var(--em-purple);
    padding: 2rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 3rem;
}

.definition-text {
    font-size: 1.3rem;
    line-height: 1.8;
    color: var(--color-text);
}

.aristotle-quote {
    text-align: center;
    padding: 3rem 2rem;
    margin: 3rem 0;
    position: relative;
}

.aristotle-quote::before {
    content: '"';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-display);
    font-size: 12rem;
    color: var(--em-purple);
    opacity: 0.1;
    line-height: 1;
    pointer-events: none;
}

.aristotle-quote p {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    font-style: italic;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.aristotle-quote cite {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.cells-example {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.08), rgba(241, 196, 15, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(155, 89, 182, 0.2);
}

.cells-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.cells-text {
    font-size: 1.15rem;
    line-height: 1.7;
    color: var(--color-text);
}

/* ---------- SECTION 2: Rise of Meaning ---------- */
.section-rise {
    background: var(--color-bg);
    position: relative;
    overflow: hidden;
}

.gradient-rise {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, 
        transparent 0%,
        rgba(46, 204, 113, 0.03) 50%,
        rgba(241, 196, 15, 0.05) 100%);
    pointer-events: none;
}

.section-header-center {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 0.5rem;
}

.complexity-ladder {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 3rem 0;
    padding-left: 2rem;
    position: relative;
}

.complexity-ladder::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
        rgba(155, 89, 182, 0.3) 0%,
        rgba(241, 196, 15, 0.5) 50%,
        rgba(46, 204, 113, 0.7) 100%);
    border-radius: 2px;
}

.ladder-step {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--color-bg-elevated);
    border-radius: 12px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ladder-step:hover {
    transform: translateX(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.ladder-step::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 3px solid;
}

.step-1::before { border-color: var(--em-purple); background: var(--color-bg); }
.step-2::before { border-color: var(--em-gold); background: var(--color-bg); }
.step-3::before { border-color: var(--em-hope); background: var(--em-hope); }

.step-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.step-content p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-text);
}

.step-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
}

.step-1 .step-bar { width: 30%; background: var(--em-purple); opacity: 0.5; }
.step-2 .step-bar { width: 60%; background: var(--em-gold); opacity: 0.6; }
.step-3 .step-bar { width: 100%; background: var(--em-hope); opacity: 0.7; }

.rise-insight {
    text-align: center;
    padding: 2rem;
    margin: 3rem 0;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(241, 196, 15, 0.1));
    border-radius: 12px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.insight-statement {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    color: var(--em-hope);
}

[data-theme="light"] .insight-statement {
    color: var(--em-hope);
}

.rise-question {
    text-align: center;
    margin-top: 3rem;
}

.rise-question p {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-style: italic;
    color: var(--color-text-muted);
}

/* ---------- SECTION 3: Fall of Meaning ---------- */
.section-fall {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--em-void) 50%, var(--color-bg) 100%);
    position: relative;
}

[data-theme="light"] .section-fall {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--em-void) 50%, var(--color-bg) 100%);
}

.void-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(231, 76, 60, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.ai-context {
    padding: 2rem;
    background: var(--color-bg-elevated);
    border-radius: 12px;
    border-left: 4px solid var(--em-consciousness);
    margin: 2rem 0 3rem;
}

.context-text {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-text);
}

.meaning-scenarios {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.scenario-intro {
    text-align: center;
    margin-bottom: 1rem;
}

.scenario-intro p {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    font-style: italic;
}

.scenario {
    background: var(--color-bg-elevated);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--color-text-dim);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.scenario:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.scenario-1 { border-color: rgba(155, 89, 182, 0.3); }
.scenario-1:hover { box-shadow: 0 20px 50px rgba(155, 89, 182, 0.15); }

.scenario-2 { border-color: rgba(231, 76, 60, 0.3); }
.scenario-2:hover { box-shadow: 0 20px 50px rgba(231, 76, 60, 0.15); }

.scenario-3 { border-color: rgba(46, 204, 113, 0.3); }
.scenario-3:hover { box-shadow: 0 20px 50px rgba(46, 204, 113, 0.15); }

.scenario-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.scenario-icon {
    font-size: 2rem;
}

.scenario-header h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text);
}

.scenario-text {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-text-muted);
}

/* ---------- SECTION 4: The Question ---------- */
.section-question {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--em-nebula) 50%, var(--color-bg) 100%);
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

[data-theme="light"] .section-question {
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--em-cosmic) 50%, var(--color-bg) 100%);
}

.question-aurora {
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 30% 40%, rgba(155, 89, 182, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(241, 196, 15, 0.1) 0%, transparent 50%);
    animation: auroraPulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes auroraPulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.final-question {
    margin-bottom: 3rem;
}

.question-text {
    font-family: var(--font-display);
    font-size: clamp(2rem, 6vw, 4rem);
    font-style: italic;
    color: var(--color-text-muted);
}

.closing-questions {
    max-width: 700px;
    margin: 0 auto;
}

.closing-q {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.4;
    margin-bottom: 1.5rem;
}

.q1 {
    color: var(--em-consciousness);
}

.q2 {
    color: var(--em-hope);
}

.closing-divider {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--color-text-dim);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    margin: 2rem 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .hero-title-emergence {
        font-size: 3.5rem;
    }
    
    .em-particle {
        width: 4px;
        height: 4px;
    }
    
    .emergence-visual {
        display: none;
    }
    
    .cells-example {
        flex-direction: column;
        text-align: center;
    }
    
    .aristotle-quote::before {
        font-size: 8rem;
    }
    
    .complexity-ladder {
        padding-left: 1.5rem;
    }
    
    .ladder-step {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
    }
    
    .ladder-step::before {
        left: -1.5rem;
    }
    
    .scenario-header {
        flex-direction: column;
        text-align: center;
    }
    
    .closing-q {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .hero-title-emergence {
        font-size: 2.5rem;
    }
    
    .accent-emergence {
        font-size: 0.6em;
    }
    
    .aristotle-quote p {
        font-size: 1.5rem;
    }
}
