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

body {
    background: #F5F0E8;
    color: #6B5E52;
    font-family: "Karla", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    position: relative;
    overflow-x: hidden;
}

/* Grain texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.04;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="256" height="256"><filter id="grain"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="4" result="noise" seed="2"/><feColorMatrix type="saturate" values="0"/></filter><rect width="256" height="256" fill="gray" filter="url(%23grain)"/></svg>');
    animation: grain-shift 10s linear infinite;
    z-index: -1;
}

@keyframes grain-shift {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(1px);
    }
}

main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

/* Hero Section */
.hero {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    text-align: center;
    background: #F5F0E8;
}

.hero h1 {
    font-family: "Libre Baskerville", serif;
    font-size: 48px;
    font-weight: 700;
    color: #3C3226;
    letter-spacing: 2px;
}

/* Portfolio Grid */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    grid-auto-flow: dense;
}

/* Portfolio Card */
.portfolio-card {
    background: #F5F0E8;
    border: 2px solid #B8A08C;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 4px 4px 12px rgba(60, 50, 38, 0.08);
    animation: card-reveal 0.6s ease-out backwards;
}

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

@keyframes card-reveal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.portfolio-card:hover {
    transform: translateY(-4px);
    box-shadow: 4px 8px 20px rgba(60, 50, 38, 0.15);
}

.portfolio-card:hover .card-image {
    filter: brightness(0.95);
}

.card-image {
    width: 100%;
    aspect-ratio: 1;
    background-size: cover;
    background-position: center;
    transition: filter 0.3s ease;
}

.card-1 .card-image { aspect-ratio: 2 / 2; }
.card-5 .card-image { aspect-ratio: 2 / 1; }

.card-content {
    padding: 24px;
    background: #F5F0E8;
}

.card-content h2 {
    font-family: "Libre Baskerville", serif;
    font-size: 24px;
    font-weight: 700;
    color: #3C3226;
    margin-bottom: 8px;
    line-height: 1.2;
}

.card-label {
    font-family: "Karla", sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #8C7B6A;
    margin-bottom: 12px;
    font-weight: 600;
}

.card-content p:last-child {
    color: #6B5E52;
    font-size: 15px;
    line-height: 1.6;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(60, 50, 38, 0.7);
    display: flex;
    align-items: flex-end;
    z-index: 1000;
    animation: modal-fade-in 0.3s ease;
}

@keyframes modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #F5F0E8;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 12px 12px 0 0;
    position: relative;
    animation: modal-slide-up 0.5s ease;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes modal-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #3C3226;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.modal-close:hover {
    color: #6B5E52;
}

#modal-body h2 {
    font-family: "Libre Baskerville", serif;
    font-size: 32px;
    font-weight: 700;
    color: #3C3226;
    margin-bottom: 16px;
}

#modal-body p {
    color: #6B5E52;
    margin-bottom: 16px;
    line-height: 1.7;
}

/* Responsive */
@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 30px;
    }

    .card-1 {
        grid-column: span 2;
        grid-row: span 1;
    }

    .card-5 {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 60px 20px;
    }

    .hero h1 {
        font-size: 36px;
    }

    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px;
    }

    .card-1,
    .card-5 {
        grid-column: span 2;
    }

    .card-content {
        padding: 16px;
    }

    .card-content h2 {
        font-size: 18px;
    }

    .modal-content {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .card-1,
    .card-5 {
        grid-column: span 1;
    }

    .hero h1 {
        font-size: 28px;
    }
}
