/* Reset & Base */
:root {
    --bg-color: #050505;
    --text-color: #f0f0f0;
    --accent-color: #ffffff;
    --cursor-size: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    cursor: none; /* Hide default cursor */
    -webkit-font-smoothing: antialiased;
}

/* Background Canvas (lives inside .hero-section) */
#canvas-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: block;
}

/* Score Counter (anchored to bottom of hero) */
#score-counter {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.4);
    z-index: 5;
    pointer-events: auto; /* Enable clicking */
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.2s;
    cursor: pointer;
}

#score-counter:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Custom Cursor */
#cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--cursor-size);
    height: var(--cursor-size);
    border: 1px solid white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s, background-color 0.3s, mix-blend-mode 0.3s;
    mix-blend-mode: difference;
}

#cursor.hovered {
    width: 50px;
    height: 50px;
    background-color: white;
    mix-blend-mode: exclusion;
    border: none;
}

/* Layout - Default (Homepage) */
#main {
    max-width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Hero (top half) */
.hero-section {
    position: relative;
    min-height: 50vh;
    flex: 1 0 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 60px 20px;
    box-sizing: border-box;
    background-color: #050505;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
}

/* Section divider — gradient fade between halves */
.hero-section::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 80px;
    background: linear-gradient(180deg, rgba(15,18,28,0) 0%, rgba(15,18,28,1) 100%);
    pointer-events: none;
    z-index: 1;
}

/* Projects (bottom half) — visibly lighter, distinct surface */
.projects-section {
    position: relative;
    flex: 1 0 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    box-sizing: border-box;
    background-color: #0f121c;
    background-image:
        radial-gradient(circle at 20% 0%, rgba(120, 140, 220, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 100%, rgba(220, 140, 200, 0.06) 0%, transparent 50%);
    border-top: 1px solid rgba(255,255,255,0.06);
}

.projects-inner {
    width: 100%;
    max-width: 900px;
    position: relative;
    z-index: 1;
}

/* Content Page Layout Overrides */
body.content-page #main {
    display: block;
    max-width: 700px; /* Constrained for better readability */
    margin: 0 auto;
    padding: 140px 40px 100px; /* Increased side padding */
    height: auto;
}

/* Typography & Animations */
header {
    text-align: center;
    margin-bottom: 4vh;
    animation: fadeInDown 1.5s ease-out forwards;
    opacity: 0;
}

h1.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 6vw;
    font-weight: 800;
    margin: 0;
    color: var(--accent-color);
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-shadow: 0 0 20px rgba(255,255,255,0.1);
}

/* Content Page Headers */
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 1rem;
    animation: fadeInDown 1s ease-out forwards;
}

p {
    line-height: 1.8;
    color: rgba(255,255,255,0.8);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

a {
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    transition: all 0.2s ease;
}

a:hover {
    border-bottom-color: white;
    text-shadow: 0 0 8px rgba(255,255,255,0.4);
}

/* Project/Game List */
.project-list {
    list-style: none;
    padding: 0;
    margin: 40px 0;
}

.project-list li {
    margin-bottom: 3rem;
    animation: fadeInUp 1s ease-out forwards;
    opacity: 0;
}

/* Stagger list items animations */
.project-list li:nth-child(1) { animation-delay: 0.1s; }
.project-list li:nth-child(2) { animation-delay: 0.2s; }
.project-list li:nth-child(3) { animation-delay: 0.3s; }
.project-list li:nth-child(4) { animation-delay: 0.4s; }
.project-list li:nth-child(5) { animation-delay: 0.5s; }

.project-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 600;
    display: inline-block;
    margin-bottom: 0.5rem;
    border-bottom: none; /* Remove default link border for titles */
}

.project-title:hover {
    transform: translateX(10px);
    border-bottom: none;
}

.project-meta {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

/* Socials */
.prominent-socials {
    display: flex;
    justify-content: center;
    gap: 2vw;
    margin-top: 1.5rem;
}

.social-link {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    position: relative;
    padding: 10px;
    border: none; /* Reset base link style */
}

.social-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 5px;
    left: 50%;
    background-color: white;
    transition: all 0.3s ease;
}

.social-link:hover {
    color: white;
    text-shadow: none;
    border: none;
}

.social-link:hover::after {
    width: 100%;
    left: 0;
}

/* Navigation */
.text-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4vw;
    margin-top: 4vh;
    animation: fadeInUp 1.5s ease-out forwards 0.3s;
    opacity: 0;
}

.nav-item {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-style: italic;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.3s;
    position: relative;
    border: none; /* Reset base link style */
}

.nav-item:hover {
    color: #fff;
    transform: scale(1.1);
    border: none;
}

/* Recent Projects (Homepage) */
.section-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: rgba(255,255,255,0.5);
    text-align: center;
    margin: 0 0 2.5rem;
    position: relative;
}

.section-label::before,
.section-label::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: rgba(255,255,255,0.2);
    vertical-align: middle;
    margin: 0 20px;
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 1s ease-out forwards 0.4s;
    opacity: 0;
}

.project-card {
    position: relative;
    display: block;
    padding: 1.75rem 1.75rem 1.5rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    background: rgba(255,255,255,0.025);
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                border-color 0.3s ease,
                background 0.3s ease,
                box-shadow 0.4s ease;
}

/* Subtle sweep highlight on the top edge */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255,255,255,0.6) 50%,
        transparent 100%);
    transition: left 0.7s ease;
}

.project-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.05);
    box-shadow:
        0 20px 40px -20px rgba(0,0,0,0.5),
        0 0 30px -5px rgba(255,255,255,0.08);
    text-shadow: none;
}

.project-card:hover::before {
    left: 100%;
}

.project-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
    color: var(--accent-color);
    position: relative;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .project-card-title {
    transform: translateX(4px);
}

.project-card-year {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.1em;
    margin-bottom: 0.85rem;
}

.project-card-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    margin: 0;
    transition: color 0.3s ease;
}

.project-card:hover .project-card-desc {
    color: rgba(255,255,255,0.9);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    h1.hero-title {
        font-size: 15vw;
    }
    
    .text-nav {
        flex-direction: column;
        gap: 2vh;
        align-items: center;
    }

    .nav-item {
        font-size: 2rem;
    }

    .prominent-socials {
        flex-wrap: wrap;
        gap: 15px;
    }

    .hero-section {
        padding: 40px 20px;
    }

    .projects-section {
        padding: 60px 20px;
    }

    .section-label::before,
    .section-label::after {
        width: 20px;
        margin: 0 12px;
    }

    .project-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .project-card {
        padding: 1.25rem 1.25rem 1rem;
    }

    .project-card-title {
        font-size: 1.4rem;
    }
    
    body.content-page #main {
        padding: 80px 20px;
    }

    .page-title {
        font-size: 2.5rem;
    }
    
    /* Disable custom cursor on touch devices */
    #cursor {
        display: none;
    }
    body {
        cursor: auto;
    }
}

/* Keyframes */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
