/* supplychain.watch - Dopamine maximalism filtered through analog warmth */

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

:root {
    --stone: #f5f0e6;
    --deep-timber: #2c2416;
    --aged-brass: #c4a246;
    --oxidized-copper: #5a8a6e;
    --vintage-rose: #b87d6a;
    --star-silver: #a8a08e;
    --dopamine-amber: #e8a832;
    --charcoal-mortar: #1a1610;
    --earth-brown: #3d3427;
    --muted-label: #8b7d5e;
    --spring-ease: cubic-bezier(0.34, 1.56, 0.64, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--charcoal-mortar);
    color: var(--earth-brown);
    font-family: 'Lora', serif;
    font-size: 17px;
    line-height: 1.75;
    overflow-x: hidden;
}

/* ---- Compass Navigation ---- */
#compass-nav {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    width: 44px;
    height: 44px;
}

.compass-rose {
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: transform 0.8s var(--spring-ease);
}

#compass-nav:hover .compass-rose {
    transform: rotate(360deg);
}

.compass-links {
    position: absolute;
    top: 0;
    left: 0;
    width: 160px;
    height: 160px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}

#compass-nav:hover .compass-links {
    opacity: 1;
    pointer-events: auto;
}

.compass-links a {
    position: absolute;
    font-family: 'Inconsolata', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--deep-timber);
    text-decoration: none;
    background: var(--stone);
    padding: 3px 8px;
    border: 1px solid var(--aged-brass);
    white-space: nowrap;
    transform: scale(0.8);
    transition: transform 0.5s var(--spring-ease), color 0.3s;
}

#compass-nav:hover .compass-links a {
    transform: scale(1);
}

.compass-links a:hover {
    color: var(--dopamine-amber);
}

.compass-n { top: -8px; left: 50px; }
.compass-e { top: 22px; left: 80px; }
.compass-s { top: 52px; left: 50px; }
.compass-w { top: 22px; left: -40px; }

/* ---- Beacon Section ---- */
.beacon-section {
    position: relative;
    min-height: 100vh;
    background: var(--stone);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.beacon-pulse-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.beacon-ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid transparent;
    opacity: 0;
}

.ring-1 {
    width: 200px;
    height: 200px;
    border-color: var(--aged-brass);
    animation: pulseRing 4s ease-out infinite 0.3s;
}

.ring-2 {
    width: 350px;
    height: 350px;
    border-color: var(--dopamine-amber);
    animation: pulseRing 4s ease-out infinite 0.7s;
}

.ring-3 {
    width: 500px;
    height: 500px;
    border-color: var(--aged-brass);
    animation: pulseRing 4s ease-out infinite 1.1s;
}

@keyframes pulseRing {
    0% { transform: scale(0.3); opacity: 0.8; }
    50% { opacity: 0.3; }
    100% { transform: scale(1.5); opacity: 0; }
}

.beacon-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 5rem);
    color: var(--deep-timber);
    position: relative;
    z-index: 2;
    margin-bottom: 16px;
}

.beacon-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: springIn 0.5s var(--spring-ease) forwards;
}

.beacon-title span:nth-child(1) { animation-delay: 0.3s; }
.beacon-title span:nth-child(2) { animation-delay: 0.38s; }
.beacon-title span:nth-child(3) { animation-delay: 0.46s; }
.beacon-title span:nth-child(4) { animation-delay: 0.54s; }
.beacon-title span:nth-child(5) { animation-delay: 0.62s; }
.beacon-title span:nth-child(6) { animation-delay: 0.7s; }
.beacon-title span:nth-child(7) { animation-delay: 0.78s; }
.beacon-title span:nth-child(8) { animation-delay: 0.86s; }
.beacon-title span:nth-child(9) { animation-delay: 0.94s; }
.beacon-title span:nth-child(10) { animation-delay: 1.02s; }
.beacon-title span:nth-child(11) { animation-delay: 1.1s; }
.beacon-title span:nth-child(12) { animation-delay: 1.18s; }
.beacon-title span:nth-child(13) { animation-delay: 1.26s; }
.beacon-title span:nth-child(14) { animation-delay: 1.34s; }
.beacon-title span:nth-child(15) { animation-delay: 1.42s; }
.beacon-title span:nth-child(16) { animation-delay: 1.5s; }
.beacon-title span:nth-child(17) { animation-delay: 1.58s; }

@keyframes springIn {
    0% { opacity: 0; transform: translateY(20px); }
    60% { opacity: 1; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

.beacon-subtitle {
    font-family: 'Inconsolata', monospace;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted-label);
    position: relative;
    z-index: 2;
    min-height: 1.5em;
}

.beacon-subtitle::after {
    content: '|';
    animation: cursorBlink 1s step-end infinite;
    color: var(--aged-brass);
}

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

/* ---- Observation Slits ---- */
.observation-slit {
    position: relative;
    height: 40px;
    width: 100%;
    background: var(--charcoal-mortar);
    overflow: hidden;
}

.star-dot {
    position: absolute;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: var(--star-silver);
    animation: drift 20s linear infinite;
}

.star-dot.star-gold {
    background: var(--aged-brass);
    width: 3px;
    height: 3px;
}

@keyframes drift {
    0% { transform: translateX(0); }
    100% { transform: translateX(100vw); }
}

/* ---- Tower Floors ---- */
.tower-floors {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.floor-block {
    position: relative;
    background: var(--stone);
    padding: 48px 56px;
    border-top: 2px solid var(--deep-timber);
    overflow: hidden;
}

.block-left {
    align-self: flex-start;
}

.block-right {
    align-self: flex-end;
}

.block-center {
    align-self: center;
}

.block-texture {
    position: absolute;
    inset: 0;
    opacity: 0.02;
    pointer-events: none;
}

.texture-diag {
    background: repeating-linear-gradient(
        45deg,
        var(--deep-timber),
        var(--deep-timber) 1px,
        transparent 1px,
        transparent 10px
    );
    background-size: 80px 80px;
}

.texture-cross {
    background: repeating-linear-gradient(
        0deg,
        var(--deep-timber),
        var(--deep-timber) 1px,
        transparent 1px,
        transparent 10px
    ),
    repeating-linear-gradient(
        90deg,
        var(--deep-timber),
        var(--deep-timber) 1px,
        transparent 1px,
        transparent 10px
    );
    background-size: 80px 80px;
}

.texture-grid {
    background: repeating-linear-gradient(
        -45deg,
        var(--deep-timber),
        var(--deep-timber) 1px,
        transparent 1px,
        transparent 12px
    );
    background-size: 80px 80px;
}

.block-annotation {
    display: block;
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted-label);
    margin-bottom: 14px;
}

.floor-block h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--deep-timber);
    margin-bottom: 14px;
}

.floor-block p {
    max-width: 640px;
    margin-bottom: 16px;
}

.alert-quote {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 24px;
    color: var(--aged-brass);
    border-left: 3px solid var(--aged-brass);
    padding-left: 20px;
    margin: 20px 0;
    max-width: 560px;
}

.mortar-gap {
    width: 100%;
    height: 6px;
    background: var(--charcoal-mortar);
}

/* ---- Data Rows ---- */
.data-row {
    display: flex;
    gap: 36px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.data-cell {
    text-align: center;
}

.data-val {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 36px;
    color: var(--dopamine-amber);
}

.data-lbl {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--muted-label);
    text-transform: uppercase;
}

/* ---- Spring-in animation ---- */
.spring-in {
    opacity: 0;
    transform: translateY(60px);
    transition: opacity 0.7s ease, transform 0.7s var(--spring-ease);
}

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

/* ---- Nature Interlude ---- */
.nature-interlude {
    position: relative;
    background: var(--stone);
    padding: 60px 20px;
    display: flex;
    justify-content: center;
    overflow: hidden;
    border-top: 2px solid var(--deep-timber);
}

.tree-container {
    position: relative;
    width: 120px;
    height: 200px;
}

.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 100px;
    background: var(--earth-brown);
    border-radius: 2px;
}

.tree-branch {
    position: absolute;
    left: 50%;
    background: var(--oxidized-copper);
    height: 4px;
    transform-origin: left center;
    border-radius: 2px;
    opacity: 0;
    transition: opacity 0.5s, transform 0.6s var(--spring-ease);
}

.tree-container.visible .tree-branch {
    opacity: 1;
}

.branch-1 {
    bottom: 80px;
    width: 40px;
    transform: translateX(-100%) rotate(-30deg) scaleX(0.5);
}
.tree-container.visible .branch-1 {
    transform: translateX(-100%) rotate(-30deg) scaleX(1);
    transition-delay: 0.15s;
}

.branch-2 {
    bottom: 90px;
    width: 35px;
    transform: rotate(25deg) scaleX(0.5);
}
.tree-container.visible .branch-2 {
    transform: rotate(25deg) scaleX(1);
    transition-delay: 0.3s;
}

.branch-3 {
    bottom: 110px;
    width: 30px;
    transform: translateX(-100%) rotate(-20deg) scaleX(0.5);
}
.tree-container.visible .branch-3 {
    transform: translateX(-100%) rotate(-20deg) scaleX(1);
    transition-delay: 0.45s;
}

.branch-4 {
    bottom: 120px;
    width: 28px;
    transform: rotate(35deg) scaleX(0.5);
}
.tree-container.visible .branch-4 {
    transform: rotate(35deg) scaleX(1);
    transition-delay: 0.6s;
}

.branch-5 {
    bottom: 135px;
    width: 22px;
    transform: translateX(-100%) rotate(-15deg) scaleX(0.5);
}
.tree-container.visible .branch-5 {
    transform: translateX(-100%) rotate(-15deg) scaleX(1);
    transition-delay: 0.75s;
}

.tree-crown {
    position: absolute;
    bottom: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: var(--oxidized-copper);
    clip-path: polygon(50% 0%, 15% 100%, 85% 100%);
    opacity: 0.7;
}

/* ---- Nature Grass ---- */
.nature-grass {
    padding: 40px 20px 20px;
    align-items: flex-end;
}

.grass-row {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    justify-content: center;
}

.grass-blade {
    width: 4px;
    background: var(--oxidized-copper);
    border-radius: 2px 2px 0 0;
    transform-origin: bottom center;
    animation: sway 3s ease-in-out infinite;
}

.blade-1 { height: 40px; animation-delay: 0s; }
.blade-2 { height: 55px; animation-delay: 0.2s; }
.blade-3 { height: 35px; animation-delay: 0.5s; }
.blade-4 { height: 60px; animation-delay: 0.1s; }
.blade-5 { height: 45px; animation-delay: 0.7s; }
.blade-6 { height: 50px; animation-delay: 0.3s; }
.blade-7 { height: 38px; animation-delay: 0.6s; }
.blade-8 { height: 58px; animation-delay: 0.15s; }
.blade-9 { height: 42px; animation-delay: 0.45s; }
.blade-10 { height: 52px; animation-delay: 0.8s; }
.blade-11 { height: 36px; animation-delay: 0.25s; }
.blade-12 { height: 48px; animation-delay: 0.55s; }

@keyframes sway {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(6deg); }
    75% { transform: rotate(-4deg); }
}

/* ---- Foundation Section ---- */
.foundation-section {
    background: var(--deep-timber);
    color: var(--stone);
    padding: 80px 20px 60px;
    margin: 0 -20px;
    overflow: hidden;
}

.foundation-inner {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.foundation-inner h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2rem, 5vw, 3.5rem);
    color: var(--stone);
    margin-bottom: 20px;
}

.foundation-inner p {
    color: rgba(245, 240, 230, 0.8);
    max-width: 600px;
    margin: 0 auto 40px;
}

.foundation-compass {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
}

.compass-emblem {
    width: 200px;
    height: 200px;
}

.foundation-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.meta-item {
    font-family: 'Inconsolata', monospace;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: var(--star-silver);
}

.meta-divider {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--aged-brass);
}

/* ---- Warm tint variations ---- */
.tower-floors-warm .floor-block {
    background: var(--stone);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .floor-block {
        padding: 32px 24px;
        width: 100% !important;
    }

    .block-left, .block-right {
        align-self: stretch;
    }

    .alert-quote {
        font-size: 20px;
    }

    #compass-nav {
        top: 12px;
        left: 12px;
    }

    .data-row {
        gap: 20px;
    }
}
