:root {
    /* Monochromatic Color System */
    --pure-black: #000000;
    --rich-black: #050505;
    --dark-gray: #0a0a0a;
    --medium-gray: #111111;
    --light-gray: #1a1a1a;
    --border-gray: rgba(255, 255, 255, 0.08);
    --border-bright: rgba(255, 255, 255, 0.15);
    --silver: #888888;
    --light-silver: #b4b4b4;
    --off-white: #e0e0e0;
    --pure-white: #ffffff;

    /* Accent Colors */
    --accent-primary: #4A9EFF;
    --accent-glow: rgba(74, 158, 255, 0.3);

    /* Typography */
    --font-heading: 'Syne', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Transitions */
    --ease-premium: cubic-bezier(0.16, 1, 0.3, 1);
    --duration-fast: 300ms;
    --duration-base: 500ms;
    --duration-slow: 1000ms;
}

/* ===============================================
   GLOBAL STYLES & RESET
   =============================================== */

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

body {
    font-family: var(--font-body);
    color: var(--off-white);
    background: var(--pure-black);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.grain-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("https://grainy-gradients.vercel.app/noise.svg");
    opacity: 0.03;
    pointer-events: none;
    z-index: 9999;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ===============================================
   NAVIGATION
   =============================================== */

.nav-projects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all 0.4s var(--ease-premium);
}

.nav-projects.scrolled {
    padding: 16px 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-gray);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 24px;
    display: flex;
    align-items: center;
}

.logo-text {
    color: var(--pure-white);
    letter-spacing: -0.5px;
}

.logo-dot {
    color: var(--accent-primary);
}

.nav-menu {
    display: flex;
    gap: 40px;
}

.nav-link {
    color: var(--silver);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--pure-white);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--silver);
    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--pure-white);
}

/* ===============================================
   HERO SECTION
   =============================================== */

.projects-hero {
    position: relative;
    padding: 160px 0 100px;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 0%, #111 0%, #000 70%);
    overflow: hidden;
}

.hero-atmospheric-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gray);
    border-radius: 100px;
    margin: 0 auto 32px;
}

.badge-icon {
    color: var(--accent-primary);
    display: flex;
}

.badge-text {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25em;
    color: var(--light-silver);
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    margin-bottom: 32px;
    letter-spacing: -0.04em;
    background: linear-gradient(180deg, var(--pure-white) 0%, var(--silver) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-description {
    font-size: 1.15rem;
    color: var(--silver);
    max-width: 580px;
    margin: 0 auto 56px;
    line-height: 1.6;
}

.project-stats {
    display: flex;
    justify-content: center;
    gap: 64px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.stat-number {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: var(--pure-white);
    line-height: 1;
}

.stat-suffix {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--pure-white);
    line-height: 1;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--silver);
    margin-top: 10px;
}

/* ===============================================
   FILTERS
   =============================================== */

.projects-filters {
    padding: 24px 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-gray);
    position: sticky;
    top: 0;
    z-index: 100;
}

.filters-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 320px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--silver);
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 48px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gray);
    border-radius: 14px;
    color: var(--pure-white);
    font-size: 14px;
    transition: all 0.3s var(--ease-premium);
}

.search-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.filter-categories::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gray);
    border-radius: 100px;
    color: var(--light-silver);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--border-bright);
    color: var(--pure-white);
}

.filter-btn.active {
    background: var(--pure-white);
    color: var(--pure-black);
    border-color: var(--pure-white);
}

.view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    padding: 4px;
    border-radius: 12px;
    border: 1px solid var(--border-gray);
}

.view-btn {
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--silver);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
}

.view-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--pure-white);
}

/* ===============================================
   GRID & CARDS
   =============================================== */

.projects-showcase {
    padding: 80px 0;
}

#projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    align-items: stretch;
}

.project-card {
    background: var(--medium-gray);
    border: 1px solid var(--border-gray);
    border-radius: 24px;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 1 !important;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-bright);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.project-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.project-image {
    width: 100%;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.project-image img,
.project-image video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1.2s var(--ease-premium);
}

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

.project-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.project-info {
    flex: 1;
}

.project-category {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.project-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.project-year {
    font-size: 11px;
    font-weight: 600;
    color: var(--silver);
}

.project-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--pure-white);
    margin-bottom: 16px;
}

.project-description {
    font-size: 0.95rem;
    color: var(--light-silver);
    margin-bottom: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.tech-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--silver);
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-gray);
    border-radius: 6px;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-gray);
}

.project-metrics {
    display: flex;
    align-items: center;
    gap: 8px;
}

.project-metrics .metric {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--light-silver);
}

.project-arrow {
    color: var(--pure-white);
    opacity: 0.4;
    transition: all 0.3s ease;
}

.project-card:hover .project-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ===============================================
   LIST VIEW
   =============================================== */

#projects-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1000px;
    margin: 0 auto;
}

#projects-grid.list-view .project-card {
    flex-direction: row;
    align-items: stretch;
}

#projects-grid.list-view .project-link {
    flex-direction: row;
    width: 100%;
}

#projects-grid.list-view .project-image {
    width: 350px;
    min-width: 350px;
    aspect-ratio: auto;
    min-height: 100%;
}

#projects-grid.list-view .project-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#projects-grid.list-view .project-title {
    font-size: 1.5rem;
}

/* ===============================================
   CTA SECTION
   =============================================== */

.projects-cta {
    padding: 120px 0;
    background: radial-gradient(circle at 100% 100%, #111 0%, #000 70%);
}

.cta-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 5;
}

.cta-title {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: var(--pure-white);
    margin-bottom: 24px;
}

.cta-description {
    font-size: 1.1rem;
    color: var(--silver);
    margin-bottom: 48px;
    max-width: 500px;
    margin: 0 auto 48px;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 36px;
    border-radius: 100px;
    font-weight: 700;
    transition: all 0.4s var(--ease-premium);
}

.cta-btn.primary {
    background: var(--pure-white);
    color: var(--pure-black);
}

.cta-btn.primary:hover {
    background: transparent;
    color: var(--pure-white);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.cta-btn.secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--pure-white);
    border: 1px solid var(--border-gray);
    backdrop-filter: blur(10px);
}

/* ===============================================
   FOOTER
   =============================================== */

.footer-projects {
    padding: 60px 0;
    border-top: 1px solid var(--border-gray);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-credits {
    color: var(--silver);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.footer-links {
    display: flex;
    gap: 40px;
}

.footer-links a {
    color: var(--silver);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.footer-links a:hover {
    color: var(--pure-white);
}

/* ===============================================
   UTILITIES
   =============================================== */

.load-more-container {
    padding: 60px 0 100px;
    text-align: center;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 48px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-gray);
    color: var(--pure-white);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.5s var(--ease-premium);
    position: relative;
    overflow: hidden;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.load-more-btn:hover {
    background: var(--pure-white);
    color: var(--pure-black);
    border-color: var(--pure-white);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

.load-more-btn:hover::before {
    opacity: 1;
}

.load-more-btn svg {
    transition: transform 0.4s var(--ease-premium);
}

.load-more-btn:hover svg {
    transform: rotate(180deg);
}

/* ===============================================
   RESPONSIVE DESIGN (PREMIUM MOBILE)
   =============================================== */

@media (max-width: 1200px) {
    #projects-grid:not(.list-view) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 24px;
    }

    .nav-projects {
        padding: 16px 0;
    }

    .nav-menu {
        display: none;
    }

    .projects-hero {
        padding: 120px 0 80px;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .hero-content {
        text-align: center !important;
        width: 100% !important;
    }

    .hero-badge {
        margin: 0 auto 24px !important;
    }

    .hero-title {
        font-size: clamp(2rem, 10vw, 3rem) !important;
        text-align: center !important;
    }

    .hero-description {
        font-size: 1rem !important;
        margin: 0 auto 40px !important;
        text-align: center !important;
    }

    .project-stats {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 32px !important;
        width: 100% !important;
        max-width: 400px;
        margin: 0 auto !important;
    }

    .stat-number {
        font-size: 2.25rem !important;
    }

    .stat-label {
        font-size: 9px !important;
    }

    #projects-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 24px;
    }

    /* Hide view toggle on mobile - only list view */
    .view-toggle {
        display: none !important;
    }

    #projects-grid .project-card {
        flex-direction: column;
    }

    #projects-grid .project-link {
        flex-direction: column;
    }

    #projects-grid .project-image {
        width: 100%;
        aspect-ratio: 16/9;
    }

    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }

    .cta-btn {
        width: 100%;
        justify-content: center;
    }

    .footer-content {
        flex-direction: column;
        gap: 32px;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 24px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.25rem !important;
    }

    .project-stats {
        gap: 20px !important;
    }

    /* Hide non-essential card details on mobile for a cleaner look */
    .project-tech,
    .project-footer,
    .project-description,
    .project-year {
        display: none !important;
    }

    .project-content {
        padding: 20px;
    }

    .project-title {
        font-size: 1.25rem !important;
        margin-bottom: 8px;
    }

    .stat-number {
        font-size: 1.75rem !important;
    }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
    .project-card:hover {
        transform: none !important;
    }

    .project-card::before {
        display: none;
    }
}