/* ==============================================
   multipledger.com - Aurora Gradient / Inflated 3D
   ============================================== */

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: #0A0E18;
    color: #F0F0F0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.6vw, 1.1rem);
    line-height: 1.8;
    overflow-x: hidden;
    position: relative;
}

/* --- Aurora Background --- */
#aurora-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #40D8A0, #30A8B0, #8060C0, #D060A0, #4080D0, #40D8A0);
    background-size: 300% 300%;
    animation: aurora 20s ease infinite;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

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

/* --- Main Column --- */
#main-column {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

/* --- Ledger Sections --- */
.ledger-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 4rem 0;
}

.section-aurora {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #40D8A0, #30A8B0, #8060C0, #D060A0, #4080D0, #40D8A0);
    background-size: 300% 300%;
    animation: aurora 20s ease infinite;
    opacity: var(--aurora-intensity, 0.1);
    pointer-events: none;
    z-index: -1;
    transition: opacity 0.5s ease;
}

#ledger-1 .section-aurora { opacity: 0.1; animation-delay: 0s; }
#ledger-2 .section-aurora { opacity: 0.15; animation-delay: -5s; }
#ledger-3 .section-aurora { opacity: 0.2; animation-delay: -10s; }
#ledger-4 .section-aurora { opacity: 0.25; animation-delay: -15s; }

/* --- Content Width Breathing --- */
.content-wide {
    max-width: 90%;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.content-narrow {
    max-width: 50%;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

/* --- Typography --- */
h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: clamp(2.4rem, 7vw, 5rem);
    letter-spacing: 0.02em;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
}

h2 {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(1.4rem, 3.5vw, 2.4rem);
    letter-spacing: 0.01em;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.5rem;
}

p {
    color: rgba(240, 240, 240, 0.85);
    margin-bottom: 1rem;
}

/* --- Typewriter Text --- */
.typewriter-text {
    font-family: 'Courier Prime', monospace;
    font-weight: 400;
    font-size: clamp(0.9rem, 1.5vw, 1.05rem);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.8;
    min-height: 1.8em;
    position: relative;
    text-align: left;
    margin-bottom: 1.5rem;
}

.typewriter-text .tw-char {
    opacity: 0;
    transition: opacity 0.05s ease;
}

.typewriter-text .tw-char.visible {
    opacity: 1;
}

.typewriter-text.typing::after {
    content: '|';
    color: #40D8A0;
    animation: blink 1s step-end infinite;
    font-weight: 700;
}

.typewriter-text.done::after {
    content: '';
}

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

/* --- Inflated Book (Ledger I) --- */
.inflated-book {
    position: relative;
    width: 220px;
    height: 280px;
    margin: 0 auto 3rem;
    animation: bob 4s ease-in-out infinite;
}

.book-outer {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 20px 8px 8px 20px;
    background: linear-gradient(135deg, #40D8A0, #30A8B0, #8060C0, #D060A0, #4080D0, #40D8A0);
    background-size: 300% 300%;
    animation: aurora 20s ease infinite;
    box-shadow:
        inset 0 -15px 30px rgba(0, 0, 0, 0.2),
        inset 0 15px 30px rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.book-inner {
    position: absolute;
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    box-shadow:
        inset 0 -8px 20px rgba(0, 0, 0, 0.1),
        inset 0 8px 20px rgba(255, 255, 255, 0.05);
}

.book-spine-lines {
    position: absolute;
    top: 20%;
    left: -12px;
    width: 8px;
    height: 60%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-spine-lines::before,
.book-spine-lines::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 1px;
}

.book-page-edge {
    position: absolute;
    top: 10%;
    right: -4px;
    width: 4px;
    height: 80%;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.15) 0px,
        rgba(255, 255, 255, 0.15) 1px,
        transparent 1px,
        transparent 4px
    );
    border-radius: 0 2px 2px 0;
}

.book-shadow {
    position: absolute;
    bottom: -20px;
    left: 10%;
    width: 80%;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 0, 0, 0.3), transparent);
    filter: blur(8px);
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* --- Inflated Cards (Ledger II) --- */
.ledger-cards {
    max-width: 90%;
    width: 100%;
    margin: 2rem auto 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.inflated-card {
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 -10px 25px rgba(0, 0, 0, 0.15),
        inset 0 10px 25px rgba(255, 255, 255, 0.05),
        0 15px 50px rgba(0, 0, 0, 0.25);
    padding: 3rem;
    transition: transform 0.4s ease;
    position: relative;
    overflow: hidden;
}

.inflated-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 30px;
    background: linear-gradient(135deg, #40D8A0, #30A8B0, #8060C0, #D060A0, #4080D0, #40D8A0);
    background-size: 300% 300%;
    animation: aurora 20s ease infinite;
    opacity: 0.12;
    z-index: -1;
}

.inflated-card:hover {
    transform: scale(1.02);
}

.inflated-card[data-aurora-phase="0"]::before { animation-delay: 0s; }
.inflated-card[data-aurora-phase="1"]::before { animation-delay: -7s; }
.inflated-card[data-aurora-phase="2"]::before { animation-delay: -14s; }

.card-left {
    transform: translateX(-40px);
}

.card-right {
    transform: translateX(40px);
}

.card-left:hover {
    transform: translateX(-40px) scale(1.02);
}

.card-right:hover {
    transform: translateX(40px) scale(1.02);
}

.card-body {
    font-family: 'Inter', sans-serif;
    color: rgba(240, 240, 240, 0.85);
}

/* --- Depth Container (Ledger III) --- */
.depth-container {
    perspective: 1000px;
    position: relative;
    width: 300px;
    height: 260px;
    margin: 2rem auto 3rem;
}

.depth-card {
    position: absolute;
    width: 260px;
    height: 160px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        inset 0 -8px 20px rgba(0, 0, 0, 0.15),
        inset 0 8px 20px rgba(255, 255, 255, 0.05),
        0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    left: 50%;
    margin-left: -130px;
    overflow: hidden;
}

.depth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, #40D8A0, #30A8B0, #8060C0, #D060A0, #4080D0, #40D8A0);
    background-size: 300% 300%;
    animation: aurora 20s ease infinite;
    opacity: 0.15;
    z-index: -1;
}

.depth-card-1 {
    transform: translateZ(0px) translateY(80px);
    z-index: 1;
}
.depth-card-1::before { animation-delay: 0s; }

.depth-card-2 {
    transform: translateZ(30px) translateY(40px);
    z-index: 2;
}
.depth-card-2::before { animation-delay: -7s; }

.depth-card-3 {
    transform: translateZ(60px) translateY(0px);
    z-index: 3;
}
.depth-card-3::before { animation-delay: -14s; }

.depth-label {
    font-family: 'Courier Prime', monospace;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    z-index: 1;
}

.depth-glow {
    position: absolute;
    bottom: -2px;
    left: 10%;
    width: 80%;
    height: 4px;
    background: rgba(64, 216, 160, 0.4);
    filter: blur(6px);
    border-radius: 2px;
}

.convergence-text {
    font-family: 'Inter', sans-serif;
    color: rgba(240, 240, 240, 0.85);
    margin-top: 1rem;
}

/* --- Inflated Sphere (Ledger IV) --- */
.inflated-sphere {
    width: 200px;
    height: 200px;
    margin: 0 auto 3rem;
    position: relative;
    animation: bob 5s ease-in-out infinite;
}

.sphere-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #40D8A0, #30A8B0, #8060C0, #D060A0, #4080D0, #40D8A0);
    background-size: 300% 300%;
    animation: aurora 20s ease infinite;
    box-shadow:
        inset 0 -30px 60px rgba(0, 0, 0, 0.3),
        inset 0 30px 60px rgba(255, 255, 255, 0.1),
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 0 80px rgba(64, 216, 160, 0.15);
}

.sphere-highlight {
    position: absolute;
    top: 15%;
    left: 25%;
    width: 30%;
    height: 20%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(-20deg);
}

/* --- Scroll-linked aurora intensity --- */
body {
    --scroll-progress: 0;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-narrow {
        max-width: 85%;
    }

    .content-wide {
        max-width: 95%;
    }

    .card-left {
        transform: translateX(-15px);
    }

    .card-right {
        transform: translateX(15px);
    }

    .card-left:hover {
        transform: translateX(-15px) scale(1.02);
    }

    .card-right:hover {
        transform: translateX(15px) scale(1.02);
    }

    .inflated-card {
        padding: 2rem;
    }

    .inflated-book {
        width: 160px;
        height: 210px;
    }

    .inflated-sphere {
        width: 150px;
        height: 150px;
    }

    .depth-container {
        width: 240px;
        height: 220px;
    }

    .depth-card {
        width: 200px;
        height: 130px;
        margin-left: -100px;
    }
}

@media (max-width: 480px) {
    .content-narrow {
        max-width: 92%;
    }

    .inflated-card {
        padding: 1.5rem;
        border-radius: 20px;
    }

    .card-left,
    .card-right {
        transform: translateX(0);
    }

    .card-left:hover,
    .card-right:hover {
        transform: scale(1.02);
    }
}
