/* =========================================================
   namu.day — a tree a day
   palette (seven colours, all flat, no gradient):
     #2F3A2C  forest-green deep   (body text)
     #5B6B47  moss mid            (marginalia, ring stroke)
     #8FA37A  lichen pale         (hover state, stamp)
     #E8DDC4  paper warm          (trunk background)
     #3E2A1A  bark dark           (column edge shadow)
     #A8744A  sepia heartwood     (stamp ink, dated edition, underlines)
     #1F2A1B  canopy black-green  (forest-floor backdrop)
   ========================================================= */

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

html, body {
    width: 100%;
    background: #1F2A1B;
    color: #2F3A2C;
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 17px;
    line-height: 30px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* =========================================================
   Forest-floor backdrop (fixed, behind everything)
   ========================================================= */
.forest-floor {
    position: fixed;
    inset: 0;
    z-index: 0;
    background-color: #1F2A1B;
    background-image:
        radial-gradient(circle at 18% 22%, rgba(91, 107, 71, 0.16) 0 1.4px, transparent 2px),
        radial-gradient(circle at 73% 11%, rgba(168, 116, 74, 0.10) 0 1.8px, transparent 2.4px),
        radial-gradient(circle at 41% 67%, rgba(143, 163, 122, 0.12) 0 1.2px, transparent 1.8px),
        radial-gradient(circle at 88% 84%, rgba(91, 107, 71, 0.14) 0 1.6px, transparent 2.2px),
        radial-gradient(circle at 9% 91%, rgba(168, 116, 74, 0.08) 0 2.2px, transparent 3px),
        radial-gradient(circle at 56% 38%, rgba(143, 163, 122, 0.10) 0 1.4px, transparent 2px),
        radial-gradient(ellipse at 30% 50%, rgba(62, 42, 26, 0.30) 0 60px, transparent 200px),
        radial-gradient(ellipse at 78% 30%, rgba(62, 42, 26, 0.24) 0 80px, transparent 240px),
        radial-gradient(ellipse at 60% 80%, rgba(91, 107, 71, 0.10) 0 90px, transparent 280px);
    background-size:
        420px 420px,
        380px 380px,
        300px 300px,
        500px 500px,
        360px 360px,
        440px 440px,
        100% 100%,
        100% 100%,
        100% 100%;
    background-attachment: fixed;
    background-repeat: repeat, repeat, repeat, repeat, repeat, repeat, no-repeat, no-repeat, no-repeat;
    opacity: 1;
}

.forest-floor::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(31, 42, 27, 0.82);
    pointer-events: none;
}

.forest-vignette {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.28) 100%);
}

/* =========================================================
   Trunk column — 480 px wide, centred, paper-warm background
   ========================================================= */
.trunk {
    position: relative;
    z-index: 2;
    width: 480px;
    margin: 0 auto;
    background: #E8DDC4;
    box-shadow:
        inset 16px 0 32px -16px #3E2A1A,
        inset -16px 0 32px -16px #3E2A1A,
        0 0 80px 0 rgba(0,0,0,0.45);
    color: #2F3A2C;
}

@media (max-width: 600px) {
    .trunk {
        width: 320px;
    }
}

/* =========================================================
   Ring (section) common
   ========================================================= */
.ring {
    position: relative;
    padding: 84px 56px 84px 56px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

@media (max-width: 600px) {
    .ring {
        padding: 60px 32px 60px 32px;
    }
}

.ring + .ring {
    border-top: 1px dashed rgba(91, 107, 71, 0.28);
}

.ring-label {
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #5B6B47;
    margin-bottom: 28px;
}

.ring-label--light {
    color: #E8DDC4;
    position: relative;
    z-index: 4;
}

.section-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 28px;
    line-height: 1.25;
    color: #2F3A2C;
    margin-bottom: 14px;
}

.section-blurb {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: 14px;
    line-height: 24px;
    color: #5B6B47;
    margin-bottom: 36px;
}

/* =========================================================
   Ring 1 — Canopy
   ========================================================= */
.ring--canopy {
    overflow: hidden;
    padding-top: 120px;
    padding-bottom: 120px;
    background: #2F3A2C;
}

.canopy-photo {
    position: absolute;
    inset: 0;
    background-color: #2F3A2C;
    background-image:
        radial-gradient(circle at 22% 18%, #8FA37A 0 28px, transparent 60px),
        radial-gradient(circle at 68% 32%, #5B6B47 0 36px, transparent 80px),
        radial-gradient(circle at 84% 70%, #8FA37A 0 24px, transparent 56px),
        radial-gradient(circle at 14% 78%, #5B6B47 0 30px, transparent 70px),
        radial-gradient(circle at 50% 50%, #8FA37A 0 38px, transparent 88px),
        radial-gradient(circle at 30% 60%, #2F3A2C 0 26px, transparent 60px),
        radial-gradient(circle at 78% 8%, #8FA37A 0 22px, transparent 50px),
        radial-gradient(circle at 6% 36%, #5B6B47 0 32px, transparent 70px),
        radial-gradient(circle at 44% 88%, #5B6B47 0 28px, transparent 64px);
    filter: blur(8px) saturate(0.8);
    z-index: 1;
}

.canopy-content {
    position: relative;
    z-index: 2;
    text-align: center;
    mix-blend-mode: multiply;
    color: #1F2A1B;
}

.canopy-content .ring-label {
    color: #5B6B47;
}

.tree-name {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 44px;
    line-height: 1.1;
    color: #1F2A1B;
    margin-bottom: 16px;
    letter-spacing: 0;
}

.binomial {
    font-family: 'Cormorant Infant', Georgia, serif;
    font-style: normal;
    font-weight: 500;
    font-size: 18px;
    font-variant: small-caps;
    letter-spacing: 0.06em;
    color: #1F2A1B;
    margin-bottom: 36px;
    border-bottom: 1px solid #A8744A;
    padding-bottom: 6px;
    display: inline-block;
}

.opening-line {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-weight: 400;
    font-size: 16px;
    line-height: 28px;
    color: #1F2A1B;
    max-width: 380px;
    margin: 0 auto;
}

/* =========================================================
   Ring 2 — Cambium
   ========================================================= */
.ring--cambium {
    background: #E8DDC4;
}

.field-notes {
    position: relative;
    background-image:
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent 29px,
            rgba(91, 107, 71, 0.14) 29px,
            rgba(91, 107, 71, 0.14) 30px
        );
}

.prose {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 17px;
    line-height: 30px;
    color: #2F3A2C;
    text-align: justify;
    hyphens: auto;
    text-indent: 2em;
    margin: 0;
}

.prose + .prose {
    margin-top: 0;
}

.marginalia {
    position: absolute;
    width: 96px;
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    font-size: 10px;
    line-height: 18px;
    letter-spacing: 0.04em;
    color: #5B6B47;
}

.marginalia--right {
    right: -132px;
    top: 0;
}

.margin-line {
    margin-bottom: 4px;
}

@media (max-width: 900px) {
    .marginalia--right {
        position: static;
        width: 100%;
        margin-bottom: 28px;
        display: flex;
        flex-wrap: wrap;
        gap: 4px 18px;
    }

    .margin-line {
        margin-bottom: 0;
    }
}

/* =========================================================
   Ring 3 — Growth Rings
   ========================================================= */
.ring--growth {
    background: #E8DDC4;
    align-items: center;
    text-align: center;
}

.ring--growth .ring-label,
.ring--growth .section-title,
.ring--growth .section-blurb {
    text-align: center;
    width: 100%;
}

.growth-diagram-wrap {
    position: relative;
    width: 380px;
    height: 380px;
    margin: 12px auto 0;
}

.growth-rings {
    display: block;
    width: 380px;
    height: 380px;
}

.growth-rings circle {
    fill: none;
    stroke: #5B6B47;
    stroke-width: 1;
    transition: stroke 0.18s ease, stroke-width 0.18s ease;
    cursor: crosshair;
}

.growth-rings circle:hover {
    stroke: #A8744A;
    stroke-width: 2;
}

.growth-rings circle.is-hovered {
    stroke: #A8744A;
    stroke-width: 2;
}

.ring-tooltip {
    position: fixed;
    pointer-events: none;
    background: #E8DDC4;
    border: 1px solid #5B6B47;
    padding: 6px 10px;
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    font-size: 10px;
    line-height: 14px;
    letter-spacing: 0.04em;
    color: #2F3A2C;
    opacity: 0;
    transform: translate(12px, 12px);
    transition: opacity 0.14s ease;
    z-index: 100;
    max-width: 200px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}

.ring-tooltip.is-visible {
    opacity: 1;
}

.ring-tooltip .tooltip-year {
    display: block;
    color: #A8744A;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.ring-tooltip .tooltip-note {
    display: block;
    color: #2F3A2C;
}

@media (max-width: 600px) {
    .growth-diagram-wrap,
    .growth-rings {
        width: 280px;
        height: 280px;
    }
}

/* =========================================================
   Ring 4 — Bark
   ========================================================= */
.ring--bark {
    overflow: hidden;
    padding: 0;
    min-height: 100vh;
    justify-content: flex-end;
}

.bark-photo {
    position: absolute;
    inset: 0;
    background-color: #2F3A2C;
    background-image:
        repeating-linear-gradient(
            8deg,
            #1F2A1B 0,
            #1F2A1B 6px,
            #2F3A2C 6px,
            #2F3A2C 12px,
            #3E2A1A 12px,
            #3E2A1A 14px,
            #2F3A2C 14px,
            #2F3A2C 22px,
            #1F2A1B 22px,
            #1F2A1B 28px
        ),
        repeating-linear-gradient(
            -82deg,
            transparent 0,
            transparent 40px,
            rgba(62, 42, 26, 0.30) 40px,
            rgba(62, 42, 26, 0.30) 60px,
            transparent 60px,
            transparent 110px,
            rgba(91, 107, 71, 0.20) 110px,
            rgba(91, 107, 71, 0.20) 130px
        );
    background-blend-mode: multiply;
    filter: saturate(0.6) hue-rotate(-10deg);
    z-index: 1;
}

.ring--bark .ring-label {
    position: absolute;
    top: 84px;
    left: 56px;
    z-index: 4;
}

.bark-card {
    position: relative;
    z-index: 4;
    margin: 0 56px 84px 56px;
    background: rgba(232, 221, 196, 0.92);
    padding: 28px 32px;
    box-shadow: 0 4px 24px rgba(31, 42, 27, 0.45);
    align-self: flex-start;
    max-width: 320px;
}

.bark-prose {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 15px;
    line-height: 26px;
    color: #2F3A2C;
    margin: 0;
    text-indent: 1.6em;
}

.bark-prose + .bark-prose {
    margin-top: 12px;
}

@media (max-width: 600px) {
    .bark-card {
        margin: 0 32px 60px 32px;
        max-width: none;
    }
    .ring--bark .ring-label {
        left: 32px;
        top: 60px;
    }
}

/* =========================================================
   Ring 5 — Leaf-by-Leaf
   ========================================================= */
.ring--leaves {
    background: #E8DDC4;
    align-items: center;
    text-align: center;
}

.ring--leaves .ring-label,
.ring--leaves .section-title,
.ring--leaves .section-blurb {
    text-align: center;
    width: 100%;
}

.leaf-ribbon {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 6px;
    width: 100%;
    padding: 16px 4px 24px;
    scrollbar-width: thin;
    scrollbar-color: #5B6B47 #E8DDC4;
}

.leaf-ribbon::-webkit-scrollbar {
    height: 6px;
}

.leaf-ribbon::-webkit-scrollbar-track {
    background: #E8DDC4;
}

.leaf-ribbon::-webkit-scrollbar-thumb {
    background: #5B6B47;
}

.leaf-fig {
    flex: 0 0 auto;
    width: 90px;
    text-align: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.leaf-fig.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.leaf-fig:nth-child(1) { transition-delay: 0s; }
.leaf-fig:nth-child(2) { transition-delay: 0.8s; }
.leaf-fig:nth-child(3) { transition-delay: 1.6s; }
.leaf-fig:nth-child(4) { transition-delay: 2.4s; }
.leaf-fig:nth-child(5) { transition-delay: 3.2s; }
.leaf-fig:nth-child(6) { transition-delay: 4.0s; }
.leaf-fig:nth-child(7) { transition-delay: 4.8s; }

.leaf-svg {
    display: block;
    margin: 0 auto 10px;
    width: 64px;
    height: 64px;
}

.leaf-fig figcaption {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.leaf-name {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: 13px;
    font-variant: small-caps;
    letter-spacing: 0.08em;
    color: #2F3A2C;
}

.leaf-note {
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    font-size: 9px;
    line-height: 13px;
    color: #5B6B47;
    letter-spacing: 0.03em;
}

/* =========================================================
   Ring 6 — Root System
   ========================================================= */
.ring--roots {
    background: #E8DDC4;
    align-items: center;
    text-align: center;
}

.ring--roots .ring-label,
.ring--roots .section-title,
.ring--roots .section-blurb {
    text-align: center;
    width: 100%;
}

.root-wrap {
    position: relative;
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
}

.root-svg {
    display: block;
    width: 100%;
    height: auto;
}

.depth-markers {
    list-style: none;
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.depth-marker {
    position: absolute;
    left: -6px;
    transform: translateY(-50%);
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    font-size: 10px;
    line-height: 14px;
    letter-spacing: 0.04em;
    color: #5B6B47;
    text-align: left;
    background: #E8DDC4;
    padding: 2px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.depth-num {
    color: #A8744A;
    font-weight: 500;
    text-transform: uppercase;
}

.depth-name {
    color: #5B6B47;
}

/* =========================================================
   Ring 7 — Daybook Footer
   ========================================================= */
.ring--footer {
    background: #E8DDC4;
    align-items: center;
    text-align: center;
    padding-bottom: 140px;
}

.ring--footer .ring-label {
    text-align: center;
    width: 100%;
}

.stamp-wrap {
    margin: 24px auto 36px;
}

.rubber-stamp {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 192px;
    height: 128px;
    border: 2px solid #A8744A;
    color: #A8744A;
    transform: rotate(-3deg);
    mix-blend-mode: multiply;
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    background:
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent 2px,
            rgba(232, 221, 196, 0.5) 2px,
            rgba(232, 221, 196, 0.5) 3px
        );
    box-shadow: inset 0 0 0 6px #E8DDC4, inset 0 0 0 7px #A8744A;
    opacity: 0.88;
}

.stamp-initials {
    font-size: 24px;
    font-weight: 500;
    margin-bottom: 4px;
}

.stamp-date {
    font-size: 11px;
    margin-bottom: 4px;
}

.stamp-edition {
    font-size: 10px;
    letter-spacing: 0.18em;
}

.closing-line {
    font-family: 'Cormorant Infant', Georgia, serif;
    font-style: italic;
    font-weight: 500;
    font-size: 18px;
    line-height: 28px;
    letter-spacing: 0.06em;
    font-variant: small-caps;
    color: #2F3A2C;
    max-width: 360px;
    margin: 0 auto 28px;
}

.edition-line {
    font-family: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
    font-size: 10px;
    line-height: 16px;
    letter-spacing: 0.10em;
    color: #A8744A;
    text-transform: uppercase;
}

/* =========================================================
   Selection
   ========================================================= */
::selection {
    background: #8FA37A;
    color: #1F2A1B;
}
