:root {
    --bg-primary: #0a1f14;
    --bg-secondary: #0f2b1c;
    --text-primary: #c8d6c0;
    --text-emphasis: #e8f0e4;
    --accent-primary: #4a7a5a;
    --accent-secondary: #6b8f71;
    --accent-amber: #c9a84c;
    --border-color: #2d4a3e;
    --num-green: #8fbf9a;
    --font-primary: 'JetBrains Mono', monospace;
    --font-nav: 'Space Mono', monospace;
}

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

html {
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: hidden;
}

.lambda-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-primary);
    font-size: 40vw;
    color: var(--bg-secondary);
    z-index: 0;
    pointer-events: none;
    user-select: none;
    line-height: 1;
}

.nav-signature {
    font-family: var(--font-nav);
    font-size: 14px;
    color: var(--accent-primary);
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.nav-fn { color: var(--accent-secondary); }
.nav-op { color: var(--text-primary); opacity: 0.6; }
.nav-type { color: var(--accent-amber); }
.nav-paren { color: var(--text-primary); opacity: 0.5; }
.nav-dimmed { color: var(--border-color); }

.nav-link {
    color: var(--accent-primary);
    text-decoration: none;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-secondary);
    transition: width 0.4s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.cursor {
    color: var(--accent-amber);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.content-column {
    max-width: 42rem;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.section {
    padding: 6rem 0;
    position: relative;
}

.section + .section,
.tree-divider + .section {
    margin-top: 6rem;
}

.hero-section {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 40vh;
}

.hero-fade {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.hero-fade.visible {
    opacity: 1;
}

.prompt-line, .prompt-response {
    font-family: var(--font-primary);
    font-size: clamp(1rem, 2vw, 1.25rem);
}

.prompt-prefix { color: var(--accent-secondary); }
.prompt-cmd { color: var(--text-emphasis); }
.prompt-result { color: var(--accent-amber); }

.section-title {
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--text-emphasis);
    letter-spacing: 0.02em;
    margin-bottom: 1rem;
}

.section-divider {
    height: 1px;
    background-color: var(--border-color);
    opacity: 0;
    margin-bottom: 3rem;
    transition: opacity 1.2s ease-out;
}

.section-divider.visible {
    opacity: 0.3;
}

.margin-annotation {
    position: absolute;
    left: -18rem;
    width: 14rem;
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 13px;
    line-height: 1.6;
    color: var(--accent-secondary);
    opacity: 0.85;
    font-feature-settings: "liga" 1, "calt" 1;
    position: sticky;
    top: 2rem;
}

.body-text {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.annotation {
    font-family: var(--font-primary);
    font-weight: 300;
    font-size: 13px;
    line-height: 1.6;
    color: var(--accent-secondary);
    margin: 1rem 0 2rem;
    font-feature-settings: "liga" 1, "calt" 1;
}

.code-block {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-left: 2px solid var(--accent-primary);
    margin: 2rem 0;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    line-height: 1.75;
}

.code-block code {
    font-family: inherit;
    color: var(--text-primary);
}

.code-cursor {
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
}

.line-num {
    color: var(--border-color);
    opacity: 0.6;
    user-select: none;
    display: inline-block;
    width: 2ch;
    text-align: right;
    margin-right: 1.5ch;
}

.kw { color: var(--text-emphasis); font-weight: 700; }
.type { color: var(--accent-amber); }
.fn { color: var(--accent-primary); }
.op { color: var(--text-primary); }
.str { color: var(--accent-secondary); }
.num { color: var(--num-green); }
.comment { color: var(--border-color); opacity: 0.6; font-style: italic; }

.tree-divider {
    padding: 4rem 0;
    display: flex;
    justify-content: center;
}

.tree-divider svg {
    width: 200px;
    height: 120px;
}

.tree-divider-inline svg {
    width: 280px;
    height: 140px;
}

.tree-branch {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    transition: stroke-dashoffset 2s ease-out;
}

.tree-divider.visible .tree-branch,
.tree-divider-inline.visible .tree-branch {
    stroke-dashoffset: 0;
}

.resource-list {
    list-style: none;
    padding: 0;
}

.resource-list li {
    font-family: var(--font-primary);
    font-size: 0.95rem;
    color: var(--text-primary);
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(45, 74, 62, 0.15);
}

.text-link {
    color: var(--accent-secondary);
    text-decoration: none;
    position: relative;
}

.text-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--accent-secondary);
    transition: width 0.4s ease;
}

.text-link:hover::after {
    width: 100%;
}

.epilogue {
    padding: 8rem 0;
    text-align: left;
}

.epilogue-sig {
    padding: 0;
}

.io-pulse {
    animation: pulse-once 1.5s ease-in-out 1;
}

@keyframes pulse-once {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; color: var(--accent-amber); }
}

.silence {
    height: 50vh;
}

.fade-reveal {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}

.fade-reveal.visible {
    opacity: 1;
}

@media (min-width: 1201px) {
    .margin-annotation {
        position: absolute;
        left: -18rem;
        width: 14rem;
        top: auto;
    }
}

@media (max-width: 1200px) {
    .margin-annotation {
        position: relative;
        left: 0;
        width: 100%;
        margin-bottom: 1.5rem;
        opacity: 0.7;
    }
}

@media (max-width: 768px) {
    .content-column {
        padding: 0 1.5rem;
    }
    .nav-signature {
        font-size: 11px;
        padding: 1.5rem;
        word-break: break-all;
    }
    .hero-section {
        padding-top: 20vh;
    }
    .lambda-watermark {
        font-size: 60vw;
    }
    .section {
        padding: 4rem 0;
    }
    .section + .section,
    .tree-divider + .section {
        margin-top: 3rem;
    }
}

@media (max-width: 480px) {
    .code-block {
        font-size: 0.8rem;
        padding: 1rem;
    }
    .body-text {
        font-size: 0.9rem;
    }
    .tree-divider svg {
        width: 160px;
        height: 96px;
    }
}
