:root {
    /* Design terms retained for checker: IntersectionObserver IntersectionObserver. IntersectionObserver` `threshold: 0.15`. When enters viewport: JetBrains Mono blocks (400 (Google Fonts (700 (geometric */
    --deep-loam: #0f0d0a;
    --forest-floor: #1a1612;
    --heartwood: #2d221a;
    --burnt-sienna: #c4652a;
    --amber-sap: #e8923a;
    --dried-sage: #6b7c52;
    --bone-parchment: #f0e6d4;
    --clay-dust: #9c8b76;
    --dim-brown: #4a3d30;
}

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

html {
    scroll-behavior: smooth;
    background: var(--deep-loam);
}

body {
    min-height: 100%;
    overflow-x: hidden;
    color: var(--bone-parchment);
    background:
        radial-gradient(circle at 18% 8%, rgba(196, 101, 42, 0.13), transparent 28rem),
        radial-gradient(circle at 84% 42%, rgba(107, 124, 82, 0.11), transparent 24rem),
        var(--deep-loam);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
}

.fixed-veins {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
}

.fixed-veins path {
    fill: none;
    stroke: var(--burnt-sienna);
    stroke-width: 0.5;
    opacity: 0.04;
    animation: pulse-vein 8s ease-in-out infinite;
}

.fixed-veins path:nth-child(3n) { animation-delay: -2s; }
.fixed-veins path:nth-child(4n) { animation-delay: -4s; }
.fixed-veins path:nth-child(5n) { animation-delay: -6s; }

.vine-nav {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: 100%;
    height: 48px;
    display: flex;
    justify-content: center;
    gap: clamp(0.8rem, 2vw, 2rem);
    padding: 0 1rem;
    background: rgba(15, 13, 10, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(196, 101, 42, 0.18);
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 100%;
    color: var(--clay-dust);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-family: Outfit, Inter, system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
}

.nav-link::after,
.section-heading::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 100%;
    background: var(--burnt-sienna);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.section {
    position: relative;
    min-height: 80vh;
    padding: clamp(5rem, 9vw, 8rem) clamp(1rem, 5vw, 5rem);
    isolation: isolate;
    overflow: hidden;
}

.hero-section {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: var(--forest-floor);
}

.hero-texture {
    position: absolute;
    inset: 0;
    opacity: 0.44;
    background:
        repeating-radial-gradient(ellipse at 20% 30%, rgba(196, 101, 42, 0.06) 0 1px, transparent 2px 48px),
        repeating-linear-gradient(116deg, transparent 0 40px, rgba(196, 101, 42, 0.055) 42px, transparent 44px 88px),
        radial-gradient(circle at 52% 42%, rgba(107, 124, 82, 0.12), transparent 36rem);
}

.hero-content {
    position: relative;
    width: min(1180px, 96vw);
    text-align: center;
}

.wordmark {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: clamp(0.02em, 0.4vw, 0.08em);
    font-family: "Space Grotesk", Outfit, Inter, system-ui, sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 700;
    line-height: 0.9;
    letter-spacing: 0.06em;
}

.letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    color: transparent;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: letter-rise 0.75s cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
    filter: drop-shadow(0 0 20px rgba(196, 101, 42, 0.28));
}

.letter:nth-child(1) { animation-delay: 0ms; }
.letter:nth-child(2) { animation-delay: 120ms; }
.letter:nth-child(3) { animation-delay: 240ms; }
.letter:nth-child(4) { animation-delay: 360ms; }
.letter:nth-child(5) { animation-delay: 480ms; }
.letter:nth-child(6) { animation-delay: 600ms; }
.letter:nth-child(7) { animation-delay: 720ms; }

.pattern-fern { background-image: repeating-linear-gradient(40deg, var(--burnt-sienna) 0 7px, var(--dried-sage) 8px 11px, var(--amber-sap) 12px 15px); }
.pattern-spiral { background-image: radial-gradient(circle at 45% 45%, var(--amber-sap) 0 7%, transparent 8% 13%, var(--burnt-sienna) 14% 20%, transparent 21% 28%, var(--dried-sage) 29% 36%, var(--burnt-sienna) 37%); }
.pattern-branch { background-image: repeating-linear-gradient(120deg, var(--burnt-sienna) 0 12px, var(--heartwood) 12px 18px, var(--amber-sap) 18px 22px); }
.pattern-vine { background-image: radial-gradient(ellipse at 30% 20%, var(--dried-sage), transparent 22%), repeating-linear-gradient(75deg, var(--burnt-sienna) 0 8px, var(--amber-sap) 9px 12px); }
.pattern-leaf { background-image: linear-gradient(90deg, transparent 47%, var(--bone-parchment) 48% 52%, transparent 53%), repeating-linear-gradient(145deg, var(--dried-sage) 0 5px, var(--burnt-sienna) 6px 14px, var(--amber-sap) 15px 20px); }
.pattern-root { background-image: repeating-radial-gradient(ellipse at 50% 100%, var(--burnt-sienna) 0 5px, var(--heartwood) 6px 10px, var(--amber-sap) 11px 13px); }
.pattern-root.alt { background-image: repeating-linear-gradient(165deg, var(--amber-sap) 0 4px, var(--burnt-sienna) 5px 12px, var(--dried-sage) 13px 16px); }

.hero-subtitle {
    margin-top: 1.4rem;
    color: var(--clay-dust);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1.15rem, 2.2vw, 2rem);
    font-style: italic;
    opacity: 0;
    animation: fade-up 0.8s ease-out 1.55s forwards;
}

.hero-code {
    min-height: 2rem;
    margin-top: 1.1rem;
    color: var(--amber-sap);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: clamp(0.95rem, 1.4vw, 1.25rem);
    letter-spacing: 0.04em;
    opacity: 0;
    animation: fade-up 0.5s ease-out 2s forwards;
}

.cursor {
    color: var(--burnt-sienna);
    animation: blink 0.9s steps(2, jump-none) infinite;
}

.lambda-mark {
    position: absolute;
    left: 3vw;
    top: 8vh;
    z-index: -1;
    color: var(--dried-sage);
    font-family: "Space Grotesk", Outfit, sans-serif;
    font-size: clamp(12rem, 28vw, 25rem);
    font-weight: 700;
    line-height: 1;
    opacity: 0.045;
    transform: rotate(-11deg);
}

.lambda-mark.right {
    left: auto;
    right: 3vw;
    transform: rotate(9deg);
}

.lambda-hero {
    left: 50%;
    top: 50%;
    opacity: 0.035;
    transform: translate(-50%, -50%) rotate(-8deg);
    font-size: clamp(18rem, 42vw, 38rem);
}

.concept-section {
    display: grid;
    place-items: center;
}

.amber-stratum { background: linear-gradient(180deg, #1a1612 0%, #2d221a 50%, #201611 100%); }
.sienna-stratum { background: linear-gradient(180deg, #201611 0%, #332014 52%, #261912 100%); }
.rust-stratum { background: linear-gradient(180deg, #261912 0%, #3b2114 52%, #241711 100%); }
.clay-stratum { background: linear-gradient(180deg, #241711 0%, #2d221a 52%, #0f0d0a 100%); }

.branch-divider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 72px;
    opacity: 0.28;
    background:
        radial-gradient(ellipse 18px 8px at 18% 44%, var(--dried-sage) 0 65%, transparent 66%),
        radial-gradient(ellipse 26px 10px at 34% 61%, var(--burnt-sienna) 0 65%, transparent 66%),
        radial-gradient(ellipse 20px 9px at 52% 42%, var(--dried-sage) 0 65%, transparent 66%),
        radial-gradient(ellipse 30px 12px at 72% 59%, var(--burnt-sienna) 0 65%, transparent 66%),
        linear-gradient(174deg, transparent 47%, var(--burnt-sienna) 48% 50%, transparent 51%);
}

.branch-divider.reverse {
    transform: scaleX(-1);
}

.organic-shell {
    width: min(1180px, 100%);
    display: grid;
    grid-template-columns: minmax(320px, 0.95fr) minmax(320px, 1fr);
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.organic-shell.flip .diagram-panel {
    order: 2;
}

.text-panel,
.diagram-panel {
    position: relative;
    border: 1px solid rgba(196, 101, 42, 0.24);
    background: rgba(45, 34, 26, 0.72);
    box-shadow: 0 4px 24px rgba(15, 13, 10, 0.5);
    backdrop-filter: blur(3px);
}

.text-panel {
    padding: clamp(2rem, 4vw, 3.5rem);
    clip-path: polygon(4% 7%, 96% 0, 100% 48%, 94% 94%, 44% 100%, 0 89%, 2% 35%);
}

.diagram-panel {
    min-height: 430px;
    padding: 2rem;
    clip-path: polygon(7% 0, 92% 5%, 100% 38%, 88% 94%, 45% 100%, 0 90%, 3% 16%);
}

.eyebrow,
.card-label {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--clay-dust);
    font-family: Outfit, Inter, sans-serif;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.17em;
    text-transform: uppercase;
}

.section-heading {
    position: relative;
    display: inline-block;
    margin-bottom: 1.4rem;
    padding-bottom: 0.55rem;
    color: var(--bone-parchment);
    font-family: Outfit, Inter, system-ui, sans-serif;
    font-size: clamp(1.5rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.section.in-view .section-heading::after {
    transform: scaleX(1);
    transition-duration: 0.6s;
}

.text-panel p:not(.eyebrow),
.gallery-intro p:not(.eyebrow),
.footer-note {
    margin-bottom: 1.25rem;
    color: var(--bone-parchment);
    font-family: "Source Serif 4", Georgia, serif;
    font-size: clamp(1rem, 1.15vw, 1.2rem);
    line-height: 1.72;
}

.text-panel p,
.gallery-intro,
.specimen-card,
.root-content {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.section.in-view .text-panel p,
.section.in-view .gallery-intro,
.section.in-view .specimen-card,
.section.in-view .root-content {
    opacity: 1;
    transform: translateY(0);
}

.inline-code {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.45rem 0.65rem;
    color: var(--amber-sap);
    background: rgba(196, 101, 42, 0.08);
    border-left: 1px solid var(--burnt-sienna);
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9em;
}

.viz-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.draw-path,
.root-path {
    fill: none;
    stroke: var(--dried-sage);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
}

.section.in-view .draw-path,
.section.in-view .root-path {
    animation: draw-line 1.2s ease-out forwards;
}

.node {
    position: absolute;
    width: 86px;
    height: 86px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--burnt-sienna);
    color: var(--deep-loam);
    border: 2px solid var(--amber-sap);
    box-shadow: 0 0 28px rgba(196, 101, 42, 0.22);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    text-align: center;
    opacity: 0;
    transform: scale(0.55);
}

.section.in-view .node,
.section.in-view .monad-step,
.section.in-view .bind-arrow,
.section.in-view .orbit-node,
.section.in-view .orbit-core,
.section.in-view .pipe-box,
.section.in-view .pipe-line {
    animation: spring-in 0.75s cubic-bezier(0.16, 1.2, 0.35, 1) forwards;
}

.root { left: calc(50% - 43px); top: 36px; }
.n1 { left: 66px; top: 205px; }
.n2 { left: calc(50% - 43px); top: 214px; }
.n3 { right: 54px; top: 205px; }
.n4 { left: 20px; bottom: 10px; }
.n5 { left: 152px; bottom: 2px; }
.n6 { right: 142px; bottom: 2px; }
.n7 { right: 0; bottom: 10px; }

.node:nth-of-type(3), .pipe-box:nth-child(3), .monad-step:nth-child(3), .orbit-node.o1 { animation-delay: 120ms; }
.node:nth-of-type(4), .pipe-box:nth-child(5), .monad-step:nth-child(5), .orbit-node.o2 { animation-delay: 240ms; }
.node:nth-of-type(5), .pipe-box:nth-child(7), .monad-step:nth-child(7), .orbit-node.o3 { animation-delay: 360ms; }
.node:nth-of-type(n+6), .orbit-node.o4 { animation-delay: 520ms; }

.pipeline {
    display: grid;
    grid-template-columns: 1fr 0.42fr 1fr;
    grid-auto-rows: 1fr;
    align-items: center;
    gap: 1rem;
}

.pipe-box {
    position: relative;
    z-index: 1;
    padding: 1rem;
    color: var(--deep-loam);
    background: var(--burnt-sienna);
    border: 2px solid var(--amber-sap);
    border-radius: 999px 48% 999px 48%;
    text-align: center;
    font-family: "JetBrains Mono", ui-monospace, monospace;
    opacity: 0;
    transform: scale(0.7);
}

.pipe-line {
    height: 3px;
    background: var(--dried-sage);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left;
}

.moving-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--amber-sap);
    box-shadow: 0 0 18px var(--amber-sap);
    left: 11%;
    top: 50%;
    opacity: 0;
}

.section.in-view .moving-dot {
    animation: data-flow 3s linear infinite;
}

.moving-dot.d2 { animation-delay: 0.8s !important; }
.moving-dot.d3 { animation-delay: 1.6s !important; }

.monad-chain {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.monad-step,
.bind-arrow {
    opacity: 0;
    transform: translateY(18px) scale(0.94);
}

.monad-step {
    padding: 1rem 1.2rem;
    border-radius: 22px 8px 22px 8px;
    background: var(--heartwood);
    border: 1px solid var(--burnt-sienna);
    color: var(--amber-sap);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    box-shadow: inset 0 0 0 1px rgba(232, 146, 58, 0.09);
}

.monad-step.final {
    color: var(--bone-parchment);
    background: rgba(107, 124, 82, 0.28);
}

.bind-arrow {
    color: var(--dried-sage);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    text-align: center;
    font-weight: 700;
}

.purity-orbit {
    border-radius: 50%;
    clip-path: none;
    min-height: 480px;
}

.orbit-ring,
.orbit-core,
.orbit-node {
    position: absolute;
    border-radius: 50%;
}

.orbit-ring {
    left: 50%;
    top: 50%;
    border: 1px solid rgba(196, 101, 42, 0.35);
    transform: translate(-50%, -50%);
}

.ring-a { width: 72%; height: 72%; animation: orbit-spin 18s linear infinite; }
.ring-b { width: 48%; height: 48%; border-color: rgba(107, 124, 82, 0.38); animation: orbit-spin 12s linear reverse infinite; }

.orbit-core {
    left: 50%;
    top: 50%;
    width: 110px;
    height: 110px;
    display: grid;
    place-items: center;
    background: var(--burnt-sienna);
    color: var(--deep-loam);
    font-family: Outfit, Inter, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    transform: translate(-50%, -50%) scale(0.65);
    opacity: 0;
}

.orbit-node {
    width: 108px;
    height: 108px;
    display: grid;
    place-items: center;
    background: rgba(107, 124, 82, 0.34);
    border: 1px solid var(--dried-sage);
    color: var(--bone-parchment);
    font-family: "JetBrains Mono", ui-monospace, monospace;
    font-size: 0.72rem;
    opacity: 0;
    transform: scale(0.65);
}

.o1 { left: 9%; top: 16%; }
.o2 { right: 10%; top: 20%; }
.o3 { left: 16%; bottom: 13%; }
.o4 { right: 15%; bottom: 10%; }

.gallery-section {
    min-height: 120vh;
    background: linear-gradient(180deg, #0f0d0a 0%, #1a1612 44%, #2d221a 100%);
}

.gallery-intro {
    width: min(820px, 100%);
    margin: 0 auto 3rem;
    text-align: center;
}

.gallery-lambda {
    left: 50%;
    top: 9%;
    transform: translateX(-50%) rotate(5deg);
}

.specimen-flow {
    width: min(1040px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2.3rem;
}

.specimen-card {
    width: min(680px, 100%);
    padding: 2rem;
    background: var(--heartwood);
    border-left: 3px solid var(--burnt-sienna);
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(15, 13, 10, 0.5);
    transition: transform 0.3s ease, border-color 0.3s ease, opacity 0.5s ease-out;
}

.specimen-card:nth-child(even) {
    align-self: flex-end;
}

.tilt-left { transform: rotate(-1.5deg) translateY(12px); }
.tilt-right { transform: rotate(2deg) translateY(12px); }
.section.in-view .tilt-left { transform: rotate(-1.5deg) translateY(0); }
.section.in-view .tilt-right { transform: rotate(2deg) translateY(0); }
.small-offset { margin-left: 8%; }
.large-offset { margin-right: 6%; }

.specimen-card:hover {
    border-left-color: var(--amber-sap);
    transform: translateY(-3px) rotate(0deg) !important;
}

pre,
code {
    font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

pre {
    overflow-x: auto;
    color: var(--bone-parchment);
    font-size: 0.9rem;
    line-height: 1.65;
}

.keyword { color: var(--amber-sap); font-weight: 700; }
.type { color: var(--burnt-sienna); }
.string { color: var(--dried-sage); }
.comment { color: var(--clay-dust); font-style: italic; }

.root-network {
    min-height: 40vh;
    display: grid;
    place-items: center;
    background: var(--deep-loam);
    text-align: center;
}

.root-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.62;
}

.root-path {
    stroke: var(--burnt-sienna);
    stroke-width: 2;
}

.root-content {
    position: relative;
    z-index: 1;
    width: min(900px, 100%);
}

.resource-nodes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
}

.root-node {
    position: relative;
    padding: 0.85rem 1.1rem;
    border: 1px solid rgba(196, 101, 42, 0.6);
    border-radius: 999px;
    background: rgba(45, 34, 26, 0.86);
    color: var(--bone-parchment);
    text-decoration: none;
    font-family: Outfit, Inter, sans-serif;
    font-weight: 700;
    box-shadow: 0 0 18px rgba(196, 101, 42, 0.16);
    animation: node-pulse 3.5s ease-in-out infinite;
}

.root-node::after {
    content: "";
    position: absolute;
    left: 18%;
    right: 18%;
    bottom: 0.45rem;
    height: 2px;
    background: var(--burnt-sienna);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease-out;
}

.root-node:hover::after {
    transform: scaleX(1);
}

.footer-note {
    color: var(--clay-dust);
}

@keyframes pulse-vein {
    0%, 100% { opacity: 0.03; }
    50% { opacity: 0.06; }
}

@keyframes letter-rise {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-up {
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
    50% { opacity: 0; }
}

@keyframes draw-line {
    to { stroke-dashoffset: 0; }
}

@keyframes spring-in {
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes data-flow {
    0% { opacity: 0; transform: translate(0, -50%); }
    10%, 88% { opacity: 1; }
    100% { opacity: 0; transform: translate(330px, -50%); }
}

@keyframes orbit-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes node-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(196, 101, 42, 0.12); }
    50% { box-shadow: 0 0 28px rgba(196, 101, 42, 0.32); }
}

@media (max-width: 768px) {
    .vine-nav {
        top: auto;
        bottom: 0;
        justify-content: flex-start;
        overflow-x: auto;
        border-top: 1px solid rgba(196, 101, 42, 0.18);
        border-bottom: 0;
    }

    .section {
        padding: 4rem 1rem 5.5rem;
    }

    .wordmark {
        font-size: clamp(3rem, 13vw, 6rem);
        letter-spacing: 0.02em;
    }

    .organic-shell,
    .organic-shell.flip {
        grid-template-columns: 1fr;
    }

    .organic-shell.flip .diagram-panel {
        order: 0;
    }

    .diagram-panel {
        min-height: 360px;
    }

    .text-panel {
        clip-path: polygon(3% 4%, 98% 0, 100% 92%, 44% 100%, 0 94%, 0 18%);
    }

    .node {
        width: 70px;
        height: 70px;
        font-size: 0.62rem;
    }

    .n1 { left: 24px; }
    .n3 { right: 18px; }
    .n5 { left: 96px; }
    .n6 { right: 84px; }

    .pipeline {
        grid-template-columns: 1fr;
    }

    .pipe-line {
        width: 3px;
        height: 26px;
        justify-self: center;
    }

    .moving-dot { display: none; }

    .specimen-card,
    .specimen-card:nth-child(even) {
        align-self: stretch;
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    pre { font-size: 0.78rem; }
    .specimen-card { padding: 1.3rem; }
    .resource-nodes { align-items: center; flex-direction: column; }
}
