:root {
    --indigo: #18234A;
    --morning: #BFD7FF;
    --leaf: #4E7C45;
    --violet: #6D5FD3;
    --pollen: #E6B84A;
    --paper: #F4E9D2;
    --stem: #243222;
    --clay: #B66A4B;
    --chapter-shift: 0;
    --pointer-x: 50vw;
    --pointer-y: 50vh;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--stem);
    font-family: "Literata", serif;
    background: var(--paper);
    overflow-x: hidden;
}

.daylight-wash,
.paper-grain,
.mountain-shadow,
.bee-routes,
.pollen-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

.daylight-wash {
    z-index: -5;
    background:
        radial-gradient(circle at 20% 22%, rgba(191, 215, 255, .95), transparent 32%),
        linear-gradient(145deg, #BFD7FF 0%, #F4E9D2 33%, rgba(109, 95, 211, .28) 72%, #18234A 120%);
    filter: saturate(calc(1 + var(--chapter-shift) * .08));
    transition: background 800ms ease, filter 800ms ease;
}

.paper-grain {
    z-index: -4;
    opacity: .36;
    background-image:
        radial-gradient(circle at 22% 18%, rgba(36, 50, 34, .12) 0 1px, transparent 1.6px),
        radial-gradient(circle at 68% 63%, rgba(182, 106, 75, .13) 0 1px, transparent 1.8px),
        linear-gradient(90deg, rgba(244, 233, 210, .28) 50%, rgba(191, 215, 255, .12));
    background-size: 23px 31px, 37px 43px, 100% 100%;
    mix-blend-mode: multiply;
}

.mountain-shadow {
    z-index: -3;
    height: 42vh;
    top: auto;
    background: rgba(24, 35, 74, .18);
    clip-path: polygon(0 100%, 18% 35%, 35% 78%, 52% 22%, 67% 72%, 84% 34%, 100% 100%);
    transform: translateY(calc(18vh - var(--chapter-shift) * 5vh));
}

.mountain-shadow-two {
    opacity: .45;
    transform: translateY(calc(25vh - var(--chapter-shift) * 7vh)) scaleX(-1);
    background: rgba(109, 95, 211, .18);
}

.day-dial {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: "Bricolage Grotesque", sans-serif;
    color: var(--paper);
    mix-blend-mode: difference;
}

.dial-orbit {
    width: 44px;
    height: 44px;
    border: 1px solid currentColor;
    border-radius: 50%;
    position: relative;
    transform: rotate(calc(var(--chapter-shift) * 40deg));
    transition: transform 700ms ease;
}

.dial-body {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--pollen);
    box-shadow: 0 0 24px rgba(230, 184, 74, .8);
    position: absolute;
    left: 4px;
    top: 4px;
}

.day-dial p {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-size: 12px;
}

.raceme-clock {
    position: fixed;
    left: calc(50% - 52px);
    top: 5vh;
    width: 120px;
    height: 90vh;
    z-index: 20;
    pointer-events: none;
    transform: translateX(calc((var(--chapter-shift) - 2) * 3vw));
    transition: transform 700ms ease;
}

.raceme-line {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.stem-main,
.stem-side {
    fill: none;
    stroke: #243222;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 980;
    stroke-dashoffset: calc(760 - var(--chapter-shift) * 175);
    transition: stroke-dashoffset 900ms ease;
}

.stem-side { stroke-width: 2.5; opacity: .78; }

.blossom {
    position: absolute;
    width: 58px;
    height: 46px;
    border: 1px solid rgba(24, 35, 74, .5);
    background: rgba(109, 95, 211, .2);
    color: var(--indigo);
    border-radius: 58% 42% 55% 45% / 63% 52% 48% 37%;
    font-family: "Bricolage Grotesque", sans-serif;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .08em;
    cursor: pointer;
    pointer-events: auto;
    opacity: .42;
    transform: scale(.62) rotate(var(--tilt, -12deg));
    transition: transform 600ms cubic-bezier(.2,.9,.2,1), opacity 500ms ease, background 500ms ease;
}

.blossom::before,
.blossom::after {
    content: "";
    position: absolute;
    inset: 4px 14px 5px 5px;
    border-radius: inherit;
    background: rgba(191, 215, 255, .52);
    transform: rotate(-18deg);
}

.blossom::after {
    inset: 7px 4px 4px 18px;
    background: rgba(244, 233, 210, .28);
    transform: rotate(24deg);
}

.blossom span { position: relative; z-index: 2; }
.blossom-1 { left: 8px; bottom: 8%; --tilt: -18deg; }
.blossom-2 { right: 4px; bottom: 31%; --tilt: 17deg; }
.blossom-3 { left: 0; bottom: 53%; --tilt: -12deg; }
.blossom-4 { right: 8px; bottom: 70%; --tilt: 14deg; }
.blossom-5 { left: 16px; bottom: 85%; --tilt: -8deg; }

.blossom.open {
    opacity: 1;
    background: rgba(109, 95, 211, .75);
    transform: scale(1) rotate(var(--tilt));
    box-shadow: 0 12px 34px rgba(109, 95, 211, .28);
}

.bee-routes {
    z-index: 9;
    top: 20vh;
    height: 54vh;
}

.bee-routes path {
    fill: none;
    stroke: #E6B84A;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 10 18;
    opacity: .56;
}

.bee {
    position: fixed;
    z-index: 25;
    left: 8vw;
    top: 58vh;
    width: 22px;
    height: 14px;
    background: #E6B84A;
    border-radius: 50%;
    pointer-events: none;
    box-shadow: inset 7px 0 0 rgba(36, 50, 34, .75), 0 0 15px rgba(230, 184, 74, .55);
}

.bee::before,
.bee::after {
    content: "";
    position: absolute;
    width: 13px;
    height: 9px;
    border-radius: 50%;
    background: rgba(191, 215, 255, .72);
    top: -7px;
    animation: wing 150ms infinite alternate;
}
.bee::before { left: 2px; transform: rotate(-22deg); }
.bee::after { right: 1px; transform: rotate(22deg); }

.pollen-field span,
.pollen-cloud i {
    position: absolute;
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #E6B84A;
    opacity: .5;
    animation: drift 7s ease-in-out infinite;
}

.daybook { position: relative; z-index: 5; }

.chapter {
    min-height: 108vh;
    position: relative;
    display: grid;
    align-items: center;
    padding: 9vh 7vw;
}

.chapter-inner {
    min-height: 82vh;
    width: 100%;
    position: relative;
}

.pressed-title,
.chapter-note,
.specimen-slip,
.observation-window {
    background: rgba(244, 233, 210, .72);
    border: 1px solid rgba(36, 50, 34, .22);
    box-shadow: 0 25px 70px rgba(24, 35, 74, .13), inset 0 0 38px rgba(191, 215, 255, .18);
    backdrop-filter: blur(8px);
    clip-path: polygon(1.5% 0, 98% 1%, 100% 94%, 96% 100%, 3% 98%, 0 6%);
}

.pressed-title {
    width: min(650px, 80vw);
    padding: 34px 42px 38px;
    transform: rotate(-3deg);
}

.pressed-title h1,
.pressed-title h2,
.chapter-note h2,
.specimen-slip h2 {
    font-family: "Fraunces", serif;
    line-height: .92;
    color: #18234A;
    margin: 10px 0 18px;
    font-weight: 760;
    letter-spacing: -.045em;
}

.pressed-title h1 { font-size: clamp(64px, 12vw, 180px); }
.pressed-title h2,
.chapter-note h2,
.specimen-slip h2 { font-size: clamp(38px, 6vw, 94px); }

.pressed-title p,
.chapter-note p,
.specimen-slip p,
.observation-window p {
    font-size: clamp(17px, 2vw, 24px);
    line-height: 1.45;
    margin: 0;
}

.field-label,
.specimen-slip span,
.observation-window strong,
.weather-tags p,
.annotation-line {
    font-family: "Bricolage Grotesque", sans-serif;
    text-transform: uppercase;
    letter-spacing: .15em;
    font-size: 12px;
    color: #4E7C45;
}

.soil-layout { transform: translate(-2vw, 4vh); }

.root-window {
    position: absolute;
    left: 5vw;
    bottom: 2vh;
    width: 430px;
    max-width: 48vw;
    height: 250px;
    border-bottom: 3px solid #243222;
    color: #F4E9D2;
}

.roots i {
    position: absolute;
    bottom: 58px;
    width: 2px;
    height: 170px;
    background: #243222;
    transform-origin: bottom;
    border-radius: 99px;
}
.roots i:nth-child(1) { left: 14%; transform: rotate(20deg); height: 136px; }
.roots i:nth-child(2) { left: 29%; transform: rotate(-13deg); }
.roots i:nth-child(3) { left: 46%; transform: rotate(7deg); height: 190px; }
.roots i:nth-child(4) { left: 62%; transform: rotate(-22deg); height: 150px; }
.roots i:nth-child(5) { left: 78%; transform: rotate(15deg); }

.nodule {
    position: absolute;
    width: 22px;
    height: 16px;
    border-radius: 50%;
    background: #B66A4B;
    box-shadow: 0 0 0 4px rgba(182, 106, 75, .2);
}
.nodule-a { left: 18%; bottom: 124px; }
.nodule-b { left: 42%; bottom: 84px; }
.nodule-c { left: 67%; bottom: 152px; }
.nodule-d { left: 84%; bottom: 92px; }
.root-window p { position: absolute; bottom: 0; max-width: 340px; color: #243222; }

.soil-slip { position: absolute; right: 4vw; top: 20vh; width: 360px; padding: 28px; transform: rotate(4deg); }
.high-note { position: absolute; left: 8vw; top: 5vh; width: 520px; padding: 34px; transform: rotate(2deg); }
.noon-note { position: absolute; right: 9vw; top: 13vh; width: 560px; padding: 36px; transform: rotate(-2deg); }
.seed-note { position: absolute; left: 13vw; top: 18vh; width: 590px; padding: 36px; transform: rotate(3deg); }
.dusk-title { position: absolute; right: 7vw; top: 14vh; transform: rotate(2deg); }

.leaf-cluster {
    position: absolute;
    width: 190px;
    height: 190px;
    transform: rotate(-26deg);
}
.leaf-left { right: 14vw; bottom: 10vh; }
.leaf-right { left: 8vw; bottom: 12vh; transform: rotate(18deg); }
.leaf-cluster b {
    position: absolute;
    left: 86px;
    top: 80px;
    width: 38px;
    height: 110px;
    background: rgba(78, 124, 69, .72);
    border: 1px solid #243222;
    border-radius: 80% 20% 80% 20%;
    transform-origin: 50% 8%;
}
.leaf-cluster b:nth-child(1) { transform: rotate(-58deg); }
.leaf-cluster b:nth-child(2) { transform: rotate(-28deg); }
.leaf-cluster b:nth-child(3) { transform: rotate(0deg); }
.leaf-cluster b:nth-child(4) { transform: rotate(28deg); }
.leaf-cluster b:nth-child(5) { transform: rotate(58deg); }

.spire-illustration {
    position: absolute;
    right: 16vw;
    top: 6vh;
    height: 70vh;
    width: 170px;
    border-left: 4px solid #4E7C45;
    transform: rotate(7deg);
}
.spire-illustration span {
    position: absolute;
    width: 90px;
    height: 62px;
    background: rgba(109, 95, 211, .68);
    border: 1px solid #18234A;
    border-radius: 61% 39% 64% 36%;
    left: 17px;
}
.spire-illustration span:nth-child(1) { bottom: 5%; }
.spire-illustration span:nth-child(2) { bottom: 19%; left: 58px; }
.spire-illustration span:nth-child(3) { bottom: 34%; }
.spire-illustration span:nth-child(4) { bottom: 50%; left: 54px; }
.spire-illustration span:nth-child(5) { bottom: 66%; }
.spire-illustration span:nth-child(6) { bottom: 81%; left: 45px; }

.annotation-line { position: absolute; left: 45vw; top: 24vh; transform: rotate(-12deg); }
.annotation-line::before { content: ""; display: inline-block; width: 140px; border-top: 1px solid #243222; margin-right: 12px; transform: translateY(-4px); }

.pollen-cloud { position: absolute; left: 21vw; top: 14vh; width: 300px; height: 220px; }
.pollen-cloud i:nth-child(1) { left: 20%; top: 20%; }
.pollen-cloud i:nth-child(2) { left: 48%; top: 33%; animation-delay: -2s; }
.pollen-cloud i:nth-child(3) { left: 72%; top: 10%; animation-delay: -3s; }
.pollen-cloud i:nth-child(4) { left: 62%; top: 72%; animation-delay: -4s; }
.pollen-cloud i:nth-child(5) { left: 12%; top: 64%; animation-delay: -1s; }
.pollen-cloud i:nth-child(6) { left: 86%; top: 48%; animation-delay: -5s; }
.pollen-cloud i:nth-child(7) { left: 34%; top: 88%; animation-delay: -6s; }

.observation-window { position: absolute; left: 9vw; bottom: 12vh; width: 330px; padding: 26px; transform: rotate(5deg); }

.seedpod-column {
    position: absolute;
    right: 18vw;
    top: 5vh;
    width: 120px;
    height: 78vh;
    border-left: 4px solid #243222;
    transform: rotate(-5deg);
}
.seedpod-column span {
    position: absolute;
    left: 19px;
    width: 82px;
    height: 35px;
    border-radius: 60% 40% 40% 60%;
    background: rgba(182, 106, 75, .75);
    border: 1px solid #243222;
}
.seedpod-column span:nth-child(1) { top: 8%; }
.seedpod-column span:nth-child(2) { top: 24%; left: -68px; transform: scaleX(-1); }
.seedpod-column span:nth-child(3) { top: 42%; }
.seedpod-column span:nth-child(4) { top: 60%; left: -68px; transform: scaleX(-1); }
.seedpod-column span:nth-child(5) { top: 78%; }
.weather-tags { position: absolute; right: 6vw; bottom: 10vh; display: grid; gap: 10px; transform: rotate(-3deg); }
.weather-tags p { margin: 0; padding: 9px 16px; background: rgba(244, 233, 210, .66); border: 1px solid rgba(36, 50, 34, .24); }

.chapter-dusk { color: #F4E9D2; }
.chapter-dusk .pressed-title { background: rgba(24, 35, 74, .64); border-color: rgba(191, 215, 255, .24); }
.chapter-dusk h2, .chapter-dusk p { color: #F4E9D2; }
.moon-vellum {
    position: absolute;
    left: 10vw;
    top: 20vh;
    width: 340px;
    height: 340px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(191, 215, 255, .18);
    border: 1px solid rgba(244, 233, 210, .34);
    font-family: "Fraunces", serif;
    font-size: 48px;
    color: rgba(244, 233, 210, .46);
    transform: rotate(-8deg);
}
.dusk-spires { position: absolute; inset: auto 0 0 0; height: 46vh; }
.dusk-spires i { position: absolute; bottom: 0; width: 4px; background: #18234A; border-radius: 9px; }
.dusk-spires i:nth-child(1) { left: 12%; height: 34vh; }
.dusk-spires i:nth-child(2) { left: 28%; height: 44vh; }
.dusk-spires i:nth-child(3) { left: 73%; height: 36vh; }
.dusk-spires i:nth-child(4) { left: 86%; height: 48vh; }

.chapter-visible .chapter-note,
.chapter-visible .pressed-title,
.chapter-visible .specimen-slip,
.chapter-visible .observation-window {
    animation: vellumRise 900ms ease both;
}

@keyframes vellumRise {
    from { opacity: .2; translate: 0 26px; }
    to { opacity: 1; translate: 0 0; }
}

@keyframes drift {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(24px, -36px); }
}

@keyframes wing {
    from { scale: 1 .7; opacity: .5; }
    to { scale: 1.18 1; opacity: .9; }
}

@media (max-width: 820px) {
    .raceme-clock { left: auto; right: 0; width: 95px; opacity: .82; }
    .chapter { padding: 10vh 5vw; min-height: 116vh; }
    .pressed-title, .chapter-note, .specimen-slip { width: min(92vw, 560px); position: relative; left: auto; right: auto; top: auto; margin: 0 0 28px; }
    .root-window { position: relative; left: 0; max-width: 90vw; width: 90vw; margin-top: 8vh; }
    .spire-illustration, .seedpod-column { opacity: .45; right: 4vw; }
    .moon-vellum { left: 4vw; width: 240px; height: 240px; font-size: 34px; }
    .day-dial { right: 12px; top: 12px; }
}
