/* supplychain.observer - Frutiger Aero meets logistical cartography */

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

:root {
    --deep-bg: #0a1628;
    --panel-surface: #132742;
    --aurora-teal: #3de8c8;
    --aurora-rose: #e87da3;
    --aurora-violet: #9b6dff;
    --warm-parchment: #e8e4df;
    --soft-steel: #5a7d99;
    --signal-green: #4ade80;
    --aurora-gradient: linear-gradient(135deg, #3de8c8 0%, #9b6dff 50%, #e87da3 100%);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--deep-bg);
    color: var(--warm-parchment);
    font-family: 'Source Sans 3', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ---- Navigation ---- */
#nav-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 10px 28px;
    background: rgba(19, 39, 66, 0.6);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(61, 232, 200, 0.15);
    border-radius: 999px;
    box-shadow: inset 0 0 20px rgba(61, 232, 200, 0.08);
}

.nav-domain {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.02em;
    color: var(--aurora-teal);
}

.nav-links {
    display: flex;
    gap: 18px;
}

.nav-links a {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--soft-steel);
    text-decoration: none;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--aurora-teal);
}

/* ---- Scroll Depth Indicator ---- */
#depth-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    width: 44px;
    height: 44px;
}

#depth-indicator svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.depth-track {
    fill: none;
    stroke: rgba(90, 125, 153, 0.2);
    stroke-width: 3;
}

.depth-fill {
    fill: none;
    stroke: url(#aurora-grad);
    stroke-width: 3;
    stroke-dasharray: 113;
    stroke-dashoffset: 113;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

/* ---- Depth Particles ---- */
.depth-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--aurora-teal);
    opacity: 0;
    animation: particleDrift 12s infinite linear;
}

@keyframes particleDrift {
    0% { opacity: 0; transform: translateY(0) translateX(0); }
    10% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-100vh) translateX(40px); }
}

/* ---- Hero / Observatory Section ---- */
.section-hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 20px;
    overflow: hidden;
}

.globe-container {
    width: clamp(280px, 50vw, 500px);
    margin-bottom: 40px;
    animation: globePulse 8s ease-in-out infinite;
}

@keyframes globePulse {
    0%, 90%, 100% { transform: translateX(0); }
    92% { transform: translateX(-1px); }
    94% { transform: translateX(1px); }
    96% { transform: translateX(-1px); }
    98% { transform: translateX(1px); }
}

.globe-svg {
    width: 100%;
    height: auto;
    filter: drop-shadow(0 0 40px rgba(61, 232, 200, 0.15));
}

.loc-dot {
    animation: dotPulse 3s ease-in-out infinite;
}

.loc-dot:nth-child(odd) { animation-delay: 0.5s; }
.loc-dot:nth-child(3n) { animation-delay: 1s; }

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

.trade-route {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    animation: drawRoute 2s ease forwards;
}

.trade-route:nth-child(n+2) { animation-delay: 0.3s; }
.trade-route:nth-child(n+3) { animation-delay: 0.6s; }
.trade-route:nth-child(n+4) { animation-delay: 0.9s; }
.trade-route:nth-child(n+5) { animation-delay: 1.2s; }
.trade-route:nth-child(n+6) { animation-delay: 1.5s; }
.trade-route:nth-child(n+7) { animation-delay: 1.8s; }

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

.hero-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -0.02em;
    color: var(--warm-parchment);
    margin-bottom: 16px;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    animation: charFade 0.4s ease forwards;
}

.hero-title span:nth-child(1) { animation-delay: 0.6s; }
.hero-title span:nth-child(2) { animation-delay: 0.65s; }
.hero-title span:nth-child(3) { animation-delay: 0.7s; }
.hero-title span:nth-child(4) { animation-delay: 0.75s; }
.hero-title span:nth-child(5) { animation-delay: 0.8s; }
.hero-title span:nth-child(6) { animation-delay: 0.85s; }
.hero-title span:nth-child(7) { animation-delay: 0.9s; }
.hero-title span:nth-child(8) { animation-delay: 0.95s; }
.hero-title span:nth-child(9) { animation-delay: 1.0s; }
.hero-title span:nth-child(10) { animation-delay: 1.05s; }
.hero-title span:nth-child(11) { animation-delay: 1.1s; }
.hero-title span:nth-child(12) { animation-delay: 1.15s; }
.hero-title span:nth-child(13) { animation-delay: 1.2s; }
.hero-title span:nth-child(14) { animation-delay: 1.25s; }
.hero-title span:nth-child(15) { animation-delay: 1.3s; }
.hero-title span:nth-child(16) { animation-delay: 1.35s; }
.hero-title span:nth-child(17) { animation-delay: 1.4s; }
.hero-title span:nth-child(18) { animation-delay: 1.45s; }
.hero-title span:nth-child(19) { animation-delay: 1.5s; }
.hero-title span:nth-child(20) { animation-delay: 1.55s; }

@keyframes charFade {
    to { opacity: 1; }
}

.hero-sub {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 20px;
    color: var(--soft-steel);
    margin-bottom: 32px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 2s;
}

.hero-readout {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0;
    animation: fadeUp 0.8s ease forwards 2.3s;
}

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

.readout-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--signal-green);
    text-transform: uppercase;
}

.readout-blink {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--signal-green);
    animation: blink 1s step-end infinite;
}

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

.readout-text {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: #7ec8c8;
    letter-spacing: 0.05em;
}

/* ---- Routes Section ---- */
.section-routes {
    position: relative;
    padding: 100px 20px 120px;
    max-width: 900px;
    margin: 0 auto;
}

.route-arc-decor {
    width: 100%;
    height: 100px;
    margin-bottom: 60px;
    opacity: 0.5;
}

.route-panel {
    position: relative;
    background: rgba(19, 39, 66, 0.7);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(61, 232, 200, 0.15);
    box-shadow: inset 0 0 20px rgba(61, 232, 200, 0.08);
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 40px;
    max-width: 650px;
    overflow: hidden;
}

.panel-retro-texture {
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 18px,
        rgba(90, 125, 153, 0.03) 18px,
        rgba(90, 125, 153, 0.03) 20px
    );
    pointer-events: none;
}

.panel-left {
    margin-right: auto;
}

.panel-right {
    margin-left: auto;
}

.panel-tag {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--aurora-teal);
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

.route-panel h2, .obs-panel h3 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: -0.02em;
    color: var(--warm-parchment);
    margin-bottom: 14px;
}

.route-panel p, .obs-panel p {
    color: rgba(232, 228, 223, 0.85);
    margin-bottom: 20px;
}

.panel-data {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
}

.data-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--soft-steel);
    text-transform: uppercase;
}

.data-value {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    color: var(--aurora-teal);
}

.data-unit {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--soft-steel);
}

.route-connector {
    display: flex;
    justify-content: center;
    margin: -10px 0;
}

.route-connector svg {
    width: 80px;
    height: 80px;
    opacity: 0.5;
}

.trade-route-mini {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
}

/* ---- Fade-in animation ---- */
.fade-in-panel {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in-panel.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Collage Section ---- */
.section-collage {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 80px 20px;
}

.collage-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 20% 40%, rgba(155, 109, 255, 0.15), transparent 60%),
        radial-gradient(ellipse at 80% 60%, rgba(61, 232, 200, 0.1), transparent 50%),
        linear-gradient(180deg, var(--deep-bg) 0%, #0d1f3a 50%, var(--deep-bg) 100%);
}

.collage-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(155, 109, 255, 0.08) 0%, rgba(232, 125, 163, 0.06) 100%);
    mix-blend-mode: overlay;
}

.collage-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 40px;
    align-items: center;
}

.collage-glass-panel {
    background: rgba(19, 39, 66, 0.6);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(61, 232, 200, 0.15);
    box-shadow: inset 0 0 20px rgba(61, 232, 200, 0.08);
    border-radius: 16px;
    padding: 40px 48px;
    text-align: center;
    max-width: 700px;
}

.collage-glass-panel h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
    letter-spacing: -0.02em;
    color: var(--warm-parchment);
    margin-bottom: 16px;
}

.collage-glass-panel p {
    color: rgba(232, 228, 223, 0.85);
    max-width: 560px;
    margin: 0 auto;
}

.collage-stat-panel {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item {
    text-align: center;
    background: rgba(19, 39, 66, 0.5);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(61, 232, 200, 0.15);
    border-radius: 16px;
    padding: 28px 36px;
}

.stat-number {
    display: block;
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 42px;
    color: var(--aurora-teal);
    margin-bottom: 4px;
}

.stat-desc {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.05em;
    color: var(--soft-steel);
    text-transform: uppercase;
}

.cargo-silhouette {
    position: absolute;
    bottom: 30px;
    right: 40px;
    width: 300px;
    height: auto;
    opacity: 0.12;
}

/* ---- Observations Section ---- */
.section-observations {
    padding: 100px 20px 120px;
    max-width: 1000px;
    margin: 0 auto;
}

.obs-header {
    text-align: center;
    margin-bottom: 60px;
}

.obs-header h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.02em;
    color: var(--warm-parchment);
    margin-bottom: 12px;
}

.obs-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 20px;
    color: var(--soft-steel);
}

.obs-panel {
    position: relative;
    background: rgba(19, 39, 66, 0.7);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(61, 232, 200, 0.15);
    box-shadow: inset 0 0 20px rgba(61, 232, 200, 0.08);
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 36px;
    overflow: hidden;
}

.obs-wide {
    width: 100%;
}

.obs-row {
    display: flex;
    gap: 36px;
    margin-bottom: 36px;
}

.obs-half {
    flex: 1;
    margin-bottom: 0;
}

/* ---- Bar Charts ---- */
.chart-bar-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 10px;
}

.chart-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-bar-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--soft-steel);
    width: 90px;
    text-align: right;
    letter-spacing: 0.03em;
}

.chart-bar {
    flex: 1;
    height: 16px;
    background: rgba(90, 125, 153, 0.15);
    border-radius: 8px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--aurora-gradient);
    border-radius: 8px;
    transition: width 1.2s ease-out;
}

.chart-bar-fill.animated {
    /* width set by JS */
}

.chart-bar-val {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: var(--aurora-teal);
    width: 40px;
    letter-spacing: 0.03em;
}

/* ---- Flow Diagram ---- */
.flow-diagram {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    margin-top: 16px;
}

.flow-node {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--warm-parchment);
    background: rgba(61, 232, 200, 0.1);
    border: 1px solid rgba(61, 232, 200, 0.25);
    border-radius: 8px;
    padding: 8px 14px;
    letter-spacing: 0.03em;
}

.flow-arrow {
    width: 30px;
    height: 2px;
    background: var(--aurora-gradient);
    position: relative;
}

.flow-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -3px;
    border-left: 6px solid var(--aurora-teal);
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
}

/* ---- Delta / Footer Section ---- */
.section-delta {
    padding: 100px 20px 60px;
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.delta-header h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.2rem);
    letter-spacing: -0.02em;
    color: var(--warm-parchment);
    margin-bottom: 50px;
}

.delta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    margin-bottom: 60px;
}

.delta-channel {
    background: rgba(19, 39, 66, 0.6);
    backdrop-filter: blur(12px) saturate(1.3);
    border: 1px solid rgba(61, 232, 200, 0.15);
    box-shadow: inset 0 0 20px rgba(61, 232, 200, 0.08);
    border-radius: 16px;
    padding: 28px 32px;
    flex: 1 1 160px;
    max-width: 220px;
    text-align: left;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.delta-channel:hover {
    border-color: rgba(61, 232, 200, 0.35);
    box-shadow: inset 0 0 30px rgba(61, 232, 200, 0.12), 0 0 20px rgba(61, 232, 200, 0.08);
}

.delta-channel h4 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--aurora-teal);
    margin-bottom: 8px;
}

.delta-channel p {
    font-size: 14px;
    color: var(--soft-steel);
    line-height: 1.5;
}

.delta-readout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
    min-height: 30px;
}

.typewriter {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px;
    color: rgba(126, 200, 200, 0.8);
    letter-spacing: 0.05em;
}

.typewriter::after {
    content: '|';
    animation: blink 1s step-end infinite;
    color: var(--aurora-teal);
}

.delta-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-top: 40px;
    border-top: 1px solid rgba(90, 125, 153, 0.2);
}

.footer-domain {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: 18px;
    background: var(--aurora-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
    color: var(--soft-steel);
    letter-spacing: 0.05em;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    #nav-bar {
        padding: 8px 18px;
        gap: 12px;
    }
    .nav-links { gap: 10px; }
    .nav-links a { font-size: 10px; }

    .route-panel {
        padding: 24px 24px;
        max-width: 100%;
    }

    .obs-row {
        flex-direction: column;
    }

    .collage-glass-panel {
        padding: 28px 24px;
    }

    .delta-channel {
        max-width: 100%;
    }

    .flow-diagram {
        justify-content: center;
    }

    #depth-indicator {
        display: none;
    }
}
