/* ==========================================================
   cbdc.bar — Monetary Observatory
   Design: Aurora-gradient, light-academia, dashboard layout
   ========================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: #0d0b1a;
    color: #f5f0e6;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    overflow-x: hidden;
}

/* --- Typography --- */
h1, h2, h3 {
    font-family: 'Barlow Condensed', 'Arial Narrow', sans-serif;
    font-weight: 600;
    text-transform: uppercase;
    color: #f5f0e6;
}

/* --- HERO SECTION --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background: linear-gradient(135deg, #0d0b1a 0%, #1a1140 25%, #0d2a3a 50%, #0d1a2e 75%, #1a0d2e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Aurora Blob Shapes */
.aurora-blob {
    position: absolute;
    width: 55vw;
    height: 55vw;
    max-width: 700px;
    max-height: 700px;
    opacity: 0;
    will-change: transform, opacity;
    pointer-events: none;
}

.blob-green {
    top: 5%;
    left: -10%;
    animation: morphBlob1 23s ease-in-out infinite;
}

.blob-violet {
    top: 20%;
    right: -15%;
    animation: morphBlob2 29s ease-in-out infinite;
}

.blob-cyan {
    bottom: -10%;
    left: 25%;
    animation: morphBlob3 17s ease-in-out infinite;
}

/* Blob morph keyframes */
@keyframes morphBlob1 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(30px, -20px) scale(1.05) rotate(5deg); }
    50% { transform: translate(-20px, 30px) scale(0.95) rotate(-3deg); }
    75% { transform: translate(15px, 15px) scale(1.03) rotate(2deg); }
}

@keyframes morphBlob2 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(-25px, 20px) scale(1.04) rotate(-4deg); }
    50% { transform: translate(35px, -15px) scale(0.96) rotate(6deg); }
    75% { transform: translate(-10px, -25px) scale(1.02) rotate(-2deg); }
}

@keyframes morphBlob3 {
    0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
    25% { transform: translate(20px, 25px) scale(0.97) rotate(3deg); }
    50% { transform: translate(-30px, -10px) scale(1.06) rotate(-5deg); }
    75% { transform: translate(10px, -20px) scale(1.01) rotate(1deg); }
}

/* Blob fade-in animation */
.aurora-blob.visible {
    opacity: 1;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hero Content */
#hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    /* Positioned at the golden ratio from the top */
    margin-top: 23.6vh; /* 100vh * 0.618 from top, offset for centering */
    opacity: 0;
    transform: scale(0.85);
}

#hero-content.visible {
    opacity: 1;
    transform: scale(1);
    animation: bounceEnter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes bounceEnter {
    0% { opacity: 0; transform: scale(0.85); }
    60% { opacity: 1; transform: scale(1.02); }
    100% { opacity: 1; transform: scale(1); }
}

#hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    letter-spacing: 0.3em;
    font-weight: 600;
    color: #f5f0e6;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

#guilloche-line {
    width: clamp(200px, 30vw, 400px);
    height: auto;
    margin: 0.75rem auto;
    display: block;
}

.guilloche-path,
.guilloche-path-2 {
    stroke-dasharray: 500;
    stroke-dashoffset: 500;
}

.guilloche-path.animate {
    animation: drawLine 1.5s ease-out forwards;
}

.guilloche-path-2.animate {
    animation: drawLine 1.5s ease-out 0.2s forwards;
}

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

#hero-subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.9rem, 1.5vw, 1.2rem);
    color: #c9a84c;
    letter-spacing: 0.1em;
    margin-top: 0.75rem;
    opacity: 0;
}

#hero-subtitle.visible {
    animation: fadeIn 800ms ease-out forwards;
}

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


/* --- LEDGER STRIPS --- */
.ledger-strip {
    width: 100%;
    height: 4rem;
    background-color: #0d0b1a;
    overflow: hidden;
    position: relative;
    border-top: 1px solid rgba(42, 36, 64, 0.4);
    border-bottom: 1px solid rgba(42, 36, 64, 0.4);
    display: flex;
    align-items: center;
    mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 10%, black 90%, transparent 100%);
}

.ledger-track {
    display: flex;
    gap: 4rem;
    white-space: nowrap;
    animation: scrollLedger 60s linear infinite;
}

.ledger-track-reverse {
    animation: scrollLedgerReverse 55s linear infinite;
}

.ledger-track span {
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: #7ee8b1;
    flex-shrink: 0;
}

@keyframes scrollLedger {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

@keyframes scrollLedgerReverse {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0); }
}


/* --- SCHOLARLY PANELS (Bento Grid) --- */
#panels {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.bento-grid {
    display: grid;
    grid-template-columns: 38.2% 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1px;
}

.panel {
    border: 1px solid #2a2440;
    background-color: rgba(26, 17, 64, 0.15);
    box-shadow: inset 0 2px 8px rgba(26, 20, 51, 0.15);
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    transition: background 300ms ease, border-color 300ms ease, transform 300ms ease;
    /* #1a1433 used in box-shadow for recessed vitrine effect */
}

.panel.revealed {
    opacity: 1;
    transform: translateY(0);
    animation: panelBounce 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

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

.panel:hover {
    background: linear-gradient(180deg, rgba(126,232,177,0.03), rgba(180,142,250,0.03));
    border-color: rgba(201, 168, 76, 0.6);
    transform: translateY(-2px);
    box-shadow: inset 0 2px 12px #1a1433;
}

.panel-inner {
    padding: 2rem;
    opacity: 0;
    transition: opacity 200ms ease;
}

.panel.revealed .panel-inner {
    opacity: 1;
    transition-delay: 200ms;
}

.panel-inner.panel-seal-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

/* Panel sizes */
.panel-large {
    grid-row: span 2;
}

.panel-heading {
    font-size: clamp(1.1rem, 2vw, 1.6rem);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: #f5f0e6;
    font-weight: 600;
    border-bottom: 1px solid rgba(180, 142, 250, 0.2);
    padding-bottom: 0.75rem;
    /* #b48efa Aurora Violet used as accent border on headings */
}

.panel-body {
    color: #f5f0e6;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    line-height: 1.75;
    max-width: 65ch;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
}

/* Drop caps */
.drop-cap {
    float: left;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 3.5em;
    line-height: 0.8;
    padding-right: 0.1em;
    padding-top: 0.05em;
    color: #c9a84c;
    font-weight: 500;
}

/* Data blocks inside panels */
.data-block {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(42, 36, 64, 0.3);
}

.data-block:last-child {
    border-bottom: none;
}

.data-label {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #5ec4d4;
}

.data-value {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: #7ee8b1;
}

/* Colophon marks */
.colophon-mark {
    display: block;
    width: 40px;
    height: 40px;
    margin: 1.5rem auto 0;
    opacity: 0.6;
}

/* Golden Seal */
.golden-seal {
    width: 100px;
    height: 100px;
    opacity: 0;
    transform: scale(0) rotate(-180deg);
    transition: opacity 400ms ease;
}

.golden-seal.revealed {
    animation: sealEntrance 800ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes sealEntrance {
    0% { opacity: 0; transform: scale(0) rotate(-180deg); }
    70% { opacity: 1; transform: scale(1.05) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.golden-seal.revealed + .seal-glow,
.golden-seal.glow {
    box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}


/* --- DEEP CONTENT SECTION --- */
#deep-content {
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.deep-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
}

.panel-wide {
    grid-column: span 2;
}

.panel-narrow-left,
.panel-narrow-right {
    grid-column: span 1;
}

/* Light panel variant (parchment background) */
.panel-narrow-left .panel-inner {
    background-color: rgba(245, 240, 230, 0.04);
}

.panel-narrow-left .panel-body {
    color: #f5f0e6;
}

/* Rose quartz accent on data labels for tertiary highlight */
.data-block:nth-child(even) .data-label {
    color: #d4a0b0;
}

/* Ink Dark for text on any light-background contexts */
.light-panel {
    background-color: #f5f0e6;
    color: #1e1b2e;
}


/* --- DOUBLE RULE --- */
.double-rule {
    border-top: 1px solid #c9a84c;
    border-bottom: 1px solid #c9a84c;
    height: 3px;
    background: transparent;
    margin: 0 4rem;
    opacity: 0.5;
}


/* --- READING ROOM FOOTER --- */
#reading-room {
    background-color: #0d0b1a;
    padding: 0;
    margin-top: 0;
}

.footer-content {
    padding: 6rem 4rem;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.footer-nav {
    margin-bottom: 3rem;
}

.footer-link {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #f5f0e6;
    opacity: 0.7;
    cursor: pointer;
    transition: color 300ms ease, opacity 300ms ease;
}

.footer-link:hover {
    color: #7ee8b1;
    opacity: 1;
}

.footer-divider {
    color: #c9a84c;
    margin: 0 1rem;
    opacity: 0.5;
}

.footer-seal {
    width: 60px;
    height: 60px;
    margin: 0 auto 2rem;
    display: block;
    opacity: 0.6;
}

.footer-colophon {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 400;
    font-style: italic;
    font-size: 1rem;
    color: #f5f0e6;
    opacity: 0.5;
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

.footer-year {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.3em;
    color: #c9a84c;
    opacity: 0.4;
}


/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .bento-grid {
        grid-template-columns: 1fr 1fr;
    }

    .panel-large {
        grid-row: span 1;
        grid-column: span 2;
    }

    .deep-grid {
        grid-template-columns: 1fr;
    }

    .panel-wide,
    .panel-narrow-left,
    .panel-narrow-right {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .bento-grid {
        grid-template-columns: 1fr;
    }

    .panel-large,
    .panel-top-right,
    .panel-mid-right,
    .panel-bottom-left,
    .panel-bottom-center,
    .panel-bottom-right {
        grid-column: span 1;
        grid-row: span 1;
    }

    #panels {
        padding: 2rem 1rem;
    }

    #deep-content {
        padding: 2rem 1rem;
    }

    .footer-content {
        padding: 4rem 2rem;
    }

    .double-rule {
        margin: 0 2rem;
    }

    #hero-title {
        letter-spacing: 0.2em;
    }

    .aurora-blob {
        width: 80vw;
        height: 80vw;
    }
}

@media (max-width: 480px) {
    #hero-content {
        margin-top: 35vh;
    }

    .footer-nav {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .footer-divider {
        display: none;
    }
}
