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

:root {
    --deep-earth: #a0522d;
    --warm-ground: #cc7755;
    --soft-blush: #d4a088;
    --cream-glow: #f5e6d3;
    --deep-root: #2e1f14;
    --moss-accent: #5a7247;
    --dewdrop: #88b5c4;
    --fairy-light: #e8c547;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    line-height: 1.72;
    letter-spacing: 0.005em;
    color: var(--deep-root);
    background: var(--cream-glow);
    overflow-x: hidden;
}

/* === Typography === */
.section-headline {
    font-family: 'Anybody', sans-serif;
    font-variation-settings: 'wdth' 100, 'wght' 700;
    font-size: clamp(2.2rem, 6vw, 5rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--deep-root);
    margin-bottom: 1.5rem;
}

.portal-title {
    font-family: 'Anybody', sans-serif;
    font-variation-settings: 'wdth' 100, 'wght' 500;
    font-size: clamp(2.5rem, 8vw, 6rem);
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--deep-root);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

/* === HUD Frame === */
.hud-frame {
    position: fixed;
    inset: 16px;
    pointer-events: none;
    z-index: 100;
}

.hud-border {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(90, 114, 71, 0.35);
    border-radius: 24px;
    animation: hud-breathe 4s ease-in-out infinite;
}

@keyframes hud-breathe {
    0%, 100% { border-color: rgba(90, 114, 71, 0.2); }
    50% { border-color: rgba(90, 114, 71, 0.5); }
}

.hud-corner {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.hud-corner--tl { top: 12px; left: 12px; }
.hud-corner--tr { top: 12px; right: 12px; }
.hud-corner--bl { bottom: 12px; left: 12px; }
.hud-corner--br { bottom: 12px; right: 12px; }

.hud-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--moss-accent);
    opacity: 0.65;
}

.hud-line {
    position: absolute;
    background: rgba(90, 114, 71, 0.15);
}

.hud-line--h {
    top: 50%;
    left: 80px;
    right: 80px;
    height: 1px;
}

.hud-line--v {
    left: 50%;
    top: 80px;
    bottom: 80px;
    width: 1px;
}

/* === Sections === */
.section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 48px;
}

/* Section 1: Portal */
.section--portal {
    background: var(--cream-glow);
}

.portal-bubble {
    position: relative;
    width: clamp(250px, 50vw, 400px);
    height: clamp(250px, 50vw, 400px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-blob {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

/* Section 2: Meadow */
.section--meadow {
    background: var(--cream-glow);
    background-image: radial-gradient(ellipse at 20% 80%, rgba(204, 119, 85, 0.08) 0%, transparent 60%);
}

.meadow-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 48px;
    max-width: 1100px;
    width: 100%;
    align-items: start;
}

.meadow-text p {
    margin-bottom: 1.2rem;
    color: var(--deep-root);
}

.meadow-icons {
    display: flex;
    flex-direction: column;
    gap: 32px;
    align-items: center;
}

.icon-vignette {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 35% 35%, rgba(245,230,211,0.7), rgba(212,160,136,0.2));
    border-radius: 47% 53% 42% 58% / 55% 45% 52% 48%;
}

/* Section 3: Undergrowth */
.section--undergrowth {
    background: linear-gradient(to bottom, var(--cream-glow), #f0dcc4);
}

.undergrowth-content {
    max-width: 42ch;
    text-align: left;
}

.undergrowth-content p {
    margin-bottom: 1.4rem;
}

/* Section 4: Canopy */
.section--canopy {
    background: #f0dcc4;
}

.canopy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    max-width: 1100px;
    width: 100%;
}

.canopy-card {
    background: radial-gradient(circle at 30% 30%, rgba(245,230,211,0.8), rgba(212,160,136,0.15));
    border-radius: 47% 53% 42% 58% / 55% 45% 52% 48%;
    padding: 48px 32px;
    text-align: center;
}

.canopy-card h3 {
    font-family: 'Anybody', sans-serif;
    font-variation-settings: 'wdth' 125, 'wght' 300;
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: var(--deep-root);
    margin-bottom: 1rem;
}

.canopy-card p {
    font-size: 0.95rem;
    color: var(--deep-root);
    opacity: 0.85;
}

/* Section 5: Clearing */
.section--clearing {
    background: var(--cream-glow);
    padding: 200px 48px;
}

.clearing-text {
    font-family: 'Anybody', sans-serif;
    font-variation-settings: 'wdth' 125, 'wght' 300;
    font-size: clamp(1.2rem, 3vw, 2rem);
    color: var(--deep-root);
    opacity: 0.7;
    text-align: center;
}

/* === Bubble Particles === */
.bubble-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(245,230,211,0.6), rgba(212,160,136,0.15));
    animation: bubble-rise var(--duration) linear var(--delay) infinite;
    left: var(--x);
    width: var(--size);
    height: var(--size);
}

@keyframes bubble-rise {
    0% { transform: translateY(100vh) translateX(0) scale(1); opacity: 0.3; }
    50% { transform: translateY(50vh) translateX(calc(var(--drift) * 30px)) scale(1.1); opacity: 0.2; }
    100% { transform: translateY(-10vh) translateX(calc(var(--drift) * -20px)) scale(0.8); opacity: 0; }
}

/* === Cursor Trail === */
.cursor-bubble {
    position: fixed;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(136,181,196,0.4), transparent);
    pointer-events: none;
    z-index: 99;
    animation: cursor-fade 600ms ease-out forwards;
}

@keyframes cursor-fade {
    0% { width: 6px; height: 6px; opacity: 1; }
    100% { width: 14px; height: 14px; opacity: 0; }
}

/* === Reveal Animations === */
.reveal-block {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 800ms cubic-bezier(0.22, 0.61, 0.36, 1), transform 800ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.reveal-block.revealed {
    opacity: 1;
    transform: translateY(0);
}

.icon-vignette.revealed {
    animation: pop-in 500ms cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* === Hover States === */
.canopy-card:hover,
.icon-vignette:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 20px rgba(204, 119, 85, 0.25);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

/* === Crystal rotation === */
.hud-corner--tr svg {
    animation: crystal-drift 20s linear infinite;
}

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

/* === Lantern bob === */
.hud-corner--br svg {
    animation: lantern-bob 3s ease-in-out infinite alternate;
}

@keyframes lantern-bob {
    0% { transform: translateY(0); }
    100% { transform: translateY(-4px); }
}

/* === Responsive === */
@media (max-width: 768px) {
    .hud-frame {
        inset: 8px;
    }

    .hud-corner svg {
        width: 32px;
        height: 32px;
    }

    .section {
        padding: 60px 24px;
    }

    .meadow-grid {
        grid-template-columns: 1fr;
    }

    .meadow-icons {
        flex-direction: row;
        justify-content: center;
    }

    .canopy-grid {
        grid-template-columns: 1fr;
    }

    .hud-line--h, .hud-line--v {
        display: none;
    }
}
