.portfolio-page {
    background: var(--bg);
}

.portfolio-page-main {
    min-height: 620px;
}

.portfolio-directory,
.portfolio-documentation {
    padding: 72px 0;
}

.portfolio-directory {
    padding-top: 150px;
    background: var(--bg);
}

.portfolio-page-heading {
    margin-bottom: 34px;
}

.portfolio-kicker {
    margin-bottom: 12px;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .18em;
}

.portfolio-page-heading h1,
.portfolio-page-heading h2 {
    max-width: 760px;
    margin: 0;
    color: var(--text);
    font-family: var(--font-heading);
    font-size: clamp(42px, 5vw, 66px);
    line-height: .98;
}

.portfolio-page-heading h2 {
    font-size: clamp(38px, 4.5vw, 56px);
}

.portfolio-page-heading h1 em,
.portfolio-page-heading h2 em {
    color: var(--accent-dark);
    font-style: normal;
}

#portfolio-title {
    scroll-margin-top: 120px;
}

.portfolio-table-wrap {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 2px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(22, 35, 59, .08);
}

.portfolio-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    table-layout: fixed;
}

.portfolio-table th,
.portfolio-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    line-height: 1.35;
    text-align: left;
    vertical-align: middle;
}

.portfolio-table th {
    background: var(--text);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.portfolio-table th:first-child {
    border-radius: 7px 0 0;
}

.portfolio-table th:last-child {
    border-radius: 0 7px 0 0;
}

.portfolio-table tbody tr {
    transition: background var(--motion-fast) ease;
}

.portfolio-table tbody tr:hover {
    background: #fff8f7;
}

.portfolio-table tbody tr:last-child td {
    border-bottom: 0;
}

.portfolio-table td:first-child {
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 400;
}

.portfolio-table td:nth-child(2) {
    color: var(--text);
    font-size: 12px;
}

.portfolio-table td:nth-child(3) {
    color: var(--text-muted);
    font-size: 12px;
}

.portfolio-table td:last-child span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.portfolio-table th:nth-child(1),
.portfolio-table td:nth-child(1) {
    width: 7%;
}

.portfolio-table th:nth-child(2),
.portfolio-table td:nth-child(2) {
    width: 31%;
}

.portfolio-table th:nth-child(3),
.portfolio-table td:nth-child(3) {
    width: 42%;
}

.portfolio-table th:nth-child(4),
.portfolio-table td:nth-child(4) {
    width: 20%;
}

.portfolio-documentation {
    background: var(--bg-soft);
}

.portfolio-documentation-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    max-width: 1080px;
    margin-inline: auto;
}

.portfolio-documentation .portfolio-card {
    height: 200px;
}

.portfolio-documentation .portfolio-card-content { padding: 16px; }
.portfolio-documentation .portfolio-card-content h3 { font-size: 20px; }
.portfolio-documentation .portfolio-card-content span { font-size: 10px; }

.portfolio-documentation .portfolio-card > img {
    height: 100%;
    opacity: .82;
}

.portfolio-documentation-placeholder {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
    background: linear-gradient(135deg, var(--text), #33415c);
    color: rgba(255, 255, 255, .42);
    font-size: 32px;
}

.portfolio-documentation .portfolio-card::after {
    background: linear-gradient(180deg, rgba(22, 35, 59, .02) 12%, rgba(22, 35, 59, .96) 100%);
}

.portfolio-documentation .portfolio-card-content p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, .7);
    font-size: 10px;
    line-height: 1.45;
}
.portfolio-partners { padding: 60px 0; background: var(--bg); scroll-margin-top: 100px; }

.portfolio-partners-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.portfolio-partners-grid li {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 1 calc((100% - 4 * 16px) / 5); /* 5 item per baris (desktop) */
    min-width: 0;
    height: 116px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.portfolio-partners-grid img {
    display: block;
    width: 100%;
    max-width: 180px;
    height: 76px;
    object-fit: contain;
}

/* Tablet: 4 item per baris */
@media (max-width: 900px) {
    .portfolio-documentation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .portfolio-documentation .portfolio-card { height: 170px; }
    .portfolio-documentation .portfolio-card-content { padding: 12px; }
    .portfolio-documentation .portfolio-card-content h3 { font-size: 17px; }
    .portfolio-partners-grid { gap: 12px; }
    .portfolio-partners-grid li {
        flex: 0 1 calc((100% - 3 * 12px) / 4); /* 4 item per baris, gap 12px */
        height: 106px;
    }
}

/* Mobile: 3 item per baris */
@media (max-width: 600px) {
    .portfolio-documentation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portfolio-documentation .portfolio-card { height: 150px; }
    .portfolio-documentation .portfolio-card-content h3 { font-size: 16px; }
    .portfolio-table th, .portfolio-table td { padding: 7px 9px; }
    .portfolio-partners { padding: 48px 0; }
    .portfolio-partners-grid { gap: 10px; }
    .portfolio-partners-grid li {
        flex: 0 1 calc((100% - 2 * 10px) / 3); /* 3 item per baris, gap 10px */
        height: 94px;
        padding: 8px;
    }
    .portfolio-partners-grid img { height: 60px; }
}
