/* ================================================================
   PROJECTS PAGE — Matching Main Site Design
   ================================================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1428;
    --bg-glass: rgba(14, 165, 233, 0.04);
    --text-primary: #e2e8f0;
    --text-secondary: rgba(226, 232, 240, 0.6);
    --text-muted: rgba(226, 232, 240, 0.35);
    --accent: #0ea5e9;
    --accent-light: #38bdf8;
    --accent-glow: rgba(14, 165, 233, 0.3);
    --glass-border: rgba(14, 165, 233, 0.1);
    --font-display: 'Exo 2', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --border-radius: 16px;
}

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-primary);
}

body {
    font-family: var(--font-body);
    color: var(--text-primary);
    background: var(--bg-primary);
    line-height: 1.6;
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(14, 165, 233, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(14, 165, 233, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul { list-style: none; }
.accent { color: var(--accent); }

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

/* Navigation */
.projects-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    padding: 0 clamp(1.5rem, 4vw, 4rem);
    z-index: 100;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.projects-nav__back {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.projects-nav__back:hover {
    color: var(--accent);
}

/* Hero */
.projects-hero {
    min-height: 60vh;
    display: flex;
    align-items: center;
    padding: 120px clamp(1.5rem, 4vw, 4rem) 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

.projects-hero__label {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent);
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 1rem;
    padding: 0.4rem 1rem;
    background: rgba(14, 165, 233, 0.08);
    border: 1px solid rgba(14, 165, 233, 0.2);
    border-radius: 4px;
}

.projects-hero__title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8vw, 7rem);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: -0.03em;
    margin-bottom: 1.5rem;
    animation: fadeUp 0.8s ease-out both;
}

.projects-hero__subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 500px;
    animation: fadeUp 0.8s ease-out 0.2s both;
}

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

/* Projects Grid */
.projects-grid-section {
    padding: 0 clamp(1.5rem, 4vw, 4rem) 8rem;
    max-width: 1400px;
    margin: 0 auto;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
    gap: 2rem;
}

/* Project Card */
.project-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--bg-glass);
    transition: all 0.5s var(--ease-out-expo);
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.6s ease-out both;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }

.project-card:hover {
    border-color: rgba(14, 165, 233, 0.3);
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4), 0 0 40px var(--accent-glow);
}

.project-card__image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.project-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.5) saturate(0.8);
    transition: all 0.8s var(--ease-out-expo);
}

.project-card:hover .project-card__image img {
    transform: scale(1.08);
    filter: brightness(0.65) saturate(1);
}

.project-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 30%, rgba(10, 14, 26, 0.8) 100%);
}

.project-card__content {
    padding: 1.5rem 2rem 2rem;
    position: relative;
}

.project-card__number {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: 0.5rem;
}

.project-card__title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.project-card__tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.project-card__tools span {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s;
}

.project-card:hover .project-card__tools span {
    border-color: rgba(14, 165, 233, 0.2);
    color: var(--text-secondary);
}

.project-card__arrow {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    transition: all 0.4s var(--ease-out-expo);
    opacity: 0;
    transform: translate(-8px, 8px);
}

.project-card:hover .project-card__arrow {
    opacity: 1;
    transform: translate(0, 0);
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* Footer */
.projects-footer {
    padding: 2rem clamp(1.5rem, 4vw, 4rem);
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Noise overlay */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.25;
}

/* DataCenter scanline effect */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(14, 165, 233, 0.008) 2px,
        rgba(14, 165, 233, 0.008) 4px
    );
    pointer-events: none;
    z-index: 9998;
}

/* Responsive */
@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .projects-hero {
        min-height: 45vh;
        padding-top: 100px;
    }

    .projects-grid-section {
        padding-bottom: 4rem;
    }

    .project-card__content {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .projects-hero__title {
        font-size: 3rem;
    }

    .projects-hero__subtitle {
        font-size: 1rem;
    }

    .project-card__title {
        font-size: 1.1rem;
    }

    .project-card__tools span {
        font-size: 0.6rem;
        padding: 0.25rem 0.5rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}