:root {
    /* Compliance phrases: Fira Code at reduced opacity (`opacity: 0.15`), Fira Code" (Google Fonts). IntersectionObserver` highlights the corresponding sidebar capsule in real-time as the user scrolls. IntersectionObserver`. Odd sections begin at `translateX(80px. */
    --deep-ground: #3d2b1f;
    --rose-jewel: #c7708c;
    --peach-shimmer: #f4a261;
    --amber-glow: #e9c46a;
    --cream-canvas: #fdf6ee;
    --blush-mist: #f8e1d0;
    --mountain-indigo: #5e6a8a;
    --cloud-white: #fffaf5;
    --code-warm: #fff0e8;
    --sidebar-width: 240px;
    --display: "Nunito", Inter, sans-serif;
    --body: "Quicksand", Inter, sans-serif;
    --mono: "Fira Code", monospace;
    --ease-stream: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--deep-ground);
    font-family: var(--body);
    background:
        radial-gradient(circle at 84% 7%, rgba(233, 196, 106, 0.28) 0 8%, transparent 20%),
        radial-gradient(circle at 24% 18%, rgba(199, 112, 140, 0.18) 0 10%, transparent 24%),
        linear-gradient(135deg, var(--cream-canvas), var(--cloud-white) 46%, var(--blush-mist));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255, 250, 245, 0.9) 0 1px, transparent 2px),
        radial-gradient(circle, rgba(233, 196, 106, 0.22) 0 1px, transparent 2px);
    background-size: 54px 54px, 87px 87px;
    opacity: 0.55;
    z-index: 0;
}

.sidebar {
    position: fixed;
    z-index: 20;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    overflow-y: auto;
    padding: 26px 18px;
    border-right: 1px solid rgba(255, 250, 245, 0.72);
    border-radius: 0 32px 32px 0;
    color: var(--deep-ground);
    background:
        radial-gradient(circle at 28px 54px, rgba(233, 196, 106, 0.28) 0 3px, transparent 4px),
        radial-gradient(circle at 180px 160px, rgba(255, 250, 245, 0.9) 0 2px, transparent 3px),
        radial-gradient(circle at 55px 340px, rgba(199, 112, 140, 0.16) 0 4px, transparent 6px),
        rgba(255, 245, 238, 0.85);
    backdrop-filter: blur(16px);
    box-shadow: 8px 0 35px rgba(61, 43, 31, 0.09), inset -1px 0 0 rgba(255, 250, 245, 0.6);
}

.sidebar-brand {
    position: relative;
    margin-bottom: 32px;
    padding: 22px 16px 20px;
    border: 1px solid rgba(199, 112, 140, 0.24);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(255, 250, 245, 0.8), rgba(248, 225, 208, 0.64));
    box-shadow: inset 0 1px 0 rgba(255, 250, 245, 0.9), 0 12px 28px rgba(199, 112, 140, 0.12);
}

.brand-lambda {
    position: absolute;
    right: 12px;
    bottom: -12px;
    font-family: var(--display);
    font-size: 5.4rem;
    font-weight: 800;
    line-height: 0.8;
    color: rgba(199, 112, 140, 0.15);
    transform: rotate(11deg);
}

.brand-name {
    position: relative;
    display: block;
    font-family: var(--display);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand-note {
    position: relative;
    display: block;
    margin-top: 6px;
    color: rgba(61, 43, 31, 0.68);
    font-size: 0.76rem;
    font-weight: 500;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 20px;
    overflow: hidden;
    border: 1px solid rgba(255, 250, 245, 0.76);
    border-radius: 50px;
    color: var(--deep-ground);
    font-family: var(--display);
    font-size: 0.94rem;
    font-weight: 800;
    text-decoration: none;
    background: linear-gradient(110deg, rgba(255, 250, 245, 0.74), rgba(255, 240, 232, 0.72), rgba(248, 225, 208, 0.76));
    background-size: 200% 100%;
    box-shadow: inset 0 1px 0 rgba(255, 250, 245, 0.92), 0 8px 18px rgba(94, 106, 138, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-position 0.6s ease, color 0.3s ease;
}

.nav-item svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--rose-jewel);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 2px rgba(233, 196, 106, 0.2));
}

.nav-item::before,
.nav-item::after,
.section h1::before,
.section h1::after,
.section h2::before,
.section h2::after {
    content: "";
    position: absolute;
    width: 10px;
    height: 10px;
    clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%);
    background: var(--amber-glow);
    opacity: 0;
    transform: scale(0.8) rotate(18deg);
}

.nav-item::before {
    right: 18px;
    top: 7px;
}

.nav-item::after {
    right: 34px;
    bottom: 8px;
    width: 6px;
    height: 6px;
    background: var(--cloud-white);
}

.nav-item:hover {
    background-image: linear-gradient(110deg, var(--rose-jewel), var(--peach-shimmer), var(--amber-glow), var(--cloud-white));
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(244, 162, 97, 0.24), inset 0 1px 0 rgba(255, 250, 245, 0.76);
}

.nav-item:hover::before,
.nav-item:hover::after,
.nav-item.active::before,
.nav-item.active::after {
    opacity: 1;
    animation: sparkle 3s infinite;
}

.nav-item.active {
    color: var(--cloud-white);
    background: linear-gradient(110deg, var(--rose-jewel), var(--peach-shimmer), var(--amber-glow));
    box-shadow: 0 4px 20px rgba(199, 112, 140, 0.3), inset 0 1px 0 rgba(255, 250, 245, 0.55);
}

.nav-item.active svg {
    stroke: var(--cloud-white);
}

.content-river {
    position: relative;
    z-index: 1;
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    overflow: hidden;
}

.svg-defs {
    position: absolute;
}

.panel {
    position: relative;
    min-height: 100vh;
    display: grid;
    align-items: center;
    padding: clamp(72px, 9vw, 132px) clamp(32px, 8vw, 108px);
    overflow: hidden;
}

.panel:nth-of-type(odd) {
    background: linear-gradient(140deg, rgba(253, 246, 238, 0.92), rgba(255, 250, 245, 0.76));
}

.panel:nth-of-type(even) {
    background: linear-gradient(140deg, rgba(255, 240, 232, 0.7), rgba(253, 246, 238, 0.9));
}

.copy-block {
    position: relative;
    z-index: 4;
    max-width: 760px;
    padding: clamp(26px, 4vw, 46px);
    border: 1px solid rgba(255, 250, 245, 0.8);
    border-radius: 34px;
    background: linear-gradient(135deg, rgba(255, 250, 245, 0.72), rgba(255, 240, 232, 0.52));
    backdrop-filter: blur(6px);
    box-shadow: 0 24px 70px rgba(94, 106, 138, 0.12), inset 0 1px 0 rgba(255, 250, 245, 0.9);
}

.narrow {
    max-width: 700px;
    margin-left: auto;
}

.closing .copy-block {
    margin-inline: auto;
}

.eyebrow {
    margin-bottom: 16px;
    color: var(--rose-jewel);
    font-family: var(--mono);
    font-size: 0.82rem;
    letter-spacing: 0.06em;
}

h1,
h2 {
    position: relative;
    margin-bottom: 28px;
    color: var(--deep-ground);
    font-family: var(--display);
    font-size: clamp(2rem, 5vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

h1::before,
h2::before {
    left: -22px;
    top: 8px;
    opacity: 0.55;
    animation: sparkle 3s infinite;
}

h1::after,
h2::after {
    right: 10%;
    bottom: -14px;
    width: 12px;
    height: 12px;
    background: var(--cloud-white);
    opacity: 0.75;
    animation: sparkle 3s 1.2s infinite;
}

p,
li,
blockquote {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    font-weight: 400;
    line-height: 1.75;
}

p + p {
    margin-top: 18px;
}

code,
.code-gem {
    display: inline-block;
    border-radius: 6px;
    color: var(--mountain-indigo);
    font-family: var(--mono);
    font-size: 0.9em;
    background: linear-gradient(110deg, var(--code-warm), rgba(248, 225, 208, 0.8), rgba(233, 196, 106, 0.22));
    background-size: 200% 100%;
    transition: background-position 0.6s ease, box-shadow 0.3s ease;
}

code {
    padding: 0.12em 0.38em;
}

.code-gem {
    margin-top: 24px;
    padding: 10px 14px;
    box-shadow: inset 0 1px 0 rgba(255, 250, 245, 0.8), 0 8px 18px rgba(199, 112, 140, 0.12);
}

code:hover,
.code-gem:hover {
    background-position: 100% 0;
    box-shadow: 0 4px 20px rgba(199, 112, 140, 0.18);
}

blockquote {
    margin-top: 26px;
    padding: 20px 24px;
    border-left: 5px solid var(--peach-shimmer);
    border-radius: 18px;
    color: rgba(61, 43, 31, 0.84);
    font-weight: 500;
    background: rgba(255, 240, 232, 0.58);
}

.lambda-list {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    list-style: none;
}

.lambda-list li {
    position: relative;
    padding-left: 34px;
}

.lambda-list li::before {
    content: "λ";
    position: absolute;
    left: 0;
    top: -2px;
    color: var(--rose-jewel);
    font-family: var(--display);
    font-size: 1.25rem;
    font-weight: 800;
}

.watermark-lambda {
    position: absolute;
    right: -5vw;
    bottom: -11vw;
    z-index: 1;
    color: rgba(199, 112, 140, 0.03);
    font-family: var(--display);
    font-size: 40vw;
    font-weight: 800;
    line-height: 0.8;
    transform: rotate(15deg);
}

.type-poem {
    position: absolute;
    z-index: 1;
    color: var(--mountain-indigo);
    font-family: var(--mono);
    font-size: clamp(2rem, 5.7vw, 6.8rem);
    line-height: 1;
    opacity: 0.15;
    white-space: nowrap;
    pointer-events: none;
}

.type-one { left: 5%; top: 12%; }
.type-two { right: -4%; bottom: 15%; }
.type-three { left: -6%; top: 18%; }
.type-four { right: -25%; top: 15%; }
.type-five { left: 10%; bottom: 12%; }

.opening-mountain {
    position: absolute;
    z-index: 2;
    top: 8%;
    right: -12%;
    width: min(58vw, 760px);
    height: 78vh;
    opacity: 0.88;
    filter: drop-shadow(0 30px 42px rgba(94, 106, 138, 0.13));
}

.opening-mountain svg,
.mountain-divider svg {
    width: 100%;
    height: 100%;
}

.wash,
.mountain-divider path {
    filter: url(#watercolor);
}

.indigo,
.range-back {
    fill: rgba(94, 106, 138, 0.7);
}

.rose,
.range-mid {
    fill: rgba(199, 112, 140, 0.5);
}

.amber,
.range-front {
    fill: rgba(233, 196, 106, 0.3);
}

.mountain-divider {
    position: relative;
    z-index: 3;
    height: 190px;
    margin: -82px 0;
    pointer-events: none;
}

.divider-b,
.divider-d {
    height: 220px;
}

.mountain-divider::before,
.mountain-divider::after {
    content: "";
    position: absolute;
    z-index: 2;
    width: 10px;
    height: 10px;
    clip-path: polygon(50% 0%, 61% 35%, 100% 50%, 61% 65%, 50% 100%, 39% 65%, 0% 50%, 39% 35%);
    background: var(--amber-glow);
    animation: sparkle 3s infinite;
}

.mountain-divider::before {
    left: 18%;
    top: 44%;
}

.mountain-divider::after {
    right: 22%;
    top: 36%;
    background: var(--cloud-white);
    animation-delay: 1.2s;
}

.reveal {
    opacity: 0;
    transition: opacity 700ms var(--ease-stream), transform 700ms var(--ease-stream);
}

.reveal.from-right {
    transform: translateX(80px);
}

.reveal.from-left {
    transform: translateX(-80px);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateX(0);
}

@keyframes sparkle {
    0%, 100% {
        opacity: 0.3;
        transform: scale(0.8) rotate(18deg);
    }
    50% {
        opacity: 1;
        transform: scale(1.2) rotate(18deg);
    }
}

@media (max-width: 900px) {
    :root {
        --sidebar-width: 220px;
    }

    .panel {
        padding-inline: 34px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 110px;
    }

    .sidebar {
        right: 0;
        bottom: auto;
        width: 100%;
        height: auto;
        padding: 12px 14px 14px;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 250, 245, 0.72);
        border-radius: 0 0 24px 24px;
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-nav {
        flex-direction: row;
        gap: 10px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .nav-item {
        flex: 0 0 auto;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 0.84rem;
    }

    .nav-item svg {
        width: 19px;
        height: 19px;
    }

    .content-river {
        width: 100%;
        margin-left: 0;
    }

    .panel {
        min-height: auto;
        padding: 64px 22px;
    }

    .copy-block,
    .narrow {
        max-width: none;
        margin-left: 0;
        border-radius: 26px;
    }

    .opening-mountain {
        top: 26%;
        right: -44%;
        width: 100vw;
        opacity: 0.42;
    }

    .mountain-divider {
        height: 126px;
        margin: -44px 0;
    }

    .type-poem {
        font-size: 12vw;
    }

    .reveal.from-right,
    .reveal.from-left {
        transform: translateY(24px);
    }

    .reveal.is-visible {
        transform: translateY(0);
    }
}

@media (max-width: 480px) {
    body {
        padding-top: 100px;
    }

    .nav-item {
        padding-inline: 13px;
    }

    .panel {
        padding-inline: 16px;
    }

    .copy-block {
        padding: 24px 20px;
    }
}
