/* ── Projects Section ────────────────────────────────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--code-bg);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 240, 255, 0.1);
}

.project-card:hover::before {
    opacity: 1;
}

/* ── Project Image Area ───────────────────────────────────────────────────────── */
.project-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--dark);
    flex-shrink: 0;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* Placeholder shown when no real image */
.project-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--dark) 0%, var(--code-bg) 100%);
    border-bottom: 1px solid rgba(0, 240, 255, 0.1);
}

.project-placeholder i {
    font-size: 3.5rem;
    color: rgba(0, 240, 255, 0.25);
    transition: color 0.3s ease, transform 0.3s ease;
}

.project-placeholder span {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: rgba(0, 240, 255, 0.2);
    letter-spacing: 0.15em;
}

.project-card:hover .project-placeholder i {
    color: rgba(0, 240, 255, 0.5);
    transform: scale(1.1);
}

/* Overlay on hover */
.project-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
        transparent 40%,
        rgba(10, 14, 39, 0.8) 100%
    );
    pointer-events: none;
}

/* ── Project Content ──────────────────────────────────────────────────────────── */
.project-content {
    padding: 1.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.project-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--light);
    line-height: 1.3;
}

.project-content p {
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.7;
    flex: 1;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.tech-tag {
    padding: 0.3rem 0.8rem;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 4px;
    color: var(--primary);
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.2s ease;
}

.tech-tag:hover {
    background: rgba(0, 240, 255, 0.15);
    border-color: var(--primary);
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 6px;
    background: rgba(0, 240, 255, 0.05);
    transition: all 0.25s ease;
    font-family: 'JetBrains Mono', monospace;
}

.project-link:hover {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--primary);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
}

.project-link i {
    font-size: 0.75rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .project-content {
        padding: 1.4rem;
    }
    .project-content h3 {
        font-size: 1.1rem;
    }
}