/* economics.day - Victorian Ornate + Neon Timeline */
/* Colors: #0d0d1a, #12102a, #ff00ff, #39ff14, #00f0ff, #d4ff00, #9b8ab8, #e0d6f0 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;700&family=Inter:wght@400;500;600&family=Lora:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Playfair+Display:wght@400;700;900&display=swap');

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0d0d1a;
    color: #e0d6f0;
    font-family: 'Lora', Georgia, serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
    position: relative;
}

/* Timeline Thread */
#timeline-thread {
    position: fixed;
    left: 50%;
    top: 0;
    width: 1px;
    height: 100vh;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(155, 138, 184, 0.15) 20%,
        rgba(155, 138, 184, 0.3) 50%,
        rgba(155, 138, 184, 0.15) 80%,
        transparent 100%
    );
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
}

/* ============================================
   GATEWAY / HERO
   ============================================ */

#gateway {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.gateway-frame {
    position: relative;
    width: 90vw;
    max-width: 800px;
    aspect-ratio: 4/3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ornamental-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.gateway-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem;
}

.gateway-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.7rem, 1.5vw, 0.9rem);
    color: #9b8ab8;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.gateway-title {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 7rem);
    color: #39ff14;
    letter-spacing: 0.04em;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.4), 0 0 60px rgba(57, 255, 20, 0.15);
    margin-bottom: 1.5rem;
}

.gateway-domain {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(0.8rem, 1.5vw, 1rem);
    color: #ff00ff;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(255, 0, 255, 0.4);
}

.scroll-indicator {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: breathe 3s ease-in-out infinite;
}

.scroll-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: #9b8ab8;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.6;
}

.scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 16; opacity: 1; }
    50% { cy: 30; opacity: 0.3; }
}

@keyframes breathe {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ============================================
   NEON LINE ANIMATIONS
   ============================================ */

.neon-line {
    filter: drop-shadow(0 0 3px currentColor);
}

@keyframes neonPulse {
    0%, 100% { opacity: 0.8; filter: drop-shadow(0 0 3px currentColor); }
    50% { opacity: 1; filter: drop-shadow(0 0 8px currentColor); }
}

.pulse-dot {
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
    0%, 100% { r: 4; opacity: 1; }
    50% { r: 6; opacity: 0.6; }
}

/* ============================================
   DIVIDERS
   ============================================ */

.divider {
    position: relative;
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.divider-svg {
    width: 90%;
    max-width: 1000px;
    height: auto;
}

.era-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #9b8ab8;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* ============================================
   CHAPTERS
   ============================================ */

.chapter {
    position: relative;
    z-index: 1;
}

.reveal-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-section.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-frame {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.chapter-border {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.6;
}

.chapter-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.chapter-number {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #ff00ff;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.chapter-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 4rem);
    color: #39ff14;
    letter-spacing: 0.04em;
    line-height: 1.15;
    text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    margin-bottom: 0.5rem;
}

.chapter-period {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8rem;
    color: #00f0ff;
    letter-spacing: 0.15em;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    margin-bottom: 2rem;
}

.chapter-illustration {
    max-width: 500px;
    margin: 0 auto 2rem;
}

.illustration {
    width: 100%;
    height: auto;
}

.chapter-text {
    max-width: 600px;
    margin: 0 auto;
    text-align: left;
}

.chapter-text p {
    font-family: 'Lora', Georgia, serif;
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    color: #e0d6f0;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.chapter-text em {
    color: #00f0ff;
    font-style: italic;
}

/* Key Concept boxes */
.key-concept {
    border-left: 2px solid #ff00ff;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: linear-gradient(90deg, rgba(255, 0, 255, 0.05), transparent);
}

.concept-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.65rem;
    color: #ff00ff;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(255, 0, 255, 0.3);
}

.concept-text {
    font-family: 'Lora', Georgia, serif;
    font-size: 0.95rem;
    color: #d4ff00;
    line-height: 1.6;
    font-style: italic;
}

/* Thinker pills */
.thinker-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}

.thinker {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: #00f0ff;
    border: 1px solid rgba(0, 240, 255, 0.3);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    letter-spacing: 0.05em;
    background: rgba(0, 240, 255, 0.05);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.thinker:hover {
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* ============================================
   FOOTER
   ============================================ */

#footer {
    padding: 4rem 2rem 3rem;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 2rem auto;
}

.footer-text {
    font-family: 'Lora', Georgia, serif;
    font-size: 1rem;
    color: #9b8ab8;
    font-style: italic;
    line-height: 1.7;
    margin-bottom: 2rem;
}

.footer-domain {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #ff00ff;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
    margin-bottom: 0.5rem;
}

.footer-year {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: #9b8ab8;
    letter-spacing: 0.3em;
    opacity: 0.5;
}

.footer-ornament {
    display: flex;
    justify-content: center;
}

.footer-ornament .divider-svg {
    width: 60%;
    max-width: 600px;
}

/* ============================================
   PARTICLE CANVAS (added by JS)
   ============================================ */

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.4;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .gateway-frame {
        width: 95vw;
        aspect-ratio: auto;
        min-height: 80vh;
    }

    .chapter-frame {
        padding: 2rem 1.2rem;
    }

    .chapter-illustration {
        max-width: 350px;
    }

    .divider-svg {
        width: 95%;
    }

    .thinker-list {
        justify-content: center;
    }

    .key-concept {
        padding: 0.8rem 1rem;
    }
}

@media (max-width: 480px) {
    .gateway-title {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .chapter-title {
        font-size: clamp(1.5rem, 7vw, 2.5rem);
    }

    .chapter-number {
        font-size: 2rem;
    }
}

/* ============================================
   SVG ANIMATION HELPERS
   ============================================ */

@keyframes drawLine {
    from { stroke-dashoffset: var(--dash-length); }
    to { stroke-dashoffset: 0; }
}

.reveal-section.visible .neon-line {
    animation: neonPulse 4s ease-in-out infinite;
}

/* Staggered reveal for chapter children */
.reveal-section.visible .chapter-number {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}
.reveal-section.visible .chapter-title {
    animation: fadeInUp 0.8s ease-out 0.3s both;
}
.reveal-section.visible .chapter-period {
    animation: fadeInUp 0.8s ease-out 0.5s both;
}
.reveal-section.visible .chapter-illustration {
    animation: fadeInUp 1s ease-out 0.7s both;
}
.reveal-section.visible .chapter-text {
    animation: fadeInUp 1s ease-out 0.9s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glow keyframes for text */
@keyframes textGlow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(57, 255, 20, 0.4);
    }
    50% {
        text-shadow: 0 0 30px rgba(57, 255, 20, 0.6), 0 0 60px rgba(57, 255, 20, 0.2);
    }
}

.gateway-title {
    animation: textGlow 4s ease-in-out infinite;
}
