/* ============================================
   namu.club — Frutiger Aero Botanical Conservatory
   ============================================ */

:root {
    --morning-mist: #f5f0e8;
    --petal-blush: #fce4ec;
    --frosted-leaf: #e8f5e9;
    --deep-bark: #2e2418;
    --lichen-gray: #7d8471;
    --sap-green: #81c784;
    --pollen-gold: #f0d58c;
    --forest-floor: #2a1f14;
    --dew-drop: #b2ebf2;
    --elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    scroll-snap-type: y mandatory;
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', serif;
    background: var(--morning-mist);
    color: var(--deep-bark);
    overflow-x: hidden;
}

/* ---- Hex Navigation ---- */
.hex-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.hex-dot {
    cursor: pointer;
    transition: transform 0.4s var(--elastic);
}

.hex-dot polygon {
    fill: transparent;
    stroke: var(--lichen-gray);
    stroke-width: 2;
    transition: fill 0.4s var(--elastic), stroke 0.4s ease;
}

.hex-dot.active polygon {
    fill: var(--sap-green);
    stroke: var(--sap-green);
}

.hex-dot:hover {
    transform: scale(1.3);
}

/* ---- Chambers ---- */
.chamber {
    min-height: 100vh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ---- Chamber 1: Canopy ---- */
.canopy {
    background: linear-gradient(180deg, var(--frosted-leaf) 0%, var(--morning-mist) 100%);
}

.dew-drops {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.dew {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: var(--s);
    height: var(--s);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(178, 235, 242, 0.4), transparent);
}

.hex-frame {
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    overflow: hidden;
}

.hero-hex {
    width: min(70vw, 500px);
    height: min(80vw, 570px);
    background: rgba(232, 245, 233, 0.6);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(46, 36, 24, 0.08);
    transform: scale(0);
    transition: transform 0.8s var(--elastic);
}

.hero-hex.visible {
    transform: scale(1);
}

.hero-hex .hex-inner {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canopy-photo {
    background: var(--frosted-leaf);
}

.canopy-scene {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canopy-art {
    width: 100%;
    height: 100%;
    filter: sepia(0.25) saturate(0.8) contrast(0.95) brightness(1.05);
}

.botanical-silhouette {
    position: absolute;
    width: 80%;
    height: 80%;
    pointer-events: none;
}

.wordmark {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(2rem, 5vw, 4.5rem);
    letter-spacing: 0.03em;
    color: var(--deep-bark);
    margin-top: 2rem;
}

.scroll-hint {
    margin-top: 2rem;
    animation: chevronPulse 2s var(--elastic) infinite;
}

@keyframes chevronPulse {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* ---- Chamber 2: Understory ---- */
.understory {
    background: linear-gradient(180deg, var(--morning-mist) 0%, var(--frosted-leaf) 50%, var(--petal-blush) 100%);
}

.growth-ring-divider {
    position: absolute;
    top: 20px;
    opacity: 0.6;
}

.growth-ring-divider.top {
    top: 20px;
}

.hex-cluster {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    width: min(90vw, 600px);
    height: min(90vw, 600px);
    position: relative;
}

/* Honeycomb rosette layout with absolute positioning */
.rosette {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(90vw, 600px);
    height: min(90vw, 600px);
    position: relative;
}

.hex-cell {
    position: absolute;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    background: rgba(232, 245, 233, 0.6);
    backdrop-filter: blur(12px) saturate(1.2);
    border: none;
    box-shadow: 0 8px 32px rgba(46, 36, 24, 0.08);
    transform: scale(0);
    transition: transform 0.6s var(--elastic);
    overflow: hidden;
}

.hex-cell.visible {
    transform: scale(1);
}

.hex-cell .hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hex-cell .hex-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.botanical-detail {
    width: 100%;
    height: 100%;
    filter: sepia(0.25) saturate(0.8) contrast(0.95) brightness(1.05);
}

.hex-label {
    position: absolute;
    bottom: 22%;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Quicksand', sans-serif;
    font-weight: 500;
    font-size: clamp(0.55rem, 0.9vw, 0.75rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lichen-gray);
    white-space: nowrap;
}

/* Rosette positions */
.hex-cell.center {
    width: 35%;
    height: 35%;
    left: 50%;
    top: 50%;
    transform-origin: center;
    translate: -50% -50%;
    z-index: 2;
}

.hex-cell.center.visible {
    transform: scale(1);
}

.hex-cell.ring {
    width: 28%;
    height: 28%;
}

/* Position ring cells around center */
.hex-cell.ring[data-index="1"] { left: 50%; top: 14%; translate: -50% 0; }
.hex-cell.ring[data-index="2"] { left: 82%; top: 29%; translate: -50% 0; }
.hex-cell.ring[data-index="3"] { left: 82%; top: 57%; translate: -50% 0; }
.hex-cell.ring[data-index="4"] { left: 50%; top: 72%; translate: -50% 0; }
.hex-cell.ring[data-index="5"] { left: 18%; top: 57%; translate: -50% 0; }
.hex-cell.ring[data-index="6"] { left: 18%; top: 29%; translate: -50% 0; }

/* ---- Chamber 3: Forest Floor ---- */
.forest-floor {
    background: var(--morning-mist);
    flex-direction: row;
    padding: 0 5%;
}

.hex-lattice {
    flex: 0 0 auto;
    width: 120px;
    opacity: 0.6;
}

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

.prose.narrow {
    max-width: 38ch;
    flex: 1;
    padding: 3rem 2rem;
    position: relative;
}

.prose .botanical-silhouette.fern {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.chamber-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: clamp(1.8rem, 4vw, 3.5rem);
    letter-spacing: 0.03em;
    color: var(--deep-bark);
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.chamber-title.dark {
    color: var(--morning-mist);
}

.prose p {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.75;
    color: var(--deep-bark);
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 1;
}

.prose p em {
    font-style: italic;
}

/* ---- Chamber 4: Root System ---- */
.root-system {
    background: var(--forest-floor);
}

.hex-network {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.network-svg {
    width: min(90vw, 800px);
    height: auto;
}

.network-lines line {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    transition: stroke-dashoffset 1.5s ease;
}

.root-system.in-view .network-lines line {
    stroke-dashoffset: 0;
}

.network-hex {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.root-system.in-view .network-hex {
    opacity: 1;
}

.root-caption {
    font-family: 'Lora', serif;
    font-weight: 400;
    font-style: italic;
    font-size: clamp(0.9rem, 1.1vw, 1.05rem);
    line-height: 1.75;
    color: var(--lichen-gray);
    max-width: 42ch;
    text-align: center;
    margin-top: 1.5rem;
}

/* ---- Chamber 5: Seed ---- */
.seed {
    background: linear-gradient(180deg, var(--petal-blush) 0%, var(--morning-mist) 100%);
}

.seed-hex {
    width: min(30vw, 180px);
    height: min(34vw, 205px);
    background: rgba(232, 245, 233, 0.6);
    backdrop-filter: blur(12px) saturate(1.2);
    box-shadow: 0 8px 32px rgba(46, 36, 24, 0.08);
    transform: scale(0);
    transition: transform 0.8s var(--elastic);
}

.seed-hex.visible {
    transform: scale(1);
}

.seed-hex .hex-inner {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seed-art {
    width: 100%;
    height: 100%;
    filter: sepia(0.25) saturate(0.8) contrast(0.95) brightness(1.05);
}

.rotating {
    animation: slowSpin 60s linear infinite;
}

@keyframes slowSpin {
    from { transform: scale(1) rotate(0deg); }
    to { transform: scale(1) rotate(360deg); }
}

.closing-line {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: clamp(1rem, 1.8vw, 1.4rem);
    letter-spacing: 0.03em;
    color: var(--lichen-gray);
    margin-top: 2rem;
    text-align: center;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hex-nav {
        right: 12px;
    }

    .hex-lattice {
        display: none;
    }

    .forest-floor {
        flex-direction: column;
        padding: 3rem 1.5rem;
    }

    .prose.narrow {
        max-width: 100%;
        padding: 2rem 0;
    }

    .hex-cell.ring {
        width: 26%;
        height: 26%;
    }

    .hex-cell.center {
        width: 32%;
        height: 32%;
    }
}

@media (max-width: 480px) {
    .rosette {
        width: 95vw;
        height: 95vw;
    }

    .hero-hex {
        width: 80vw;
        height: 92vw;
    }
}
