:root {
    --font-main: 'Proxima Nova', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --color-bg: #ffffff;
    --color-text: #000000;
    --color-accent: rgba(45, 80, 250, 0.2);
    --spacing-unit: 20px;
}

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

/* Loading Indicator */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px;
    color: rgb(45, 80, 250);
    font-family: var(--font-main);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(45, 80, 250, 0.1);
    border-top: 4px solid rgb(45, 80, 250);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-message {
    color: #ff4444;
    text-align: center;
    padding: 20px;
    font-family: var(--font-main);
}

body {
    font-family: var(--font-main);
    background-color: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
    line-height: 1.5;
    overflow-x: hidden;
    cursor: none;
}

*,
html,
body {
    cursor: none !important;
}

.custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    background-image: url('Cursor.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    /* Or a visible fallback if needed */
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transform: translate(-50%, -50%);
    /* Center the cursor on the mouse point */
}

::selection {
    background: var(--color-accent);
    color: var(--color-text);
}

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: #ffffff;
    /* Or rgba(255,255,255,0.9) if sticky needed */
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo img {
    height: 40px;
    /* Adjust as needed based on the logo aspect ratio */
    width: auto;
}

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

nav a {
    text-decoration: none;
    color: rgb(45, 80, 250);
    font-family: 'Proxima Nova', sans-serif;
    font-weight: bold;
    font-size: 20pt;
    text-transform: lowercase;
    transition: opacity 0.2s ease;
}

nav a:hover {
    opacity: 0.6;
}

/* Layout */
main {
    padding-top: 120px;
    /* Space for header */
    padding-bottom: 100px;
    min-height: 100vh;
    padding-left: 40px;
    padding-right: 40px;
}

/* Project Grid (Collage Style) */
/* Organic Spread Grid - Max 2 per row */
.project-grid {
    position: relative;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    padding-bottom: 100px;

}

.project-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.4s ease-out;
    /* Base width - will be overridden by nth-child */
    width: 45%;

}

.project-item a {
    display: block;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

/* Remove Blue Overlay */
.project-item a::after {
    display: none;
}

.project-item:hover a::after {
    opacity: 0;
}

/* Centered Project Title */
.project-info {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    color: #ffffff;
    font-family: 'Proxima Nova', sans-serif;
    font-weight: bold;
    font-size: 35pt;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.project-item:hover .project-info {
    opacity: 1;
    color: rgb(45, 80, 250);
}

.project-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease;
}

.project-item:hover img {
    filter: grayscale(100%) brightness(1.1);
}



.project-item:hover {
    z-index: 10;
}

/* Random scatter - varied sizes allowing 1-3 items per row */
/* 15% smaller: Small items (~22-26%) = 3-4 per row, Medium (~30-38%) = 2-3 per row, Large (~43-47%) = 2 per row */

.project-item:nth-child(8n+1) {
    width: 47%;
    /* Large - was 55% */
    margin-top: 0;
    margin-left: 5%;
}

.project-item:nth-child(8n+2) {
    width: 24%;
    /* Small - was 28% */
    margin-top: 100px;
    margin-right: 3%;
}

.project-item:nth-child(8n+3) {
    width: 34%;
    /* Medium - was 40% */
    margin-top: 60px;
    margin-left: 8%;
}

.project-item:nth-child(8n+4) {
    width: 22%;
    /* Small - was 26% */
    margin-top: 140px;
    margin-right: 6%;
}

.project-item:nth-child(8n+5) {
    width: 43%;
    /* Large - was 50% */
    margin-top: 30px;
    margin-left: 10%;
}

.project-item:nth-child(8n+6) {
    width: 32%;
    /* Medium - was 38% */
    margin-top: 180px;
    margin-right: 4%;
}

.project-item:nth-child(8n+7) {
    width: 26%;
    /* Small - was 30% */
    margin-top: 80px;
    margin-left: 7%;
}

.project-item:nth-child(8n) {
    width: 38%;
    /* Medium - was 45% */
    margin-top: 200px;
    margin-right: 8%;
}

/* Ensure images maintain aspect ratio */
.project-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease;
}

/* Disable hover effects on Detail Pages */
.project-detail .project-item:hover img {
    filter: none !important;
    cursor: default;
}

.project-detail .project-item:hover .project-info {
    opacity: 0 !important;
}

.project-detail .project-item {
    cursor: default;
}

/* Project Detail Page Styles */
.project-detail {
    max-width: 1400px;
    margin: 0 auto;
    padding-top: 140px;
    padding-left: 40px;
    padding-right: 40px;
}

/* Hero Section - Image Left, Info Right */
.project-hero {
    display: flex;
    gap: 60px;
    margin-bottom: 100px;
    align-items: flex-start;
}

.project-hero-image {
    flex: 1;
    max-width: 55%;
}

.project-hero-image img {
    width: 100%;
    height: auto;
    display: block;
}

.project-hero-info {
    flex: 1;
    max-width: 45%;
}

.project-hero-info h1 {
    font-family: 'Proxima Nova', sans-serif;
    font-weight: bold;
    font-size: 42pt;
    color: rgb(45, 80, 250);
    margin-bottom: 30px;
    line-height: 1.2;
}

.project-description {
    margin-bottom: 40px;
    font-family: 'Proxima Nova', sans-serif;
    font-size: 14pt;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
    /* Preserves spaces and line breaks from .txt files */
}

.project-description *:first-child {
    margin-top: 0 !important;
}

.project-description p {
    margin-bottom: 1em;
    font-family: inherit;
    font-size: inherit;
}

.project-participants {
    margin-top: 40px;
}

.project-participants h3 {
    font-family: 'Proxima Nova', sans-serif;
    font-size: 16pt;
    color: rgb(45, 80, 250);
    margin-bottom: 15px;
}

.project-participants p {
    font-family: 'Proxima Nova', sans-serif;
    font-size: 13pt;
    line-height: 1.8;
    color: var(--color-text);
}

/* Project Gallery Grid - Below Hero */
.project-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 80px;
    justify-content: flex-start;
}

.gallery-item {
    width: calc(33.333% - 20px);
    position: relative;
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Back Link */
.back-link-container {
    margin-bottom: 60px;
}

.back-link {
    display: inline-block;
    font-family: 'Proxima Nova', sans-serif;
    font-size: 14pt;
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: rgb(45, 80, 250);
}

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

    main {
        padding: 80px 20px;
    }

    .project-item,
    .project-item:nth-child(odd),
    .project-item:nth-child(even),
    .project-item:nth-child(3n) {
        width: 100%;
        margin: 0 0 60px 0;
    }

    .project-info {
        opacity: 1;
        /* Always show titles on mobile */
        transform: none;
    }
}