:root {
    --void: #0a1a0f;
    --canopy: #143d24;
    --moss: #2d6a4f;
    --leaf: #52b788;
    --dew: #b7e4c7;
    --chrome: #d4e8d0;
    --flare-white: #eaf5e6;
    --gold: #d4a843;
    --pink: #e87c9f;
    --hex-size: clamp(120px, 20vw, 220px);
    --hex-gap: clamp(6px, 1vw, 12px);
    --scroll-progress: 0;
}

@property --border-angle {
    syntax: '<angle>';
    initial-value: 135deg;
    inherits: false;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--void);
    color: var(--flare-white);
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: clamp(0.95rem, 1.8vw, 1.15rem);
    line-height: 1.68;
    letter-spacing: 0.01em;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Intro Lens Flare */
.lens-flare-intro {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lens-flare-intro.active {
    opacity: 1;
}

.lens-flare-intro.fade-out {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.flare-core {
    position: absolute;
    width: 12px;
    height: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, var(--flare-white) 0%, transparent 100%);
    opacity: 0;
    animation: flareIn 0.3s 0.4s forwards;
}

.flare-ring {
    position: absolute;
    width: 80px;
    height: 80px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(82, 183, 136, 0.4) 0%, transparent 70%);
    animation: flareRing 0.4s 0.6s forwards;
}

.flare-haze {
    position: absolute;
    width: 240px;
    height: 240px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(232, 124, 159, 0.15) 0%, transparent 70%);
    animation: flareHaze 0.5s 0.8s forwards;
}

.flare-streak {
    position: absolute;
    width: 200px;
    height: 2px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.3), transparent);
    opacity: 0;
    animation: flareIn 0.3s 0.9s forwards;
}

.flare-streak-1 { transform: translate(-50%, -50%) rotate(30deg); }
.flare-streak-2 { transform: translate(-50%, -50%) rotate(-30deg); }

@keyframes flareIn {
    to { opacity: 1; }
}

@keyframes flareRing {
    to { transform: translate(-50%, -50%) scale(1); }
}

@keyframes flareHaze {
    to { transform: translate(-50%, -50%) scale(1); }
}

/* Honeycomb World */
.honeycomb-world {
    position: relative;
    padding: 10vh 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: rotate(calc(var(--scroll-progress) * 2deg));
    transition: transform 0.1s linear;
}

/* Zones */
.zone {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5vh 0;
}

.zone-dawn {
    min-height: 100vh;
    justify-content: center;
}

.zone-growth {
    min-height: 150vh;
}

.zone-bloom {
    min-height: 100vh;
}

/* Hex Rows */
.hex-row {
    display: flex;
    justify-content: center;
    margin-bottom: calc(var(--hex-gap) - 20px);
}

.hex-row-even {
    margin-left: calc(var(--hex-size) * 0.5 + var(--hex-gap) * 0.5);
}

/* Hex Cells */
.hex-cell {
    width: var(--hex-size);
    height: calc(var(--hex-size) * 1.1547);
    margin: 0 calc(var(--hex-gap) / 2);
    position: relative;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    opacity: 0;
    transform: scale(0.3);
    transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1), transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

.hex-border {
    position: absolute;
    inset: 0;
    background: linear-gradient(var(--border-angle, 135deg), var(--chrome), var(--leaf), var(--canopy));
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    transition: --border-angle 0.3s;
}

.hex-cell:hover .hex-border {
    animation: rotateBorder 2s linear infinite;
}

@keyframes rotateBorder {
    from { --border-angle: 0deg; }
    to { --border-angle: 360deg; }
}

.hex-content {
    position: absolute;
    inset: 2px;
    background: var(--canopy);
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 3rem);
    overflow: hidden;
}

.hex-cell:hover .hex-content {
    background: radial-gradient(circle at var(--flare-x, 50%) var(--flare-y, 50%), rgba(82, 183, 136, 0.2), var(--canopy) 60%);
}

/* Bloom Cells */
.bloom-cell {
    width: calc(var(--hex-size) * 1.5);
    height: calc(var(--hex-size) * 1.5 * 1.1547);
}

/* Title Cell */
.title-cell .hex-content {
    background: var(--void);
}

.site-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 4.5rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--flare-white);
    display: inline;
}

.typewriter-cursor {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(2rem, 6vw, 4.5rem);
    color: var(--leaf);
    animation: blink 1.06s step-end infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Headlines */
.headline {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: clamp(1.2rem, 3vw, 2.5rem);
    letter-spacing: -0.02em;
    line-height: 1.08;
    color: var(--flare-white);
    text-align: center;
}

/* Body Text */
.body-text {
    font-family: 'Karla', sans-serif;
    font-size: clamp(0.8rem, 1.4vw, 1rem);
    line-height: 1.68;
    color: var(--dew);
    text-align: center;
}

/* Label Text */
.label-text {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 400;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--leaf);
}

/* CJK Characters */
.cjk-char {
    font-family: 'Noto Sans KR', sans-serif;
    font-weight: 300;
    font-size: clamp(3rem, 8vw, 6rem);
    color: var(--canopy);
    opacity: 0.4;
    transition: opacity 0.5s, color 0.5s;
}

.hex-cell.visible .cjk-char {
    opacity: 0.6;
    color: var(--leaf);
}

/* Petal Burst */
.petal-burst {
    position: relative;
    width: 60px;
    height: 60px;
}

.petal {
    position: absolute;
    width: 20px;
    height: 40px;
    top: 50%;
    left: 50%;
    border-radius: 50% 0;
    transform-origin: bottom center;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.petal:nth-child(1) { background: #143d24; transform: translate(-50%, -100%) rotate(0deg); }
.petal:nth-child(2) { background: #1e5233; transform: translate(-50%, -100%) rotate(72deg); }
.petal:nth-child(3) { background: #2d6a4f; transform: translate(-50%, -100%) rotate(144deg); }
.petal:nth-child(4) { background: #3d8b6a; transform: translate(-50%, -100%) rotate(216deg); }
.petal:nth-child(5) { background: #52b788; transform: translate(-50%, -100%) rotate(288deg); }

.petal-burst-cell:hover .petal:nth-child(1) { transform: translate(-50%, -130%) rotate(0deg); transition-delay: 0ms; }
.petal-burst-cell:hover .petal:nth-child(2) { transform: translate(-50%, -130%) rotate(72deg); transition-delay: 60ms; }
.petal-burst-cell:hover .petal:nth-child(3) { transform: translate(-50%, -130%) rotate(144deg); transition-delay: 120ms; }
.petal-burst-cell:hover .petal:nth-child(4) { transform: translate(-50%, -130%) rotate(216deg); transition-delay: 180ms; }
.petal-burst-cell:hover .petal:nth-child(5) { transform: translate(-50%, -130%) rotate(288deg); transition-delay: 240ms; }

/* Cell Flare */
.cell-flare {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--flare-white) 0%, rgba(82, 183, 136, 0.4) 30%, rgba(232, 124, 159, 0.15) 60%, transparent 100%);
    animation: pulseLens 3s ease-in-out infinite;
}

@keyframes pulseLens {
    0%, 100% { transform: scale(0.8); opacity: 0.6; }
    50% { transform: scale(1.1); opacity: 1; }
}

/* Fern Canvas */
.fern-canvas {
    width: 100%;
    height: 100%;
    max-width: 150px;
    max-height: 150px;
}

/* Nectar Cells */
.nectar-cell {
    cursor: pointer;
}

.nectar-cell .hex-content {
    background: var(--moss);
}

.nectar-expand {
    display: none;
}

/* Nectar Overlay */
.nectar-overlay {
    position: fixed;
    inset: 0;
    background: var(--canopy);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    pointer-events: none;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    transition: clip-path 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s;
}

.nectar-overlay.active {
    opacity: 1;
    pointer-events: all;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

.nectar-overlay-content {
    max-width: 600px;
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s 0.3s, transform 0.4s 0.3s;
}

.nectar-overlay.active .nectar-overlay-content {
    opacity: 1;
    transform: translateY(0);
}

.nectar-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: none;
    border: none;
    color: var(--flare-white);
    font-size: 2rem;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nectar-close:hover {
    color: var(--leaf);
}

/* Final cell styling */
.final-cell .hex-content {
    background: linear-gradient(135deg, var(--canopy), var(--moss));
}
