/* =========================================
   WORK PAGE REDESIGN — SYSTEM-FIRST NARRATIVE
   Aligned with Index & Services • Deep Navy • Teal • Off-white
   ========================================= */

:root {
    --color-navy-deep: #1e293b;
    --color-navy-light: #334155;
    --color-teal: #14b8a6;
    --color-teal-neon: #2dd4bf;
    --color-teal-dim: #0d9488;
    --color-off-white: #f8fafc;
    --color-soft-grey: #64748b;
    --color-divider: #e2e8f0;
    --color-text-heading: #f8fafc;
    --color-text-body: #94a3b8;
    --color-text-dark: #1e293b;
    --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-elastic: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.work-page {
    overflow-x: hidden;
}

/* =========================================
   1. HERO — Work as Outcomes, not Deliverables
   ========================================= */

.work-hero {
    position: relative;
    padding: calc(var(--header-height, 80px) + 6rem) 0 6rem;
    background: var(--color-navy-deep);
    background-image: 
        linear-gradient(180deg, #1e293b 0%, #1a2332 100%),
        linear-gradient(rgba(20, 184, 166, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 60px 60px, 60px 60px;
    color: var(--color-text-heading);
    overflow: hidden;
}

.work-hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

.work-hero-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-flow-line {
    stroke: rgba(20, 184, 166, 0.15);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 20 12;
    animation: work-drift 25s linear infinite;
}

.work-flow-line-2 {
    animation-duration: 30s;
    animation-direction: reverse;
    opacity: 0.08;
}

@keyframes work-drift {
    to { stroke-dashoffset: -64; }
}

.work-hero-top-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-teal) 30%, var(--color-teal) 70%, transparent);
    opacity: 0.4;
    z-index: 1;
}

.work-hero-inner {
    position: relative;
    z-index: 2;
    text-align: center;
}

.work-hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--color-text-heading);
}

.work-hero-accent {
    color: var(--color-teal);
}

.work-hero-lead {
    font-size: clamp(1.1rem, 1.8vw, 1.35rem);
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
    color: var(--color-text-body);
}

/* Floating System Node */
.work-hero-node {
    position: absolute;
    top: 10%;
    right: 8%;
    opacity: 0.08;
    animation: float 12s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(5deg); }
}

/* =========================================
   2. SYSTEM-FIRST CASE STUDY SHOWCASE
   ========================================= */

.work-cases {
    padding: 6rem 0;
    background: var(--color-off-white);
    position: relative;
}

.work-cases-header {
    text-align: center;
    margin-bottom: 4rem;
}

.work-badge {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-teal);
    background: rgba(20, 184, 166, 0.1);
    padding: 0.5rem 1.2rem;
    border-radius: 50px;
    border: 1px solid rgba(20, 184, 166, 0.2);
    margin-bottom: 1rem;
}

.work-cases-header h2 {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 800;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.work-cases-header p {
    font-size: 1.15rem;
    color: var(--color-soft-grey);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Filter Tabs */
.work-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 4rem;
}

.work-filter-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--color-divider);
    border-radius: 50px;
    color: var(--color-soft-grey);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s var(--ease-smooth);
    position: relative;
}

.work-filter-btn:hover {
    border-color: var(--color-teal);
    color: var(--color-teal);
    background: rgba(20, 184, 166, 0.05);
}

.work-filter-btn.active {
    background: var(--color-teal);
    color: var(--color-navy-deep);
    border-color: var(--color-teal);
    font-weight: 700;
}

/* Projects Container - Staggered Layout */
.work-projects-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

.work-project-card {
    background: #fff;
    border: 1px solid var(--color-divider);
    border-radius: 20px;
    padding: 3rem;
    transition: all 0.4s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

/* Alternating Layout for Desktop */
@media (min-width: 1024px) {
    .work-project-card:nth-child(even) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: start;
    }
    
    .work-project-card:nth-child(odd) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: start;
    }
    
    .work-project-card:nth-child(even) .work-project-content {
        order: 2;
    }
    
    .work-project-card:nth-child(even) .work-project-visual {
        order: 1;
    }
}

.work-project-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: rgba(20, 184, 166, 0.3);
}

.work-project-header {
    margin-bottom: 2rem;
}

.work-project-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.work-project-badge {
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.work-project-badge.industry {
    background: rgba(100, 116, 139, 0.1);
    color: var(--color-soft-grey);
}

.work-project-badge.category {
    background: rgba(20, 184, 166, 0.1);
    color: var(--color-teal);
}

.work-project-card h3 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--color-text-dark);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.work-project-section {
    margin-bottom: 2rem;
}

.work-project-section-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-teal);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.work-project-section-label svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.work-project-section-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--color-text-dark);
}

.work-project-outcomes {
    background: rgba(20, 184, 166, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 3px solid var(--color-teal);
    margin-top: 1.5rem;
}

.work-project-outcomes ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.work-project-outcomes li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: var(--color-text-dark);
    font-size: 1rem;
}

.work-project-outcomes li:last-child {
    margin-bottom: 0;
}

/* Support both our custom ::before and formatOutcomes check-icon */
.work-project-outcomes li::before,
.work-project-outcomes .check-icon {
    color: var(--color-teal);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.work-project-outcomes li::before {
    content: '✓';
}

.work-project-tech {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-divider);
}

.work-project-tech-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-soft-grey);
    margin-bottom: 0.5rem;
}

.work-project-tech-stack {
    font-size: 0.9rem;
    color: var(--color-soft-grey);
}

.work-project-visual {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--color-off-white);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.work-project-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    width: 100%;
}

.work-project-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s var(--ease-smooth);
}

.work-project-images img:hover {
    transform: scale(1.05);
}

.work-project-cta {
    margin-top: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-teal);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s var(--ease-smooth);
}

.work-project-cta:hover {
    gap: 0.75rem;
    color: var(--color-teal-dim);
}

.work-project-cta svg {
    transition: transform 0.3s var(--ease-smooth);
}

.work-project-cta:hover svg {
    transform: translateX(4px);
}

/* Empty State */
.work-empty-state {
    text-align: center;
    padding: 6rem 2rem;
    color: var(--color-soft-grey);
}

.work-empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    opacity: 0.4;
    color: var(--color-soft-grey);
}

.work-empty-state h3 {
    font-size: 1.5rem;
    color: var(--color-text-dark);
    margin-bottom: 0.5rem;
}

/* =========================================
   3. SYSTEM IMPACT SECTION
   ========================================= */

.work-impact {
    padding: 6rem 0;
    background: var(--color-navy-deep);
    position: relative;
    overflow: hidden;
}

.work-impact-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(20, 184, 166, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, 0.04) 1px, transparent 1px);
    background-size: 80px 80px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 20%, transparent 85%);
    pointer-events: none;
    opacity: 0.3;
}

.work-impact-header {
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
    z-index: 2;
}

.work-impact-header h2 {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 800;
    color: var(--color-text-heading);
    margin-bottom: 1rem;
}

.work-impact-header p {
    font-size: 1.15rem;
    color: var(--color-text-body);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.work-impact-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.work-impact-item {
    background: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.4s var(--ease-smooth);
    flex: 1;
    min-width: 250px;
    max-width: 300px;
}

.work-impact-item:hover {
    transform: translateY(-6px);
    border-color: rgba(20, 184, 166, 0.3);
    background: rgba(30, 41, 59, 0.7);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.work-impact-number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    line-height: 1;
    color: var(--color-text-heading);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.work-impact-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-body);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.work-impact-divider {
    width: 2px;
    height: 60px;
    background: linear-gradient(to bottom, transparent, rgba(20, 184, 166, 0.35), transparent);
    margin: 0 1rem;
    flex-shrink: 0;
}

/* =========================================
   4. TRUST / TESTIMONIAL SECTION
   ========================================= */

.work-trust {
    padding: 6rem 0;
    background: var(--color-off-white);
}

.work-trust-header {
    text-align: center;
    margin-bottom: 4rem;
}

.work-trust-header h2 {
    font-size: clamp(2.25rem, 4vw, 3.25rem);
    font-weight: 800;
    color: var(--color-text-dark);
    margin-bottom: 1rem;
}

.work-trust-header p {
    font-size: 1.15rem;
    color: var(--color-soft-grey);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.work-trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.work-trust-card {
    background: #fff;
    border: 1px solid var(--color-divider);
    border-radius: 16px;
    padding: 2.5rem;
    transition: all 0.3s var(--ease-smooth);
}

.work-trust-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    border-color: rgba(20, 184, 166, 0.25);
}

.work-trust-quote {
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--color-text-dark);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.work-trust-author {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-divider);
}

.work-trust-author-name {
    font-weight: 700;
    color: var(--color-text-dark);
    font-size: 1rem;
}

.work-trust-author-role {
    font-size: 0.9rem;
    color: var(--color-soft-grey);
}

/* =========================================
   5. FINAL CTA
   ========================================= */

.work-cta {
    position: relative;
    padding: 6rem 0;
    background: linear-gradient(180deg, var(--color-navy-deep) 0%, #0f172a 100%);
    overflow: hidden;
}

.work-cta-divider {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(20, 184, 166, 0.35), transparent);
    pointer-events: none;
}

.work-cta-divider-top { top: 0; }
.work-cta-divider-bottom { bottom: 0; }

.work-cta-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-image:
        linear-gradient(rgba(20, 184, 166, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 184, 166, 0.08) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
}

.work-cta-inner {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.work-cta-headline {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 800;
    color: var(--color-text-heading);
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.work-cta-text {
    font-size: 1.25rem;
    color: var(--color-text-body);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.work-cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.work-cta-btn-primary {
    padding: 1.125rem 2.5rem;
    background: var(--color-teal);
    color: var(--color-navy-deep);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s var(--ease-smooth);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.25);
}

.work-cta-btn-primary:hover {
    background: var(--color-teal-neon);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.work-cta-btn-primary svg {
    transition: transform 0.3s var(--ease-smooth);
}

.work-cta-btn-primary:hover svg {
    transform: translateX(4px);
}

/* =========================================
   ANIMATIONS & SCROLL REVEAL
   ========================================= */

.work-hero,
.work-cases,
.work-impact,
.work-trust,
.work-cta {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-smooth), transform 0.7s var(--ease-smooth);
}

.work-hero.visible,
.work-cases.visible,
.work-impact.visible,
.work-trust.visible,
.work-cta.visible {
    opacity: 1;
    transform: translateY(0);
}

.work-project-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s var(--ease-smooth), transform 0.6s var(--ease-smooth);
}

.work-project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger animation delays */
.work-project-card:nth-child(1) { transition-delay: 0.1s; }
.work-project-card:nth-child(2) { transition-delay: 0.2s; }
.work-project-card:nth-child(3) { transition-delay: 0.3s; }
.work-project-card:nth-child(4) { transition-delay: 0.4s; }
.work-project-card:nth-child(5) { transition-delay: 0.5s; }

/* =========================================
   RESPONSIVE
   ========================================= */

@media (max-width: 1024px) {
    .work-project-card {
        grid-template-columns: 1fr !important;
    }
    
    .work-project-card .work-project-content,
    .work-project-card .work-project-visual {
        order: 0 !important;
    }
}

@media (max-width: 768px) {
    .work-hero {
        padding: calc(var(--header-height, 80px) + 4rem) 0 4rem;
    }
    
    .work-cases,
    .work-impact,
    .work-trust,
    .work-cta {
        padding: 4rem 0;
    }
    
    .work-filters {
        gap: 0.5rem;
    }
    
    .work-filter-btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .work-project-card {
        padding: 2rem;
    }
    
    .work-impact-grid {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .work-impact-item {
        width: 100%;
        max-width: 100%;
    }
    
    .work-impact-divider {
        width: 60px;
        height: 2px;
        margin: 0 auto;
        background: linear-gradient(to right, transparent, rgba(20, 184, 166, 0.35), transparent);
    }
    
    .work-trust-grid {
        grid-template-columns: 1fr;
    }
    
    .work-cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .work-cta-btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .work-flow-line,
    .work-hero-node {
        animation: none;
    }
    
    .work-hero,
    .work-cases,
    .work-impact,
    .work-trust,
    .work-cta,
    .work-project-card {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    .work-project-card:hover,
    .work-impact-item:hover,
    .work-trust-card:hover {
        transform: none;
    }
    
    .work-impact-number {
        animation: none !important;
    }
}
