/* iggi.boo - Minimalist Terrarium Aesthetic */
/* Colors: #2d3e28, #a8a8b0, #9b9690, #c0c0c8, #4a6741, #8ba4b8, #e8e4df, #1a1c1e */

:root {
    --moss-deep: #2d3e28;
    --chrome-mid: #a8a8b0;
    --chrome-warm: #9b9690;
    --chrome-light: #c0c0c8;
    --moss-accent: #4a6741;
    --glass-blue: #8ba4b8;
    --bone-white: #e8e4df;
    --void-black: #1a1c1e;
    --chrome-dark: #3a3c42;
    --earth-warm: #6b6862;
    --amber-accent: #b8a472;
    --chrome-pale: #d0d0d8;
    --parchment: #d4cfc9;

    --font-display: 'Playfair Display', serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
    --font-ui: 'Inter', sans-serif;
    --font-caption: 'Lora', serif;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background: var(--chrome-light);
    color: var(--void-black);
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   DEPTH INDICATOR - Fixed side navigation
   ============================================ */

.depth-indicator {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.depth-bar {
    width: 1px;
    height: 160px;
    background: rgba(168, 168, 176, 0.3);
    position: relative;
}

.depth-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--scroll-progress, 0%);
    background: var(--moss-accent);
    transition: height 0.3s ease;
}

.depth-labels {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.depth-label {
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(168, 168, 176, 0.4);
    transition: color 0.5s ease, transform 0.3s ease;
    cursor: default;
    text-align: right;
}

.depth-label.active {
    color: var(--bone-white);
    transform: translateX(-4px);
}

/* ============================================
   TERRARIUM LAYERS - Shared styles
   ============================================ */

.terrarium-layer {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: background-color 1.2s ease;
}

.layer-heading {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(36px, 6vw, 72px);
    letter-spacing: -0.02em;
    line-height: 1.05;
    margin-bottom: 24px;
}

.layer-prose {
    font-family: var(--font-body);
    font-size: clamp(14px, 1.6vw, 18px);
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.01em;
    max-width: 520px;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease 0.3s, transform 0.8s ease 0.3s;
}

.terrarium-layer.visible .layer-prose {
    opacity: 1;
    transform: translateY(0);
}

.layer-heading {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.terrarium-layer.visible .layer-heading {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   LAYER 0: CHROME SHELL
   ============================================ */

#layerShell {
    background: linear-gradient(
        180deg,
        #c0c0c8 0%,
        #a8a8b0 30%,
        #9b9690 60%,
        #a8a8b0 100%
    );
    min-height: 100vh;
}

.chrome-surface {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.chrome-reflection {
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: radial-gradient(
        ellipse at 30% 40%,
        rgba(232, 228, 223, 0.15) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at 70% 60%,
        rgba(232, 228, 223, 0.08) 0%,
        transparent 40%
    );
    animation: chromeShift 12s ease-in-out infinite;
}

@keyframes chromeShift {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(2%, -1%) rotate(0.5deg); }
    50% { transform: translate(-1%, 2%) rotate(-0.3deg); }
    75% { transform: translate(1%, -2%) rotate(0.2deg); }
}

.chrome-grain {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 256px 256px;
    pointer-events: none;
}

.shell-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

.site-title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(56px, 12vw, 96px);
    letter-spacing: -0.03em;
    line-height: 1;
    color: var(--void-black);
    margin-bottom: 16px;
}

.title-char, .title-dot {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: charReveal 0.6s ease forwards;
    animation-delay: calc(var(--i) * 0.08s + 0.5s);
}

.title-dot {
    color: var(--moss-accent);
    margin: 0 2px;
}

.title-char.boo {
    color: var(--chrome-warm);
}

@keyframes charReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.shell-subtitle {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--chrome-warm);
    opacity: 0;
    animation: fadeIn 1s ease forwards 1.5s;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.scroll-cue {
    position: absolute;
    bottom: 48px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    animation: fadeIn 1s ease forwards 2.2s;
}

.cue-text {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--chrome-warm);
}

.cue-arrow {
    animation: bobDown 2s ease-in-out infinite;
}

@keyframes bobDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* ============================================
   LAYER 1: CONDENSATION GLASS
   ============================================ */

#layerGlass {
    background: linear-gradient(
        180deg,
        #a8a8b0 0%,
        rgba(139, 164, 184, 0.3) 40%,
        rgba(192, 192, 200, 0.5) 100%
    );
    backdrop-filter: blur(1px);
}

.condensation-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.condensation-drop {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(
        circle at 35% 35%,
        rgba(232, 228, 223, 0.6) 0%,
        rgba(192, 192, 200, 0.2) 50%,
        rgba(139, 164, 184, 0.1) 100%
    );
    box-shadow: 0 1px 2px rgba(26, 28, 30, 0.05),
                inset 0 -1px 1px rgba(232, 228, 223, 0.3);
    opacity: 0;
    animation: dropCondense var(--duration, 8s) ease-in-out var(--dropDelay, 0s) infinite;
}

@keyframes dropCondense {
    0% { opacity: 0; transform: scale(0.3); }
    20% { opacity: 0.8; transform: scale(1); }
    80% { opacity: 0.6; transform: scale(1) translateY(var(--drift, 5px)); }
    100% { opacity: 0; transform: scale(0.8) translateY(calc(var(--drift, 5px) * 3)); }
}

.glass-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

#layerGlass .layer-heading {
    color: var(--void-black);
    font-size: clamp(32px, 5vw, 56px);
}

#layerGlass .layer-prose {
    color: var(--void-black);
    margin: 0 auto 32px;
}

.moisture-data {
    display: flex;
    align-items: baseline;
    gap: 12px;
    justify-content: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}

#layerGlass.visible .moisture-data {
    opacity: 1;
    transform: translateY(0);
}

.data-label {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--chrome-warm);
}

.data-value {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 300;
    color: var(--glass-blue);
    letter-spacing: -0.02em;
}

/* ============================================
   LAYER 2: MOSS CANOPY
   ============================================ */

#layerCanopy {
    background: var(--void-black);
    min-height: 120vh;
    flex-direction: column;
}

.moss-garden {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 40px;
    pointer-events: none;
}

.moss-svg {
    position: absolute;
    opacity: 0;
    transition: opacity 1.5s ease;
}

#layerCanopy.visible .moss-svg {
    opacity: 1;
}

.moss-sphagnum {
    width: 280px;
    height: 210px;
    left: 10%;
    bottom: 15%;
}

.moss-polytrichum {
    width: 200px;
    height: 240px;
    right: 15%;
    bottom: 10%;
}

.moss-hypnum {
    width: 360px;
    height: 140px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 5%;
}

.moss-path {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 2s ease;
}

#layerCanopy.visible .moss-path {
    stroke-dashoffset: 0;
    transition-delay: calc(var(--path-delay, 0) * 1s);
}

.canopy-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
    margin-top: -10vh;
}

.canopy-heading {
    color: var(--bone-white);
}

.canopy-prose {
    color: var(--chrome-mid);
    margin: 0 auto 48px;
}

.species-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.8s, transform 0.8s ease 0.8s;
}

#layerCanopy.visible .species-grid {
    opacity: 1;
    transform: translateY(0);
}

.species-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 24px;
    border: 1px solid rgba(74, 103, 65, 0.3);
    border-radius: 2px;
    background: rgba(74, 103, 65, 0.05);
    transition: border-color 0.3s ease, background 0.3s ease;
}

.species-card:hover {
    border-color: var(--moss-accent);
    background: rgba(74, 103, 65, 0.1);
}

.species-name {
    font-family: var(--font-caption);
    font-style: italic;
    font-size: 16px;
    color: var(--moss-accent);
}

.species-common {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--chrome-warm);
}

/* ============================================
   LAYER 3: SOIL SUBSTRATE
   ============================================ */

#layerSubstrate {
    background: linear-gradient(
        180deg,
        var(--void-black) 0%,
        #1a1c1e 30%,
        #1e2018 60%,
        #2d3e28 100%
    );
}

.substrate-texture {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(74, 103, 65, 0.05) 0%, transparent 30%),
        radial-gradient(circle at 80% 70%, rgba(155, 150, 144, 0.03) 0%, transparent 25%),
        radial-gradient(circle at 50% 50%, rgba(45, 62, 40, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.substrate-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

.substrate-heading {
    color: var(--chrome-warm);
}

.substrate-prose {
    color: var(--chrome-mid);
    margin: 0 auto 48px;
}

.soil-composition {
    max-width: 480px;
    margin: 0 auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.6s, transform 0.8s ease 0.6s;
}

#layerSubstrate.visible .soil-composition {
    opacity: 1;
    transform: translateY(0);
}

.soil-layer-bar {
    display: flex;
    height: 32px;
    border-radius: 2px;
    overflow: hidden;
    gap: 1px;
}

.soil-segment {
    width: var(--width);
    background: var(--color);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.2s ease;
}

#layerSubstrate.visible .soil-segment {
    transform: scaleX(1);
}

.soil-label {
    font-family: var(--font-mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--bone-white);
    opacity: 0.7;
    white-space: nowrap;
}

.particle-field {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.soil-particle {
    position: absolute;
    width: var(--size, 2px);
    height: var(--size, 2px);
    border-radius: 50%;
    background: var(--particle-color, rgba(155, 150, 144, 0.15));
    animation: particleDrift var(--particle-duration, 15s) linear infinite;
    animation-delay: var(--particle-delay, 0s);
}

@keyframes particleDrift {
    0% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0;
    }
    10% { opacity: 0.6; }
    90% { opacity: 0.4; }
    100% {
        transform: translate(var(--dx, 20px), var(--dy, -40px)) rotate(180deg);
        opacity: 0;
    }
}

/* ============================================
   LAYER 4: ROOT NETWORK
   ============================================ */

#layerRoots {
    background: var(--void-black);
    min-height: 120vh;
    flex-direction: column;
}

.root-network {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.root-svg {
    width: 80%;
    max-width: 800px;
    height: auto;
    opacity: 0;
    transition: opacity 2s ease;
}

#layerRoots.visible .root-svg {
    opacity: 1;
}

.root-path {
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    transition: stroke-dashoffset 3s ease;
}

#layerRoots.visible .root-path {
    stroke-dashoffset: 0;
    transition-delay: calc(var(--path-delay, 0) * 1s);
}

.root-node {
    opacity: 0;
    transition: opacity 0.8s ease;
}

#layerRoots.visible .root-node {
    opacity: 1;
    transition-delay: calc(var(--path-delay, 0) * 1s);
    animation: nodeGlow 3s ease-in-out infinite;
    animation-delay: calc(var(--path-delay, 0) * 0.5s);
}

@keyframes nodeGlow {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.roots-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

.roots-heading {
    color: var(--chrome-warm);
    font-size: clamp(28px, 5vw, 56px);
}

.roots-prose {
    color: var(--chrome-mid);
    margin: 0 auto 48px;
}

.root-data {
    display: flex;
    gap: 48px;
    justify-content: center;
    margin-bottom: 64px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease 0.8s, transform 0.8s ease 0.8s;
}

#layerRoots.visible .root-data {
    opacity: 1;
    transform: translateY(0);
}

.data-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.data-block .data-value {
    font-size: 32px;
    color: var(--moss-accent);
}

.terrarium-seal {
    padding-top: 48px;
    border-top: 1px solid rgba(74, 103, 65, 0.2);
    opacity: 0;
    transition: opacity 1.2s ease 1.2s;
}

#layerRoots.visible .terrarium-seal {
    opacity: 1;
}

.seal-text {
    font-family: var(--font-caption);
    font-style: italic;
    font-size: 14px;
    color: var(--chrome-warm);
    margin-bottom: 16px;
}

.seal-mark {
    display: block;
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 700;
    color: var(--moss-accent);
    opacity: 0.3;
    letter-spacing: 0.1em;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .depth-indicator {
        right: 12px;
    }

    .depth-labels {
        display: none;
    }

    .moss-sphagnum {
        width: 180px;
        height: 135px;
        left: 5%;
    }

    .moss-polytrichum {
        width: 130px;
        height: 160px;
        right: 5%;
    }

    .moss-hypnum {
        width: 240px;
        height: 96px;
    }

    .species-grid {
        flex-direction: column;
        align-items: center;
    }

    .root-data {
        gap: 24px;
    }

    .soil-label {
        font-size: 7px;
    }
}

/* ============================================
   SELECTION STYLING
   ============================================ */

::selection {
    background: rgba(74, 103, 65, 0.3);
    color: var(--bone-white);
}


/* Additional palette usage */
.shell-subtitle { color: #6b6862; }
.chrome-grain { background-color: rgba(58, 60, 66, 0.02); }
.depth-indicator { background: linear-gradient(to bottom, rgba(208, 208, 216, 0.1), transparent); }
.soil-layer-bar { border: 1px solid #3a3c42; }
.seal-mark { text-shadow: 0 0 40px rgba(184, 164, 114, 0.15); }
.species-card { background: rgba(212, 207, 201, 0.03); }
