html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f8f8;
    color: #333;
    display: flex;
    flex-direction: column;
}

body > .topbar,
body > header,
body > footer {
    flex-shrink: 0;
}

body > main {
    flex: 1 0 auto;
    padding: clamp(15px, 3vw, 20px) 0;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* Project page styles */
.projects {
    margin-bottom: 40px;
}

.projects h2 {
    font-size: clamp(24px, 5vw, 32px);
    margin-bottom: clamp(20px, 4vw, 30px);
    text-align: center;
    color: #0d1430;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: clamp(20px, 4vw, 25px);
    justify-content: center;
    padding: 0 clamp(10px, 2vw, 20px);
    margin: 0 auto;
    max-width: 1200px;
}

.project-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: clamp(20px, 4vw, 25px);
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    border: 2px solid #f0f0f0;
}

/* Improve touch interaction */
@media (hover: hover) {
    .project-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border-color: #0d1430;
    }
}

/* Active state for touch devices */
@media (hover: none) {
    .project-card:active {
        transform: scale(0.98);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.project-header h3 {
    margin: 0;
    color: #0d1430;
    font-size: clamp(18px, 4vw, 22px);
    line-height: 1.3;
    flex: 1;
}

.project-card p {
    flex-grow: 1;
    font-size: clamp(14px, 3vw, 16px);
    margin: 0 0 clamp(15px, 3vw, 20px) 0;
    color: #555;
    line-height: 1.6;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    background: #f8f9fa;
    color: #0d1430;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.tech-tag:hover {
    background: #0d1430;
    color: white;
    border-color: #0d1430;
}

.project-link {
    text-decoration: none;
    color: #0d1430;
    font-weight: 600;
    display: inline-block;
    border: 2px solid #0d1430;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
    text-align: center;
    background: white;
}

.project-link:hover {
    background: #0d1430;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .project-list {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }

    .project-card {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body > main {
        padding: 10px 0;
        width: 95%;
    }

    .project-list {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }

    .project-card {
        padding: clamp(12px, 4vw, 15px);
    }

    .project-card a {
        width: 100%;
        padding: 10px;
    }
}
