:root {
    --evergreen-depth: #1B3A2D;
    --canopy-green: #2D5E3F;
    --fern-glow: #4A8C5E;
    --aurora-teal: #3ECFAF;
    --aurora-violet: #7B5EA7;
    --aurora-rose: #CF6B8A;
    --birch-cream: #F2EDDF;
    --amber-moss: #D4A853;
    --forest-floor: #0F1F17;
    --lichen-gray: #8FA89B;
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-breathe: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, var(--forest-floor) 0%, var(--evergreen-depth) 100%);
    color: var(--birch-cream);
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.2vw, 1.15rem);
    line-height: 1.7;
    letter-spacing: 0.015em;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* Bokeh Background */
.bokeh-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bokeh-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.8s var(--ease-breathe), transform 0.8s var(--ease-breathe);
}

.bokeh-circle.visible {
    opacity: 1;
    transform: scale(1);
}

/* Aurora Veil */
.aurora-veil {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 60% 40% at 30% 20%, rgba(62, 207, 175, 0.06), transparent),
        radial-gradient(ellipse 50% 60% at 70% 70%, rgba(123, 94, 167, 0.04), transparent),
        radial-gradient(ellipse 40% 50% at 50% 50%, rgba(207, 107, 138, 0.03), transparent);
    animation: auroraVeil 30s ease-in-out infinite alternate;
}

@keyframes auroraVeil {
    0% { background-position: 0% 0%, 100% 100%, 50% 50%; }
    50% { background-position: 30% 20%, 70% 30%, 40% 60%; }
    100% { background-position: 60% 40%, 40% 80%, 60% 30%; }
}

/* Sections */
.section {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 8vh 6vw;
}

/* Hero */
.section-hero {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.hero-title-svg {
    width: clamp(300px, 50vw, 600px);
    height: auto;
    overflow: visible;
}

.hero-title-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 64px;
    fill: none;
    stroke: var(--amber-moss);
    stroke-width: 1.5;
    stroke-dasharray: 600;
    stroke-dashoffset: 600;
    animation: handwrite 1.8s var(--ease-breathe) 2s forwards;
}

@keyframes handwrite {
    to {
        stroke-dashoffset: 0;
        fill: var(--amber-moss);
    }
}

.hero-subtitle {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--birch-cream);
    opacity: 0;
    margin-top: 2rem;
    animation: fadeIn 1s var(--ease-breathe) 3.8s forwards;
}

@keyframes fadeIn {
    to { opacity: 0.8; }
}

/* Aurora Band */
.aurora-band {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.aurora-edge {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.7;
    animation: auroraColorShift 30s linear infinite;
}

@keyframes auroraColorShift {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

/* Canopy Navigation */
.section-canopy {
    min-height: auto;
    padding: 6vh 6vw;
    display: flex;
    justify-content: center;
}

.canopy-nav {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-blob {
    background: var(--canopy-green);
    border-radius: var(--br);
    padding: 1.5rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: transform 0.3s var(--ease-bounce), box-shadow 0.3s var(--ease-breathe);
}

.nav-blob:hover {
    transform: translateY(-6px) scale(1.03);
    box-shadow:
        0 8px 30px rgba(62, 207, 175, 0.15),
        0 4px 15px rgba(123, 94, 167, 0.1);
}

.nav-icon {
    font-size: 1.4rem;
    color: var(--aurora-teal);
}

.nav-label {
    font-family: 'Kalam', cursive;
    font-size: 0.9rem;
    color: var(--birch-cream);
    letter-spacing: 0.02em;
}

/* Portfolio Section */
.section-portfolio {
    padding-top: 10vh;
    padding-bottom: 10vh;
}

.section-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    color: var(--amber-moss);
    text-align: center;
    margin-bottom: 6vh;
    line-height: 1.15;
    letter-spacing: 0.01em;
}

.blob-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    max-width: 1200px;
    margin: 0 auto;
}

.blob-card {
    background: var(--evergreen-depth);
    border-radius: var(--br);
    padding: clamp(1.5rem, 3vw, 2.5rem);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.88);
    transition: opacity 0.6s var(--ease-breathe), transform 0.6s var(--ease-breathe),
                box-shadow 0.35s var(--ease-breathe);
    cursor: pointer;
}

.blob-card.in-view {
    opacity: 1;
    transform: scale(1);
}

.blob-card:hover {
    transform: translateY(-8px) scale(1.04);
    box-shadow:
        0 12px 40px rgba(62, 207, 175, 0.12),
        0 6px 20px rgba(123, 94, 167, 0.08);
}

.blob-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(62, 207, 175, 0.06) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.35s var(--ease-breathe);
    border-radius: inherit;
}

.blob-card:hover::before {
    opacity: 1;
}

/* Moss texture overlay */
.blob-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    opacity: 0.03;
    pointer-events: none;
    border-radius: inherit;
}

.blob-bg {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

.blob-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    color: var(--birch-cream);
    margin-bottom: 0.75rem;
    position: relative;
    transition: color 0.35s var(--ease-breathe);
    line-height: 1.15;
}

.blob-card:hover .blob-title {
    color: var(--amber-moss);
}

.blob-desc {
    font-family: 'Nunito', sans-serif;
    font-weight: 400;
    font-size: 0.95rem;
    color: var(--lichen-gray);
    line-height: 1.6;
    position: relative;
    margin-bottom: 1rem;
}

.blob-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    position: relative;
}

.tag {
    font-family: 'Kalam', cursive;
    font-size: 0.8rem;
    color: var(--aurora-teal);
    background: rgba(62, 207, 175, 0.08);
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    letter-spacing: 0.02em;
}

/* Deep Forest Floor */
.section-floor {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.floor-content {
    max-width: 700px;
    text-align: center;
}

.floor-title {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    color: var(--amber-moss);
    margin-bottom: 2rem;
    line-height: 1.15;
}

.floor-body {
    font-family: 'Nunito', sans-serif;
    font-weight: 300;
    color: var(--birch-cream);
    opacity: 0.85;
    line-height: 1.8;
}

/* Root Footer */
.root-footer {
    position: relative;
    z-index: 1;
    padding: 6vh 6vw 4vh;
    text-align: center;
}

.root-svg {
    position: absolute;
    top: -80px;
    left: 0;
    width: 100%;
    height: 100px;
    pointer-events: none;
}

.footer-content {
    position: relative;
}

.footer-text {
    font-family: 'Caveat', cursive;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--amber-moss);
}

.footer-sub {
    font-family: 'Kalam', cursive;
    font-size: 0.85rem;
    color: var(--lichen-gray);
    margin-top: 0.5rem;
}

/* Spore Particles */
.spore-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.spore {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: sporeFloat linear infinite;
}

@keyframes sporeFloat {
    0% { transform: translateY(100vh) translateX(0); opacity: 0; }
    10% { opacity: 0.1; }
    90% { opacity: 0.1; }
    100% { transform: translateY(-10vh) translateX(30px); opacity: 0; }
}

/* Responsive */
@media (max-width: 768px) {
    .blob-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .canopy-nav {
        gap: 1rem;
    }

    .nav-blob {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .blob-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aurora-veil, .aurora-edge {
        animation: none;
    }

    .hero-title-text {
        animation: none;
        stroke-dashoffset: 0;
        fill: var(--amber-moss);
    }

    .hero-subtitle {
        animation: none;
        opacity: 0.8;
    }

    .spore {
        animation: none;
    }

    .bokeh-circle {
        animation: none !important;
    }
}
