:root {
    --bg-color: #AABA9E;
    --text-color: #62795D;
    --accent-color: #ffffff;
    --font-main: 'Google Sans Flex', sans-serif;
    --spacing-unit: 1rem;
    --header-height: 60px;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

html.lenis {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header */
/* Header merged below */

.site-nav a {
    margin-left: 2rem;
    transition: opacity 0.3s ease;
}

.site-nav a:hover {
    opacity: 0.5;
}

.site-nav a.logo {
    z-index: 101;
    /* Ensure above everything */
}

/* Page transition */
body {
    transition: opacity 0.5s ease;
    opacity: 1;
}

body.fade-out {
    opacity: 0;
    pointer-events: none;
}

.logo a {
    transition: opacity 2s ease;
    display: block;
}

.logo.fade-out a {
    opacity: 0;
}

header.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background-color: var(--bg-color);
    /* Match theme background */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
}

.logo {
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.7;
}

/* Hero Section */
/* Hero Section */
.hero {
    height: 100vh;
    /* Reverted to 100vh to hide text initially */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 1;
    opacity: 1;
    /* Ensure visible */
}

.hero-content h1 {
    font-size: 12vw;
    line-height: 1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: -0.04em;
    margin: 0;
    color: var(--text-color);
}

.hero-background-stroke {
    position: absolute;
    /* Scrolls away with the section */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    /* Behind everything */
    pointer-events: none;
    opacity: 0.8;
}

.hero-background-stroke svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Float animation kept, draw animation handled in JS */
    animation: floatStroke 20s ease-in-out infinite alternate;
}

@keyframes floatStroke {
    0% {
        transform: scale(1.1) translate(0, 0) rotate(0deg);
    }

    33% {
        transform: scale(1.15) translate(-2%, 2%) rotate(1deg);
    }

    66% {
        transform: scale(1.12) translate(2%, -1%) rotate(-1deg);
    }

    100% {
        transform: scale(1.1) translate(0, 0) rotate(0deg);
    }
}

/* Mission Statement Section */
.mission-statement {
    position: relative;
    z-index: 10;
    /* Above hero */
    background-color: var(--bg-color);
    padding: 4rem 2rem;
    /* Reduced padding */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    border-bottom: 1px solid #eee;
    margin-top: 0;
    /* Removed 100vh margin */
}

.mission-col p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-color);
    text-align: justify;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-auto-flow: dense;
    gap: 0;
    background-color: var(--bg-color);
    position: relative;
    z-index: 10;
    scroll-margin-top: var(--header-height);
    border-bottom: 1px solid #eee;
    margin-top: 0;
    /* Continues after mission section */
}

.project-item {
    background-color: var(--bg-color);
    /* Ensure items are opaque */
    position: relative;
    z-index: 20;
    /* Ensure above pixel layer */
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.3s ease;
    border: 1px solid #f0f0f0;
    /* Add border to items instead of using gap */
    margin: -1px 0 0 -1px;
    /* Collapse borders */
}

/* Irregular Grid Sizes */
.project-item.span-2 {
    grid-column: span 2;
    aspect-ratio: 8/3;
    /* Maintain wide aspect ratio */
}

.project-item.tall {
    grid-row: span 2;
    aspect-ratio: 2/3;
    /* Taller aspect ratio */
}

/* On mobile, reset spans for single column */
@media (max-width: 768px) {

    .project-item.span-2,
    .project-item.tall {
        grid-column: auto;
        grid-row: auto;
        aspect-ratio: 4/3;
    }
}

.project-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    transition: transform 0.5s ease;
}

.project-item:hover .project-image-placeholder {
    transform: scale(1.05);
}

.project-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5), transparent);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-item:hover .project-info {
    opacity: 1;
}

.project-info h2 {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.project-info p {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Footer */
.site-footer {
    display: flex;
    justify-content: space-between;
    padding: 4rem 2rem;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

.footer-col h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: var(--text-color);
    /* Use main text color */
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-col p,
.footer-col a {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 400;
    /* Slightly bolder for readability on color */
}

.material-symbols-outlined {
    font-size: 1.1rem;
    font-weight: 300;
    vertical-align: middle;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 15vw;
        /* Even larger on mobile */
    }

    .mission-statement {
        grid-template-columns: 1fr;
        /* Stack columns */
        padding: 4rem 1.5rem;
    }

    .site-footer {
        flex-direction: column;
        gap: 2rem;
    }

    /* Add spacing for cards on mobile */
    .project-item {
        margin-bottom: 1rem;
        /* Space down */
    }

    /* Remove the negative margin hack on mobile so spacing works */
    .project-grid {
        gap: 1rem;
        /* Use gap on mobile */
        margin-top: 0;
        border-bottom: none;
    }

    .project-item {
        border: none;
        /* Clean look on mobile */
        margin: 0;
        /* Reset the collapse margin */
    }

    .project-detail {
        flex-direction: column;
    }

    .project-content {
        height: auto;
        border-left: none;
        border-top: 1px solid #eee;
    }

    .content-sticky {
        position: static;
    }
}

/* Custom Cursor */
.cursor-dot,
.cursor-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
    mix-blend-mode: difference;
    /* Invert colors */
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: white;
}

.cursor-outline {
    width: 40px;
    height: 40px;
    border: 1px solid white;
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

/* Hide default cursor */
body {
    cursor: none;
}

a:hover~.cursor-outline,
.project-item:hover~.cursor-outline,
.swatch:hover~.cursor-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Pixel Art Background Layer */
#pixel-background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Low z-index */
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    overflow: hidden;
    pointer-events: auto;
}

.project-item {
    background-color: var(--bg-color);
    position: relative;
    z-index: 20;
    /* High z-index to stay above pixels */
    aspect-ratio: 4/3;
    overflow: hidden;
    cursor: pointer;
    transition: filter 0.3s ease;
    border: 1px solid rgba(98, 121, 93, 0.2);
    /* Dark green with opacity */
    margin: -1px 0 0 -1px;
}

/* Pixel Art Canvas */
.pixel-art-canvas {
    background-color: #fff;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    cursor: crosshair;
    overflow: hidden;
    /* Ensure pixels don't overflow */
}

.pixel-cell {
    border: 1px solid rgba(0, 0, 0, 0.03);
    background-color: transparent;
    box-sizing: border-box;
    flex-shrink: 0;
    /* No hover effect on cells behind items, but items cover them anyway */
}

/* Color Palette */
.color-palette-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    /* Hidden by default */
    z-index: 1000;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.color-palette-container.active {
    transform: translateX(-50%) translateY(0);
}

.color-palette {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--color);
    cursor: pointer;
    transition: transform 0.2s;
    border: 2px solid transparent;
}

.swatch:hover {
    transform: scale(1.2);
}

.swatch.active {
    transform: scale(1.2);
    border-color: #000;
}

.swatch.eraser {
    background-color: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swatch.eraser span {
    font-size: 1.2rem;
    color: #555;
}

/* Project Detail */
.project-detail {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
}

.project-images {
    flex: 6;
    /* 60% width */
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 2rem;
}

.image-block {
    width: 100%;
    aspect-ratio: 16/9;
    background-color: #f5f5f5;
}

.project-content {
    flex: 4;
    /* 40% width */
    padding: 4rem;
    border-left: 1px solid #eee;
}

.content-sticky {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
}

.project-content h1 {
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.subtitle {
    color: #888;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.text-section {
    margin-bottom: 2rem;
}

.text-section h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.text-section p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
    text-align: justify;
}

.underline-link {
    text-decoration: underline;
    text-underline-offset: 3px;
}