/* ============================================================
   lump.dev — Styles
   A digital monograph on the philosophy of shapelessness
   ============================================================ */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Source Sans 3', 'Source Sans Pro', sans-serif;
    font-weight: 400;
    color: #D4CFC0;
    background-color: #1B3A2D;
    line-height: 1.7;
    overflow-x: hidden;
}

::selection {
    background-color: #5B8C5A;
    color: #F4EFE1;
}

/* --- Running Header (Fixed) --- */
.running-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    padding: 10px 4vw;
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 11px;
    color: #D4CFC0;
    background-color: rgba(27, 58, 45, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.running-header.visible {
    opacity: 1;
    pointer-events: auto;
}

.running-header-left,
.running-header-right {
    letter-spacing: 0.03em;
}

/* --- Frontispiece --- */
.frontispiece {
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 12vw;
    background-color: #1B3A2D;
    position: relative;
}

.frontispiece-content {
    max-width: 70vw;
}

.frontispiece-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 20vw;
    color: #F4EFE1;
    letter-spacing: 0.04em;
    line-height: 0.9;
    text-transform: uppercase;
}

.frontispiece-rule {
    width: 40vw;
    height: 1px;
    background-color: #C4A35A;
    margin: 3vh 0;
    animation: goldShimmer 8s ease-in-out infinite;
}

.frontispiece-subtitle {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 18px;
    color: #D4CFC0;
    letter-spacing: 0.02em;
    max-width: 500px;
    line-height: 1.6;
}

/* --- Book Layout (Spine + Content) --- */
.book-layout {
    display: flex;
    position: relative;
    min-height: 100vh;
}

/* --- The Spine --- */
.spine {
    width: 30%;
    position: sticky;
    top: 0;
    height: 100vh;
    background-color: #2D5A3E;
    flex-shrink: 0;
    overflow: hidden;
}

.spine-inner {
    position: relative;
    width: 100%;
    height: 100%;
}

.spine-gradient-overlay {
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 200%;
    background: linear-gradient(
        to top,
        transparent 0%,
        transparent 40%,
        rgba(58, 122, 80, 0.2) 50%,
        transparent 60%,
        transparent 100%
    );
    animation: spinePulse 30s linear infinite;
}

.spine-annotation {
    position: absolute;
    left: 50%;
    transform: translateX(-50%) rotate(-90deg);
    white-space: nowrap;
}

.spine-label {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    color: #C4A35A;
    letter-spacing: 0.05em;
    animation: goldShimmer 8s ease-in-out infinite;
}

.spine-lump-medium {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background-color: #3A7A50;
    border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    border: 1px solid #C4A35A;
    animation: breathingLump 12s ease-in-out infinite;
}

/* --- Content Area --- */
.content {
    width: 70%;
    min-height: 100vh;
}

/* --- Chapter Interstitials --- */
.chapter-interstitial {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 8vw 8vw 8vw 8vw;
    background-color: #1B3A2D;
    position: relative;
    overflow: hidden;
}

.chapter-interstitial-light {
    background-color: #F4EFE1;
}

.interstitial-inner {
    position: relative;
    z-index: 2;
}

.chapter-number {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 15vw;
    color: #F4EFE1;
    letter-spacing: 0.04em;
    line-height: 1;
    display: block;
    margin-bottom: 3vh;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1.5s ease, transform 1.5s ease;
}

.chapter-number.visible {
    opacity: 1;
    transform: translateY(0);
}

.chapter-interstitial-light .chapter-number {
    color: #1B3A2D;
}

.chapter-abstract {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 18px;
    color: #D4CFC0;
    max-width: 500px;
    line-height: 1.6;
}

.chapter-interstitial-light .chapter-abstract {
    color: #3A3A32;
}

.interstitial-lump {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    width: 200px;
    height: 200px;
    background-color: #2D5A3E;
    border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    border: 1px solid #C4A35A;
    animation: breathingLumpMonumental 12s ease-in-out infinite;
    z-index: 1;
}

.interstitial-lump-dark {
    background-color: #1B3A2D;
}

/* --- Chapter Content --- */
.chapter {
    padding: 10vh 12vw 10vh 8vw;
    background-color: #1B3A2D;
    position: relative;
}

.chapter-light {
    background-color: #F4EFE1;
}

.chapter-heading {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 48px;
    color: #F4EFE1;
    letter-spacing: 0.04em;
    margin-bottom: 5vh;
    line-height: 1.15;
}

.chapter-heading-dark {
    color: #1B3A2D;
}

/* --- Drop Caps --- */
.drop-cap {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 72px;
    float: left;
    line-height: 0.8;
    margin-right: 16px;
    margin-top: 6px;
    color: #C4A35A;
    animation: goldShimmer 8s ease-in-out infinite;
}

.drop-cap-on-light {
    color: #C4A35A;
}

/* --- Body Text --- */
.chapter p {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.7;
    color: #D4CFC0;
    margin-bottom: 2em;
    max-width: 640px;
}

.chapter-text-dark {
    color: #3A3A32 !important;
}

.chapter p em {
    font-style: italic;
}

.chapter p strong {
    font-weight: 700;
    color: #F4EFE1;
}

.chapter-light p strong {
    color: #1B3A2D;
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 28px;
    line-height: 1.5;
    color: #F4EFE1;
    margin: 4vh 0 4vh 4vw;
    padding-left: 2vw;
    border-left: 3px solid #C4A35A;
    max-width: 560px;
}

.pull-quote-dark {
    color: #1B3A2D;
}

/* --- Footnote Markers --- */
.footnote-marker {
    color: #C4A35A;
    font-size: 0.75em;
    vertical-align: super;
    cursor: default;
    animation: goldShimmer 8s ease-in-out infinite;
}

.footnote-marker-dark {
    color: #C4A35A;
}

/* --- Figure Frames --- */
.figure-frame {
    margin: 4vh 0;
    max-width: 500px;
}

.figure-empty {
    width: 100%;
    height: 200px;
    border: 2px solid #B8A88A;
    background-color: #1B3A2D;
}

.figure-frame-dark .figure-empty,
.figure-empty-dark {
    background-color: #F4EFE1;
    border-color: #B8A88A;
}

.figure-caption {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-style: italic;
    font-size: 13px;
    color: #C4A35A;
    margin-top: 1em;
    line-height: 1.5;
    animation: goldShimmer 8s ease-in-out infinite;
}

.figure-caption-dark {
    color: #B8A88A;
}

/* --- Footnotes --- */
.footnotes {
    margin-top: 6vh;
    padding-top: 3vh;
    max-width: 50%;
    margin-left: auto;
}

.footnote-divider {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 3vh;
}

.footnote {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 13px !important;
    color: #D4CFC0 !important;
    line-height: 1.6;
    margin-bottom: 1.2em !important;
}

.footnote-dark {
    color: #3A3A32 !important;
}

.footnote sup {
    color: #C4A35A;
    font-weight: 400;
    margin-right: 4px;
}

/* --- Lump Dingbats --- */
.lump-dingbat {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-color: #C4A35A;
    border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    animation: goldShimmer 8s ease-in-out infinite;
}

.lump-dingbat-large {
    width: 40px;
    height: 40px;
}

/* --- Colophon --- */
.colophon {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #F4EFE1;
    padding: 8vh 8vw;
}

.colophon-content {
    text-align: center;
    max-width: 460px;
}

.colophon-ornament {
    margin-bottom: 4vh;
    display: flex;
    justify-content: center;
}

.colophon-title {
    font-family: 'Bitter', serif;
    font-weight: 700;
    font-size: 24px;
    color: #1B3A2D;
    letter-spacing: 0.04em;
    margin-bottom: 3vh;
    text-transform: uppercase;
}

.colophon-text {
    font-family: 'Source Sans 3', sans-serif;
    font-weight: 300;
    font-size: 14px !important;
    color: #3A3A32 !important;
    line-height: 1.7;
    margin-bottom: 1.5em !important;
}

.colophon-date {
    font-family: 'Bitter', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 14px !important;
    color: #C4A35A !important;
    letter-spacing: 0.06em;
    margin-top: 4vh;
    animation: goldShimmer 8s ease-in-out infinite;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

/* Breathing Lump — Medium (40px) */
@keyframes breathingLump {
    0% {
        border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    }
    25% {
        border-radius: 50% 50% 45% 55% / 52% 48% 53% 47%;
    }
    50% {
        border-radius: 44% 56% 48% 52% / 50% 50% 46% 54%;
    }
    75% {
        border-radius: 52% 48% 44% 56% / 53% 47% 51% 49%;
    }
    100% {
        border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    }
}

/* Breathing Lump — Monumental (200px) */
@keyframes breathingLumpMonumental {
    0% {
        border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    }
    20% {
        border-radius: 52% 48% 46% 54% / 50% 50% 53% 47%;
    }
    40% {
        border-radius: 45% 55% 50% 50% / 48% 52% 46% 54%;
    }
    60% {
        border-radius: 50% 50% 44% 56% / 53% 47% 49% 51%;
    }
    80% {
        border-radius: 48% 52% 47% 53% / 51% 49% 52% 48%;
    }
    100% {
        border-radius: 47% 53% 42% 58% / 55% 45% 50% 50%;
    }
}

/* Spine Pulse — slow vertical gradient drift */
@keyframes spinePulse {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(50%);
    }
}

/* Gold Shimmer — subtle opacity fluctuation */
@keyframes goldShimmer {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.85;
    }
    100% {
        opacity: 1;
    }
}

/* ============================================================
   RESPONSIVE (basic)
   ============================================================ */

@media (max-width: 900px) {
    .spine {
        width: 15%;
    }

    .content {
        width: 85%;
    }

    .chapter {
        padding: 8vh 6vw 8vh 4vw;
    }

    .chapter-interstitial {
        padding: 6vw;
    }

    .frontispiece {
        padding-left: 6vw;
    }

    .frontispiece-title {
        font-size: 25vw;
    }

    .chapter-heading {
        font-size: 36px;
    }

    .chapter-number {
        font-size: 20vw;
    }

    .footnotes {
        max-width: 80%;
    }

    .interstitial-lump {
        width: 120px;
        height: 120px;
    }

    .spine-annotation {
        display: none;
    }

    .spine-lump-medium {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 600px) {
    .book-layout {
        flex-direction: column;
    }

    .spine {
        width: 100%;
        height: 60px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .spine-inner {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 20px;
    }

    .spine-annotation {
        position: static;
        transform: none;
        display: inline-block;
    }

    .spine-lump-medium {
        position: static;
        transform: none;
        display: inline-block;
    }

    .spine-gradient-overlay {
        display: none;
    }

    .content {
        width: 100%;
    }

    .chapter {
        padding: 6vh 6vw;
    }

    .frontispiece-title {
        font-size: 30vw;
    }

    .chapter-heading {
        font-size: 28px;
    }

    .pull-quote {
        font-size: 22px;
    }

    .footnotes {
        max-width: 100%;
    }

    .interstitial-lump {
        width: 80px;
        height: 80px;
        right: 5%;
    }

    .running-header {
        display: none;
    }
}
