:root {
    --bg-color: #050806;
    --text-main: #f0fdf6;
    --text-dim: #a7c0b2;
    --accent: #34d399;
    --glass-bg: rgba(15, 25, 20, 0.65);
    --glass-border: rgba(52, 211, 153, 0.2);
    --card-hover: rgba(52, 211, 153, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: 'Outfit', sans-serif;
    overflow-x: hidden;
}

/* Parallax Scroll Setup */
.parallax-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.canopy-section {
    background-image: url('assets/canopy.png');
}

.trunk-section {
    background-image: url('assets/trunk.png');
    min-height: 80vh;
    /* slightly shorter to pass through */
}

.roots-section {
    background-image: url('assets/roots.png');
    min-height: 120vh;
    justify-content: flex-start;
    padding-top: 10vh;
}

/* Overlay Canvases */
.layer-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* Needs to be above the dark-overlay (z-index 1) but below the text (z-index 3) */
    pointer-events: none;
    /* Let clicks pass through */
}

/* Overlays for readable text */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 20, 15, 0.4);
    z-index: 1;
}

.trunk-section .light-overlay {
    background: rgba(20, 30, 20, 0.6);
}

.roots-section .dark-overlay {
    background: linear-gradient(to bottom, rgba(5, 10, 8, 0.8) 0%, rgba(5, 10, 8, 0.95) 100%);
}

.hero-content,
.trunk-content,
.roots-content,
footer {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1200px;
    padding: 2rem;
}

/* Hero Typography */
.hero-content {
    text-align: center;
    margin-top: -5vh;
    /* Center slightly above visual center */
}

h1 {
    font-size: 4.5rem;
    font-weight: 600;
    letter-spacing: 2px;
    margin-bottom: 2rem;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.hero-content p {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 5vh;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.scroll-indicator span {
    font-size: 0.9rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.arrow-down {
    width: 20px;
    height: 20px;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(45deg);
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0) rotate(45deg);
    }

    40% {
        transform: translateY(-10px) rotate(45deg);
    }

    60% {
        transform: translateY(-5px) rotate(45deg);
    }
}

/* Trunk Quote */
.trunk-content {
    text-align: center;
}

blockquote {
    font-size: 2rem;
    font-style: italic;
    font-weight: 300;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.5;
    color: #e2e8f0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
}

/* Roots Section */
.roots-content {
    text-align: center;
}

.roots-content h2 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    color: var(--accent);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-dim);
    margin-bottom: 4rem;
}

/* Project Cards Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.project-card {
    position: relative;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    text-decoration: none;
    color: var(--text-main);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    overflow: hidden;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--card-hover);
    box-shadow: 0 15px 40px rgba(52, 211, 153, 0.15);
}

.card-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.card-content p {
    color: var(--text-dim);
    line-height: 1.7;
    font-size: 1.1rem;
}

.card-glow {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: var(--accent);
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
    z-index: -1;
}

.project-card:hover .card-glow {
    opacity: 0.3;
}

/* Hamburger Menu Icon */
.hamburger-menu {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 35px;
    height: 30px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-menu span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: var(--accent);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.4);
}

/* Hamburger Menu Animation to X */
.hamburger-menu.open span:nth-child(1) {
    transform: translateY(13.5px) rotate(45deg);
}

.hamburger-menu.open span:nth-child(2) {
    opacity: 0;
}

.hamburger-menu.open span:nth-child(3) {
    transform: translateY(-13.5px) rotate(-45deg);
}

/* Side Drawer Navigation */
.side-drawer {
    position: fixed;
    top: 0;
    right: -350px;
    /* Hidden off-screen by default */
    width: 350px;
    height: 100%;
    background: var(--glass-bg);
    border-left: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 999;
    transition: right 0.4s cubic-bezier(0.77, 0.2, 0.05, 1.0);
    padding: 6rem 2rem 2rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
}

/* When drawer is open */
.side-drawer.open {
    right: 0;
}

.drawer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.drawer-category {
    color: var(--accent);
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: -1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(52, 211, 153, 0.3);
}

.drawer-links li a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 400;
    transition: color 0.3s ease, padding-left 0.3s ease;
    display: block;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-links li a:hover {
    color: var(--accent);
    padding-left: 15px;
    border-bottom-color: rgba(52, 211, 153, 0.3);
}

/* Responsive adjustments for Drawer */
@media (max-width: 400px) {
    .side-drawer {
        width: 100%;
        right: -100%;
    }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 10vh;
    padding-bottom: 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.admin-email {
    margin-top: 0.5rem;
}

.admin-email a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.3s ease;
}

.admin-email a:hover {
    color: #fff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Fade In Animations via JS Observer */
.fade-in-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-element.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.delay-1 {
    transition-delay: 0.2s;
}

.delay-2 {
    transition-delay: 0.4s;
}

.delay-3 {
    transition-delay: 0.6s;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2.8rem;
    }

    .hero-content p {
        font-size: 1.2rem;
    }

    blockquote {
        font-size: 1.4rem;
        padding: 0 1rem;
    }

    .roots-content h2 {
        font-size: 2.2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem;
    }

    .parallax-section {
        background-attachment: scroll;
    }

    /* Mobile browsers often struggle with background-attachment fixed */
}