/* ============================================
   misty.day — Translucent Frost Neomorphism
   ============================================ */

:root {
    --morning-fog: #e8edf2;
    --cloud-linen: #f0f2f5;
    --dew-highlight: #ffffff;
    --mist-shadow: #b8c4d0;
    --deep-slate: #2c3e50;
    --soft-graphite: #6b7c8d;
    --petal-rose: #d4a0a0;
    --frost-lavender: #9badc4;
    --stem-sage: #8fa89b;
    --glass-veil: rgba(240, 242, 245, 0.65);

    --neo-raised: 6px 6px 12px rgba(184, 196, 208, 0.55), -6px -6px 12px rgba(255, 255, 255, 0.8);
    --neo-hover: 10px 10px 20px rgba(184, 196, 208, 0.6), -10px -10px 20px rgba(255, 255, 255, 0.85);
    --neo-inset: inset 4px 4px 8px rgba(184, 196, 208, 0.5), inset -4px -4px 8px rgba(255, 255, 255, 0.7);

    --meadow-width: 60%;
    --ease-gentle: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-symmetric: cubic-bezier(0.45, 0, 0.55, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    display: grid;
    grid-template-columns: var(--meadow-width) 1fr;
    min-height: 100vh;
    background: var(--morning-fog);
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    color: var(--deep-slate);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    transition: grid-template-columns 0.8s var(--ease-gentle);
}

/* ============================================
   MEADOW PANEL (Left - Sticky)
   ============================================ */

.meadow {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(
        180deg,
        #edf1f5 0%,
        var(--morning-fog) 40%,
        #dfe6ed 70%,
        #e2e8ee 100%
    );
    z-index: 1;
}

/* Fog particles */
.fog-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.fog-particle {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    animation: drift var(--drift-duration, 60s) linear infinite,
               breathe var(--breathe-duration, 8s) var(--ease-symmetric) infinite;
    will-change: transform, opacity;
}

@keyframes drift {
    from { transform: translateX(-120px); }
    to { transform: translateX(calc(100vw + 120px)); }
}

@keyframes breathe {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.6; }
}

/* Flowers */
.flowers-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s var(--ease-gentle);
}

.meadow.meadow--sprouting .flowers-container,
.meadow.meadow--blooming .flowers-container,
.meadow.meadow--dewfall .flowers-container {
    opacity: 1;
}

.flower {
    position: absolute;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
}

.flower-stem {
    width: 2px;
    background: var(--stem-sage);
    height: 0;
    transform-origin: bottom center;
    animation: grow var(--grow-duration, 3s) var(--ease-gentle) var(--grow-delay, 0s) forwards;
}

@keyframes grow {
    from { height: 0; }
    to { height: var(--stem-height, 80px); }
}

.flower-bloom {
    width: var(--bloom-size, 12px);
    height: var(--bloom-size, 12px);
    border-radius: 50%;
    background: radial-gradient(circle, var(--bloom-color, #d4a0a0) 30%, transparent 70%);
    transform: scale(0);
    animation: bloom 0.5s var(--ease-spring) var(--bloom-delay, 3s) forwards;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scale(0);
}

@keyframes bloom {
    from { transform: translateX(-50%) scale(0); }
    to { transform: translateX(-50%) scale(1); }
}

.flower-leaf {
    position: absolute;
    width: 6px;
    height: 10px;
    border-radius: 0 50% 50% 50%;
    background: var(--stem-sage);
    opacity: 0.7;
}

/* Dewdrops */
.dewdrops-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.5s var(--ease-gentle);
}

.meadow.meadow--dewfall .dewdrops-container {
    opacity: 1;
}

.dewdrop {
    position: absolute;
    width: var(--drop-size, 8px);
    height: var(--drop-size, 8px);
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(155, 173, 196, 0.3));
    backdrop-filter: blur(2px);
    transform: scale(0);
    animation: dewAppear 0.6s var(--ease-spring) var(--dew-delay, 0s) forwards;
}

.dewdrop::after {
    content: '';
    position: absolute;
    top: 25%;
    left: 25%;
    width: 2px;
    height: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
}

@keyframes dewAppear {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

/* Falling leaves */
.leaves-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 2s var(--ease-gentle);
}

.meadow.meadow--dewfall .leaves-container,
.meadow.meadow--horizon .leaves-container {
    opacity: 1;
}

.falling-leaf {
    position: absolute;
    width: 12px;
    height: 18px;
    border-radius: 0 50% 50% 50%;
    background: linear-gradient(135deg, var(--stem-sage), transparent);
    opacity: 0.6;
    animation: leafFall var(--leaf-duration, 25s) linear infinite;
    will-change: transform;
}

@keyframes leafFall {
    0% {
        transform: translate(0, -20px) rotate(0deg);
        opacity: 0;
    }
    5% { opacity: 0.6; }
    90% { opacity: 0.6; }
    100% {
        transform: translate(var(--leaf-drift, 60px), calc(100vh + 20px)) rotate(720deg);
        opacity: 0;
    }
}

/* Emblem */
.emblem {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--cloud-linen);
    box-shadow: var(--neo-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 1s var(--ease-gentle), transform 1s var(--ease-gentle);
}

.emblem-text {
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    color: var(--deep-slate);
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.meadow.meadow--blooming .emblem,
.meadow.meadow--dewfall .emblem {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.8);
}

.meadow.meadow--horizon .emblem {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

/* Horizon text */
.horizon-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    max-width: 80%;
    opacity: 0;
    transition: opacity 2s var(--ease-gentle);
    text-shadow: 0 1px 8px rgba(44, 62, 80, 0.15);
}

.meadow.meadow--horizon .horizon-text {
    opacity: 1;
}

.meadow.meadow--horizon {
    background: linear-gradient(
        180deg,
        #dce3ea 0%,
        #c8d2dc 40%,
        #b8c4d0 70%,
        #aab6c4 100%
    );
}

/* ============================================
   JOURNAL PANEL (Right - Scrollable)
   ============================================ */

.journal {
    background: var(--cloud-linen);
    min-height: 100vh;
    padding: 0;
}

.section {
    padding: 60px clamp(30px, 5vw, 80px);
}

/* The Clearing (Hero) */
.section-clearing {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-title {
    text-align: right;
}

.hero-name {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(4rem, 10vw, 9rem);
    letter-spacing: 0.08em;
    color: var(--deep-slate);
    line-height: 1;
    font-feature-settings: 'liga' 1, 'kern' 1;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.hero-subtitle {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: clamp(0.85rem, 1.5vw, 1.1rem);
    color: var(--soft-graphite);
    letter-spacing: 0.15em;
    margin-top: 1.5rem;
    text-transform: lowercase;
}

/* Philosophy */
.section-philosophy {
    min-height: 150vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 50px;
}

.philosophy-block {
    padding: 40px;
    border-radius: 20px;
    background: var(--cloud-linen);
    box-shadow: var(--neo-raised);
    max-width: 560px;
}

.philosophy-block p {
    font-family: 'Libre Baskerville', serif;
    font-size: 1.1rem;
    line-height: 1.85;
    color: var(--deep-slate);
}

.section-heading {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--deep-slate);
    margin-bottom: 1.2rem;
    letter-spacing: 0.02em;
}

/* Wave separator */
.wave-separator {
    padding: 20px clamp(30px, 5vw, 80px);
}

.wave-separator svg {
    width: 100%;
    height: 40px;
}

/* Garden (Game catalog) */
.section-garden {
    min-height: 200vh;
    padding-bottom: 120px;
}

.garden-heading {
    margin-bottom: 60px;
}

.game-cards-scatter {
    position: relative;
    min-height: 800px;
}

.game-card {
    position: absolute;
    left: var(--card-x, 0);
    top: var(--card-y, 0);
    padding: 32px;
    border-radius: 20px;
    background: var(--cloud-linen);
    box-shadow: var(--neo-raised);
    transition: all 0.35s var(--ease-gentle);
    cursor: default;
}

.game-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--neo-hover);
}

.card-large {
    width: clamp(240px, 50%, 340px);
}

.card-medium {
    width: clamp(200px, 45%, 280px);
}

.card-small {
    width: clamp(180px, 40%, 240px);
}

.card-icon {
    margin-bottom: 16px;
    opacity: 0.8;
}

.card-title {
    font-family: 'Libre Baskerville', serif;
    font-weight: 400;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
    color: var(--deep-slate);
    margin-bottom: 8px;
}

.card-desc {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--soft-graphite);
    margin-bottom: 12px;
}

.card-meta {
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 300;
    font-size: 0.85rem;
    color: var(--soft-graphite);
    opacity: 0.5;
}

/* Dewfall (Members) */
.section-dewfall {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 32px;
}

.member {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 0;
}

.member-name {
    font-family: 'Libre Baskerville', serif;
    font-style: italic;
    font-size: 1.3rem;
    color: var(--deep-slate);
}

.member-role {
    font-family: 'Karla', sans-serif;
    font-weight: 300;
    font-size: 0.95rem;
    color: var(--soft-graphite);
    letter-spacing: 0.04em;
}

/* Horizon (Closing) */
.section-horizon {
    min-height: 100vh;
}

/* ============================================
   REVEAL ANIMATIONS
   ============================================ */

[data-reveal] {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s var(--ease-gentle), transform 0.8s var(--ease-gentle);
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

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

@media (max-width: 768px) {
    body {
        grid-template-columns: 1fr;
    }

    .meadow {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 100vh;
        z-index: 0;
        opacity: 0.3;
    }

    .journal {
        position: relative;
        z-index: 1;
        background: rgba(240, 242, 245, 0.85);
        backdrop-filter: blur(8px);
    }

    .hero-name {
        writing-mode: horizontal-tb;
    }

    .game-card {
        position: relative;
        left: auto;
        top: auto;
        width: 100% !important;
        margin-bottom: 24px;
    }

    .game-cards-scatter {
        min-height: auto;
        display: flex;
        flex-direction: column;
    }
}
