.portfolio-section {
    position: relative;
    padding: 5rem 1.5rem 6rem;
    color: var(--text-color, #f5f7fb);
    overflow: hidden;
    z-index: 1;
}

.portfolio-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 18%, rgba(0, 212, 255, 0.1), transparent 30%),
        radial-gradient(circle at 82% 12%, rgba(111, 178, 255, 0.08), transparent 26%),
        linear-gradient(180deg, rgba(9, 14, 26, 0.12), rgba(9, 14, 26, 0));
    pointer-events: none;
    z-index: 0;
}

.portfolio-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 96%);
    opacity: 0.3;
    pointer-events: none;
    z-index: 0;
}

.portfolio-container {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
}

.portfolio-intro {
    max-width: 780px;
    margin: 0 auto 2.75rem;
    text-align: center;
}

.portfolio-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.85rem;
    margin-bottom: 1.1rem;
    border: 1px solid rgba(84, 198, 255, 0.22);
    border-radius: 999px;
    background: rgba(10, 18, 32, 0.58);
    color: var(--accent, #7fe7ff);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 12px 30px rgba(4, 10, 22, 0.28);
}

.portfolio-heading {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.25rem);
    line-height: 1.08;
    color: #f8fbff;
    text-wrap: balance;
}

.portfolio-lead {
    margin: 1rem auto 0;
    max-width: 720px;
    font-size: 1.02rem;
    line-height: 1.75;
    color: rgba(226, 234, 244, 0.8);
}

.portfolio-nav {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.portfolio-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 2.9rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(13, 21, 36, 0.72);
    color: rgba(239, 245, 252, 0.82);
    cursor: pointer;
    transition:
        background-color 0.22s ease,
        border-color 0.22s ease,
        color 0.22s ease,
        transform 0.22s ease,
        box-shadow 0.22s ease;
}

.portfolio-tab:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(122, 225, 255, 0.2);
    color: #f8fbff;
}

.portfolio-tab.active {
    background: rgba(22, 34, 55, 0.92);
    border-color: rgba(122, 225, 255, 0.25);
    color: #f8fbff;
    box-shadow: 0 12px 24px rgba(4, 9, 20, 0.24);
}

.portfolio-tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.portfolio-tab-label {
    font-size: 0.92rem;
    font-weight: 700;
}

.portfolio-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    height: 1.8rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: rgba(122, 225, 255, 0.12);
    color: var(--accent, #7fe7ff);
    font-size: 0.78rem;
    font-weight: 700;
}

.portfolio-carousel {
    display: none;
}

.portfolio-carousel.active {
    display: block;
}

.portfolio-card-track {
    position: relative;
}

.portfolio-card,
.portfolio-empty {
    position: relative;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.9rem;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(17, 26, 43, 0.88), rgba(12, 19, 33, 0.76));
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 18px 42px rgba(4, 9, 20, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(16px);
}

.portfolio-card {
    display: none;
    opacity: 0;
    transform: translateY(18px);
    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        border-color 0.25s ease,
        box-shadow 0.25s ease;
}

.portfolio-card::before,
.portfolio-empty::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(180deg, rgba(122, 225, 255, 0.26), rgba(122, 225, 255, 0));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    opacity: 0.75;
}

.portfolio-card.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.portfolio-card:hover {
    border-color: rgba(123, 228, 255, 0.18);
    box-shadow:
        0 24px 58px rgba(4, 9, 20, 0.38),
        0 0 0 1px rgba(123, 228, 255, 0.06);
}

.portfolio-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.portfolio-tier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.portfolio-tier-standard {
    background: rgba(205, 127, 50, 0.14);
    border: 1px solid rgba(205, 127, 50, 0.28);
    color: #e6b17b;
}

.portfolio-tier-pro {
    background: rgba(192, 192, 192, 0.12);
    border: 1px solid rgba(192, 192, 192, 0.26);
    color: #e7edf7;
}

.portfolio-tier-elite {
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.26);
    color: #f6de74;
}

.portfolio-card-meta {
    color: rgba(212, 223, 237, 0.62);
    font-size: 0.88rem;
}

.portfolio-preview {
    overflow: hidden;
    margin-bottom: 1.3rem;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(8, 14, 25, 0.88);
    aspect-ratio: 16 / 9;
}

.portfolio-preview img {
    display: block;
    width: 100%;
    height: 100%;
}

.portfolio-title {
    margin: 0;
    color: #f8fbff;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
    line-height: 1.2;
}

.portfolio-desc {
    margin: 0.9rem 0 0;
    color: rgba(223, 232, 243, 0.78);
    font-size: 1rem;
    line-height: 1.7;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 1.2rem;
}

.portfolio-tag {
    display: inline-flex;
    align-items: center;
    min-height: 2rem;
    padding: 0.38rem 0.75rem;
    border-radius: 999px;
    background: rgba(122, 225, 255, 0.1);
    border: 1px solid rgba(122, 225, 255, 0.16);
    color: rgba(233, 241, 251, 0.9);
    font-size: 0.82rem;
}

.portfolio-empty {
    text-align: center;
}

.portfolio-empty-copy {
    margin: 1rem 0 0;
    color: rgba(223, 232, 243, 0.74);
    font-size: 0.98rem;
}

@media (max-width: 768px) {
    .portfolio-section {
        padding: 4rem 1rem 4.5rem;
    }

    .portfolio-intro {
        margin-bottom: 2rem;
    }

    .portfolio-nav {
        gap: 0.65rem;
    }

    .portfolio-tab {
        width: 100%;
        justify-content: space-between;
    }

    .portfolio-card,
    .portfolio-empty {
        padding: 1.35rem;
        border-radius: 22px;
    }

    .portfolio-card-head {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .portfolio-tab,
    .portfolio-card,
    .portfolio-card:hover {
        transition: none;
        transform: none;
    }
}
