/* ==========================================================================
   EVERGAIN PORTFOLIO COMPLETE STYLESHEET
   ========================================================================== */

/* --- Portfolio Page Canvas Core --- */
body {
    background-color: #ffffff !important;
    color: #1e293b;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
}

.portfolio-hero {
    position: relative;
    padding: 8rem 2rem 5rem 2rem;
    text-align: center;
    background-color: #ffffff;
    overflow: hidden;
    width: 100%;
    border-bottom: 1px solid #f1f5f9;
}

/* Light Ambient Backdrop Orbs */
.hero-blur-overlay-1 {
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.05) 0%, transparent 70%);
    top: -10%;
    left: 15%;
    z-index: 1;
}

.hero-blur-overlay-2 {
    position: absolute;
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.05) 0%, transparent 70%);
    bottom: 0;
    right: 10%;
    z-index: 1;
}

.portfolio-hero .container {
    position: relative;
    z-index: 5;
    max-width: 850px;
    margin: 0 auto;
}

.portfolio-tag {
    color: #0066ff;
    background: #eef2ff;
    border: 1px solid rgba(0, 102, 255, 0.15);
    padding: 0.4rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.portfolio-hero h1 {
    font-size: clamp(2.5rem, 5vw, 3.8rem);
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -1.5px;
    margin: 1.5rem 0 1rem 0;
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.65;
    color: #475569;
}

/* --- Responsive Top Filter Controls Section --- */
.portfolio-controls {
    width: 100%;
    background: #f8fafc;
    padding: 1.25rem 0;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    z-index: 10;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.portfolio-controls::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.portfolio-controls .container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.filter-tab-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: max-content;
    margin: 0 auto;
}

.filter-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.65rem 1.4rem;
    border-radius: 50px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.25s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.filter-btn:hover {
    border-color: #0066ff;
    color: #0066ff;
    transform: translateY(-1px);
}

.filter-btn.active {
    background-color: #0066ff;
    color: #ffffff;
    border-color: #0066ff;
    box-shadow: 0 4px 12px rgba(0, 102, 255, 0.25);
}

/* --- Macro Display Grid Area --- */
.portfolio-display-area {
    padding: 5rem 2rem;
    width: 100%;
    background-color: #ffffff;
}

.portfolio-matrix-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2.5rem;
    max-width: 1280px;
    margin: 0 auto;
}

/* --- Card Architecture --- */
.portfolio-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card:hover {
    transform: translateY(-6px);
    border-color: #93c5fd;
    box-shadow: 0 20px 40px rgba(0, 102, 255, 0.08);
}

.portfolio-card.selected-card {
    border: 3.5px solid #0066ff !important;
    box-shadow: 0 0 25px rgba(0, 102, 255, 0.4), 0 15px 35px rgba(0, 0, 0, 0.08) !important;
    transform: translateY(-4px);
}

/* Simulated Tech Browser Frame */
.card-visual {
    position: relative;
    background: #f1f5f9;
    padding-top: 24px;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
}

.mock-browser-bar {
    position: absolute;
    top: 8px;
    left: 16px;
    display: flex;
    gap: 6px;
}

.mock-browser-bar span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
}

.card-visual img {
    width: 100%;
    height: 230px;
    object-fit: cover;
    object-position: top;
    display: block;
    transition: transform 0.5s ease;
}

.portfolio-card:hover .card-visual img {
    transform: scale(1.03);
}

/* Interaction Overlay Hover Gate */
.card-hover-action-gate {
    position: absolute;
    top: 24px;
    left: 0;
    width: 100%;
    height: calc(100% - 24px);
    background: rgba(15, 23, 42, 0.82);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.portfolio-card:hover .card-hover-action-gate {
    opacity: 1;
}

.launch-btn {
    text-decoration: none;
    background: #0066ff;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.8rem 1.6rem;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 102, 255, 0.3);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.launch-btn:hover {
    background: #0052cc;
    transform: scale(1.04);
}

/* Card Content Area */
.card-content {
    padding: 2rem;
}

.card-meta-tags {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.card-meta-tags span {
    font-size: 0.72rem;
    font-weight: 700;
    color: #0066ff;
    background: #eff6ff;
    border: 1px solid #dbeafe;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
}

.card-content h3 {
    font-size: 1.3rem;
    color: #0f172a;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.3px;
}

.card-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #64748b;
}

/* Utility Accessibility Class */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */

/* 1. Laptops & Desktop Displays (Max-Width: 1024px) */
@media screen and (max-width: 1024px) {
    .portfolio-hero {
        padding-top: 6.5rem;
    }

    .portfolio-matrix-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }
}

/* 2. Tablets & Mobile Devices (Max-Width: 768px) */
@media screen and (max-width: 768px) {
    .portfolio-hero {
        padding: 5.5rem 1.25rem 3rem 1.25rem;
    }

    .portfolio-hero h1 {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Filter Controls Full-Width Left Touch-Scroll Fix */
    .portfolio-controls {
        padding: 0.85rem 0;
    }

    .portfolio-controls .container {
        padding: 0 1rem;
    }

    .filter-tab-row {
        justify-content: flex-start;
        margin: 0;
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.55rem 1.15rem;
        font-size: 0.85rem;
    }

    .portfolio-display-area {
        padding: 3rem 1rem;
    }

    .portfolio-matrix-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .card-content {
        padding: 1.5rem;
    }
}

/* 3. Small Mobile Devices (Max-Width: 480px) */
@media screen and (max-width: 480px) {
    .portfolio-hero {
        padding: 4.5rem 1rem 2.5rem 1rem;
    }

    .portfolio-hero h1 {
        font-size: 1.85rem;
    }

    .card-visual img {
        height: 190px;
    }

    .card-content {
        padding: 1.25rem;
    }

    .launch-btn {
        padding: 0.7rem 1.2rem;
        font-size: 0.85rem;
    }
}