/* ============================================================
   cbdc.bar - Sovereign Digital Treasury
   Aurora Gradient on Absolute Dark
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    background: #06090F;
    overflow-x: hidden;
}

body {
    font-family: 'IBM Plex Mono', monospace;
    background: #06090F;
    color: #B8C6D4;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- CRT Scanline Overlay --- */
#crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px,
        transparent 1px,
        rgba(0, 0, 0, 0.08) 1px,
        rgba(0, 0, 0, 0.08) 2px
    );
    opacity: 0.4;
}

/* --- Section Counter --- */
#section-counter {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #2A3A4A;
    z-index: 100;
    letter-spacing: 0.05em;
}

/* --- Floating Aurora Accents --- */
.aurora-accent {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    filter: blur(80px);
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.aurora-accent-left {
    left: 5%;
    top: 30%;
    background: radial-gradient(circle, rgba(0, 232, 198, 0.08) 0%, transparent 70%);
}

.aurora-accent-right {
    right: 3%;
    top: 60%;
    background: radial-gradient(circle, rgba(123, 104, 238, 0.06) 0%, transparent 70%);
}

.aurora-accent.visible {
    opacity: 1;
}

/* --- Scene Base --- */
.scene {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* --- Punch Card Grid Texture --- */
.punch-card-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background-image:
        repeating-linear-gradient(
            to right,
            transparent,
            transparent 3px,
            transparent 3px,
            transparent 9px
        ),
        repeating-linear-gradient(
            to bottom,
            transparent,
            transparent 1px,
            transparent 1px,
            transparent 7px
        );
    opacity: 0.03;
}

.punch-card-grid::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(
        ellipse 3px 1px at center,
        #0C1420 0%,
        transparent 100%
    );
    background-size: 9px 7px;
    opacity: 0.5;
}

/* ============================================================
   Scene 1: Vault Gate
   ============================================================ */
.vault-gate {
    background: #06090F;
    flex-direction: column;
}

.vault-gate-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
}

/* Vault Door SVG */
.vault-door-svg {
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.vault-door-svg.revealed {
    opacity: 1;
}

/* Domain Title - character-by-character reveal */
.domain-title {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 48px;
    letter-spacing: 0.08em;
    color: #00E8C6;
    text-shadow: 0 0 40px rgba(0, 232, 198, 0.15);
    min-height: 1.2em;
    text-align: center;
}

.domain-title .char {
    display: inline-block;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.domain-title .char.visible {
    opacity: 1;
}

/* Tagline */
.tagline {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 0.04em;
    color: #E8D5A0;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
    text-align: center;
}

.tagline.visible {
    opacity: 1;
}

/* ============================================================
   Scene 2: Aurora Field
   ============================================================ */
.aurora-field {
    background: #06090F;
    overflow: hidden;
}

.aurora-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 300%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(
        135deg,
        rgba(61, 236, 133, 0.12) 0%,
        rgba(0, 232, 198, 0.15) 15%,
        rgba(6, 9, 15, 0.95) 30%,
        rgba(123, 104, 238, 0.12) 50%,
        rgba(6, 9, 15, 0.95) 65%,
        rgba(232, 85, 160, 0.1) 80%,
        rgba(61, 236, 133, 0.12) 100%
    );
    animation: auroraShift 20s linear infinite;
}

.aurora-bg-alt {
    background: linear-gradient(
        225deg,
        rgba(232, 85, 160, 0.1) 0%,
        rgba(123, 104, 238, 0.15) 20%,
        rgba(6, 9, 15, 0.95) 35%,
        rgba(0, 232, 198, 0.12) 55%,
        rgba(6, 9, 15, 0.95) 70%,
        rgba(61, 236, 133, 0.1) 85%,
        rgba(232, 85, 160, 0.1) 100%
    );
    animation: auroraShiftReverse 24s linear infinite;
}

@keyframes auroraShift {
    0% { transform: translateX(0); }
    100% { transform: translateX(-66.666%); }
}

@keyframes auroraShiftReverse {
    0% { transform: translateX(-66.666%); }
    100% { transform: translateX(0); }
}

.aurora-field-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mandala-illustration,
.ledger-illustration {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mandala-illustration.revealed,
.ledger-illustration.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Slow rotation for mandala */
.mandala-illustration.revealed {
    animation: slowRotate 120s linear infinite;
}

@keyframes slowRotate {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(0) rotate(360deg); }
}

/* ============================================================
   Scene 3 & 5: Ledger Spread
   ============================================================ */
.ledger-spread {
    background: #06090F;
    padding: 8rem 0;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.ledger-content {
    position: relative;
    z-index: 2;
    width: 72ch;
    max-width: 90%;
    margin-left: 28%;
    margin-right: 18%;
    padding: 8rem 0;
}

@media (max-width: 1200px) {
    .ledger-content {
        margin-left: auto;
        margin-right: auto;
        max-width: 72ch;
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* Mainframe Indicator Dots */
.mainframe-indicators {
    position: absolute;
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 1200px) {
    .mainframe-indicators {
        left: 1rem;
    }
}

.indicator-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #00E8C6;
    opacity: 0.3;
    transition: opacity 0.5s, background 2s;
}

.indicator-dot.active {
    opacity: 1;
}

/* Skeleton Loading */
.skeleton-loader {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.skeleton-loader[data-revealed="true"] {
    opacity: 0;
    pointer-events: none;
    position: absolute;
}

.skeleton-bar {
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        #3DEC85 0%,
        #00E8C6 35%,
        #7B68EE 70%,
        #E855A0 100%
    );
    background-size: 300% 100%;
    animation: skeletonPulse 3s ease-in-out infinite;
    opacity: 0.15;
}

.skeleton-bar:nth-child(1) { width: 85%; }
.skeleton-bar:nth-child(2) { width: 72%; animation-delay: 0.3s; }
.skeleton-bar:nth-child(3) { width: 60%; animation-delay: 0.6s; }

@keyframes skeletonPulse {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ledger Text Content */
.ledger-text {
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.ledger-text[data-revealed="true"] {
    opacity: 1;
}

/* Section Headings */
.section-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 42px;
    letter-spacing: 0.08em;
    color: #00E8C6;
    text-shadow: 0 0 40px rgba(0, 232, 198, 0.15);
    margin-bottom: 2rem;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .section-heading {
        font-size: 28px;
    }
}

/* Ticker Tape Borders */
.ticker-tape {
    font-family: 'Share Tech Mono', monospace;
    font-size: 14px;
    color: #2A3A4A;
    margin: 2.5rem 0;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: 0.02em;
    user-select: none;
}

/* Ledger Body Text */
.ledger-body {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 16px;
    line-height: 3.2rem;
    color: #B8C6D4;
    margin-bottom: 2rem;
    max-width: 72ch;
}

/* Data Labels */
.data-label {
    font-family: 'Share Tech Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #7B68EE;
    letter-spacing: 0.12em;
    margin: 2rem 0 1rem;
    text-transform: uppercase;
}

/* ============================================================
   Scene 4: Vault Gate (Transition)
   ============================================================ */
.hash-illustration {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1),
                transform 2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hash-illustration.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Scene 7: Final Vault Gate
   ============================================================ */
.vault-gate-final {
    min-height: 100vh;
}

.final-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 96px;
    letter-spacing: 0.04em;
    color: #E8D5A0;
    text-align: center;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 2.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 2.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.final-title.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .final-title {
        font-size: 48px;
    }
}

.closing-inscription {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: 14px;
    color: #2A3A4A;
    text-align: center;
    letter-spacing: 0.06em;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s,
                transform 2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s;
}

.closing-inscription.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Scroll Reveal Base
   ============================================================ */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   Spacing & Layout Utilities
   ============================================================ */

/* Minimum 16rem between major sections - via scene padding */
.scene + .scene {
    margin-top: 0;
}

/* Ensure vast negative space in Vault Gates */
.vault-gate {
    padding: 8rem 0;
}

.vault-gate-content {
    max-width: 30%;
}

@media (max-width: 768px) {
    .vault-gate-content {
        max-width: 80%;
    }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
    .domain-title {
        font-size: 32px;
    }

    .tagline {
        font-size: 18px;
    }

    .section-heading {
        font-size: 24px;
    }

    .ledger-body {
        font-size: 14px;
        line-height: 2.6rem;
    }

    .final-title {
        font-size: 36px;
    }

    #section-counter {
        bottom: 1rem;
        right: 1rem;
    }
}
