/* ========================================
   monopole.style — CSS
   Seapunk × Pastoral Romanticism
   ======================================== */

@property --count {
    syntax: '<integer>';
    initial-value: 0;
    inherits: false;
}

@property --energy {
    syntax: '<integer>';
    initial-value: 0;
    inherits: false;
}

@property --final {
    syntax: '<integer>';
    initial-value: 0;
    inherits: false;
}

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

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

body {
    font-family: 'Libre Baskerville', Georgia, serif;
    color: #1a2f2f;
    background: #f0e8d8;
    overflow-x: hidden;
}

/* ---- Coordinate Grid Overlay ---- */
#coord-grid {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    opacity: 0.05;
    transition: opacity 0.8s ease;
    background-image:
        linear-gradient(to right, #44b8a0 0.5px, transparent 0.5px),
        linear-gradient(to bottom, #44b8a0 0.5px, transparent 0.5px);
    background-size: 60px 60px;
}

/* ---- Scroll Progress ---- */
#scroll-progress {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    background: #44b8a0;
    transform: rotate(45deg);
    opacity: 0.25;
    transition: opacity 0.5s ease, transform 0.5s ease, box-shadow 0.5s ease;
}

.progress-dot.active {
    opacity: 1;
    box-shadow: 0 0 8px #44b8a0;
}

/* ---- Pressed Petal Cards ---- */
.specimen-card {
    border: 1px solid #d4c4a8;
    background: #f0e8d8;
}

/* ---- Coral Accent ---- */
.coral-highlight {
    color: #e87461;
}

/* ---- Biome Base ---- */
.biome {
    position: relative;
    min-height: 100vh;
    width: 100%;
}

/* ---- Counter Labels ---- */
.counter-label {
    font-family: 'Inconsolata', monospace;
    font-weight: 700;
    font-size: clamp(0.75rem, 1vw, 0.9rem);
    letter-spacing: 0.05em;
    color: #44b8a0;
}

/* ---- Axis Labels (SVG) ---- */
.axis-label {
    font-family: 'Inconsolata', monospace;
    font-size: 12px;
    font-weight: 700;
    fill: #1a4a4a;
    letter-spacing: 0.05em;
}

.reef-axis {
    fill: #44b8a0;
}

/* ========================================
   BIOME I — The Surface
   ======================================== */
#biome-surface {
    min-height: 100vh;
    background: #f0e8d8;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#specimen-counter {
    position: absolute;
    top: 30px;
    right: 40px;
    z-index: 10;
}

#scatter-meadow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
}

#scatter-meadow.visible {
    opacity: 1;
}

#scatter-meadow .flower-point {
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    transform: translateY(10px);
}

#scatter-meadow .flower-point.shown {
    opacity: 1;
    transform: translateY(0);
}

#surface-text {
    position: relative;
    z-index: 10;
    text-align: center;
    margin-top: 25vh;
}

#site-title {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(3rem, 7vw, 6rem);
    letter-spacing: -0.015em;
    line-height: 1.1;
    color: #0d2b2b;
    opacity: 0;
    transition: opacity 0.8s ease;
}

#site-title.visible {
    opacity: 1;
}

#site-subtitle {
    font-family: 'Inconsolata', monospace;
    font-size: clamp(0.85rem, 1.2vw, 1.1rem);
    letter-spacing: 0.12em;
    color: #44b8a0;
    margin-top: 1rem;
    opacity: 0;
    transition: opacity 0.6s ease 0.3s;
}

#site-subtitle.visible {
    opacity: 1;
}

/* ========================================
   BIOME II — The Descent
   ======================================== */
#biome-descent {
    min-height: 200vh;
    background: linear-gradient(175deg, #f0e8d8 0%, #0a0f14 40%, #0d2b2b 70%, #1a4a4a 100%);
    position: relative;
    display: flex;
    overflow: hidden;
}

.descent-panel {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4rem;
}

#descent-left {
    width: 55%;
    clip-path: polygon(0 0, 100% 0, 75% 100%, 0 100%);
}

#descent-right {
    width: 55%;
    margin-left: -10%;
    clip-path: polygon(25% 0, 100% 0, 100% 100%, 0 100%);
}

.diagonal-divider {
    position: absolute;
    top: 0;
    left: 50%;
    width: 60px;
    height: 100%;
    transform: translateX(-50%);
    pointer-events: none;
}

/* Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    height: 300px;
    padding: 20px;
}

.bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(to top, #44b8a0, #b8e0d4);
    border-radius: 2px 2px 0 0;
    height: 0;
    transition: height 1.5s ease-out;
}

.bar.animated {
    /* height set by JS */
}

.bar-label {
    font-family: 'Inconsolata', monospace;
    font-size: 0.7rem;
    color: #44b8a0;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.chart-title {
    font-family: 'Inconsolata', monospace;
    font-size: 0.8rem;
    color: #44b8a0;
    letter-spacing: 0.08em;
    text-align: center;
    margin-top: 1.5rem;
    font-weight: 700;
}

/* Descent Text */
.descent-text-inner {
    max-width: 420px;
}

.descent-text-inner p {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    color: #d4e4df;
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.descent-text-inner p.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   BIOME III — The Reef
   ======================================== */
#biome-reef {
    min-height: 200vh;
    background: linear-gradient(175deg, #0d2b2b 0%, #1a4a4a 50%, #0a0f14 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#reef-energy-counter {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 10;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    text-shadow: 0 0 20px rgba(68, 184, 160, 0.5);
}

#reef-meadow {
    width: 90%;
    max-width: 1200px;
    height: auto;
    position: sticky;
    top: 10vh;
}

#reef-meadow .reef-flower {
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    transform: translateY(20px);
}

#reef-meadow .reef-flower.shown {
    opacity: 1;
    transform: translateY(0);
}

/* ========================================
   BIOME IV — The Greenhouse
   ======================================== */
#biome-greenhouse {
    min-height: 120vh;
    background: #f0e8d8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12vh 2rem;
}

.greenhouse-content {
    max-width: 38rem;
    width: 100%;
}

.greenhouse-content .fade-in-paragraph {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.85;
    color: #1a2f2f;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.greenhouse-content .fade-in-paragraph.visible {
    opacity: 1;
    transform: translateY(0);
}

.wave-divider {
    width: 100%;
    height: 40px;
    margin: 1.5rem 0;
    display: block;
}

/* ========================================
   BIOME V — The Singularity
   ======================================== */
#biome-singularity {
    min-height: 100vh;
    background: #0a0f14;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

#singularity-content {
    text-align: center;
    position: relative;
    z-index: 10;
}

#singularity-counter {
    font-size: clamp(4rem, 10vw, 8rem);
    color: #44b8a0;
    text-shadow: 0 0 60px rgba(68, 184, 160, 0.4), 0 0 120px rgba(68, 184, 160, 0.2);
    position: relative;
}

#singularity-counter::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at 50% 50%, #44b8a0 0%, transparent 70%);
    opacity: 0.15;
    animation: pulse-glow 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 0.1; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.2; transform: translate(-50%, -50%) scale(1.15); }
}

#singularity-tagline {
    font-family: 'Libre Baskerville', Georgia, serif;
    font-style: italic;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
    color: #d4e4df;
    margin-top: 2rem;
    opacity: 0;
    transition: opacity 1s ease;
}

#singularity-tagline.visible {
    opacity: 1;
}

#final-chevron {
    font-size: 3rem;
    color: #c45b9a;
    opacity: 0.6;
    margin-top: 3rem;
    animation: slow-rotate 12s linear infinite;
    display: inline-block;
}

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

/* ========================================
   Chevron Particles
   ======================================== */
#chevron-particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 500;
    overflow: hidden;
}

.chevron-particle {
    position: absolute;
    font-size: 14px;
    opacity: 0;
    animation: drift 15s linear infinite;
    pointer-events: none;
}

@keyframes drift {
    0% {
        opacity: 0;
        transform: translateY(100vh) rotate(0deg);
    }
    10% {
        opacity: 0.15;
    }
    90% {
        opacity: 0.15;
    }
    100% {
        opacity: 0;
        transform: translateY(-20vh) rotate(180deg);
    }
}

/* ========================================
   Sharp-Angle Section Dividers
   ======================================== */
.section-divider-svg {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 5;
}
