/* =========================================
   PORTFOLIO PAGE STYLES
========================================= */

/* --- 1. Hero Section --- */
.portfolioHero {
    width: 100%;
    height: 110vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    background: #ffffff;
    color: #010008;
    margin-top: -120px;
    padding-top: 120px;
}

#portfolioCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.6;
}

.hero-spotlight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(69, 63, 255, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.portHeroContainer {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 1000px;
    padding: 0 20px;
    margin-top: auto;
}

.hero-label {
    display: inline-block;
    font-size: 0.95rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #453fff;
    margin-bottom: 30px;
    border: 1px solid rgba(69, 63, 255, 0.2);
    padding: 10px 20px;
    border-radius: 50px;
    background: rgba(69, 63, 255, 0.05);
    backdrop-filter: blur(10px);
    font-weight: 600;
}

.portHeroContainer h1 {
    font-size: 4.5rem;
    line-height: 1.1;
    color: #010008;
    margin-bottom: 20px;
    font-weight: 800;
}

.portHeroContainer p {
    font-size: 1.25rem;
    color: #555;
    max-width: 600px;
    margin: 0 auto 50px auto;
    line-height: 1.6;
}

/* Outline Text Animation */
.outline-wrapper {
    position: relative;
    display: inline-block;
}

.outline-base {
    -webkit-text-stroke: 2px rgba(0, 0, 0, 0.15);
    color: transparent;
}

.outline-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    /* Animated via JS */
    height: 100%;
    color: #453fff;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid #453fff;
    /* Cursor effect */
    /* text-shadow: 0 0 20px rgba(69, 63, 255, 0.3); */
}

/* Hero Stats Row */
.hero-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px 40px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    width: fit-content;
    margin: 0 auto 20px auto;
    transition: transform 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.hero-stats-row:hover {
    transform: translateY(-5px);
    border-color: #453fff;
}

.h-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.h-icon {
    font-size: 1.5rem;
    color: #453fff;
    margin-bottom: 5px;
}

.h-num {
    font-size: 2rem;
    font-weight: 700;
    color: #010008;
    line-height: 1;
    margin-bottom: 5px;
}

.h-lbl {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.h-divider {
    width: 1px;
    height: 40px;
    background: rgba(0, 0, 0, 0.1);
}

.grad-text-violet {
    background: linear-gradient(135deg, #453fff 0%, #7000FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Scroll Indicator */
.scroll-indicator {
    margin-top: auto;
    margin-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    opacity: 0.7;
    z-index: 5;
    cursor: pointer;
}

.scroll-indicator span {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #010008;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, #010008, transparent);
    animation: scrollLineAnim 1.5s cubic-bezier(0.77, 0, 0.175, 1) infinite;
}

@keyframes scrollLineAnim {
    0% {
        transform: scaleY(0);
        transform-origin: top;
    }

    50% {
        transform: scaleY(1);
        transform-origin: top;
    }

    50.1% {
        transform-origin: bottom;
    }

    100% {
        transform: scaleY(0);
        transform-origin: bottom;
    }
}

/* --- Laptop & Short Screen Optimizations (1200px - 1536px) --- */
@media (max-width: 1536px) {

    .portfolioHero .scroll-indicator{
        margin-bottom: 0px;
    }

    .portHeroContainer h1 {
        font-size: 3.8rem;
    }

    .portHeroContainer{
        margin-top: 120px;
    }

    .portHeroContainer p {
        margin-bottom: 30px;
    }



    .hero-stats-row {
        gap: 30px;
        padding: 15px 30px;
    }

    .h-num {
        font-size: 1.75rem;
    }
}

/* --- 2. Featured Case Studies (Sticky Stack) --- */
.featuredCasesSection {
    width: 100%;
    padding: 120px 0;
    background: #f8f9ff;
    /* Light theme */
    color: #010008;
}

.feat-Header {
    text-align: center;
    margin-bottom: 80px;
}

.feat-Header h2 {
    font-size: 3.5rem;
    color: #010008;
    margin-bottom: 10px;
}

.feat-Header p {
    font-size: 1.2rem;
    color: #555;
}

/* Split Layout */
.cases-split-container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    display: flex;
    justify-content: space-between;
}

.cases-visuals {
    width: 50%;
    height: 600px;
    /* Fixed height for stability */
    max-height: 80vh;
    position: sticky;
    top: 120px;
    /* Center vertically in viewport approx */
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-img {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    /* Softer shadow for light theme */
    background: #fff;
    /* Frame background */
}

.case-img.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}

.case-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cases-content {
    width: 40%;
    display: flex;
    flex-direction: column;
    /* gap: 20vh; */
    /* Removed gap to use padding instead for better control */
    padding-bottom: 10vh;
    /* padding-top: 10vh; */
}

.case-block {
    min-height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    opacity: 0.3;
    transition: all 0.5s ease;
    padding: 40px 0;
    border-left: 3px solid rgba(0, 0, 0, 0.05);
    /* Inactive border */
    padding-left: 40px;
    margin-bottom: 10vh;
}

.case-block.active {
    opacity: 1;
    border-left-color: #453fff;
    /* Active accent */
    transform: translateX(10px);
}

.case-number {
    font-size: 5rem;
    font-weight: 800;
    /* color: rgba(0,0,0,0.05); */
    /* Outline text style */
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.1);
    line-height: 1;
    margin-bottom: 20px;
    display: block;
}

.case-tag {
    display: inline-block;
    font-size: 0.9rem;
    color: #453fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    font-weight: 600;
}

.case-details h3 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.1;
    color: #010008;
}

.case-diagnosis {
    font-size: 1.1rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 40px;
    /* border-left: 2px solid #453fff; */
    /* Moved border to parent block */
    padding-left: 20px;
}

.case-link {
    color: #453fff;
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: 0.3s;
}

.case-link:hover {
    color: #010008;
    gap: 15px;
}

.case-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.case-stats div {
    display: flex;
    flex-direction: column;
}

.case-stats span {
    font-size: 1.8rem;
    font-weight: 700;
    color: #453fff;
}

.case-stats small {
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

/* --- 3. Work Grid (Filterable) --- */
.workGridSection {
    width: 100%;
    padding: 100px 0;
    background: #f8f9ff;
}

.workGridContainer {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

.work-Header {
    text-align: center;
    margin-bottom: 60px;
}

.work-Header h2 {
    font-size: 3rem;
    color: #010008;
    margin-bottom: 10px;
}

.work-Header p {
    font-size: 1.1rem;
    color: #555;
}

.work-filters {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.w-filter {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 25px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
    color: #666;
}

.w-filter.active,
.w-filter:hover {
    background: #453fff;
    color: #fff;
    border-color: #453fff;
    box-shadow: 0 5px 15px rgba(69, 63, 255, 0.2);
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.work-item {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: 0.3s ease;
}

.work-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.work-thumb {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
}

.work-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: 0.5s ease;
}

/* .work-item:hover .work-thumb img {
    transform: scale(1.05);
} */

.work-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 25px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: #fff;
    transform: translateY(10px);
    opacity: 0;
    transition: 0.4s ease;
}

.work-item:hover .work-overlay {
    transform: translateY(0);
    opacity: 1;
}

.work-overlay h4 {
    font-size: 1.4rem;
    margin-bottom: 5px;
    color: #fff;
}

.work-overlay span {
    font-size: 0.9rem;
    color: #00F0FF;
    text-transform: uppercase;
}

/* --- 4. Methodology Strip --- */
.methodologySection {
    width: 100%;
    padding: 80px 0;
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.methodContainer {
    width: 90%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.method-Step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    opacity: 0;
    /* Animated in */
    transform: translateY(20px);
}

.m-Icon {
    width: 70px;
    height: 70px;
    background: #f8f9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #453fff;
    border: 1px solid rgba(69, 63, 255, 0.1);
    transition: 0.3s;
}

.method-Step:hover .m-Icon {
    background: #453fff;
    color: #fff;
    transform: scale(1.1);
}

.method-Step h4 {
    font-size: 1.1rem;
    color: #010008;
}

/* Add this to the end of your /src/css/portfolio.css file */

/* Initially hide the mobile-specific image container on desktop */
.case-mobile-img {
    display: none;
}

/* --- Responsive Design for Featured Cases --- */
@media (max-width: 992px) {
    .featuredCasesSection {
        padding: 80px 20px;
    }

    .feat-Header h2 {
        font-size: 2.5rem;
    }

    .cases-split-container {
        flex-direction: column;
        gap: 0;
    }

    /* Hide the sticky desktop visuals column */
    .cases-visuals {
        display: none;
    }

    /* Make the content column full width */
    .cases-content {
        width: 100%;
    }

    .case-block {
        min-height: auto;
        padding: 60px 0;
        border-bottom: 1px solid #eee;
        opacity: 1 !important;
        /* Ensure blocks are visible for mobile animation */
    }

    .case-block:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    /* Show and style the mobile image */
    .case-mobile-img {
        display: block;
        width: 100%;
        height: 280px;
        border-radius: 16px;
        overflow: hidden;
        margin-bottom: 30px;
        border: 1px solid #f0f0f0;
    }

    .case-mobile-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

@media (max-width: 576px) {
    .featuredCasesSection {
        padding: 60px 20px;
    }

    .feat-Header h2 {
        font-size: 2rem;
    }

    .case-block h3 {
        font-size: 1.8rem;
    }

    .case-stats {
        gap: 20px;
    }

    .case-stats span {
        font-size: 2rem;
    }
}


.m-Arrow {
    color: #ddd;
    font-size: 1.5rem;
}

/* --- 5. CTA Section --- */
.portfolioCtaSection {
    padding: 120px 0;
    background: #fff;
    /* Light Theme */
    text-align: center;
}

.portCtaContainer {
    max-width: 800px;
    margin: 0 auto;
}

.cta-Label {
    display: inline-block;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #453fff;
    margin-bottom: 20px;
    font-weight: 600;
}

.portCtaContainer h2 {
    font-size: 3.5rem;
    color: #010008;
    margin-bottom: 20px;
    line-height: 1.1;
}

.portCtaContainer p {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 40px;
}

/* Responsive */
@media (max-width: 992px) {
    .portHeroContainer h1 {
        font-size: 3.5rem;
    }

    .cases-split-container {
        flex-direction: column;
    }

    .cases-visuals {
        width: 100%;
        height: 400px;
        position: relative;
        top: 0;
        margin-bottom: 60px;
    }

    .cases-content {
        width: 100%;
        padding: 0;
        gap: 0;
    }

    .case-block {
        min-height: auto;
        opacity: 1;
        margin-bottom: 60px;
        padding-left: 20px;
        border-left-width: 2px;
    }

    .case-block.active {
        transform: none;
    }

    .case-img {
        opacity: 0;
    }

    .case-img.active {
        opacity: 1;
    }

    .work-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .work-Header h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .portfolioHero {
        min-height: 85vh;
        height: auto;
        padding: 180px 0 100px 0;
        margin-top: 0;
        /* Reset negative margin for mobile */
    }

    .portHeroContainer{
        margin-top: auto;
    }

    .scroll-indicator {
        margin-top: 60px;
        margin-bottom: 0;
    }

    .portHeroContainer h1 {
        font-size: 2.8rem;
    }

    .featuredCasesSection,
    .workGridSection,
    .portfolioCtaSection {
        padding: 60px 0;
    }

    .case-details h3 {
        font-size: 2rem;
    }

    .work-filters {
        gap: 10px;
    }

    .w-filter {
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .work-grid {
        grid-template-columns: 1fr;
    }

    .portCtaContainer h2 {
        font-size: 2.5rem;
    }

    .hero-stats-row {
        flex-direction: column;
        gap: 20px;
    }

    .h-divider {
        width: 40px;
        height: 1px;
    }

    /* Methodology Mobile */
    .methodContainer {
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
    }

    .m-Arrow {
        display: none;
    }

    .method-Step {
        width: 40%;
    }
}