/* valuator.dev — goblincore appraisal engine */

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

:root {
    --burrow-deep: #1e1a15;
    --loam: #3d2b1f;
    --bark: #5c4033;
    --brass: #b5893b;
    --amber: #d4a84b;
    --parchment: #f0e6d3;
    --sage: #8a9a7b;
    --tarnish: #7b6d4e;
    --sienna: #a0522d;
}

html {
    scroll-behavior: smooth;
}

body.burrow {
    background-color: var(--burrow-deep);
    color: var(--parchment);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    line-height: 1.7;
    overflow-x: hidden;
}

/* Vine Progress Indicator */
.vine-progress {
    position: fixed;
    left: 24px;
    top: 0;
    bottom: 0;
    width: 20px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.vine-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 20px;
    height: 100%;
}

.vine-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-dashoffset 0.3s ease-out;
}

.mushroom-node {
    position: absolute;
    width: 24px;
    height: 24px;
    left: -2px;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), filter 0.4s ease;
    opacity: 0.6;
}

.mushroom-node.active {
    transform: scale(1.5);
    opacity: 1;
    filter: drop-shadow(0 0 6px var(--amber));
}

.mushroom-node svg {
    width: 100%;
    height: 100%;
}

/* Canvas */
.spore-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
}

/* Main descent */
.descent {
    position: relative;
    z-index: 2;
}

/* Chapters */
.chapter {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 4rem 6rem 4rem 5rem;
    filter: blur(20px);
    opacity: 0.3;
    transform: scale(0.96);
    transition:
        filter 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.6s ease-out,
        transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.chapter.in-view {
    filter: blur(0);
    opacity: 1;
    transform: scale(1);
}

.chapter.past-view {
    filter: blur(12px);
    opacity: 0.4;
    transform: scale(0.98);
}

/* Specimen Mode */
.specimen-mode {
    flex-direction: row;
    gap: 3rem;
    flex-wrap: wrap;
}

.specimen-svg {
    flex: 1 1 300px;
    max-width: 500px;
}

.specimen-svg svg {
    width: 100%;
    height: auto;
}

.chapter-text {
    flex: 1 1 300px;
    max-width: 520px;
}

.chapter-text h1 {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    color: var(--parchment);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 1.2rem;
}

.chapter-text h2 {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--parchment);
    letter-spacing: -0.01em;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.chapter-text p {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: var(--parchment);
    opacity: 0.85;
    max-width: 480px;
}

/* Annotations */
.annotations {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.annotation-box {
    position: absolute;
    background: rgba(30, 26, 21, 0.85);
    border: 1px solid var(--brass);
    padding: 0.4rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.annotation-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.6rem;
    color: var(--sage);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.annotation-value {
    font-family: 'Inconsolata', monospace;
    font-size: 0.85rem;
    color: var(--amber);
    font-weight: 500;
}

/* Readout Mode */
.readout-mode {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 10%;
}

.amber-panel {
    background: linear-gradient(135deg, rgba(181, 137, 59, 0.08) 0%, rgba(30, 26, 21, 0.95) 100%);
    border-left: 3px solid var(--brass);
    padding: 2.5rem 3rem;
    max-width: 640px;
    position: relative;
    z-index: 2;
}

.amber-panel h2 {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: clamp(1.8rem, 4vw, 3rem);
    color: var(--parchment);
    letter-spacing: -0.01em;
    margin-bottom: 1rem;
}

.amber-panel p {
    font-size: clamp(1rem, 1.4vw, 1.1rem);
    color: var(--parchment);
    opacity: 0.85;
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.readout-block {
    background: rgba(30, 26, 21, 0.7);
    border: 1px solid rgba(181, 137, 59, 0.3);
    padding: 1.2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.readout-line {
    font-family: 'Inconsolata', monospace;
    font-size: 0.9rem;
    color: var(--parchment);
}

.readout-key {
    color: var(--sage);
}

.readout-val {
    color: var(--amber);
}

/* Ambient Geometry */
.ambient-geometry {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.ambient-geometry::before {
    content: '';
    position: absolute;
    top: -10%;
    right: -5%;
    width: 350px;
    height: 350px;
    clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
    background: var(--brass);
    opacity: 0.05;
    animation: drift 60s linear infinite, float 30s ease-in-out infinite alternate;
}

.ambient-geometry::after {
    content: '';
    position: absolute;
    bottom: -15%;
    left: 10%;
    width: 250px;
    height: 250px;
    clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
    background: var(--sage);
    opacity: 0.04;
    animation: drift 45s linear infinite reverse, float 25s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes float {
    from { translate: 0 0; }
    to { translate: 30px -20px; }
}

/* Roots */
.roots {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.root-scroll-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 700px;
    width: 100%;
}

.root-branch {
    border-left: 2px solid var(--bark);
    padding: 1.5rem 2rem;
    position: relative;
}

.root-branch::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 1.8rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--sage);
}

.root-branch h3 {
    font-family: 'Baloo 2', cursive;
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--amber);
    margin-bottom: 0.5rem;
}

.root-branch p {
    font-size: 0.95rem;
    color: var(--parchment);
    opacity: 0.8;
    line-height: 1.7;
}

/* Footer */
.burrow-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(181, 137, 59, 0.2);
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0.5;
}

.footer-sigil {
    font-size: 1.5rem;
    color: var(--amber);
}

.footer-text {
    font-family: 'Inconsolata', monospace;
    font-size: 0.8rem;
    color: var(--tarnish);
    letter-spacing: 0.05em;
}

/* Responsive */
@media (max-width: 768px) {
    .chapter {
        padding: 3rem 2rem 3rem 3.5rem;
    }

    .specimen-mode {
        flex-direction: column;
    }

    .readout-mode {
        padding-left: 3.5rem;
    }

    .vine-progress {
        left: 10px;
    }

    .annotation-box {
        display: none;
    }
}
