.portfolio-section-body {
    min-height: 100vh;
}

.portfolio-section-hero,
.portfolio-gallery-section,
.web-projects-section {
    width: min(1480px, calc(100% - 60px));
    margin: 0 auto;
}

.portfolio-section-hero {
    padding: 150px 0 40px;
}

.portfolio-section-kicker {
    display: inline-flex;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.portfolio-section-hero__copy h1 {
    max-width: 920px;
    margin: 0;
    font-size: clamp(34px, 5vw, 62px);
    line-height: 1.04;
}

.portfolio-section-hero__copy p {
    max-width: 860px;
    margin-top: 20px;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.portfolio-gallery-section,
.web-projects-section {
    padding: 16px 0 110px;
}

.portfolio-masonry {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: 10px;
    gap: 20px;
}

.portfolio-masonry-card {
    overflow: hidden;
    border: 1px solid var(--divider);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.16);
}

body.light .portfolio-masonry-card,
body.light .web-project-card,
body.light .portfolio-empty-state {
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.08);
}

.portfolio-masonry-card__media {
    width: 100%;
}

.portfolio-masonry-card__media img,
.portfolio-masonry-card__media video {
    width: 100%;
    display: block;
    height: auto;
    background: #111;
}

.portfolio-masonry-card__copy {
    padding: 18px 18px 20px;
}

.portfolio-masonry-card__copy h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.portfolio-masonry-card__copy p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
    font-size: 14px;
}

.portfolio-empty-state {
    padding: 38px;
    border-radius: 28px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.03);
}

.portfolio-empty-state h2 {
    margin: 0 0 12px;
    font-size: 28px;
}

.portfolio-empty-state p {
    max-width: 700px;
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.6;
}

.portfolio-empty-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-text);
    text-decoration: none;
    font-weight: 700;
}

.web-project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 26px;
}

.web-project-card {
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.04);
}

.web-project-card__preview {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    min-height: 280px;
}

.web-project-card__preview iframe,
.web-project-card__preview img {
    width: 100%;
    min-height: 280px;
    border: 0;
    display: block;
}

.web-project-card__preview img {
    object-fit: cover;
}

.web-project-card__preview-label {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 15, 15, 0.85);
    color: #fff;
    font-size: 12px;
    letter-spacing: 0.04em;
}

body.light .web-project-card__preview-label {
    background: rgba(255, 255, 255, 0.92);
    color: #111;
}

.web-project-card__fallback-icon {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    color: var(--muted);
    text-align: center;
    padding: 24px;
}

.web-project-card__fallback-icon img {
    width: 64px;
    height: 64px;
}

.web-project-card__body {
    padding: 24px;
}

.web-project-card__header h3 {
    margin: 0 0 10px;
    font-size: 24px;
}

.web-project-card__header p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.web-project-card__stack {
    margin-top: 20px;
}

.web-project-card__stack-label {
    display: block;
    margin-bottom: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.web-project-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.web-project-card__tags span {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--divider);
    background: rgba(255, 255, 255, 0.04);
    font-size: 13px;
}

.web-project-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.web-project-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 999px;
    border: 1px solid var(--divider);
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.web-project-btn--primary {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: transparent;
}

@media (max-width: 768px) {
    .portfolio-section-hero,
    .portfolio-gallery-section,
    .web-projects-section {
        width: calc(100% - 28px);
    }

    .portfolio-section-hero {
        padding-top: 130px;
    }

    .portfolio-section-hero__copy p {
        font-size: 16px;
    }

    .portfolio-masonry,
    .web-project-grid {
        grid-template-columns: 1fr;
    }
}
