/* ========================================
   lungless.dev — Styles
   Earth-tone stacked sections, grain overlay,
   marble-classical motifs, underline-draw animations
   ======================================== */

/* --- 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 {
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    background: #E8DFD0;
    color: #6B5B4E;
}

/* --- Grain Overlay --- */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.08;
    filter: url(#grain);
    width: 100%;
    height: 100%;
}

/* --- Section Base --- */
.section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section-inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
}

/* --- Section Background Colors --- */
.section-parchment {
    background-color: #E8DFD0;
    color: #6B5B4E;
}

.section-sandstone {
    background-color: #C4B49A;
    color: #6B5B4E;
}

.section-kiln {
    background-color: #3D3530;
    color: #F0EBE0;
}

.section-charcoal {
    background-color: #2C2520;
    color: #F0EBE0;
}

/* --- Monument Sections --- */
.monument-section {
    display: flex;
    align-items: center;
    justify-content: center;
}

.monument-content {
    padding-left: 8.333%;
    width: 66.666%;
}

.monument-heading {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-size: clamp(80px, 14vw, 200px);
    letter-spacing: 0.04em;
    line-height: 0.95;
    margin-top: 24px;
    position: relative;
    display: inline-block;
}

/* Capital Letter Fragment — clip-path erosion */
.monument-heading.fragment {
    clip-path: inset(5% 15% 10% 0%);
    transition: clip-path 0.8s ease-out;
}

.monument-heading.fragment.revealed {
    clip-path: inset(0% 0% 0% 0%);
}

/* --- Underline Draw Animation --- */
.underline-draw {
    width: 0;
    height: 1px;
    background: #8B7355;
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    max-width: 1200px;
    margin: 0 auto;
    transition: width 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.underline-draw.animate {
    width: calc(100% - 48px);
}

/* Position underline-draw within section-inner */
.monument-section .section-inner {
    position: relative;
    padding-bottom: 40px;
}

.monument-section .underline-draw {
    position: absolute;
    bottom: 0;
    left: 0;
    right: auto;
    max-width: none;
}

.monument-section .underline-draw.animate {
    width: 100%;
}

/* --- Cornice Lines (Archive sections) --- */
.cornice-line {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: #8B7355;
    max-width: 1200px;
    transition: width 1.2s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    z-index: 2;
}

.cornice-line.animate {
    width: calc(100% - 48px);
}

/* Squared terminals */
.terminal {
    position: absolute;
    top: -1.5px;
    width: 4px;
    height: 4px;
    background: #8B7355;
    opacity: 0;
    transition: opacity 0.3s ease;
    transition-delay: 1.2s;
}

.terminal-left {
    left: 0;
}

.terminal-right {
    right: 0;
}

.cornice-line.animate .terminal {
    opacity: 1;
}

/* --- Section Labels --- */
.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.pediment {
    width: 40px;
    height: 20px;
    flex-shrink: 0;
}

.label-text {
    font-family: 'DM Mono', monospace;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.7;
}

/* Label colors for dark sections */
.section-kiln .label-text,
.section-charcoal .label-text {
    color: #F0EBE0;
}

.section-parchment .label-text,
.section-sandstone .label-text {
    color: #6B5B4E;
}

/* --- Archive Sections --- */
.archive-section {
    padding: 80px 0;
}

.archive-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 0 24px;
    align-items: start;
}

.archive-col-left {
    grid-column: 2 / 6;
}

.archive-col-right {
    grid-column: 7 / 12;
}

.marble-divider {
    grid-column: 6 / 7;
    width: 2px;
    min-height: 100%;
    align-self: stretch;
    background: linear-gradient(
        180deg,
        #E8DFD0 0%, #E8DFD0 12%,
        #B8AFA4 12.5%, #E8DFD0 13%,
        #E8DFD0 28%, #B8AFA4 28.5%,
        #E8DFD0 29%, #E8DFD0 45%,
        #B8AFA4 45.5%, #E8DFD0 46%,
        #E8DFD0 67%, #B8AFA4 67.5%,
        #E8DFD0 68%, #E8DFD0 100%
    );
    justify-self: center;
}

/* Alternate marble divider for variety */
.marble-divider-alt {
    background: linear-gradient(
        180deg,
        #E8DFD0 0%, #E8DFD0 8%,
        #B8AFA4 8.5%, #E8DFD0 9%,
        #E8DFD0 22%, #B8AFA4 22.5%,
        #E8DFD0 23%, #E8DFD0 38%,
        #B8AFA4 38.5%, #E8DFD0 39%,
        #E8DFD0 55%, #B8AFA4 55.5%,
        #E8DFD0 56%, #E8DFD0 74%,
        #B8AFA4 74.5%, #E8DFD0 75%,
        #E8DFD0 100%
    );
}

/* Dark section marble divider */
.marble-divider-dark {
    background: linear-gradient(
        180deg,
        #3D3530 0%, #3D3530 12%,
        #6B5B4E 12.5%, #3D3530 13%,
        #3D3530 28%, #6B5B4E 28.5%,
        #3D3530 29%, #3D3530 45%,
        #6B5B4E 45.5%, #3D3530 46%,
        #3D3530 67%, #6B5B4E 67.5%,
        #3D3530 68%, #3D3530 100%
    );
}

/* --- Typography — Archive Content --- */
.archive-col-left p,
.archive-col-right p {
    margin-bottom: 1.5em;
    font-family: 'Source Serif 4', 'Georgia', serif;
    font-weight: 400;
    font-size: 18px;
    line-height: 1.75;
    letter-spacing: 0.01em;
}

/* Text colors per section */
.section-parchment .archive-col-left p,
.section-parchment .archive-col-right p,
.section-sandstone .archive-col-left p,
.section-sandstone .archive-col-right p {
    color: #6B5B4E;
}

.section-kiln .archive-col-left p,
.section-kiln .archive-col-right p,
.section-charcoal .archive-col-left p,
.section-charcoal .archive-col-right p {
    color: #F0EBE0;
}

/* --- Pull Quotes --- */
.pull-quote {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 28px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    color: #A0522D;
    border-left: 2px solid #8B7355;
    padding-left: 20px;
    margin: 2em 0;
}

.pull-quote-light {
    color: #C4B49A;
    border-left-color: #8B7355;
}

/* --- Fade In for Content --- */
.fade-in {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.fade-in.visible {
    opacity: 1;
}

/* --- Colophon --- */
.colophon {
    font-family: 'DM Mono', monospace;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    opacity: 0.5;
    margin-top: 3em;
}

/* ========================================
   Responsive — Below 768px
   ======================================== */
@media (max-width: 768px) {
    .monument-heading {
        font-size: clamp(60px, 10vw, 80px);
    }

    .monument-content {
        padding-left: 5%;
        width: 90%;
    }

    .archive-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .archive-col-left,
    .archive-col-right {
        grid-column: auto;
        padding: 0 24px;
    }

    .marble-divider {
        width: 100%;
        height: 2px;
        min-height: 2px;
        margin: 2em 0;
        background: linear-gradient(
            90deg,
            #E8DFD0 0%, #E8DFD0 12%,
            #B8AFA4 12.5%, #E8DFD0 13%,
            #E8DFD0 28%, #B8AFA4 28.5%,
            #E8DFD0 29%, #E8DFD0 45%,
            #B8AFA4 45.5%, #E8DFD0 46%,
            #E8DFD0 67%, #B8AFA4 67.5%,
            #E8DFD0 68%, #E8DFD0 100%
        );
    }

    .marble-divider-dark {
        background: linear-gradient(
            90deg,
            #3D3530 0%, #3D3530 12%,
            #6B5B4E 12.5%, #3D3530 13%,
            #3D3530 28%, #6B5B4E 28.5%,
            #3D3530 29%, #3D3530 45%,
            #6B5B4E 45.5%, #3D3530 46%,
            #3D3530 67%, #6B5B4E 67.5%,
            #3D3530 68%, #3D3530 100%
        );
    }

    .archive-section {
        padding: 60px 0;
    }

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

/* ========================================
   Responsive — Below 480px
   ======================================== */
@media (max-width: 480px) {
    .monument-heading {
        font-size: clamp(40px, 9vw, 60px);
    }

    body::after {
        opacity: 0.05;
    }

    .section {
        min-height: 80vh;
    }

    .archive-col-left p,
    .archive-col-right p {
        font-size: 16px;
    }

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

    .archive-section {
        padding: 40px 0;
    }
}
