/* miris.day - Botanical Research Laboratory at the Edge of the Observable Universe */

:root {
    --abyss: #0A0A0F;
    --specimen-white: #F0F0F5;
    --chlorophyll: #00E676;
    --turquoise-signal: #40E0D0;
    --pollen-gold: #FFD54F;
    --fog-gray: #A8A8B0;
    --deep-leaf: #1B5E20;
    --silver: #C8C8C8;
    --cell-membrane: rgba(0, 230, 118, 0.08);
    --hex-width: 200px;
    --hex-height: calc(var(--hex-width) * 1.1547);
    --hex-gap: 4px;
    --hex-width-tiny: 120px;
    --hex-width-medium: 280px;
    --hex-width-large: 400px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--abyss);
    color: var(--specimen-white);
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 300vh;
}

/* ==================== BACKGROUND LAYERS ==================== */

.hex-mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.6;
}

.venation-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 300vh;
    z-index: 0;
    pointer-events: none;
}

.bokeh-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
}

/* Large green bokeh circles */
.bokeh-1 { width: 80px; height: 80px; background: radial-gradient(circle, rgba(0,230,118,0.12) 0%, transparent 70%); top: 10%; left: 15%; }
.bokeh-2 { width: 60px; height: 60px; background: radial-gradient(circle, rgba(0,230,118,0.08) 0%, transparent 70%); top: 25%; left: 70%; }
.bokeh-3 { width: 70px; height: 70px; background: radial-gradient(circle, rgba(0,230,118,0.1) 0%, transparent 70%); top: 45%; left: 30%; }
.bokeh-4 { width: 50px; height: 50px; background: radial-gradient(circle, rgba(0,230,118,0.15) 0%, transparent 70%); top: 60%; left: 80%; }
.bokeh-5 { width: 65px; height: 65px; background: radial-gradient(circle, rgba(0,230,118,0.07) 0%, transparent 70%); top: 75%; left: 50%; }

/* Turquoise bokeh */
.bokeh-6 { width: 20px; height: 20px; background: radial-gradient(circle, rgba(64,224,208,0.3) 0%, transparent 70%); top: 8%; left: 55%; }
.bokeh-7 { width: 15px; height: 15px; background: radial-gradient(circle, rgba(64,224,208,0.25) 0%, transparent 70%); top: 35%; left: 85%; }
.bokeh-8 { width: 18px; height: 18px; background: radial-gradient(circle, rgba(64,224,208,0.2) 0%, transparent 70%); top: 55%; left: 12%; }
.bokeh-9 { width: 12px; height: 12px; background: radial-gradient(circle, rgba(64,224,208,0.35) 0%, transparent 70%); top: 70%; left: 65%; }
.bokeh-10 { width: 16px; height: 16px; background: radial-gradient(circle, rgba(64,224,208,0.28) 0%, transparent 70%); top: 88%; left: 40%; }

/* Gold bokeh pollen */
.bokeh-11 { width: 14px; height: 14px; background: radial-gradient(circle, rgba(255,213,79,0.35) 0%, transparent 70%); top: 15%; left: 42%; }
.bokeh-12 { width: 10px; height: 10px; background: radial-gradient(circle, rgba(255,213,79,0.4) 0%, transparent 70%); top: 40%; left: 58%; }
.bokeh-13 { width: 12px; height: 12px; background: radial-gradient(circle, rgba(255,213,79,0.3) 0%, transparent 70%); top: 65%; left: 22%; }
.bokeh-14 { width: 8px; height: 8px; background: radial-gradient(circle, rgba(255,213,79,0.45) 0%, transparent 70%); top: 82%; left: 75%; }
.bokeh-15 { width: 11px; height: 11px; background: radial-gradient(circle, rgba(255,213,79,0.32) 0%, transparent 70%); top: 92%; left: 18%; }

/* Additional large green */
.bokeh-16 { width: 90px; height: 90px; background: radial-gradient(circle, rgba(0,230,118,0.06) 0%, transparent 70%); top: 5%; left: 88%; }
.bokeh-17 { width: 75px; height: 75px; background: radial-gradient(circle, rgba(0,230,118,0.09) 0%, transparent 70%); top: 50%; left: 5%; }
.bokeh-18 { width: 55px; height: 55px; background: radial-gradient(circle, rgba(27,94,32,0.2) 0%, transparent 70%); top: 30%; left: 45%; }
.bokeh-19 { width: 40px; height: 40px; background: radial-gradient(circle, rgba(0,230,118,0.13) 0%, transparent 70%); top: 85%; left: 60%; }
.bokeh-20 { width: 45px; height: 45px; background: radial-gradient(circle, rgba(27,94,32,0.15) 0%, transparent 70%); top: 20%; left: 25%; }

/* ==================== ZONES ==================== */

.zone {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zone-canopy {
    padding: 60px 0;
}

.zone-photosynthesis {
    padding: 40px 0;
}

.zone-root {
    padding: 80px 0 120px;
}

/* ==================== HONEYCOMB CONTAINERS ==================== */

.honeycomb-container {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--hex-gap);
}

.honeycomb-dense {
    gap: 2px;
}

.honeycomb-sparse .hex-row {
    margin-bottom: 40px;
}

/* ==================== HEX ROWS ==================== */

.hex-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--hex-gap);
}

.hex-row-offset {
    transform: translateX(calc(var(--hex-width) / 4));
}

.honeycomb-dense .hex-row-offset {
    transform: translateX(calc(var(--hex-width-tiny) / 4));
}

.honeycomb-sparse .hex-row-offset {
    transform: translateX(calc(var(--hex-width) / 3));
}

/* ==================== HEXAGONS ==================== */

.hex {
    position: relative;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out, filter 0.4s ease-out;
    opacity: 0;
    flex-shrink: 0;
}

.hex-small {
    width: var(--hex-width);
    height: calc(var(--hex-width) * 1.1547);
}

.hex-tiny {
    width: var(--hex-width-tiny);
    height: calc(var(--hex-width-tiny) * 1.1547);
}

.hex-medium {
    width: var(--hex-width-medium);
    height: calc(var(--hex-width-medium) * 1.1547);
}

.hex-large {
    width: var(--hex-width-large);
    height: calc(var(--hex-width-large) * 1.1547);
}

.hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--abyss);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 230, 118, 0.08);
}

/* Hex visible state */
.hex.hex-visible {
    opacity: 1;
}

/* Hex active (in viewport center) */
.hex.hex-active {
    filter: drop-shadow(0 0 20px rgba(0, 230, 118, 0.3));
    transform: scale(1.03);
}

/* Hex hover */
.hex-cell:hover .hex-inner {
    border-color: var(--chlorophyll);
    box-shadow: inset 0 0 30px rgba(0, 230, 118, 0.15);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hex-cell:hover .hex-word,
.hex-cell:hover .hex-label,
.hex-cell:hover .hex-data,
.hex-cell:hover .hex-annotation {
    color: var(--specimen-white);
    transition: color 0.2s ease;
}

/* ==================== CANOPY ROTATION ==================== */

.canopy-rotate {
    animation: canopyBreath 10s ease-in-out infinite;
}

@keyframes canopyBreath {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(0.5deg); }
}

.canopy-rotate.hex-active {
    animation: canopyBreathActive 10s ease-in-out infinite;
}

@keyframes canopyBreathActive {
    0%, 100% { transform: rotate(0deg) scale(1.03); }
    50% { transform: rotate(0.5deg) scale(1.03); }
}

/* ==================== TYPOGRAPHY ==================== */

.domain-name {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(48px, 8vw, 128px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--specimen-white);
    position: relative;
    z-index: 2;
    text-align: center;
    line-height: 1.1;
}

.domain-name-small {
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 700;
    font-size: clamp(16px, 2vw, 28px);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--specimen-white);
    position: relative;
    z-index: 2;
}

.hex-label {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(14px, 1.8vw, 22px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--turquoise-signal);
    transition: color 0.2s ease;
}

.hex-data {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(12px, 1.5vw, 18px);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--silver);
    transition: color 0.2s ease;
}

.hex-data-gold {
    font-family: 'Exo 2', sans-serif;
    font-weight: 500;
    font-size: clamp(20px, 3vw, 36px);
    color: var(--pollen-gold);
}

.hex-word {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    letter-spacing: 0.05em;
    color: var(--fog-gray);
    text-transform: lowercase;
    transition: color 0.2s ease;
}

.hex-annotation {
    font-family: 'IBM Plex Sans', sans-serif;
    font-weight: 400;
    font-size: 13px;
    letter-spacing: 0.02em;
    color: var(--fog-gray);
    text-align: center;
    line-height: 1.5;
    position: relative;
    z-index: 2;
    transition: color 0.2s ease;
}

.hex-glyph {
    font-size: 24px;
    color: var(--chlorophyll);
    opacity: 0.6;
    margin-top: 8px;
}

/* ==================== PULSE RING ANIMATION ==================== */

.pulse-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    border: 2px solid var(--chlorophyll);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    animation: pulseRing 3s ease-out infinite;
}

.pulse-ring-2 {
    animation-delay: 1s;
}

.pulse-ring-3 {
    animation-delay: 2s;
}

@keyframes pulseRing {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0.6;
    }
    100% {
        transform: translate(-50%, -50%) scale(5);
        opacity: 0;
    }
}

/* ==================== BOKEH FILLS ==================== */

.hex-bokeh-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hex-bokeh-a { background: radial-gradient(circle at 30% 40%, rgba(0,230,118,0.15) 0%, transparent 50%), radial-gradient(circle at 70% 60%, rgba(27,94,32,0.2) 0%, transparent 60%); }
.hex-bokeh-b { background: radial-gradient(circle at 50% 30%, rgba(64,224,208,0.12) 0%, transparent 50%), radial-gradient(circle at 40% 70%, rgba(0,230,118,0.1) 0%, transparent 60%); }
.hex-bokeh-c { background: radial-gradient(circle at 60% 50%, rgba(0,230,118,0.18) 0%, transparent 45%), radial-gradient(circle at 30% 30%, rgba(255,213,79,0.1) 0%, transparent 50%); }
.hex-bokeh-d { background: radial-gradient(circle at 40% 60%, rgba(27,94,32,0.25) 0%, transparent 55%), radial-gradient(circle at 70% 30%, rgba(0,230,118,0.08) 0%, transparent 50%); }
.hex-bokeh-e { background: radial-gradient(circle at 50% 50%, rgba(0,230,118,0.12) 0%, transparent 50%), radial-gradient(circle at 20% 80%, rgba(64,224,208,0.1) 0%, transparent 60%); }
.hex-bokeh-f { background: radial-gradient(circle at 60% 40%, rgba(27,94,32,0.3) 0%, transparent 50%), radial-gradient(circle at 30% 70%, rgba(0,230,118,0.15) 0%, transparent 55%); }
.hex-bokeh-g { background: radial-gradient(circle at 40% 50%, rgba(0,230,118,0.2) 0%, transparent 45%), radial-gradient(circle at 70% 30%, rgba(64,224,208,0.08) 0%, transparent 60%); }
.hex-bokeh-h { background: radial-gradient(circle at 50% 40%, rgba(0,230,118,0.14) 0%, transparent 50%), radial-gradient(circle at 30% 70%, rgba(27,94,32,0.18) 0%, transparent 55%); }
.hex-bokeh-i { background: radial-gradient(circle at 45% 55%, rgba(64,224,208,0.15) 0%, transparent 50%), radial-gradient(circle at 65% 25%, rgba(0,230,118,0.1) 0%, transparent 60%); }
.hex-bokeh-j { background: radial-gradient(circle at 35% 45%, rgba(0,230,118,0.2) 0%, transparent 50%), radial-gradient(circle at 65% 65%, rgba(255,213,79,0.08) 0%, transparent 55%); }
.hex-bokeh-k { background: radial-gradient(circle at 55% 35%, rgba(27,94,32,0.22) 0%, transparent 50%), radial-gradient(circle at 30% 70%, rgba(0,230,118,0.12) 0%, transparent 55%); }
.hex-bokeh-l { background: radial-gradient(circle at 50% 50%, rgba(0,230,118,0.18) 0%, transparent 45%); }
.hex-bokeh-m { background: radial-gradient(circle at 40% 40%, rgba(64,224,208,0.15) 0%, transparent 50%); }
.hex-bokeh-n { background: radial-gradient(circle at 60% 60%, rgba(27,94,32,0.2) 0%, transparent 50%); }
.hex-bokeh-o { background: radial-gradient(circle at 45% 50%, rgba(0,230,118,0.12) 0%, transparent 50%); }
.hex-bokeh-p { background: radial-gradient(circle at 55% 45%, rgba(64,224,208,0.1) 0%, transparent 50%); }
.hex-bokeh-q { background: radial-gradient(circle at 50% 50%, rgba(0,230,118,0.16) 0%, transparent 45%); }
.hex-bokeh-r { background: radial-gradient(circle at 40% 60%, rgba(27,94,32,0.18) 0%, transparent 50%); }
.hex-bokeh-s { background: radial-gradient(circle at 55% 40%, rgba(0,230,118,0.14) 0%, transparent 50%); }
.hex-bokeh-t { background: radial-gradient(circle at 45% 55%, rgba(64,224,208,0.12) 0%, transparent 50%); }
.hex-bokeh-u { background: radial-gradient(circle at 50% 50%, rgba(0,230,118,0.1) 0%, transparent 50%); }
.hex-bokeh-v { background: radial-gradient(circle at 55% 45%, rgba(27,94,32,0.15) 0%, transparent 50%); }
.hex-bokeh-w { background: radial-gradient(circle at 45% 50%, rgba(0,230,118,0.13) 0%, transparent 45%); }
.hex-bokeh-x { background: radial-gradient(circle at 50% 55%, rgba(64,224,208,0.11) 0%, transparent 50%); }
.hex-bokeh-y { background: radial-gradient(circle at 40% 50%, rgba(0,230,118,0.08) 0%, transparent 50%); }
.hex-bokeh-z { background: radial-gradient(circle at 55% 50%, rgba(27,94,32,0.12) 0%, transparent 50%); }
.hex-bokeh-aa { background: radial-gradient(circle at 50% 45%, rgba(0,230,118,0.06) 0%, transparent 50%); }
.hex-bokeh-ab { background: radial-gradient(circle at 45% 55%, rgba(27,94,32,0.1) 0%, transparent 50%); }
.hex-bokeh-large-1 {
    background:
        radial-gradient(circle at 30% 35%, rgba(0,230,118,0.2) 0%, transparent 35%),
        radial-gradient(circle at 65% 55%, rgba(0,230,118,0.15) 0%, transparent 40%),
        radial-gradient(circle at 50% 75%, rgba(64,224,208,0.1) 0%, transparent 35%),
        radial-gradient(circle at 20% 70%, rgba(27,94,32,0.25) 0%, transparent 45%),
        radial-gradient(circle at 75% 25%, rgba(255,213,79,0.08) 0%, transparent 30%);
}
.hex-bokeh-large-2 {
    background:
        radial-gradient(circle at 55% 40%, rgba(0,230,118,0.18) 0%, transparent 35%),
        radial-gradient(circle at 30% 65%, rgba(64,224,208,0.12) 0%, transparent 40%),
        radial-gradient(circle at 70% 70%, rgba(0,230,118,0.1) 0%, transparent 35%),
        radial-gradient(circle at 40% 25%, rgba(27,94,32,0.2) 0%, transparent 45%),
        radial-gradient(circle at 80% 50%, rgba(255,213,79,0.06) 0%, transparent 30%);
}

/* ==================== ROOT ZONE DISSOLVING ==================== */

.hex-dissolving {
    transition: transform 1.2s ease-out, opacity 1.2s ease-out;
}

.hex-fragment {
    opacity: 1;
    transition: opacity 0.8s ease;
}

.hex-dissolving.hex-scatter {
    opacity: 0.3;
}

.hex-final-row {
    margin-top: 60px;
}

.hex-final .hex-inner {
    background: linear-gradient(135deg, rgba(0,230,118,0.05) 0%, var(--abyss) 100%);
    border: 1px solid rgba(0, 230, 118, 0.15);
}

/* ==================== TITLE HEX ==================== */

.hex-title .hex-inner {
    background: linear-gradient(180deg, rgba(0,230,118,0.03) 0%, var(--abyss) 50%, rgba(27,94,32,0.05) 100%);
    border: 1px solid rgba(0, 230, 118, 0.12);
}

/* ==================== PULSE NODE ==================== */

.hex-pulse-node .hex-inner {
    background: radial-gradient(circle at center, rgba(0,230,118,0.05) 0%, var(--abyss) 70%);
}

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

@media (max-width: 768px) {
    :root {
        --hex-width: 120px;
        --hex-width-tiny: 80px;
        --hex-width-medium: 180px;
        --hex-width-large: 260px;
    }

    .domain-name {
        font-size: clamp(28px, 6vw, 64px);
    }

    .hex-row-offset {
        transform: translateX(calc(var(--hex-width) / 5));
    }

    .honeycomb-dense .hex-row-offset {
        transform: translateX(calc(var(--hex-width-tiny) / 5));
    }

    .hex-word {
        font-size: 11px;
    }

    .hex-annotation {
        font-size: 10px;
    }

    .hex-label {
        font-size: 12px;
    }

    .hex-data {
        font-size: 11px;
    }

    .honeycomb-sparse .hex-row {
        margin-bottom: 25px;
    }
}

@media (max-width: 480px) {
    :root {
        --hex-width: 100px;
        --hex-width-tiny: 65px;
        --hex-width-medium: 140px;
        --hex-width-large: 200px;
    }

    .hex-row {
        gap: 2px;
    }

    .hex-row-offset {
        transform: translateX(calc(var(--hex-width) / 6));
    }
}
