/* ==========================================
   sustaining.quest — Botanical Field Journal
   ========================================== */

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

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

body {
    font-family: 'Source Serif 4', Georgia, serif;
    font-weight: 400;
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.85;
    color: #5a3e28;
    background-color: #e8dcc8;
    overflow-x: hidden;
}

/* --- Hero Section --- */
#hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    background-color: #e8dcc8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#hero-bg-pattern {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    pointer-events: none;
    z-index: 0;
}

#hero-botanical {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    max-width: 700px;
    height: 80vh;
    z-index: 1;
    pointer-events: none;
}

#hero-botanical path {
    stroke-linecap: round;
    stroke-linejoin: round;
}

#hero-title {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: -10vh;
}

.title-sustaining {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(36px, 7vw, 80px);
    letter-spacing: 0.25em;
    color: #5a3e28;
    opacity: 0;
    transform: translateY(20px);
    animation: titleFadeIn 1.5s ease-out 2.5s forwards;
    text-shadow: 0 2px 20px rgba(232, 220, 200, 0.8);
}

.title-quest {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(28px, 5vw, 60px);
    letter-spacing: 0.5em;
    color: #3a6a3e;
    opacity: 0;
    transform: translateY(20px);
    animation: titleFadeIn 1.5s ease-out 3s forwards;
    text-shadow: 0 2px 20px rgba(232, 220, 200, 0.8);
}

@keyframes titleFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#hero-epigraph {
    position: relative;
    z-index: 2;
    margin-top: 3vh;
    text-align: center;
    max-width: 500px;
    opacity: 0;
    animation: titleFadeIn 1.5s ease-out 3.5s forwards;
}

.epigraph-text {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 17px);
    color: #5a3e28;
    line-height: 1.7;
    text-shadow: 0 1px 10px rgba(232, 220, 200, 0.9);
}

.epigraph-attribution {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #a87060;
    margin-top: 8px;
    text-shadow: 0 1px 10px rgba(232, 220, 200, 0.9);
}

#scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    opacity: 0;
    animation: titleFadeIn 1s ease-out 4s forwards;
}

#scroll-dot {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { cy: 10; }
    50% { cy: 24; }
}

/* --- Scholarly Sections --- */
.scholarly-section {
    position: relative;
    padding: 80px 0;
    background-color: #f4ede0;
}

.scholarly-section:nth-child(odd) {
    background-color: #e8dcc8;
}

.section-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
}

.section-ornament {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.botanical-sprig {
    opacity: 0.7;
    transition: opacity 0.4s ease;
}

.botanical-sprig:hover {
    opacity: 1;
}

.botanical-sprig .sprig-path {
    stroke-dasharray: var(--path-length, 100);
    stroke-dashoffset: var(--path-length, 100);
    transition: stroke-dashoffset 0.5s ease;
}

.botanical-sprig.animated .sprig-path {
    stroke-dashoffset: 0;
}

.botanical-sprig .sprig-leaf {
    transform: scale(0);
    transition: transform 0.4s ease 0.3s;
    transform-origin: center;
}

.botanical-sprig.animated .sprig-leaf {
    transform: scale(1);
}

.section-number {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 28px);
    color: #b89840;
    text-align: center;
    margin-bottom: 6px;
    letter-spacing: 0.1em;
}

.section-heading {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(28px, 4.5vw, 52px);
    color: #2a4a2e;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.25;
}

.section-body {
    position: relative;
}

.section-body p {
    margin-bottom: 1.5em;
}

/* --- Drop Caps --- */
.drop-cap {
    float: left;
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 700;
    font-size: 4em;
    line-height: 0.8;
    padding-right: 10px;
    padding-top: 6px;
    color: #3a6a3e;
}

/* --- Pull Quotes --- */
.pull-quote {
    margin: 40px 0;
    padding: 30px 40px;
    border-left: 3px solid #b89840;
    background: linear-gradient(90deg, rgba(184, 152, 64, 0.06) 0%, transparent 100%);
}

.pull-quote blockquote {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-style: italic;
    font-weight: 400;
    font-size: clamp(18px, 2vw, 22px);
    color: #2a4a2e;
    line-height: 1.65;
}

/* --- Margin Notes --- */
.margin-note {
    position: absolute;
    right: -220px;
    width: 180px;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 1.55;
    color: #a87060;
}

.note-marker {
    font-weight: 500;
    color: #b89840;
    margin-right: 4px;
}

.note-text em {
    font-style: italic;
}

/* --- Footnote References --- */
.footnote-ref {
    font-family: 'Inter', sans-serif;
    font-size: 0.75em;
    color: #b89840;
    cursor: pointer;
    text-decoration: none;
    position: relative;
    top: -0.3em;
    transition: color 0.3s ease;
}

.footnote-ref:hover {
    color: #3a6a3e;
}

/* --- Bibliography --- */
#bibliography {
    background-color: #f4ede0;
    padding: 60px 0 80px;
    border-top: 1px solid rgba(90, 62, 40, 0.1);
}

.bib-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 40px;
}

.bib-heading {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 700;
    font-size: clamp(20px, 2.5vw, 28px);
    color: #2a4a2e;
    text-align: center;
    margin-bottom: 10px;
}

.bib-ornament {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.bib-list {
    list-style: none;
    counter-reset: none;
}

.bib-list li {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.7;
    color: #5a3e28;
    margin-bottom: 14px;
    padding-left: 28px;
    position: relative;
}

.bib-number {
    position: absolute;
    left: 0;
    font-weight: 500;
    color: #b89840;
}

.bib-list li em {
    font-style: italic;
}

/* --- Footer / Colophon --- */
#colophon {
    background-color: #2a4a2e;
    padding: 60px 40px;
    text-align: center;
}

.colophon-container {
    max-width: 600px;
    margin: 0 auto;
}

.footer-botanical {
    opacity: 0.3;
    margin-bottom: 20px;
}

.footer-botanical .sprig-path {
    stroke: #f4ede0;
}

.footer-botanical .sprig-leaf {
    fill: #f4ede0;
}

.colophon-text {
    font-family: 'Libre Baskerville', 'Times New Roman', serif;
    font-weight: 400;
    font-size: clamp(14px, 1.4vw, 17px);
    color: #f4ede0;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.colophon-meta {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 13px;
    color: #a87060;
    letter-spacing: 0.05em;
}

/* --- Scroll Reveal Animation --- */
.scholarly-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scholarly-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 1000px) {
    .margin-note {
        position: relative;
        right: 0;
        width: 100%;
        margin-top: 20px;
        padding: 16px 20px;
        background-color: rgba(168, 112, 96, 0.06);
        border-left: 2px solid #a87060;
        border-radius: 0 4px 4px 0;
    }
}

@media (max-width: 600px) {
    .section-container {
        padding: 0 24px;
    }

    .bib-container {
        padding: 0 24px;
    }

    #hero-botanical {
        width: 90%;
    }

    .title-sustaining {
        letter-spacing: 0.15em;
    }

    .title-quest {
        letter-spacing: 0.3em;
    }

    .pull-quote {
        padding: 20px 24px;
        margin: 30px 0;
    }

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

    .drop-cap {
        font-size: 3em;
    }
}
