:root {
    --buttercream: #FFF8E8;
    --powder-blush: #F5E1EB;
    --spring-mint: #B8E8C8;
    --cornflower: #A8C8F0;
    --honeyed-peach: #F8D0A0;
    --lavender-mist: #D4C5E0;
    --dandelion-gold: #F0D060;
    --charcoal-herb: #3A3630;
    --sage-gray: #7A7568;
    --meadow-deep: #8FD4A8;
    --petal-edge: #E8C0D0;
    --notebook-red: #E8A0A0;
    color-scheme: light;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--buttercream);
    color: var(--charcoal-herb);
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.25rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow: hidden;
    height: 100vh;
}

/* Page Tabs */
.page-tabs {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}

.tab {
    width: 40px;
    height: 28px;
    padding: 0 6px;
    background: var(--tab-color, var(--lavender-mist));
    opacity: 0.6;
    border-radius: 0 8px 8px 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.02em;
    color: var(--charcoal-herb);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
}

.tab.active {
    opacity: 1;
    width: 52px;
    border-left: 1px solid var(--charcoal-herb);
}

/* Spreads container */
.spreads {
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.spreads::-webkit-scrollbar {
    display: none;
}

/* Spread */
.spread {
    min-height: 100vh;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
}

/* Gutter line */
.gutter-line {
    position: absolute;
    left: 50%;
    top: 5%;
    bottom: 5%;
    width: 0;
    border-left: 4px dashed var(--lavender-mist);
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Spread halves */
.spread-left,
.spread-right {
    position: relative;
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

/* ====== COVER SPREAD ====== */
.spread-cover {
    background: radial-gradient(ellipse at center, var(--buttercream), rgba(245, 225, 235, 0.4));
}

.spread-cover .spread-left {
    align-items: center;
    text-align: center;
    z-index: 5;
}

.cover-flowers {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.flower {
    position: absolute;
}

.flower-1 {
    width: 100px;
    height: 100px;
    top: 15%;
    left: 20%;
}

.flower-2 {
    width: 80px;
    height: 80px;
    top: 55%;
    right: 10%;
}

.flower-3 {
    width: 90px;
    height: 90px;
    bottom: 15%;
    left: 30%;
}

.cover-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(3rem, 9vw, 8rem);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: var(--charcoal-herb);
    position: relative;
    z-index: 2;
}

.cover-sub {
    font-family: 'DM Sans', sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    letter-spacing: 0.15em;
    color: var(--sage-gray);
    margin-top: 16px;
    position: relative;
    z-index: 2;
}

.dandelion-seed {
    position: absolute;
    top: 10%;
    left: 30%;
    animation: seedDrift 20s linear infinite;
}

.seed-svg {
    width: 20px;
    height: 40px;
}

@keyframes seedDrift {
    0% { transform: translate(0, 0); }
    25% { transform: translate(40px, 25vh); }
    50% { transform: translate(-20px, 50vh); }
    75% { transform: translate(30px, 75vh); }
    100% { transform: translate(50vw, 90vh); }
}

/* ====== FIELD NOTES SPREAD ====== */
.spread-field {
    background: var(--powder-blush);
}

.nature-scene {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.sky {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--cornflower) 0%, var(--buttercream) 100%);
}

.sun-motif {
    position: absolute;
    top: 8%;
    left: 10%;
    width: 80px;
    height: 80px;
    z-index: 2;
}

.tree {
    position: absolute;
    bottom: 30%;
    z-index: 3;
}

.tree-1 { left: 25%; }
.tree-2 { left: 65%; }

.tree-crown {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--spring-mint);
    margin: 0 auto;
}

.crown-small {
    width: 40px;
    height: 40px;
}

.tree-trunk {
    width: 10px;
    height: 30px;
    background: var(--honeyed-peach);
    margin: 0 auto;
    border-radius: 2px;
}

.trunk-small {
    width: 7px;
    height: 20px;
}

.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30%;
    z-index: 2;
}

.grass-tri {
    position: absolute;
    bottom: 0;
    width: 0;
    height: 0;
    border-left: 25px solid transparent;
    border-right: 25px solid transparent;
    border-bottom: 40px solid var(--gc, var(--spring-mint));
}

.butterfly {
    position: absolute;
    width: 20px;
    height: 12px;
    z-index: 5;
}

.butterfly-1 {
    top: 35%;
    right: 20%;
    background:
        linear-gradient(135deg, var(--powder-blush) 50%, transparent 50%),
        linear-gradient(-135deg, var(--powder-blush) 50%, transparent 50%);
    background-size: 10px 12px;
    background-position: left, right;
    background-repeat: no-repeat;
    animation: butterflyFloat 8s ease-in-out infinite;
}

.butterfly-2 {
    top: 50%;
    left: 15%;
    background:
        linear-gradient(135deg, var(--cornflower) 50%, transparent 50%),
        linear-gradient(-135deg, var(--cornflower) 50%, transparent 50%);
    background-size: 10px 12px;
    background-position: left, right;
    background-repeat: no-repeat;
    animation: butterflyFloat 10s ease-in-out infinite -3s;
}

@keyframes butterflyFloat {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(10px, -8px); }
    50% { transform: translate(-5px, -15px); }
    75% { transform: translate(8px, -5px); }
}

/* Notebook page */
.notebook-page {
    background: var(--buttercream);
    position: relative;
}

.notebook-margin {
    position: absolute;
    left: 32px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--notebook-red);
    opacity: 0.3;
}

.notebook-lines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        transparent 0px,
        transparent 27px,
        rgba(212, 197, 224, 0.25) 27px,
        rgba(212, 197, 224, 0.25) 28px
    );
    pointer-events: none;
}

.notebook-text {
    position: relative;
    z-index: 2;
    padding-left: 24px;
}

.body-text {
    margin-bottom: 1rem;
    color: var(--charcoal-herb);
    max-width: 38em;
}

.pull-quote {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 1.4rem;
    color: var(--sage-gray);
    transform: rotate(-2deg);
    border-left: 3px solid var(--spring-mint);
    padding-left: 16px;
    margin-top: 24px;
    position: relative;
    z-index: 2;
}

/* ====== SPECIMEN SPREAD ====== */
.spread-specimen {
    background: var(--buttercream);
    display: flex;
    align-items: center;
    justify-content: center;
}

.specimen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 20px;
    padding: 40px;
    max-width: 900px;
    width: 100%;
}

.specimen-card {
    background: var(--buttercream);
    border: 3px solid var(--card-color, var(--spring-mint));
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 0 rgba(var(--card-color), 0.2);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.specimen-card:hover {
    transform: translateY(-4px);
}

.specimen-illus {
    width: 60px;
    height: 60px;
}

.specimen-label {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spec-name {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    color: var(--charcoal-herb);
}

.spec-id {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    color: var(--sage-gray);
    letter-spacing: 0.05em;
}

/* ====== DIAGRAM SPREAD ====== */
.spread-diagram {
    background: var(--buttercream);
    display: flex;
    align-items: center;
    justify-content: center;
}

.diagram-container {
    text-align: center;
    max-width: 500px;
}

.diagram-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2vw, 1.6rem);
    letter-spacing: 0.03em;
    color: var(--charcoal-herb);
    margin-bottom: 24px;
}

.flower-diagram-svg {
    width: 100%;
    max-width: 400px;
    height: auto;
}

/* ====== COLOPHON SPREAD ====== */
.spread-colophon {
    background: var(--powder-blush);
    display: flex;
    align-items: center;
    justify-content: center;
}

.colophon-content {
    text-align: center;
}

.rosette-svg {
    width: 200px;
    height: 200px;
    animation: rosetteRotate 60s linear infinite;
}

@keyframes rosetteRotate {
    to { transform: rotate(360deg); }
}

.colophon-title {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    font-size: 1.2rem;
    letter-spacing: 0.2em;
    color: var(--sage-gray);
    margin-top: 24px;
    margin-bottom: 16px;
}

.colophon-credits {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    color: var(--sage-gray);
    line-height: 1.8;
}

/* Stagger animation */
[data-stagger] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

[data-stagger].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .spread {
        grid-template-columns: 1fr;
        height: auto;
        min-height: 100vh;
    }

    .spread-left,
    .spread-right {
        min-height: 50vh;
        padding: 24px;
    }

    .gutter-line {
        display: none;
    }

    .page-tabs {
        display: none;
    }

    .specimen-grid {
        grid-template-columns: 1fr 1fr;
        padding: 20px;
    }

    .cover-title {
        font-size: clamp(2rem, 8vw, 4rem);
    }

    body {
        overflow-y: auto;
        height: auto;
    }

    .spreads {
        height: auto;
        scroll-snap-type: none;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .dandelion-seed {
        animation: none;
    }

    .butterfly-1,
    .butterfly-2 {
        animation: none;
    }

    .rosette-svg {
        animation: none;
    }

    [data-stagger] {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .tab {
        transition: none;
    }

    .spreads {
        scroll-snap-type: none;
    }
}
