/* ========================================
   iggi.boo - Haunted Moss Garden
   Bauhaus + Bryophyte
   ======================================== */

/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --ivory: #F0EDE4;
    --moss-green: #3A6A4A;
    --dark-moss: #2A3028;
    --bauhaus-red: #C05040;
    --bauhaus-yellow: #D4A040;
    --text-dark: #1A2018;
    --spore-brown: #8A7A60;
    --ghost-white: #F8F8F0;
    --light-bg: #E8E4D8;
    --moss-mid: #7A8A70;
}

html {
    overflow-x: hidden;
    overflow-y: hidden;
    height: 100%;
}

body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 16px);
    line-height: 1.8;
    color: var(--text-dark);
    background: var(--ivory);
    height: 100%;
    overflow: hidden;
}

/* Noise Overlay */
#noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    filter: url(#noise-filter);
    background: var(--ghost-white);
    mix-blend-mode: overlay;
    transition: opacity 1000ms ease;
}

#noise-overlay.active {
    opacity: 0.03;
}

/* Progress Bar */
#progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(26, 32, 24, 0.1);
    z-index: 999;
}

#progress-fill {
    height: 100%;
    width: 0%;
    background: var(--moss-green);
    transition: width 100ms linear;
}

.zone-marker {
    position: absolute;
    top: -2px;
    transform: translateX(-50%);
    z-index: 1000;
}

.marker-circle {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--moss-green);
}

.marker-square {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 0;
    background: var(--bauhaus-yellow);
}

.marker-triangle {
    display: block;
    width: 0;
    height: 0;
    border-left: 3px solid transparent;
    border-right: 3px solid transparent;
    border-bottom: 6px solid var(--bauhaus-red);
}

/* Horizontal Scroll Container */
.horizontal-scroll {
    display: flex;
    height: 100vh;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.horizontal-scroll {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Zones */
.zone {
    flex: 0 0 100vw;
    width: 100vw;
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    transition: background-color 600ms ease;
}

.zone-wide {
    flex: 0 0 120vw;
    width: 120vw;
}

.zone-narrow {
    flex: 0 0 60vw;
    width: 60vw;
}

.zone-inner {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 80px 60px 60px;
    display: flex;
    flex-direction: column;
}

.zone-inner-centered {
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Zone 1: Entry */
#zone-1 {
    background: var(--ivory);
}

#zone-1 .zone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Bauhaus Shapes */
.bauhaus-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.shape {
    position: absolute;
    opacity: 0;
    transition: transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.shape svg {
    display: block;
}

.shape-circle {
    top: 15%;
    left: 8%;
    transform: translateX(-200%);
}

.shape-circle.animate {
    opacity: 0.15;
    transform: translateX(0);
}

.shape-triangle {
    top: -10%;
    right: 25%;
    transform: translateY(-200%);
}

.shape-triangle.animate {
    opacity: 0.12;
    transform: translateY(0);
}

.shape-square {
    bottom: 20%;
    right: 5%;
    transform: translateX(200%);
}

.shape-square.animate {
    opacity: 0.1;
    transform: translateX(0);
}

/* Logotype */
.logotype {
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 10;
    margin-bottom: 24px;
}

.logo-char {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: clamp(36px, 5vw, 64px);
    height: clamp(36px, 5vw, 64px);
    opacity: 0;
    transition: opacity 300ms ease;
}

.logo-char.visible {
    opacity: 1;
}

.logo-char.dot {
    width: auto;
    padding: 0 2px;
}

.char-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

[data-shape="circle"] .char-bg {
    border-radius: 50%;
    background: var(--moss-green);
    opacity: 0.15;
}

[data-shape="square"] .char-bg {
    border-radius: 0;
    background: var(--bauhaus-yellow);
    opacity: 0.15;
}

[data-shape="triangle"] .char-bg {
    background: var(--bauhaus-red);
    opacity: 0.12;
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}

.char-letter {
    position: relative;
    z-index: 1;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(24px, 4vw, 48px);
    letter-spacing: 0.06em;
    color: var(--text-dark);
}

.zone-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1.2vw, 18px);
    color: var(--spore-brown);
    letter-spacing: 0.08em;
    z-index: 10;
    margin-bottom: 40px;
}

/* Wave Containers */
.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    pointer-events: none;
}

.wave-svg {
    width: 100%;
    height: 100%;
}

/* Zone 2: Botanical */
#zone-2 {
    background: var(--light-bg);
}

.zone-heading {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: clamp(24px, 3vw, 42px);
    letter-spacing: 0.06em;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.zone-heading-light {
    color: var(--ghost-white);
}

.zone-intro {
    font-family: 'Work Sans', sans-serif;
    font-size: clamp(14px, 1.1vw, 17px);
    color: var(--spore-brown);
    max-width: 600px;
    margin-bottom: 40px;
    line-height: 1.8;
}

.zone-intro-light {
    color: var(--moss-mid);
}

/* Species Grid */
.species-grid {
    display: flex;
    gap: 28px;
    flex: 1;
    align-items: flex-start;
    overflow-x: auto;
    padding-bottom: 140px;
}

.species-card {
    flex: 0 0 260px;
    background: var(--ivory);
    border: 1px solid var(--spore-brown);
    padding: 24px;
    position: relative;
    transition: transform 200ms ease;
}

.species-card:hover {
    transform: translateY(-4px);
}

.species-card:hover .species-tooltip {
    opacity: 1;
    transform: translateY(0);
}

.card-shape-marker {
    width: 20px;
    height: 20px;
    position: absolute;
    top: -10px;
    right: 20px;
}

.circle-marker {
    border-radius: 50%;
    background: var(--moss-green);
}

.square-marker {
    border-radius: 0;
    background: var(--bauhaus-yellow);
}

.triangle-marker {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 20px solid var(--bauhaus-red);
    background: transparent;
}

.card-illustration {
    width: 100%;
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.moss-drawing {
    width: 120px;
    height: 160px;
}

.draw-path {
    stroke-dasharray: 1000;
    stroke-dashoffset: 1000;
    transition: stroke-width 200ms ease;
}

.draw-path.drawn {
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1500ms ease-out, stroke-width 200ms ease;
}

.moss-drawing:hover .draw-path.drawn {
    stroke-width: 2;
}

.species-name {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-style: italic;
    font-size: 13px;
    color: var(--moss-mid);
    margin-bottom: 4px;
}

.species-name em {
    font-style: italic;
}

.species-common {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.species-desc {
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--spore-brown);
}

.species-tooltip {
    position: absolute;
    bottom: -8px;
    left: 20px;
    background: var(--text-dark);
    color: var(--ghost-white);
    padding: 4px 12px;
    font-family: 'Space Mono', monospace;
    font-size: 11px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 200ms ease, transform 200ms ease;
    white-space: nowrap;
    z-index: 10;
}

.species-tooltip em {
    font-style: italic;
    color: var(--moss-mid);
}

/* Zone 3: Dark Zone */
#zone-3 {
    background: var(--dark-moss);
}

.ecology-blocks {
    display: flex;
    gap: 32px;
    flex: 1;
    align-items: flex-start;
    padding-bottom: 140px;
}

.ecology-block {
    flex: 0 0 280px;
    position: relative;
    padding-left: 20px;
}

.block-accent {
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: var(--moss-green);
    opacity: 0.6;
}

.block-accent.accent-yellow {
    background: var(--bauhaus-yellow);
}

.block-accent.accent-red {
    background: var(--bauhaus-red);
}

.ecology-block h3 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 16px;
    color: var(--ghost-white);
    margin-bottom: 12px;
    letter-spacing: 0.04em;
}

.ecology-block p {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--moss-mid);
}

.ecology-block em {
    font-style: italic;
    color: var(--bauhaus-yellow);
}

.wave-container-dark .wave-path {
    stroke: var(--moss-mid);
}

/* Zone 4: Identification Guide */
#zone-4 {
    background: var(--ivory);
}

.id-guide {
    display: flex;
    gap: 48px;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    padding-bottom: 140px;
}

.id-specimen {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 220px;
}

.specimen-shape {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.circle-frame {
    border-radius: 50%;
    border: 2px solid var(--moss-green);
    background: rgba(58, 106, 74, 0.04);
}

.square-frame {
    border-radius: 0;
    border: 2px solid var(--bauhaus-yellow);
    background: rgba(212, 160, 64, 0.04);
}

.triangle-frame {
    clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
    background: rgba(192, 80, 64, 0.06);
    border: none;
    position: relative;
}

.triangle-frame::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    clip-path: polygon(50% 2%, 98% 98%, 2% 98%);
    border: 2px solid var(--bauhaus-red);
}

.specimen-inner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.specimen-inner .moss-drawing {
    width: 100px;
    height: 100px;
}

.id-specimen h4 {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: 0.04em;
}

.id-specimen p {
    font-family: 'Work Sans', sans-serif;
    font-size: 13px;
    line-height: 1.7;
    color: var(--spore-brown);
}

/* Zone 5: Credits */
#zone-5 {
    background: var(--ivory);
}

.closing-composition {
    margin-bottom: 40px;
}

.closing-svg {
    width: 300px;
    height: 300px;
    opacity: 0.8;
}

.credits {
    z-index: 10;
}

.credits-title {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: clamp(28px, 3vw, 40px);
    letter-spacing: 0.06em;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.credits-subtitle {
    font-family: 'Work Sans', sans-serif;
    font-size: 16px;
    color: var(--spore-brown);
    margin-bottom: 20px;
    letter-spacing: 0.08em;
}

.credits-text {
    font-family: 'Work Sans', sans-serif;
    font-size: 14px;
    line-height: 1.8;
    color: var(--spore-brown);
    margin-bottom: 24px;
}

.credits-links {
    display: flex;
    align-items: center;
    gap: 12px;
}

.credit-item {
    font-family: 'Space Mono', monospace;
    font-size: 12px;
    color: var(--moss-green);
    letter-spacing: 0.04em;
}

.credit-divider {
    color: var(--spore-brown);
    opacity: 0.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .zone {
        flex: 0 0 100vw;
        width: 100vw;
    }

    .zone-wide {
        flex: 0 0 160vw;
        width: 160vw;
    }

    .zone-narrow {
        flex: 0 0 80vw;
        width: 80vw;
    }

    .zone-inner {
        padding: 60px 30px 40px;
    }

    .species-grid {
        gap: 20px;
    }

    .species-card {
        flex: 0 0 220px;
    }

    .ecology-blocks {
        gap: 24px;
    }

    .ecology-block {
        flex: 0 0 240px;
    }

    .id-guide {
        gap: 30px;
    }

    .shape svg {
        width: 120px;
        height: 120px;
    }
}
