/* Projects Section Redesign - Reduce Size & Minimalist */
#projects {
    background-color: transparent;
    position: relative;
    overflow: visible;
    color: var(--color-text);
}

/* Remove decorative background glow */
#projects::before {
    display: none;
}

#projects .section-header h2 {
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-radius: 0;
}

#projects .section-header p {
    color: var(--color-text-muted);
}

.projects-grid {
    display: grid;
    /* Increase minmax to prevent too-small columns, but control image size via .project-image */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem 2rem;
    margin-top: 3rem;
    position: relative;
    z-index: 1;
}

.project-card {
    /* Full card clickable set up requires relative positioning */
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
    transition: transform 0.3s ease;
    height: auto;
    display: flex;
    flex-direction: column;
    position: relative;
    /* Crucial for stretched link */
    cursor: pointer;
    /* Indicate clickability */
}

.project-card:hover {
    transform: translateY(-8px);
}

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

.project-image {
    /* Reduce size constraint here */
    height: 180px;
    /* Force smaller height as requested */
    width: 100%;
    /* Remove aspect ratio lock so it flows better with smaller height */
    background: transparent;
    position: relative;
    overflow: visible;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /* Remove padding to maximize image within the smaller height */
    border-radius: 20px;
    margin-bottom: 1rem;
}

.project-card .project-image {
    background: transparent;
}

.project-image img {
    /* Contain within the smaller dimensions */
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.1));
    /* Subtler shadow */
    border-radius: 12px;
}

.project-card:hover .project-image img {
    transform: scale(1.05);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.15));
}

.project-content {
    padding: 0;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    text-align: center;
    align-items: center;
}

.project-content h3 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    /* Slightly smaller title */
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    background: none;
    -webkit-text-fill-color: initial;
}

.project-content p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    /* Smaller text */
    line-height: 1.5;
    max-width: 90%;
}

.project-link {
    align-self: center;
    font-size: 0.9rem;
    color: var(--color-primary);
    position: static;
    /* Reset static so pseudo element works relative to card */
}

/* Stretched Link Technique - Make entire card clickable */
.project-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* No background, just a hit area */
}

.project-link:hover {
    color: var(--color-accent);
}

.project-link:hover::after {
    /* Override standard link hover line because we are now capturing the whole card */
    background: transparent;
    width: 100%;
}

/* Tool Cards - Keep consistent */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.tool-card {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
}

.tool-card h3 {
    color: var(--color-text);
}

.tool-card p {
    color: var(--color-text-muted);
}

.tool-icon {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-primary);
    background: rgba(37, 99, 235, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}