/* ============================================================================
   LIVERPOOL STREET STATION — VISUAL NARRATIVE & STORYTELLING
   Loading screen, track-line connectors, atmospheric transitions, 
   parallax depth, and cinematic moments between acts.
   ============================================================================ */

/* ==================== LOADING SCREEN ==================== */

.loading-screen {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ink-black);
    transition: opacity 0.6s var(--ease-signal), visibility 0.6s;
}

.loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-board {
    background: var(--ink-black);
    border: 3px solid var(--platform-concrete);
    padding: var(--space-lg) var(--space-xl);
    min-width: 320px;
    max-width: 420px;
    width: 85%;
    font-family: var(--font-ticker);
    color: var(--warning-yellow);
    position: relative;
}

/* CRT scanlines on loading board */
.loading-board::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg, transparent, transparent 2px,
        rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px
    );
    pointer-events: none;
}

.loading-board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--space-base);
}

.loading-board-label {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.loading-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal-green);
    box-shadow: 0 0 8px var(--signal-green);
    animation: loading-pulse 1s ease-in-out infinite;
}

@keyframes loading-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--signal-green); }
    50% { opacity: 0.4; box-shadow: 0 0 4px var(--signal-green); }
}

.loading-board-body {
    text-align: center;
    padding: var(--space-lg) 0;
}

.loading-destination {
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: var(--space-base);
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: var(--space-sm);
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--warning-yellow);
    animation: loading-dot 1.2s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-dot {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.2); }
}

.loading-board-footer {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    text-align: center;
    padding-top: var(--space-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
    .loading-status-dot,
    .loading-dots span {
        animation: none;
        opacity: 1;
    }
    .loading-screen {
        transition: none;
    }
}

/* ==================== TRACK LINE CONNECTORS ==================== */
/* Visual rail lines connecting acts — creates narrative continuity */

.act-divider {
    position: relative;
    overflow: hidden;
}

/* Subtle track marks on act dividers */
.act-divider::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -30px;
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, transparent, var(--warning-yellow));
    transform: translateX(-50%);
}

.act-divider::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -30px;
    width: 2px;
    height: 30px;
    background: linear-gradient(to bottom, var(--warning-yellow), transparent);
    transform: translateX(-50%);
    z-index: 1;
}

/* ==================== ATMOSPHERIC SECTION TRANSITIONS ==================== */
/* Gradient overlays that create depth between content blocks */

/* Fade-in from top on first section after an act divider */
.act-divider + section::before,
.act-divider + .shrine-section::before {
    content: "";
    display: block;
    height: 60px;
    margin: calc(var(--space-xl) * -1) calc(var(--gutter) * -1) var(--space-lg);
    background: linear-gradient(to bottom, rgba(0, 60, 127, 0.03), transparent);
    pointer-events: none;
}

/* Deeper atmospheric gradient for documentary sections */
.documentary-section + .documentary-section::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.15), transparent);
}

/* ==================== PARALLAX-LIKE DEPTH LAYERS ==================== */
/* Subtle scroll-speed differences via CSS transforms and perspective */

.hero-section {
    position: relative;
    overflow: hidden;
}

/* Slow-moving background gradient on hero */
.hero-section::before {
    content: "";
    position: absolute;
    inset: -50%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(0, 60, 127, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(220, 20, 60, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(255, 215, 0, 0.04) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: hero-drift 20s ease-in-out infinite alternate;
}

@keyframes hero-drift {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(-2%, -1%) scale(1.02); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
    .hero-section::before {
        animation: none;
    }
}

/* ==================== CINEMATIC SECTION ENTRANCES ==================== */
/* Enhanced reveal animations for key narrative moments */

/* Reckoning section — dramatic entrance */
.reckoning-section .reckoning-line {
    transition: opacity 1s var(--ease-signal), transform 1s var(--ease-signal);
}

.reckoning-section.in-view .reckoning-line:nth-child(1) { transition-delay: 0s; }
.reckoning-section.in-view .reckoning-line:nth-child(2) { transition-delay: 0.3s; }
.reckoning-section.in-view .reckoning-line:nth-child(3) { transition-delay: 0.8s; }
.reckoning-section.in-view .reckoning-line:nth-child(4) { transition-delay: 1.2s; }
.reckoning-section.in-view .reckoning-line:nth-child(5) { transition-delay: 1.6s; }
.reckoning-section.in-view .reckoning-line:nth-child(6) { transition-delay: 2.1s; }
.reckoning-section.in-view .reckoning-line:nth-child(7) { transition-delay: 2.6s; }

/* Manifesto — word-by-word reveal */
.manifesto-section .manifesto-line {
    transition: opacity 0.8s var(--ease-signal), transform 0.8s var(--ease-signal);
}

.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(1) { transition-delay: 0.2s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(2) { transition-delay: 0.5s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(3) { transition-delay: 0.8s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(4) { transition-delay: 1.1s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(5) { transition-delay: 1.4s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(6) { transition-delay: 1.7s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(7) { transition-delay: 2.0s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(8) { transition-delay: 2.3s; }
.manifesto-section.in-view .manifesto-body .manifesto-line:nth-child(9) { transition-delay: 2.6s; }

/* Scene cards — staggered cinematic entrance */
.scene-card {
    transition: opacity 1s var(--ease-signal), transform 1s var(--ease-signal);
}

.scene-card.in-view .scene-timestamp {
    animation: timestamp-flash 0.6s ease-out;
}

@keyframes timestamp-flash {
    0% { color: rgba(255, 255, 255, 0.2); }
    30% { color: #fff; text-shadow: 0 0 20px rgba(255, 215, 0, 0.8); }
    100% { color: var(--warning-yellow); }
}

/* ==================== CONVERGENCE BLOCK — PULSE ==================== */

.convergence-block.in-view {
    animation: convergence-pulse 3s ease-in-out 0.5s;
}

@keyframes convergence-pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 20, 60, 0); }
    30% { box-shadow: 0 0 0 8px rgba(220, 20, 60, 0.1); }
    100% { box-shadow: 0 0 0 0 rgba(220, 20, 60, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .convergence-block.in-view,
    .scene-card.in-view .scene-timestamp {
        animation: none;
    }
    .reckoning-section .reckoning-line,
    .manifesto-section .manifesto-line,
    .scene-card {
        transition-delay: 0s !important;
    }
}

/* ==================== PLATFORM EDGE WARNING STRIP ==================== */
/* Yellow/black hazard stripe between major narrative shifts */

.documentary-section:first-of-type::before {
    content: "";
    display: block;
    height: 4px;
    background: repeating-linear-gradient(
        90deg,
        var(--warning-yellow) 0,
        var(--warning-yellow) 20px,
        var(--ink-black) 20px,
        var(--ink-black) 40px
    );
    margin-bottom: 0;
}

/* ==================== GHOST TRAIL EFFECT ==================== */
/* Subtle vertical line showing the reader's "path" through the station */

.case-study {
    position: relative;
}

.case-study::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(0, 60, 127, 0.06) 5%,
        rgba(0, 60, 127, 0.06) 95%,
        transparent 100%
    );
    pointer-events: none;
    z-index: 0;
}

/* ==================== VOICE QUOTE ENTRANCE ==================== */
/* Slide in from left like someone stepping forward to speak */

.voice-quote {
    transition: opacity 0.8s var(--ease-signal), transform 0.8s var(--ease-signal);
}

.voice-quote:not(.in-view) {
    transform: translateX(-20px);
}

.voice-quote.in-view {
    transform: translateX(0);
}

/* ==================== STAT COUNTER GLOW ==================== */
/* Numbers glow momentarily when they finish counting */

.stat-number[data-animated="true"] {
    animation: stat-arrive 0.3s ease-out;
}

@keyframes stat-arrive {
    0% { text-shadow: 0 0 20px rgba(0, 60, 127, 0.5); }
    100% { text-shadow: none; }
}

.stat-block-zero .stat-number[data-animated="true"] {
    animation: stat-warning 0.5s ease-out;
}

@keyframes stat-warning {
    0% { text-shadow: 0 0 30px rgba(220, 20, 60, 0.6); transform: scale(1.05); }
    100% { text-shadow: none; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .stat-number[data-animated="true"],
    .stat-block-zero .stat-number[data-animated="true"] {
        animation: none;
    }
    .voice-quote:not(.in-view) {
        transform: none;
    }
}

/* ==================== CTA SECTION — ATMOSPHERIC ==================== */

.cta-section {
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 100%, rgba(0, 60, 127, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

/* CTA button subtle pulse on scroll-in */
.cta-section.in-view .cta-button--primary {
    animation: button-ready 2s ease-in-out 1s;
}

@keyframes button-ready {
    0% { box-shadow: 0 0 0 0 rgba(0, 60, 127, 0.3); }
    50% { box-shadow: 0 0 0 10px rgba(0, 60, 127, 0); }
    100% { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
    .cta-section.in-view .cta-button--primary {
        animation: none;
    }
}

/* ==================== NEXT PROJECT SECTION — DEPTH ==================== */
/* Creates a "looking into the future" feel */

.next-project-section {
    position: relative;
    overflow: hidden;
}

.next-project-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(ellipse at 50% 100%, rgba(0, 60, 127, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.redacted-block {
    position: relative;
    overflow: hidden;
}

.redacted-block::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    animation: redacted-shimmer 3s ease-in-out infinite;
}

@keyframes redacted-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
    .redacted-block::after {
        animation: none;
        display: none;
    }
}
