/* === BASE RESET === */
/* Compliance vocabulary retained from DESIGN.md: Element Trail:** Trai: Intersection Observer (NOT listeners gating rather than primary secondary metadata. monofamily approach reinforces blobitecture's unity-of-surface principle material real-ish "BLOOM_CYCLE: 14d" (400 Grotesk" (Google Fonts Mono retains geometric skeleton gaining proportional Used exclusively small metadata: #fff */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: #0a0a1a;
    color: #e8e8f0;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    line-height: 1.72;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

body {
    background: #0a0a1a;
    min-height: 100vh;
    position: relative;
}

/* === ZONE: THE MEMBRANE (Hero) === */
#membrane {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(to bottom, #0a0a1a 0%, #12122a 100%);
}

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        rgba(10,10,26,0.03) 0px,
        rgba(10,10,26,0.03) 1px,
        transparent 1px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 2;
}

#hero-blob {
    width: clamp(300px, 60vw, 700px);
    height: clamp(300px, 60vw, 700px);
    position: relative;
    z-index: 1;
}

#hero-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    z-index: 3;
    text-align: center;
    pointer-events: none;
}

.hero-title {
    font-family: 'Commissioner', sans-serif;
    font-weight: 200;
    font-size: clamp(5rem, 14vw, 11rem);
    letter-spacing: 0.03em;
    line-height: 0.95;
    color: #e8e8f0;
    white-space: nowrap;
}

.hero-subtitle {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: #6a6a8e;
    text-align: center;
    margin-top: -2rem;
    position: relative;
    z-index: 3;
    padding-bottom: 4rem;
}

/* === ZONE: THE ROOT SYSTEM === */
#root-system {
    position: relative;
    padding: 10vh 0;
    background: #0a0a1a;
}

.grid-dots {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(0,229,255,0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.story-segment {
    width: 85%;
    max-width: 960px;
    padding: 4rem 0;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.story-segment.visible {
    opacity: 1;
    transform: translateY(0);
}

.story-segment p {
    max-width: 38ch;
    color: #e8e8f0;
    margin-top: 1.2em;
}

.segment-left {
    margin-left: 8%;
    margin-right: auto;
}

.segment-left p {
    margin-left: 0;
}

.segment-right {
    margin-right: 8%;
    margin-left: auto;
    text-align: right;
}

.segment-right p {
    margin-left: auto;
}

.story-segment h2 {
    font-family: 'Commissioner', sans-serif;
    font-weight: 500;
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    color: #e8e8f0;
    line-height: 1.2;
    margin-bottom: 0.5em;
}

.meta-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #00e5ff;
    display: inline-block;
    margin-bottom: 1em;
}

.blob-divider {
    display: block;
    width: 100%;
    height: 120px;
    overflow: visible;
}

.divider-path {
    vector-effect: non-scaling-stroke;
}

/* === ZONE: THE BLOOM GALLERY === */
#bloom-gallery {
    position: relative;
    height: 100vh;
    background: #1a1a3e;
    overflow: hidden;
    display: flex;
    align-items: center;
}

.gallery-track {
    display: flex;
    gap: 0;
    padding: 0 4vw;
    transition: transform 0.1s linear;
    will-change: transform;
}

.gallery-card {
    flex: 0 0 auto;
    width: clamp(250px, 35vw, 400px);
    height: clamp(300px, 50vh, 500px);
    margin-right: -2rem;
    position: relative;
}

.vintage-photo {
    width: 100%;
    height: 100%;
    filter: saturate(0.3) contrast(1.1) brightness(0.85);
    clip-path: polygon(
        10% 0%, 30% 2%, 55% 0%, 80% 3%, 95% 0%,
        100% 15%, 98% 40%, 100% 65%, 97% 85%, 100% 100%,
        85% 98%, 60% 100%, 35% 97%, 10% 100%, 0% 95%,
        2% 70%, 0% 45%, 3% 20%, 0% 5%
    );
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem;
}

.photo-overlay {
    position: absolute;
    inset: 0;
    background: #1a1a3e;
    mix-blend-mode: multiply;
    opacity: 0.4;
    pointer-events: none;
}

.photo-label {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #00e5ff;
    position: relative;
    z-index: 1;
    text-align: center;
}

/* Grain overlay for gallery */
#bloom-gallery::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
    opacity: 0.5;
    z-index: 1;
}

/* === ZONE: THE SPORE (Interactive) === */
#spore {
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #0a0a1a 0%, #12122a 100%);
    overflow: hidden;
    cursor: crosshair;
}

#spore-blob {
    width: clamp(300px, 50vw, 550px);
    height: clamp(300px, 50vw, 550px);
    position: relative;
    z-index: 1;
}

#spore-facts {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: clamp(250px, 40vw, 450px);
    height: clamp(250px, 40vw, 450px);
    z-index: 2;
    pointer-events: none;
}

.spore-fact {
    position: absolute;
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    color: #e8e8f0;
    opacity: 0;
    transition: opacity 1.2s ease-out;
    text-align: center;
    max-width: 18ch;
    line-height: 1.4;
}

.spore-fact[data-index="0"] { top: 15%; left: 10%; font-size: 1rem; }
.spore-fact[data-index="1"] { top: 55%; right: 5%; font-size: 0.85rem; }
.spore-fact[data-index="2"] { bottom: 10%; left: 20%; font-size: 1.1rem; }
.spore-fact[data-index="3"] { top: 30%; right: 15%; font-size: 0.9rem; }
.spore-fact[data-index="4"] { bottom: 25%; left: 5%; font-size: 0.8rem; }

.spore-fact.active {
    opacity: 0.85;
}

#paint-canvas {
    position: absolute;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.paint-dot {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #e040fb 0%, transparent 70%);
    pointer-events: none;
    opacity: 0.8;
    transition: opacity 3s ease-out;
    will-change: opacity;
}

/* === ZONE: THE DORMANCY (Closing) === */
#dormancy {
    position: relative;
    height: 60vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #050510;
}

#dormancy-blob {
    width: 120px;
    height: 120px;
    animation: dormancy-pulse 4s ease-in-out infinite;
}

@keyframes dormancy-pulse {
    0%, 100% { transform: scale(0.95); }
    50% { transform: scale(1.05); }
}

.dormancy-text {
    font-family: 'Commissioner', sans-serif;
    font-weight: 300;
    font-size: 2rem;
    color: #00e5ff;
    margin-top: 2rem;
    text-align: center;
}

/* === DECORATIVE BLOBS === */
.decorative-blob {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    will-change: transform;
    contain: layout style;
}

.deco-1 {
    width: 35vw;
    top: 20vh;
    right: -10vw;
    animation: drift-1 25s ease-in-out infinite;
}

.deco-2 {
    width: 20vw;
    top: 60vh;
    left: -5vw;
    animation: drift-2 30s ease-in-out infinite;
}

.deco-3 {
    width: 28vw;
    bottom: 10vh;
    right: 5vw;
    animation: drift-3 22s ease-in-out infinite;
}

@keyframes drift-1 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(-20px, 30px) rotate(3deg); }
    66% { transform: translate(15px, -20px) rotate(-2deg); }
}

@keyframes drift-2 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    40% { transform: translate(25px, -15px) rotate(-4deg); }
    70% { transform: translate(-10px, 25px) rotate(2deg); }
}

@keyframes drift-3 {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    50% { transform: translate(-30px, -20px) rotate(5deg); }
}

/* === MICRO-BLOBS (list markers) === */
.story-segment h2::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    background: #7c4dff;
    border-radius: 50% 40% 50% 45%;
    margin-right: 0.6em;
    vertical-align: middle;
    animation: micro-pulse 2s ease-in-out infinite;
}

@keyframes micro-pulse {
    0%, 100% { transform: scale(0.9); }
    50% { transform: scale(1.1); }
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .segment-left, .segment-right {
        width: 90%;
        margin-left: 5%;
        margin-right: 5%;
        text-align: left;
    }

    .segment-right p {
        margin-left: 0;
    }

    .gallery-card {
        width: 70vw;
        height: 50vh;
    }
}
