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

body {
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background: #0b1120;
    color: #fff;
}

/* ==========================================
   Portfolio Hero Section — compact
========================================== */

.portfolio-hero {
    position: relative;
    padding: 80px 16px 60px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.portfolio-hero-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
}

.portfolio-hero-header {
    max-width: 700px;
    margin: auto;
    text-align: center;
}

/* ===== Badge ===== */

.portfolio-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    margin-bottom: 14px;
    background: rgba(77, 143, 255, .15);
    border: 1px solid rgba(77, 143, 255, .35);
    border-radius: 50px;
    color: #4D8FFF;
    font-size: .75rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* ===== Title ===== */

.portfolio-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
    font-weight: 700;
    color: #fff;
    margin-bottom: 14px;
}

.portfolio-hero-title span {
    background: linear-gradient(90deg, #4D8FFF, #7C4DFF);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
}

/* ===== Subtitle ===== */

.portfolio-hero-subtitle {
    max-width: 580px;
    margin: 0 auto 24px;
    color: rgba(255, 255, 255, .85);
    font-size: .9rem;
    line-height: 1.7;
}

/* ===== Buttons ===== */

.portfolio-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    text-decoration: none;
    font-weight: 600;
    font-size: .82rem;
    border-radius: 6px;
    transition: .35s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #4D8FFF, #7C4DFF);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(77, 143, 255, .35);
}

.btn-secondary {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .25);
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(12px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, .15);
    border-color: #4D8FFF;
}

/* ==========================================
   Portfolio Section — compact
========================================== */

.portfolio-section {
    padding: 50px 16px 60px;
    background: #0f172a;
    position: relative;
    overflow: hidden;
}

.portfolio-container {
    max-width: 1100px;
    margin: auto;
}

/* ===== Header ===== */

.portfolio-header {
    text-align: center;
    margin-bottom: 40px;
}

.portfolio-badge {
    display: inline-block;
    padding: 5px 14px;
    margin-bottom: 12px;
    background: rgba(77, 143, 255, .12);
    border: 1px solid rgba(77, 143, 255, .35);
    border-radius: 50px;
    color: #4D8FFF;
    font-size: .7rem;
    font-weight: 600;
}

.portfolio-title {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 10px;
}

.portfolio-title span {
    background: linear-gradient(90deg, #4D8FFF, #7C4DFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.portfolio-subtitle {
    max-width: 540px;
    margin: auto;
    color: #cbd5e1;
    font-size: .88rem;
    line-height: 1.7;
}

/* ===== Grid ===== */

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

/* ===== Card ===== */

.portfolio-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, .08);
    transition: .4s ease;
}

.portfolio-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(77, 143, 255, .25);
    border-color: #4D8FFF;
}

.portfolio-image {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .6s ease;
}

.portfolio-card:hover img {
    transform: scale(1.06);
}

/* ===== Overlay ===== */

.portfolio-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px 18px;
    background: linear-gradient(to top,
            rgba(0, 0, 0, .95),
            rgba(0, 0, 0, .15));
}

.portfolio-overlay span {
    display: inline-block;
    width: fit-content;
    padding: 4px 12px;
    margin-bottom: 8px;
    border-radius: 50px;
    background: linear-gradient(135deg, #4D8FFF, #7C4DFF);
    color: #fff;
    font-size: .62rem;
    font-weight: 600;
    text-transform: uppercase;
}

.portfolio-overlay h3 {
    margin: 0;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
}

/* ===== badge colour variants ===== */

.portfolio-card:nth-child(1) .portfolio-overlay span {
    background: linear-gradient(135deg, #00C6FF, #0072FF);
}
.portfolio-card:nth-child(2) .portfolio-overlay span {
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
}
.portfolio-card:nth-child(3) .portfolio-overlay span {
    background: linear-gradient(135deg, #8B5CF6, #4D8FFF);
}
.portfolio-card:nth-child(4) .portfolio-overlay span {
    background: linear-gradient(135deg, #22C55E, #06B6D4);
}

/* ===== reveal animation ===== */

.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all .7s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   Responsive — compact adjustments
========================================== */

@media(max-width:992px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .portfolio-hero-title {
        font-size: 1.9rem;
    }

    .portfolio-hero-subtitle {
        font-size: .82rem;
        line-height: 1.6;
    }

    .portfolio-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }

    .portfolio-header {
        margin-bottom: 30px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .portfolio-image {
        height: 180px;
    }

    .portfolio-overlay {
        padding: 14px 16px;
    }

    .portfolio-overlay h3 {
        font-size: .92rem;
    }
}

@media(max-width:480px) {
    .portfolio-hero {
        padding: 48px 12px 40px;
    }

    .portfolio-hero-title {
        font-size: 1.6rem;
    }

    .portfolio-hero-subtitle {
        font-size: .78rem;
    }

    .portfolio-title {
        font-size: 1.7rem;
    }

    .portfolio-subtitle {
        font-size: .78rem;
    }

    .portfolio-image {
        height: 150px;
    }

    .portfolio-overlay span {
        font-size: .55rem;
        padding: 3px 10px;
    }

    .portfolio-overlay h3 {
        font-size: .8rem;
    }

    .btn-primary,
    .btn-secondary {
        font-size: .75rem;
        padding: 8px 18px;
    }

    .portfolio-hero-badge {
        font-size: .68rem;
        padding: 4px 12px;
    }
}