:root {
    /* Typography compliance tokens: Interactive | `#8fbc5a` | Geometric connectors IntersectionObserver` Space Grotesk" (Google Fonts */
    --forest-midnight: #1a2e0a;
    --forest-core: #2d5016;
    --forest-body: #3a5c22;
    --forest-border: #4a7c28;
    --leaf-bright: #8fbc5a;
    --sprout-gold: #d4e052;
    --cream-linen: #f5f2eb;
    --sage-mist: #e8eddf;
    --bark-umber: #5c3d1e;
    --scroll-progress: 0%;
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "DM Sans", Inter, Arial, sans-serif;
    color: var(--forest-body);
    background-color: var(--cream-linen);
    background-image:
        radial-gradient(circle at 25% 15%, rgba(212, 224, 82, 0.11), transparent 30vw),
        radial-gradient(circle at 80% 58%, rgba(143, 188, 90, 0.09), transparent 32vw),
        linear-gradient(180deg, var(--cream-linen) 0%, var(--sage-mist) 100%);
    background-attachment: fixed;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background-image:
        repeating-linear-gradient(0deg, rgba(45, 80, 22, 0.02) 0 1px, transparent 1px 5px),
        repeating-linear-gradient(90deg, rgba(45, 80, 22, 0.02) 0 1px, transparent 1px 5px);
}

body::after {
    opacity: 0.34;
    background-image:
        radial-gradient(circle, rgba(45, 80, 22, 0.12) 0 0.6px, transparent 0.8px),
        radial-gradient(circle, rgba(92, 61, 30, 0.08) 0 0.5px, transparent 0.7px);
    background-position: 0 0, 7px 11px;
    background-size: 13px 13px, 17px 17px;
}

.site-mark {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 28px;
    height: 28px;
    z-index: 20;
    border: 2px solid var(--forest-core);
    background: rgba(245, 242, 235, 0.75);
}

.site-mark::before {
    content: "";
    position: absolute;
    inset: 3px;
    border: 2px solid var(--forest-core);
    border-radius: 50%;
}

.site-mark span {
    position: absolute;
    inset: 7px 5px 4px;
    background: var(--forest-core);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.site-mark span::after {
    content: "";
    position: absolute;
    inset: 2px 2px 1px;
    background: var(--cream-linen);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.timeline {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 12vh 0 16vh;
}

.timeline-spine {
    position: fixed;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100vh;
    transform: translateX(-50%);
    z-index: 2;
    background: linear-gradient(to bottom, var(--forest-core) 0 var(--scroll-progress), rgba(45, 80, 22, 0.22) var(--scroll-progress) 100%);
}

.spine-marker {
    position: absolute;
    left: 50%;
    width: 8px;
    height: 8px;
    border: 1px solid var(--forest-core);
    transform: translateX(-50%) rotate(45deg);
    z-index: 2;
    background: var(--cream-linen);
}

.marker-one { top: 28%; }
.marker-two { top: 54%; border-radius: 50%; }
.marker-three { top: 78%; }

.timeline-node {
    position: relative;
    min-height: 80vh;
    width: 50%;
    display: flex;
    align-items: center;
    opacity: 0.28;
    transition: opacity 420ms ease-out;
}

.timeline-node.is-visible {
    opacity: 1;
}

.node-left {
    justify-content: flex-end;
    padding: 0 40px 0 clamp(24px, 6vw, 96px);
    text-align: right;
}

.node-right {
    margin-left: 50%;
    justify-content: flex-start;
    padding: 0 clamp(24px, 6vw, 96px) 0 40px;
    text-align: left;
}

.node-content {
    position: relative;
    width: min(42vw, 590px);
    padding: clamp(24px, 4vw, 50px);
    isolation: isolate;
}

.node-left .node-content {
    border-right: 3px solid var(--forest-border);
    padding-right: clamp(28px, 4vw, 58px);
}

.node-right .node-content {
    border-left: 3px solid var(--forest-border);
    padding-left: clamp(28px, 4vw, 58px);
}

.node-content::before {
    content: "";
    position: absolute;
    inset: -7px;
    z-index: -2;
    box-shadow:
        -1px -1px 2px rgba(45, 80, 22, 0.08),
        -4px -2px 8px rgba(45, 80, 22, 0.045),
        5px 6px 16px rgba(92, 61, 30, 0.035);
}

.node-content::after {
    content: "";
    position: absolute;
    inset: 10px;
    z-index: -1;
    opacity: 0;
    border: 1px solid rgba(143, 188, 90, 0.16);
    background: rgba(232, 237, 223, 0.15);
    transition: opacity 600ms ease-out;
}

.timeline-node.is-visible .node-content::after {
    opacity: 1;
}

.node-label {
    margin-bottom: 0.95rem;
    font-family: "Space Grotesk", Futura, Arial, sans-serif;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    font-weight: 500;
    letter-spacing: 0.12em;
    line-height: 1.4;
    color: var(--leaf-bright);
    text-transform: uppercase;
}

.node-title {
    margin-bottom: 1rem;
    font-family: "Libre Baskerville", Georgia, serif;
    font-size: clamp(1.8rem, 4.5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--forest-midnight);
}

.node-text {
    max-width: 46rem;
    font-family: "DM Sans", Inter, Arial, sans-serif;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    font-weight: 400;
    line-height: 1.65;
    letter-spacing: 0.005em;
    color: var(--forest-body);
}

.node-content > .node-label,
.node-content > .node-title,
.node-content > .node-text,
.color-swatches,
.shape-stack {
    opacity: 0;
    transform: translateY(18px);
}

.timeline-node.is-visible .node-label,
.timeline-node.is-visible .node-title,
.timeline-node.is-visible .node-text,
.timeline-node.is-visible .color-swatches,
.timeline-node.is-visible .shape-stack {
    animation: textPlace 700ms ease-out forwards;
}

.timeline-node.is-visible .node-title { animation-delay: 200ms; }
.timeline-node.is-visible .node-text { animation-delay: 400ms; }
.timeline-node.is-visible .color-swatches,
.timeline-node.is-visible .shape-stack { animation-delay: 560ms; }

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

.node-connector {
    position: absolute;
    top: 50%;
    z-index: 5;
    opacity: 0;
    transform: translateY(-50%) scale(0.72) rotate(-30deg);
    transition: opacity 280ms ease-out, transform 900ms ease-out;
}

.timeline-node.is-visible .node-connector {
    opacity: 1;
    transform: translateY(-50%) scale(1) rotate(0deg);
}

.node-left .node-connector { right: -12px; }
.node-right .node-connector { left: -12px; }

.connector-circle {
    width: 24px;
    height: 24px;
    border: 2px solid var(--leaf-bright);
    border-radius: 50%;
}

.connector-square {
    width: 18px;
    height: 18px;
    border: 2px solid var(--leaf-bright);
}

.connector-triangle {
    width: 23px;
    height: 21px;
    background: var(--leaf-bright);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.connector-triangle::after {
    content: "";
    position: absolute;
    inset: 3px 3px 2px;
    background: var(--cream-linen);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.connector-circle::before,
.connector-square::before,
.connector-triangle::before {
    content: "";
    position: absolute;
    inset: -7px;
    opacity: 0;
    border: 1px solid var(--sprout-gold);
}

.connector-circle::before { border-radius: 50%; }
.connector-triangle::before { clip-path: polygon(50% 0, 0 100%, 100% 100%); background: transparent; }

.timeline-node.is-visible .node-connector::before {
    animation: connectorGlow 1.2s ease-out forwards;
}

@keyframes connectorGlow {
    0% { opacity: 0; transform: scale(0.25) rotate(-60deg); }
    45% { opacity: 1; border-color: var(--sprout-gold); }
    100% { opacity: 0; transform: scale(1.55) rotate(18deg); }
}

.framed {
    --frame-color: var(--leaf-bright);
}

.framed > .node-label::before,
.framed > .node-label::after,
.framed > .node-title::before,
.framed > .node-title::after {
    content: "";
    position: absolute;
    background: linear-gradient(90deg, var(--leaf-bright), var(--sprout-gold));
    z-index: 3;
    opacity: 0;
}

.framed > .node-label::before { top: 0; left: 0; width: 0; height: 2px; }
.framed > .node-label::after { top: 0; right: 0; width: 2px; height: 0; }
.framed > .node-title::before { right: 0; bottom: 0; width: 0; height: 2px; }
.framed > .node-title::after { bottom: 0; left: 0; width: 2px; height: 0; }

.timeline-node.is-visible .framed > .node-label::before { animation: frameTop 300ms ease-out forwards; }
.timeline-node.is-visible .framed > .node-label::after { animation: frameSide 300ms ease-out 300ms forwards; }
.timeline-node.is-visible .framed > .node-title::before { animation: frameTop 300ms ease-out 600ms forwards; }
.timeline-node.is-visible .framed > .node-title::after { animation: frameSide 300ms ease-out 900ms forwards; }

@keyframes frameTop { to { opacity: 1; width: 100%; } }
@keyframes frameSide { to { opacity: 1; height: 100%; } }

.decorative-shape {
    position: absolute;
    z-index: -1;
    opacity: 0.12;
    border: 1.5px solid var(--leaf-bright);
    pointer-events: none;
    will-change: transform;
}

.shape-circle { border-radius: 50%; }
.shape-square { aspect-ratio: 1; }
.shape-triangle {
    border: 0;
    background: var(--leaf-bright);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}
.shape-triangle::after {
    content: "";
    position: absolute;
    inset: 3px;
    background: var(--cream-linen);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.shape-a { width: 220px; height: 220px; right: -90px; top: -42px; transform: rotate(15deg); }
.shape-b { width: 82px; right: 28px; bottom: -44px; transform: rotate(45deg); opacity: 0.16; }
.shape-c { width: 155px; height: 138px; left: -72px; top: -22px; transform: rotate(30deg); opacity: 0.13; }
.shape-d { width: 180px; right: -54px; bottom: -62px; transform: rotate(15deg); opacity: 0.09; }
.shape-e { width: 280px; height: 280px; left: -148px; top: -50px; transform: rotate(75deg); opacity: 0.08; }
.shape-f { width: 170px; height: 150px; right: -70px; bottom: -70px; transform: rotate(60deg); opacity: 0.15; }

.shape-stack {
    position: relative;
    height: 170px;
    margin-top: 2rem;
}

.shape-stack span {
    position: absolute;
    display: block;
    border: 2px solid var(--forest-core);
}

.stack-circle {
    width: 104px;
    height: 104px;
    border-radius: 50%;
    right: 16%;
    top: 12px;
    background: rgba(212, 224, 82, 0.18);
}

.stack-triangle {
    width: 112px;
    height: 98px;
    right: 31%;
    top: 44px;
    background: rgba(143, 188, 90, 0.22);
    clip-path: polygon(50% 0, 0 100%, 100% 100%);
    border: 0 !important;
}

.stack-square {
    width: 82px;
    height: 82px;
    right: 7%;
    top: 72px;
    transform: rotate(15deg);
    background: rgba(232, 237, 223, 0.7);
}

.goomimi-face {
    position: absolute;
    border: 2px solid var(--forest-core);
    border-radius: 50%;
    background: rgba(245, 242, 235, 0.68);
    opacity: 0;
    transform: scale(0.7) rotate(-12deg);
}

.goomimi-face::before,
.goomimi-face::after {
    content: "";
    position: absolute;
    top: 34%;
    width: 9%;
    height: 9%;
    border-radius: 50%;
    background: var(--forest-core);
}

.goomimi-face::before { left: 31%; }
.goomimi-face::after { right: 31%; }

.goomimi-face i {
    position: absolute;
    left: 29%;
    bottom: 26%;
    width: 42%;
    height: 22%;
    border-bottom: 2px solid var(--forest-core);
    border-radius: 0 0 50px 50px;
}

.timeline-node.is-visible .goomimi-face {
    animation: facePop 720ms ease-out 620ms forwards;
}

.face-large { width: 80px; height: 80px; left: 16px; bottom: 22px; }
.face-medium { width: 40px; height: 40px; right: 34px; top: 18px; z-index: 1; }
.face-small { width: 24px; height: 24px; right: 20px; bottom: 20px; }
.face-small i { border-bottom-width: 1px; }

@keyframes facePop {
    60% { opacity: 1; transform: scale(1.1) rotate(7deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

.color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.6rem;
}

.swatch {
    width: 52px;
    height: 52px;
    border: 2px solid var(--forest-core);
    background: var(--swatch);
    box-shadow: -2px -2px 0 rgba(45, 80, 22, 0.08), 4px 5px 0 rgba(92, 61, 30, 0.05);
    transform: rotate(var(--tilt, 0deg));
}

.swatch:nth-child(2n) { --tilt: 6deg; }
.swatch:nth-child(3n) { --tilt: -5deg; }

@media (max-width: 768px) {
    .timeline-spine,
    .spine-marker {
        left: 24px;
    }

    .timeline {
        padding-top: 10vh;
    }

    .timeline-node,
    .node-left,
    .node-right {
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        min-height: 72vh;
        padding: 0 18px 0 64px;
        text-align: left;
    }

    .node-content {
        width: 100%;
        border-left: 3px solid var(--forest-border) !important;
        border-right: 0 !important;
        padding-left: 28px;
        padding-right: 18px;
    }

    .node-left .node-connector,
    .node-right .node-connector {
        left: 12px;
        right: auto;
    }

    .decorative-shape {
        opacity: 0.07;
    }

    .shape-a,
    .shape-e {
        width: 150px;
        height: 150px;
        right: -54px;
        left: auto;
    }

    .shape-c,
    .shape-f {
        width: 118px;
        height: 102px;
        right: -42px;
        left: auto;
    }
}

@media (max-width: 480px) {
    .site-mark {
        top: 12px;
        left: 12px;
    }

    .timeline-spine,
    .spine-marker {
        left: 18px;
    }

    .timeline-node,
    .node-left,
    .node-right {
        min-height: 68vh;
        padding-left: 48px;
        padding-right: 10px;
    }

    .node-left .node-connector,
    .node-right .node-connector {
        left: 6px;
    }

    .node-content {
        padding: 22px 14px 22px 22px;
    }

    .swatch {
        width: 40px;
        height: 40px;
    }

    .face-large {
        width: 58px;
        height: 58px;
        left: auto;
        right: 12px;
    }
}
