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

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

body {
    background: #0a0a12;
    color: #e8e4f0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    --botanical-sage: #7a9e7e;
    --highlight-chrome: #d4e0f4;
}

/* Scroll Progress Indicator */
.scroll-progress {
    position: fixed;
    top: 0;
    right: 8px;
    width: 2px;
    height: 0%;
    background: rgba(200, 180, 220, 0.5);
    z-index: 100;
    transition: height 0.1s linear;
}

/* Floating Particles */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    bottom: -10px;
    left: var(--x);
    width: var(--size);
    height: var(--size);
    border-radius: 50%;
    background: rgba(180, 200, 220, 0.05);
    animation: particleFloat var(--duration) linear var(--delay) infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-105vh);
        opacity: 0;
    }
}

/* Chamber Base Styles */
.chamber {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    z-index: 2;
}

.chamber-glass {
    position: relative;
    width: min(90vw, 900px);
    min-height: 60vh;
    background: rgba(180, 200, 220, 0.06);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
    border-radius: 24px;
    padding: 60px 40px;
    overflow: hidden;
}

.chamber-glass-wide {
    width: min(95vw, 1100px);
}

.chamber-border {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 24px;
    border: 1px solid #c4b8e8;
    pointer-events: none;
    animation: iridescent 12s ease-in-out infinite;
}

.chamber:nth-child(odd) .chamber-border {
    animation-delay: -3s;
}

.chamber:nth-child(3n) .chamber-border {
    animation-delay: -6s;
}

@keyframes iridescent {
    0%, 100% {
        border-color: #c4b8e8;
        filter: hue-rotate(0deg);
    }
    33% {
        border-color: #b8d8d4;
        filter: hue-rotate(120deg);
    }
    66% {
        border-color: #d8b8c4;
        filter: hue-rotate(240deg);
    }
}

.chamber-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Threshold Section */
.threshold .chamber-glass {
    width: min(60vw, 700px);
    min-height: 40vh;
    opacity: 0;
    animation: thresholdFadeIn 1.2s ease-out 1.2s forwards;
}

@keyframes thresholdFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.title-domain {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    color: #e8e4f0;
    letter-spacing: 0.02em;
    margin-bottom: 12px;
    text-align: center;
}

.title-japanese {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    color: #f0e8d4;
    margin-bottom: 20px;
    text-align: center;
}

.title-subtitle {
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(200, 180, 220, 0.6);
    margin-bottom: 40px;
    text-align: center;
}

.scroll-arrow {
    animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.7;
    }
}

/* Classification Code */
.classification-code {
    position: absolute;
    top: 20px;
    left: 24px;
    font-family: 'Space Mono', monospace;
    font-weight: 400;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(200, 180, 220, 0.6);
    overflow: hidden;
    white-space: nowrap;
    width: 0;
    z-index: 5;
}

.classification-code.typing {
    animation: typewriter 1.5s steps(40, end) forwards;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Specimen Illustrations */
.specimen-illustration {
    width: 100%;
    max-width: 500px;
    margin: 0 auto 30px;
    position: relative;
}

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

.svg-path {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.svg-path.drawn {
    opacity: 1;
}

/* SVG Path Drawing Animation */
.svg-path.animate-draw {
    stroke-dashoffset: 0 !important;
    transition: stroke-dashoffset 2.5s ease-in-out;
}

/* Specimen fill on full reveal */
.specimen.fully-revealed .svg-path.terminal,
.specimen.fully-revealed .svg-path.bloom {
    fill-opacity: 0.15;
    transition: fill-opacity 1s ease;
}

/* Annotations */
.specimen-annotations {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.annotation {
    position: absolute;
    max-width: 200px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.annotation.visible {
    opacity: 1;
    transform: translateY(0);
}

.annotation-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    color: #b8a8d8;
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.annotation:hover .annotation-label {
    color: #d4e0f4;
}

.specimen-name:hover {
    color: #d4e0f4;
}

.svg-path.bloom {
    stroke: #7a9e7e;
}

.annotation-detail {
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.7rem, 0.9vw, 0.85rem);
    color: rgba(232, 228, 240, 0.6);
    line-height: 1.5;
}

/* Specimen Name */
.specimen-name {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 600;
    font-size: clamp(2rem, 4vw, 3.5rem);
    color: #e8e4f0;
    text-align: center;
    margin-top: 20px;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.specimen-name.visible {
    opacity: 1;
    transform: translateY(0);
}

.specimen-japanese {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #f0e8d4;
    text-align: center;
    margin-top: 8px;
    opacity: 0;
    transition: opacity 0.8s ease 0.2s;
}

.specimen-name.visible ~ .specimen-japanese {
    opacity: 1;
}

/* Root System Final Section */
.root-system .chamber-glass {
    min-height: 70vh;
}

.root-svg {
    max-width: 800px;
}

.root-meditation {
    max-width: 600px;
    margin: 20px auto 0;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.root-meditation.visible {
    opacity: 1;
}

.meditation-text {
    font-family: 'Inter', sans-serif;
    font-weight: 300;
    font-size: clamp(0.9rem, 1.2vw, 1.1rem);
    color: rgba(232, 228, 240, 0.7);
    line-height: 1.8;
    letter-spacing: 0.02em;
}

/* SVG text elements */
.svg-text {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.svg-text.visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .chamber-glass {
        padding: 40px 20px;
    }

    .threshold .chamber-glass {
        width: min(85vw, 500px);
    }

    .annotation {
        max-width: 140px;
    }

    .annotation-detail {
        font-size: 0.7rem;
    }

    .classification-code {
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .annotation {
        max-width: 110px;
    }

    .chamber-glass {
        padding: 30px 15px;
    }
}
