:root {
    --moss: #31452A;
    --parchment: #FFF2C7;
    --rust: #9A4F2C;
    --mycelium: #B8F06A;
    --blacksoil: #17110B;
    --paper: #E7D3A2;
    --brass: #B8893D;
    --blue: #263C55;
    --display: 'Fraunces', serif;
    --body: 'Atkinson Hyperlegible', sans-serif;
    --mono: 'IBM Plex Mono', monospace; /* sparingly for command fragments */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--parchment);
    background: var(--blacksoil);
    font-family: var(--body);
    overflow-x: hidden;
}

.cave-background {
    position: fixed;
    inset: 0;
    z-index: -5;
    background:
        radial-gradient(circle at 18% 12%, rgba(184, 240, 106, .22), transparent 18rem),
        radial-gradient(circle at 83% 28%, rgba(154, 79, 44, .35), transparent 22rem),
        radial-gradient(circle at 45% 70%, rgba(38, 60, 85, .48), transparent 28rem),
        linear-gradient(140deg, #17110B 0%, #31452A 45%, #17110B 100%);
}

.grain {
    position: absolute;
    inset: 0;
    opacity: .28;
    background-image:
        repeating-linear-gradient(22deg, rgba(255,242,199,.04) 0 1px, transparent 1px 9px),
        repeating-linear-gradient(91deg, rgba(23,17,11,.55) 0 2px, transparent 2px 13px);
    mix-blend-mode: overlay;
}

.glow {
    position: absolute;
    width: 22rem;
    height: 22rem;
    border-radius: 50%;
    filter: blur(40px);
    opacity: .22;
    animation: breathe 7s ease-in-out infinite;
}

.glow-a { left: 8vw; top: 44vh; background: #B8F06A; }
.glow-b { right: 3vw; top: 120vh; background: #B8893D; animation-delay: -3s; }

.drawer-face {
    min-height: 100vh;
    display: grid;
    place-items: center;
    position: relative;
    background:
        linear-gradient(90deg, rgba(23,17,11,.8), transparent 18%, transparent 82%, rgba(23,17,11,.8)),
        repeating-linear-gradient(0deg, #6b361f 0 10px, #9A4F2C 10px 22px, #7d4328 22px 38px);
    box-shadow: inset 0 -3rem 7rem rgba(23,17,11,.85);
}

.brass-plate {
    width: min(74vw, 780px);
    min-height: 18rem;
    padding: 3.2rem 3rem;
    position: relative;
    text-align: center;
    color: #17110B;
    background:
        radial-gradient(circle at 24% 18%, rgba(255,242,199,.55), transparent 11rem),
        linear-gradient(135deg, #E7D3A2, #B8893D 42%, #9A4F2C 100%);
    border: 6px double #17110B;
    border-radius: 28px 18px 34px 20px;
    box-shadow: 0 2.2rem 5rem rgba(0,0,0,.48), inset 0 0 2rem rgba(255,242,199,.35);
    transform: rotate(-1.2deg);
}

.brass-plate h1 {
    margin: 0;
    font: 900 clamp(4rem, 12vw, 10rem)/.85 var(--display);
    letter-spacing: -.08em;
    font-variation-settings: 'WONK' 1, 'SOFT' 90;
    text-shadow: 1px 2px rgba(255,242,199,.4), -2px -1px rgba(23,17,11,.22);
}

.brass-plate p {
    margin: 1.3rem auto 0;
    max-width: 34rem;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .13em;
}

.plate-screw {
    position: absolute;
    top: 1.2rem;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #17110B;
    box-shadow: inset .25rem .18rem #B8893D;
}

.screw-left { left: 1.4rem; }
.screw-right { right: 1.4rem; }

.drawer-crack {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 7rem;
    background: linear-gradient(to bottom, transparent, #17110B 55%, #B8F06A 56%, #17110B 62%);
    filter: drop-shadow(0 -1rem 1.5rem rgba(184,240,106,.28));
}

.pull-tag {
    position: absolute;
    bottom: 2rem;
    right: 9vw;
    padding: .7rem 1rem;
    color: #FFF2C7;
    background: #263C55;
    border: 2px solid #B8893D;
    border-radius: 999px 999px 999px 4px;
    font-family: var(--mono);
    animation: bob 2.4s ease-in-out infinite;
}

.narrative-crawl {
    position: relative;
    padding: 6rem 0 12rem;
}

.root-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.root-map path {
    fill: none;
    stroke: #B8893D;
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 24 18;
    opacity: .72;
}

.root-map .side-root {
    stroke: #31452A;
    stroke-width: 7;
    stroke-dasharray: 10 14;
}

.scene {
    min-height: 92vh;
    position: relative;
    display: flex;
    align-items: center;
    padding: 8vh 8vw;
}

.scene:nth-child(even) { justify-content: flex-end; }
.scene:nth-child(odd) { justify-content: flex-start; }

.scene-card, .console-shell, .shelf, .compost-card, .kernel-core {
    width: min(680px, 88vw);
    padding: clamp(2rem, 5vw, 4.6rem);
    border: 2px solid rgba(255,242,199,.32);
    background:
        radial-gradient(circle at 15% 0%, rgba(184,240,106,.14), transparent 15rem),
        linear-gradient(145deg, rgba(23,17,11,.88), rgba(49,69,42,.84));
    border-radius: 42px 18px 58px 24px;
    box-shadow: 0 2rem 5rem rgba(0,0,0,.42), inset 0 0 0 1px rgba(184,240,106,.12);
    transform: rotate(var(--tilt, -1deg));
}

.root-console .console-shell { --tilt: 1.4deg; background: linear-gradient(160deg, rgba(38,60,85,.9), rgba(23,17,11,.88)); }
.bug-lantern-shelf .shelf { --tilt: -2deg; border-color: rgba(184,240,106,.42); }
.patch-compost .compost-card { --tilt: 1.8deg; background: linear-gradient(150deg, rgba(154,79,44,.64), rgba(23,17,11,.9)); }
.deep-desk-kernel .kernel-core { --tilt: -.6deg; text-align: center; margin: auto; }

.scene-kicker {
    margin: 0 0 1rem;
    color: #B8F06A;
    font-family: var(--mono);
    letter-spacing: .18em;
    text-transform: uppercase;
    font-size: .78rem;
}

h2 {
    margin: 0 0 1.2rem;
    font: 800 clamp(2.3rem, 6vw, 5.6rem)/.92 var(--display);
    color: #FFF2C7;
    letter-spacing: -.04em;
    font-variation-settings: 'WONK' 1, 'SOFT' 75;
}

p {
    font-size: clamp(1rem, 1.6vw, 1.25rem);
    line-height: 1.75;
    color: #E7D3A2;
}

.artifact-row {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1.5rem;
}

.artifact-row span, .patch-stack mark {
    padding: .55rem .8rem;
    color: #17110B;
    background: #B8F06A;
    border-radius: 999px 999px 999px 8px;
    font-family: var(--mono);
}

.terminal-note {
    display: grid;
    gap: .7rem;
    margin: 1.6rem 0;
    padding: 1.2rem;
    background: #17110B;
    border-left: 6px solid #B8F06A;
    border-radius: 8px 20px 14px 8px;
}

code {
    color: #B8F06A;
    font-family: var(--mono);
    white-space: normal;
}

.lantern-list {
    margin: 1.4rem 0 0;
    padding: 0;
    list-style: none;
    font-family: var(--mono);
    color: #FFF2C7;
}

.lantern-list li { margin: .7rem 0; }
.lantern-list span {
    display: inline-block;
    width: .8rem;
    height: .8rem;
    margin-right: .7rem;
    border-radius: 50%;
    background: #B8F06A;
    box-shadow: 0 0 1rem #B8F06A;
}

.patch-stack {
    display: grid;
    gap: .8rem;
    margin-top: 1.8rem;
}

.patch-stack mark {
    display: block;
    border-radius: 10px 26px 8px 18px;
    background: #E7D3A2;
}

.brass-link {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 1rem 1.3rem;
    color: #17110B;
    background: #B8893D;
    border: 2px solid #FFF2C7;
    border-radius: 999px;
    font-family: var(--mono);
    text-decoration: none;
    transition: transform .25s ease, background .25s ease;
}

.brass-link:hover { transform: rotate(-2deg) scale(1.04); background: #B8F06A; }

.object {
    position: absolute;
    display: grid;
    place-items: center;
    color: #17110B;
    font-family: var(--mono);
    font-weight: 700;
    animation: floaty 5s ease-in-out infinite;
}

.moss-keycap {
    right: 12vw;
    top: 18vh;
    width: 7rem;
    height: 5rem;
    background: #E7D3A2;
    border: 8px solid #31452A;
    border-radius: 18px 24px 14px 28px;
    box-shadow: inset 0 -1rem #B8893D;
}

.beetle {
    left: 18vw;
    bottom: 14vh;
    width: 4.5rem;
    height: 3rem;
    color: #FFF2C7;
    background: #263C55;
    border-radius: 50%;
}

.beetle::before, .beetle::after {
    content: '';
    position: absolute;
    width: 1.6rem;
    height: .18rem;
    background: #B8893D;
    top: 50%;
}

.beetle::before { left: -1.2rem; transform: rotate(25deg); }
.beetle::after { right: -1.2rem; transform: rotate(-25deg); }

.twig-bracket {
    left: 12vw;
    top: 20vh;
    width: 6rem;
    height: 6rem;
    color: #B8F06A;
    border: 4px dashed #B8893D;
    border-radius: 42% 58% 51% 49%;
}

.mushroom-server {
    right: 8vw;
    bottom: 14vh;
    width: 9rem;
    height: 8rem;
    background: #9A4F2C;
    border-radius: 60% 60% 18% 18%;
}

.mushroom-server i {
    width: .8rem;
    height: .8rem;
    margin: .4rem;
    border-radius: 50%;
    background: #B8F06A;
    box-shadow: 0 0 1rem #B8F06A;
}

.lantern-cloud {
    position: absolute;
    right: 10vw;
    top: 18vh;
    width: 18rem;
    height: 18rem;
}

.lantern-cloud b {
    position: absolute;
    display: grid;
    place-items: center;
    width: 5.3rem;
    height: 5.3rem;
    color: #17110B;
    background: #B8F06A;
    border: 4px solid #FFF2C7;
    border-radius: 46% 54% 61% 39%;
    box-shadow: 0 0 2rem rgba(184,240,106,.75);
    font-family: var(--mono);
    animation: glowPulse 3s ease-in-out infinite;
}

.lantern-cloud b:nth-child(1) { left: 0; top: 1rem; }
.lantern-cloud b:nth-child(2) { right: 2rem; top: 0; animation-delay: -.8s; }
.lantern-cloud b:nth-child(3) { left: 4rem; bottom: 1rem; animation-delay: -1.5s; }
.lantern-cloud b:nth-child(4) { right: 0; bottom: 3rem; animation-delay: -2.1s; }

.snail-package {
    left: 9vw;
    bottom: 16vh;
    width: 7rem;
    height: 4rem;
    background: #E7D3A2;
    border-radius: 999px 999px 12px 999px;
    border: 5px solid #B8893D;
}

.acorn-db {
    right: 13vw;
    top: 18vh;
    width: 5rem;
    height: 6.5rem;
    background: #9A4F2C;
    border-radius: 48% 48% 58% 58%;
    border-top: 1.5rem solid #31452A;
}

.kernel-rings {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.kernel-rings span {
    position: absolute;
    width: min(70vw, 48rem);
    aspect-ratio: 1;
    border: 2px dashed rgba(184,240,106,.38);
    border-radius: 44% 56% 49% 51%;
    animation: spin 18s linear infinite;
}

.kernel-rings span:nth-child(2) { width: min(54vw, 35rem); animation-duration: 14s; animation-direction: reverse; border-color: rgba(184,137,61,.45); }
.kernel-rings span:nth-child(3) { width: min(38vw, 22rem); animation-duration: 10s; border-color: rgba(255,242,199,.34); }

.scene-meter {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 5;
    padding: .7rem .9rem;
    color: #B8F06A;
    background: rgba(23,17,11,.76);
    border: 1px solid rgba(184,240,106,.4);
    border-radius: 999px;
    font-family: var(--mono);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .12em;
}

.scene { opacity: .35; transform: translateY(48px); transition: opacity .8s ease, transform .8s ease; }
.scene.in-view { opacity: 1; transform: translateY(0); }

@keyframes breathe { 50% { transform: scale(1.22) translate(2rem, -1rem); opacity: .34; } }
@keyframes bob { 50% { transform: translateY(-.7rem) rotate(3deg); } }
@keyframes floaty { 50% { transform: translateY(-1.2rem) rotate(4deg); } }
@keyframes glowPulse { 50% { transform: scale(1.08); box-shadow: 0 0 3.3rem rgba(184,240,106,.95); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 780px) {
    .brass-plate { width: 88vw; padding: 2.2rem 1.3rem; }
    .scene { min-height: 100vh; padding: 7vh 5vw; }
    .object, .lantern-cloud { opacity: .42; transform: scale(.75); }
    .moss-keycap, .mushroom-server, .acorn-db { right: 2vw; }
    .beetle, .twig-bracket, .snail-package { left: 2vw; }
}
