:root {
    --forest-deep: #0d170d;
    --forest-mid: #1a331a;
    --forest-light: #4c6b4c;
    --earth-sand: #d4c5b3;
    --pure-white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: "Pretendard Variable", -apple-system, sans-serif;
    background-color: var(--forest-deep);
    color: var(--pure-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 40px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
}

header.scrolled {
    /* Stronger gradient: Dark until 70%, then fade to transparent */
    background: linear-gradient(to bottom,
            rgba(13, 23, 13, 1) 0%,
            rgba(13, 23, 13, 0.95) 50%,
            rgba(13, 23, 13, 0.8) 70%,
            rgba(13, 23, 13, 0) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    padding: 20px 40px;
    border-bottom: none;
    height: 120px;
    /* Increased height for longer fade */
    align-items: center;
    /* Restore center alignment */
}

.logo img {
    height: 32px;
    filter: brightness(0) invert(1);
}

.nav-links {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-links a {
    color: var(--pure-white);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: opacity 0.3s;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.nav-links a:hover {
    opacity: 0.6;
}

/* Hero Section */
.hero {
    height: 100vh;
    max-width: 100%;
    /* Override generic section max-width */
    width: 100%;
    margin: 0;
    padding: 0;

    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.4)), url('dadaforest_hero_bg_v2.jpg');
    background-size: cover;
    background-position: center;

    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    align-items: center;
    text-align: center;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -0.03em;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.8;
    max-width: 700px;
    word-break: keep-all;
}

/* Sections */
section {
    padding: 140px 20px;
    max-width: 1300px;
    margin: 0 auto;
    opacity: 1;
    /* Fallback to visible, script can handle animation if loaded */
    transform: none;
    transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    font-size: 3rem;
    margin-bottom: 70px;
    text-align: center;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* Project Filters */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--pure-white);
    padding: 10px 24px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--pure-white);
    color: var(--forest-deep);
    border-color: var(--pure-white);
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 40px;
}

.project-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    /* Reset link styles */
    text-decoration: none;
    color: var(--pure-white);
    display: block;
    /* Ensure it behaves like a block for the card layout */
}

.project-card:hover {
    transform: translateY(-15px);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.project-img {
    height: 300px;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-info {
    padding: 35px;
}

.project-info h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.project-info p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    text-decoration: none;
    /* Just in case */
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 1100px;
    width: 100%;
    background: var(--forest-deep);
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.modal-img {
    width: 100%;
    height: 65vh;
    object-fit: cover;
}

.modal-info {
    padding: 50px;
    text-align: center;
}

.modal-info h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.modal-info p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    max-width: 800px;
    margin: 0 auto;
    word-break: keep-all;
}

/* Utility */
.hide {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    header.scrolled {
        padding: 12px 20px;
    }

    .nav-links {
        display: none;
    }

    section {
        padding: 80px 20px;
    }

    .section-title {
        font-size: 2.25rem;
        margin-bottom: 40px;
    }

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

    .modal-img {
        height: 45vh;
    }

    .modal-info {
        padding: 30px 20px;
    }

    .modal-info h2 {
        font-size: 1.75rem;
    }
}