/* ===============================================
   CHOREOGRAPHED DIGITAL NARRATIVE - EMMA ARCHITECTURE
   The Stage: Where Data Tells Its Story
   =============================================== */

/* Base Architecture Section - The Stage */
#choreographed-architecture {
    position: relative;
    background: #0a0f1e;
    min-height: 100vh;
    overflow: hidden;
    padding: 8rem 0;
    /* Optimize for smooth scrolling */
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Multi-Layered Parallax Background - The Atmosphere */
#choreographed-architecture::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(10, 15, 30, 1) 0%,
        rgba(20, 25, 45, 1) 25%,
        rgba(15, 20, 40, 1) 50%,
        rgba(25, 30, 50, 1) 75%,
        rgba(10, 15, 30, 1) 100%
    );
    z-index: 0;
    pointer-events: none;
}

/* Nebula Layer */
#choreographed-architecture::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(236, 72, 153, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
    z-index: 0;
    animation: nebulaDrift 60s ease-in-out infinite;
    will-change: transform;
    pointer-events: none;
}

@keyframes nebulaDrift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(-5%, 5%) rotate(1deg); }
    50% { transform: translate(5%, -5%) rotate(-1deg); }
    75% { transform: translate(-5%, -5%) rotate(0.5deg); }
}

/* Floating Grid Overlay */
.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(139, 92, 246, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(139, 92, 246, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: 1;
    opacity: 0.4;
    animation: gridFloat 30s linear infinite;
    will-change: transform;
    pointer-events: none;
}

@keyframes gridFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(50px); }
}

/* Particle System - Mid Layer */
.particle-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(139, 92, 246, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.8);
    animation: particleFloat 20s linear infinite;
    will-change: transform;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) translateX(50px);
        opacity: 0;
    }
}

/* Section Header */
.choreographed-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 10;
}

.choreographed-title {
    font-size: 3rem;
    font-weight: 900;
    background: linear-gradient(135deg, #8b5cf6, #ec4899, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.choreographed-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    margin: 0 auto;
}

/* The 12-Column Grid System */
.narrative-grid {
    position: relative;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    z-index: 10;
}

/* The Permanent Data Stream Path - The Protagonist */
.data-stream-path {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.data-stream-track {
    fill: none;
    stroke: rgba(139, 92, 246, 0.15);
    stroke-width: 3;
    stroke-linecap: round;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}

/* Animated Path Drawing - Optimized for smooth scrolling */
.data-stream-animated {
    fill: none;
    stroke: url(#streamGradient);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    filter: drop-shadow(0 0 15px rgba(139, 92, 246, 0.8));
    animation: none; /* Controlled by JavaScript */
    will-change: stroke-dashoffset; /* Optimize for smooth animations */
    transition: stroke-dashoffset 0.3s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth transitions */
}

@keyframes drawPath {
    to {
        stroke-dashoffset: 0;
    }
}

/* Data Pulse - The Traveler */
.data-pulse {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 1) 0%, rgba(236, 72, 153, 0.8) 50%, transparent 100%);
    box-shadow: 
        0 0 20px rgba(139, 92, 246, 1),
        0 0 40px rgba(236, 72, 153, 0.6),
        0 0 60px rgba(59, 130, 246, 0.4);
    z-index: 5;
    opacity: 0;
    pointer-events: none;
}

.data-pulse::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.3);
    animation: pulseRing 1.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Content Blocks - 5 Columns */
.content-block {
    grid-column: span 5;
    position: relative;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Left-aligned blocks */
.content-block.left {
    grid-column: 1 / 6;
    padding-right: 3rem;
}

/* Right-aligned blocks */
.content-block.right {
    grid-column: 8 / 13;
    padding-left: 3rem;
}

/* Content block revealed state */
.content-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Connection Point - Where content "hangs" from the stream */
.content-block::before {
    content: '';
    position: absolute;
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    border: 2px solid rgba(139, 92, 246, 0.6);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.content-block.left::before {
    right: -20px;
}

.content-block.right::before {
    left: -20px;
}

.content-block.revealed::before {
    opacity: 1;
    animation: connectionPulse 2s ease-in-out infinite;
}

@keyframes connectionPulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.8);
        transform: scale(1.1);
    }
}

/* Content Block Inner Structure */
.block-container {
    background: linear-gradient(135deg, 
        rgba(30, 35, 55, 0.6) 0%, 
        rgba(20, 25, 45, 0.4) 100%
    );
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.block-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(139, 92, 246, 0.05) 0%, 
        transparent 50%, 
        rgba(236, 72, 153, 0.03) 100%
    );
    opacity: 0;
    transition: opacity 0.6s ease;
}

.content-block.revealed .block-container::before {
    opacity: 1;
}

/* Living Icon - The Reactive Element */
.living-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.living-icon svg {
    width: 40px;
    height: 40px;
    color: #8b5cf6;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.6));
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Living Icon States */
.living-icon.pulse-active {
    animation: iconPulse 1.5s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 40px rgba(139, 92, 246, 0.8);
    }
}

.living-icon.typing-active::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: typingDot 1.4s ease-in-out infinite;
}

@keyframes typingDot {
    0%, 60%, 100% { opacity: 0; }
    30% { opacity: 1; }
}

.living-icon.light-up {
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, rgba(236, 72, 153, 0.2) 70%);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
}

.living-icon.light-up svg {
    color: #ec4899;
    filter: drop-shadow(0 0 20px rgba(236, 72, 153, 1));
    transform: scale(1.2);
}

/* Hover States - Intelligent Interactions */
.living-icon:hover {
    transform: scale(1.1);
    background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(236, 72, 153, 0.1) 70%);
    box-shadow: 0 0 40px rgba(139, 92, 246, 0.8);
    cursor: pointer;
}

.living-icon:hover svg {
    transform: scale(1.15) rotate(5deg);
    color: #ec4899;
}

/* Content Text - Always Left-Aligned */
.block-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1rem;
    text-align: left;
    line-height: 1.3;
}

.block-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: left;
}

/* Tags with Intelligent Hover States */
.block-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
    transform: translateY(-2px);
}

/* Tooltip */
.tag::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(20, 25, 45, 0.95);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 8px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 100;
}

.tag:hover::after {
    opacity: 1;
}

/* Detail Visualizations - Stagger In */
.detail-visual {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-block.revealed .detail-visual {
    opacity: 1;
    transform: translateY(0);
}

/* Stage-specific Visualizations */
.calendar-ui {
    background: rgba(30, 35, 55, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.time-slot {
    padding: 0.5rem;
    background: rgba(50, 55, 75, 0.4);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 6px;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.time-slot.highlight {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.6);
    color: #fff;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
    animation: slotGlow 2s ease-in-out infinite;
}

@keyframes slotGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(139, 92, 246, 0.6);
    }
    50% {
        box-shadow: 0 0 25px rgba(139, 92, 246, 0.9);
    }
}

/* App Icons - Light Up Individually */
.app-icons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.app-icon {
    background: rgba(30, 35, 55, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.content-block.revealed .app-icon {
    opacity: 1;
    transform: scale(1);
}

.app-icon:nth-child(1) { transition-delay: 0.1s; }
.app-icon:nth-child(2) { transition-delay: 0.2s; }
.app-icon:nth-child(3) { transition-delay: 0.3s; }

.app-icon.activated {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
}

.app-icon svg {
    width: 32px;
    height: 32px;
    color: #8b5cf6;
    margin-bottom: 0.5rem;
}

.app-icon span {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Moving Light Source Effect */
.light-source {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: 3;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.light-source.active {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-block.left,
    .content-block.right {
        grid-column: 1 / 13;
        padding: 0 1rem;
    }
    
    .data-stream-path {
        display: none;
    }
    
    .choreographed-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .choreographed-title {
        font-size: 2rem;
    }
    
    .block-container {
        padding: 1.5rem;
    }
    
    .living-icon {
        width: 60px;
        height: 60px;
    }
    
    .living-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .app-icons-grid {
        grid-template-columns: 1fr;
    }
}

