/* economic.day - Celestial Masonry Almanac Styles */
/* Color palette reference */
:root {
    --midnight-sky: #0a1628;
    --deep-ocean: #0d1b30;
    --twilight: #162244;
    --starlight-gold: #e8d5a0;
    --antique-brass: #b8963e;
    --lunar-silver: #c8cfe0;
    --nebula-steel: #7a8fa8;
    --celestial-white: #f0f2f8;
    --ember-amber: #d4a05a;
    --void-black: #050d1a;
    --deep-navy: #0f1f38;
}



/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0a1628;
    color: #c8cfe0;
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== STARFIELD BACKGROUND ===== */
.starfield {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle, #c8cfe0 0.5px, transparent 0.5px) 10% 15%,
        radial-gradient(circle, #c8cfe0 0.4px, transparent 0.4px) 25% 35%,
        radial-gradient(circle, #c8cfe0 0.6px, transparent 0.6px) 40% 8%,
        radial-gradient(circle, #c8cfe0 0.3px, transparent 0.3px) 55% 45%,
        radial-gradient(circle, #c8cfe0 0.5px, transparent 0.5px) 70% 20%,
        radial-gradient(circle, #c8cfe0 0.4px, transparent 0.4px) 85% 55%,
        radial-gradient(circle, #c8cfe0 0.3px, transparent 0.3px) 15% 65%,
        radial-gradient(circle, #c8cfe0 0.5px, transparent 0.5px) 35% 78%,
        radial-gradient(circle, #c8cfe0 0.4px, transparent 0.4px) 60% 85%,
        radial-gradient(circle, #c8cfe0 0.6px, transparent 0.6px) 80% 70%,
        radial-gradient(circle, #c8cfe0 0.3px, transparent 0.3px) 5% 90%,
        radial-gradient(circle, #c8cfe0 0.4px, transparent 0.4px) 92% 12%,
        radial-gradient(circle, #c8cfe0 0.5px, transparent 0.5px) 48% 58%,
        radial-gradient(circle, #c8cfe0 0.3px, transparent 0.3px) 73% 42%,
        radial-gradient(circle, #c8cfe0 0.4px, transparent 0.4px) 20% 92%;
    background-size: 200px 200px;
    background-color: #0a1628;
    opacity: 0.6;
}

/* Twinkling stars overlay - generated by JS */
.twinkle-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #c8cfe0;
    border-radius: 50%;
    animation: twinkle var(--duration, 3s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

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

/* ===== MASONRY CONTAINER ===== */
.masonry-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@supports (grid-template-rows: masonry) {
    .masonry-container {
        grid-template-rows: masonry;
    }
}

/* ===== MASONRY BLOCK BASE ===== */
.masonry-block {
    position: relative;
    border-radius: 2px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease,
                opacity 0.6s ease;
    will-change: transform;
}

.masonry-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.masonry-block:hover {
    transform: scale(1.04);
    z-index: 10;
    box-shadow: 0 0 30px rgba(232, 213, 160, 0.15),
                0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ===== COMPASS BLOCK ===== */
.compass-block {
    border-color: rgba(184, 150, 62, 0.2); /* #b8963e with alpha */
    background: radial-gradient(ellipse at center, #162244 0%, #0a1628 70%);
    border: 1px solid rgba(200, 180, 120, 0.15);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}

.compass-rose {
    width: 180px;
    height: 180px;
    margin-bottom: 1rem;
}

.compass-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: #f0f2f8;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.compass-subtitle {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.65rem, 0.9vw, 0.8rem);
    color: #7a8fa8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ===== ATLAS BLOCK ===== */
.atlas-block {
    background: radial-gradient(ellipse at center, #162244 0%, #0a1628 70%);
    border: 1px solid rgba(200, 180, 120, 0.15);
    padding: 1.5rem;
    min-height: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.atlas-label {
    align-self: flex-start;
    margin-bottom: 0.5rem;
}

.botanical-svg {
    width: 100%;
    max-width: 260px;
    height: auto;
    flex: 1;
}

.atlas-caption {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: clamp(0.8rem, 1vw, 0.95rem);
    color: #7a8fa8;
    margin-top: 1rem;
    text-align: center;
}

/* Botanical path drawing animation */
.botanical-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 2s cubic-bezier(0.23, 1, 0.32, 1);
}

.botanical-path.stem {
    transition-delay: 0s;
}

.botanical-path.branch {
    transition-delay: 0.3s;
}

.botanical-path.leaf {
    transition-delay: 0.6s;
}

.botanical-path.root {
    transition-delay: 0.9s;
}

.atlas-block.drawn .botanical-path {
    stroke-dashoffset: 0;
}

/* ===== DATUM BLOCK ===== */
.datum-block {
    background: #0d1b30;
    box-shadow: 0 0 20px rgba(10, 22, 40, 0.6);
    padding: 2rem 1.5rem;
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.datum-word {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    color: #f0f2f8;
    letter-spacing: -0.02em;
    line-height: 1;
}

.datum-accent {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 60px;
    height: 40px;
    opacity: 0.7;
}

/* ===== CONSTELLATION BLOCK ===== */
.constellation-block {
    background: transparent;
    padding: 1.5rem;
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.constellation-svg {
    width: 100%;
    height: auto;
    flex: 1;
}

.constellation-label {
    margin-top: 0.75rem;
    text-align: center;
}

/* Celestial slow drift animation */
.celestial-drift {
    animation: celestialDrift 300s linear infinite;
}

@keyframes celestialDrift {
    to { transform: rotate(360deg); }
}

/* ===== NARRATIVE BLOCK ===== */
.narrative-block {
    background: #0f1f38;
    padding: 2rem 2rem 2rem 2.5rem;
    min-height: 300px;
    position: relative;
    display: flex;
}

.narrative-vine {
    position: absolute;
    left: 0;
    top: 0;
    width: 20px;
    height: 100%;
}

.narrative-vine svg {
    width: 100%;
    height: 100%;
}

.narrative-text {
    flex: 1;
    padding-left: 0.5rem;
}

.narrative-text p {
    margin-bottom: 1rem;
    color: #c8cfe0;
}

.narrative-text p:last-child {
    margin-bottom: 0;
}

/* Drop cap */
.drop-cap {
    float: left;
    font-size: 3.5em;
    line-height: 0.8;
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: #e8d5a0;
    margin-right: 0.1em;
    margin-top: 0.05em;
}

/* ===== PULSE BLOCK ===== */
.pulse-block {
    background: #0a1628;
    padding: 1.5rem;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.pulse-flower {
    margin-bottom: 0.5rem;
}

.bloom-svg {
    width: 80px;
    height: 80px;
}

.pulse-block:nth-child(odd) .bloom-svg {
    width: 100px;
    height: 50px;
}

.bloom-petals .petal {
    transform-origin: 0 0;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.pulse-block.bloomed .bloom-petals .petal {
    opacity: 1;
}

.pulse-block.bloomed .bloom-petals .petal:nth-child(1) { transition-delay: 0s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(2) { transition-delay: 0.1s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(3) { transition-delay: 0.2s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(4) { transition-delay: 0.3s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(5) { transition-delay: 0.4s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(6) { transition-delay: 0.5s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(7) { transition-delay: 0.6s; }
.pulse-block.bloomed .bloom-petals .petal:nth-child(8) { transition-delay: 0.7s; }

/* Growth line animation */
.growth-line {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.pulse-block.bloomed .growth-line {
    stroke-dashoffset: 0;
}

.pulse-label {
    font-size: clamp(0.6rem, 0.8vw, 0.75rem);
    color: #7a8fa8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ===== IBM PLEX MONO UTILITY ===== */
.ibm-mono {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    color: #7a8fa8;
    letter-spacing: 0.04em;
}

/* ===== FOOTER DISSOLUTION ===== */
.footer-dissolution {
    position: relative;
    z-index: 1;
    padding: 0 2rem 4rem;
    text-align: center;
}

.footer-dissolution::before {
    content: '';
    display: block;
    height: 200px;
    background: linear-gradient(to bottom, transparent 0%, #050d1a 100%);
    pointer-events: none;
}

.footer-stars {
    position: relative;
    height: 80px;
}

.footer-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: rgba(200, 207, 224, 0.3);
}

/* Footer star points */
.footer-star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: #c8cfe0;
    border-radius: 50%;
    animation: twinkle var(--duration, 4s) ease-in-out infinite;
    animation-delay: var(--delay, 0s);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .masonry-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
        padding: 1.5rem;
    }
}

@media (max-width: 640px) {
    .masonry-container {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }

    .datum-word {
        font-size: clamp(2rem, 10vw, 3rem);
    }

    .compass-rose {
        width: 140px;
        height: 140px;
    }

    .atlas-block {
        min-height: 300px;
    }

    .narrative-block {
        padding: 1.5rem 1.5rem 1.5rem 2rem;
    }

    .drop-cap {
        font-size: 2.8em;
    }
}

/* Additional color usage for #b8963e and #d4a05a */
.atlas-caption .ibm-mono {
    color: #d4a05a;
}

.compass-rose:hover {
    filter: drop-shadow(0 0 8px rgba(184, 150, 62, 0.3));
}

.datum-block:hover .datum-word {
    text-shadow: 0 0 20px rgba(232, 213, 160, 0.2);
}

.narrative-text em,
.narrative-text strong {
    color: #e8d5a0;
    font-style: italic;
}

/* Star transition smoothness */
.star {
    transition: transform 0.15s ease-out;
}
