/* ========================
   PORTFOLIO (3D Carousel)
   ======================== */
.portfolio-section {
    position: relative;
    overflow: hidden;
    padding: 6rem 0;
}

.portfolio-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 8rem;
    /* Further increased gap to prevent overlap */
    align-items: center;
}

@media (min-width: 768px) {
    .portfolio-container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.portfolio-content {
    flex: 1;
    max-width: 100%;
}

@media (min-width: 768px) {
    .portfolio-content {
        max-width: 35%;
    }
}

.portfolio-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
}

.portfolio-content p {
    color: var(--text-light);
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Indicators */
.portfolio-indicators {
    display: flex;
    gap: 0.5rem;
}

.indicator-dot {
    width: 0.5rem;
    height: 0.5rem;
    background: #cbd5e1;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator-dot.active {
    background: var(--accent);
    width: 1.5rem;
}

/* 3D Container */
.portfolio-visual {
    flex: 1;
    /* Takes remaining space */
    width: 100%;
    height: 400px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
    /* Essential for 3D */
    margin-top: 4rem;
    /* Buffer for mobile transforms */
}

@media (min-width: 768px) {
    .portfolio-visual {
        margin-top: 0;
    }
}

.portfolio-card {
    position: absolute;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 16/9;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.7s cubic-bezier(0.25, 0.8, 0.25, 1);
    /* Smooth 3D transition */
    border: 1px solid var(--border);
    cursor: pointer;
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
}

.portfolio-overlay h4 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.portfolio-overlay span {
    color: #fdba74;
    /* Orange-300 equivalent */
    font-size: 0.875rem;
    font-weight: 500;
}

/* 3D States (Mobile Optimized - Tighter) */
/* Center (Active) */
.portfolio-card.pos-0 {
    transform: translateY(0) scale(1) rotateX(0);
    z-index: 30;
    opacity: 1;
}

/* Bottom (Next) */
.portfolio-card.pos-1 {
    transform: translateY(60px) scale(0.9) rotateX(-10deg);
    z-index: 20;
    opacity: 0.7;
}

/* Hidden Bottom */
.portfolio-card.pos-2 {
    transform: translateY(120px) scale(0.8) rotateX(-20deg);
    z-index: 10;
    opacity: 0;
}

/* Top (Prev) */
.portfolio-card.pos-prev {
    transform: translateY(-40px) scale(0.9) rotateX(10deg);
    /* Reduced from -60px */
    z-index: 20;
    opacity: 0.7;
}

/* Hidden Top */
.portfolio-card.pos-hidden-top {
    transform: translateY(-80px) scale(0.8) rotateX(20deg);
    /* Reduced from -120px */
    z-index: 10;
    opacity: 0;
}

/* Desktop Transforms (Larger) */
@media (min-width: 768px) {
    .portfolio-card.pos-1 {
        transform: translateY(100px) scale(0.9) rotateX(-10deg);
    }

    .portfolio-card.pos-2 {
        transform: translateY(200px) scale(0.8) rotateX(-20deg);
    }

    .portfolio-card.pos-prev {
        transform: translateY(-100px) scale(0.9) rotateX(10deg);
    }

    .portfolio-card.pos-hidden-top {
        transform: translateY(-200px) scale(0.8) rotateX(20deg);
    }
}