/* Root variables */
:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --link-color: #6ab0f3;
    --glass-bg: rgba(32, 34, 37, 0.6);

    /* border / rim alphas */
    --border-strong: rgba(255, 255, 255, 0.14);
    --border-weak: rgba(255, 255, 255, 0.08);
}

/* Base */
body {
    background: linear-gradient(135deg, #0e2238, #0f1a34, #012424);
    min-height: 100vh;
    color: var(--text-color);
    font-family: 'Segoe UI', system-ui, -apple-system, "Helvetica Neue", Arial;
    margin: 0;
}

/* Reusable glass panel */
.glass {
    background: linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.02)), var(--glass-bg);
    backdrop-filter: blur(36px) saturate(190%) brightness(105%);
    -webkit-backdrop-filter: blur(36px) saturate(190%) brightness(105%);
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    box-shadow:
        0 6px 30px rgba(0, 0, 0, 0.20),
        0 1.5px 0 rgba(255, 255, 255, 0.06) inset;
    padding: 1.5rem;
    transition: background 0.4s ease, box-shadow 0.4s ease;
}

/* Footer */
footer {
    padding: 1rem 2rem;
    background-color: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(15px);
}

/* ========================================
   PROJECT COMPONENTS
   ======================================== */

/* Project grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(clamp(180px, 22vw, 320px), 1fr));
    gap: 1.5rem;
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    align-items: start;
}

/* Force 2 columns between ~601px and 900px for a 2x2 layout (solves 3+1 issue) */
@media (min-width: 601px) and (max-width: 900px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        max-width: 900px;
    }
}

/* Stack cards (1 column) on narrow screens <= 600px */
@media (max-width: 600px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
        max-width: 480px;
    }
}

/* Project card */
.project-card {
    background: linear-gradient(rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)), rgba(18, 20, 24, 0.75);
    backdrop-filter: blur(8px) saturate(60%);
    -webkit-backdrop-filter: blur(8px) saturate(60%);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--border-strong); /* stronger rim */
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.36),
        0 1.5px 0 rgba(255, 255, 255, 0.08) inset;
    transition: transform 200ms ease, box-shadow 220ms ease, background 180ms ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    --x: 50%;
    --y: 50%;
    will-change: transform;
}

.project-card:hover,
.project-card.is-hovered,
.project-card:focus {
    transform: translateY(-6px);
    box-shadow:
        0 14px 44px rgba(0, 0, 0, 0.44),
        0 1.5px 0 rgba(255, 255, 255, 0.08) inset;
    background: linear-gradient(rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)), rgba(18, 20, 24, 0.80);
}

.project-card:active {
    transform: translateY(-3px);
}

/* Card aura (white/gray reflect) */
.project-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at var(--x) var(--y),
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.04) 25%,
            rgba(255, 255, 255, 0.01) 50%,
            transparent 75%);
    mix-blend-mode: normal;
    filter: blur(20px);
    opacity: 0;
    transition: opacity 220ms ease, background-position 220ms ease;
}

/* Show aura */
.project-card.is-hovered::before,
.project-card:hover::before,
.project-card:focus::before {
    opacity: 1;
}

/* Ensure content sits above aura */
.project-card>* {
    position: relative;
    z-index: 1;
}

/* Project card links match nav highlight colour */
.project-card a {
    color: #aee6ff;
    text-decoration: none;
    font-weight: 600;
}

/* Link hover/active */
.project-card a:hover,
.project-card a:focus {
    color: #dff7ff;
    text-decoration: underline;
}