/* ===========================================
   REFERENCES PAGE - ULTRA MODERN REDESIGN
   Version: 2.0
   Date: 2026-01-30
   Variables: Inherited from style.css
   =========================================== */

/* ===========================================
   I. REFERENCES PAGE SPECIFIC VARIABLES
   =========================================== */
   :root {
    /* Page-specific gradient (mesh background) */
    --gradient-mesh: radial-gradient(at 40% 20%, hsla(228,100%,74%,0.15) 0px, transparent 50%),
                     radial-gradient(at 80% 0%, hsla(189,100%,56%,0.1) 0px, transparent 50%),
                     radial-gradient(at 0% 50%, hsla(355,100%,93%,0.1) 0px, transparent 50%);
    --duration-slowest: 1200ms;
}

/* ===========================================
   II. DARK MODE OVERRIDES
   =========================================== */
[data-theme="dark"] {
    --bg-primary: #0a0a0b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --border-color: #3f3f46;
    --shadow-glow: 0 0 40px -10px rgba(99, 102, 241, 0.6);
    --gradient-hero-2: linear-gradient(180deg, rgba(99, 102, 241, 0.2) 0%, transparent 50%);
}

/* ===========================================
   III. LENIS SMOOTH SCROLL STYLES
   =========================================== */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-smooth iframe {
    pointer-events: none;
}

/* ===========================================
   IV. REFERENCES HERO SECTION - REDESIGNED
   =========================================== */
.references-hero {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 140px 24px 100px;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 50%, #e0e7ff 100%);
}

/* Hero Background Effects */
.hero-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 60%);
}

.hero-grid-pattern {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(ellipse 100% 80% at 50% 20%, black 40%, transparent 100%);
}

.hero-glow-orbs {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.6;
    animation: floatOrb 12s ease-in-out infinite;
}

.hero-orb-1 {
    width: 500px;
    height: 500px;
    background: rgba(99, 102, 241, 0.25);
    top: -150px;
    right: 5%;
    animation-delay: 0s;
}

.hero-orb-2 {
    width: 400px;
    height: 400px;
    background: rgba(139, 92, 246, 0.2);
    bottom: -100px;
    left: 10%;
    animation-delay: -4s;
}

.hero-orb-3 {
    width: 250px;
    height: 250px;
    background: rgba(168, 85, 247, 0.2);
    top: 40%;
    left: 0%;
    animation-delay: -2s;
}

@keyframes floatOrb {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-40px) scale(1.08);
    }
}

/* Hero Content - Centered Container */
.hero-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Badge */
.hero-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 100px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4f46e5;
    margin-bottom: 32px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
    /* Hide initially for GSAP animation */
    opacity: 0;
    transform: translateY(30px);
}

.hero-badge::before {
    content: '✨';
    font-size: 1rem;
}

/* Title - Two Lines */
.hero-title {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-size: clamp(3rem, 10vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    margin: 0 0 28px 0;
    letter-spacing: -0.03em;
    color: #1e293b;
}

/* Hide title lines initially for GSAP animation */
.hero-title .line {
    opacity: 0;
    transform: translateY(80px);
}

.hero-title .line {
    display: block;
}

/* First line - dark text */
.hero-title .line:first-child {
    color: #0f172a;
}

/* Second line - gradient */
.hero-title .line.gradient-text {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 40%, #a855f7 70%, #c026d3 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    padding-bottom: 8px; /* Prevent cut-off on descenders */
}

/* Description */
.hero-description {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    color: #64748b;
    max-width: 640px;
    margin: 0 auto 56px auto;
    line-height: 1.75;
    text-align: center;
    /* Hide initially for GSAP animation */
    opacity: 0;
    transform: translateY(30px);
}

/* Hero Stats - Horizontal Layout */
.hero-stats {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 56px;
    flex-wrap: wrap;
    margin-bottom: 56px;
    width: 100%;
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-width: 100px;
    /* Hide initially for GSAP animation */
    opacity: 0;
    transform: translateY(40px);
}

.hero-stat-number {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 800;
    color: #4f46e5;
    line-height: 1;
    display: inline-flex;
    align-items: baseline;
    justify-content: center;
}

.hero-stat-suffix {
    /* font-size: 0.5em; */
    font-weight: 700;
    color: #6366f1;
    margin-left: 2px;
}

.hero-stat-label {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 8px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* Scroll Indicator - Centered */
.hero-scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #94a3b8;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.3s ease;
    width: 100%;
    text-align: center;
    /* Hide initially for GSAP animation */
    opacity: 0;
    transform: translateY(20px);
}

.hero-scroll-indicator:hover {
    color: #6366f1;
}

.hero-scroll-indicator span {
    display: block;
    text-align: center;
}

.hero-scroll-indicator svg {
    width: 28px;
    height: 28px;
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(8px);
        opacity: 0.6;
    }
}

/* ===========================================
   V. FILTER BAR - MODERN
   =========================================== */
.filter-bar {
    position: relative;
    z-index: 100;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    transition: all var(--duration-normal) var(--ease-smooth);
}

[data-theme="dark"] .filter-bar {
    background: rgba(10, 10, 11, 0.8);
}

/* .filter-bar.scrolled removed - no longer sticky */

.filter-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
}

.filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 100px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
    white-space: nowrap;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: var(--gray-100);
}

[data-theme="dark"] .filter-tab:hover {
    background: var(--gray-800);
}

.filter-tab.active {
    background: var(--primary-500);
    color: white;
    border-color: var(--primary-500);
}

.filter-tab-icon {
    font-size: 1.125rem;
}

.filter-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.filter-tab.active .filter-tab-count {
    background: rgba(255, 255, 255, 0.2);
}

/* ===========================================
   V.1 MOBILE FILTER DROPDOWN
   =========================================== */

/* Hide dropdown toggle on desktop */
.filter-dropdown-toggle {
    display: none;
}

/* Mobile styles */
@media (max-width: 768px) {
    /* Show dropdown toggle on mobile */
    .filter-dropdown-toggle {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 14px 20px;
        background: var(--bg-primary);
        border: 1px solid var(--border-color);
        border-radius: 12px;
        font-size: 1rem;
        font-weight: 600;
        color: var(--text-primary);
        cursor: pointer;
        transition: all var(--duration-normal) var(--ease-smooth);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    }
    
    .filter-dropdown-toggle:hover {
        border-color: var(--primary-300);
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
    }
    
    .filter-dropdown-toggle[aria-expanded="true"] {
        border-color: var(--primary-500);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
    
    [data-theme="dark"] .filter-dropdown-toggle {
        background: var(--bg-secondary);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    
    .filter-dropdown-icon {
        font-size: 1.25rem;
    }
    
    .filter-dropdown-label {
        flex: 1;
        text-align: left;
    }
    
    .filter-dropdown-count {
        padding: 4px 10px;
        background: var(--primary-500);
        color: white;
        border-radius: 100px;
        font-size: 0.75rem;
        font-weight: 700;
    }
    
    .filter-dropdown-arrow {
        transition: transform var(--duration-normal) var(--ease-smooth);
        color: var(--text-secondary);
    }
    
    .filter-dropdown-toggle[aria-expanded="true"] .filter-dropdown-arrow {
        transform: rotate(180deg);
    }
    
    /* Filter tabs as dropdown menu on mobile */
    .filter-tabs {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 8px;
        background: var(--bg-primary);
        border: 1px solid var(--primary-500);
        border-top: none;
        border-radius: 0 0 12px 12px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        z-index: 200;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .filter-tabs.open {
        display: flex;
    }
    
    [data-theme="dark"] .filter-tabs {
        background: var(--bg-secondary);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    }
    
    .filter-tab {
        width: 100%;
        justify-content: flex-start;
        padding: 14px 16px;
        border-radius: 8px;
        border: none;
    }
    
    .filter-tab:hover {
        background: var(--gray-100);
    }
    
    [data-theme="dark"] .filter-tab:hover {
        background: var(--gray-800);
    }
    
    .filter-tab.active {
        background: var(--primary-50);
        color: var(--primary-600);
        border: none;
    }
    
    [data-theme="dark"] .filter-tab.active {
        background: rgba(99, 102, 241, 0.2);
        color: var(--primary-400);
    }
    
    .filter-tab.active .filter-tab-count {
        background: var(--primary-500);
        color: white;
    }
    
    /* Filter container relative for dropdown positioning */
    .filter-container {
        position: relative;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 0 16px;
    }
    
    /* Search below dropdown */
    .filter-search {
        width: 100%;
        order: 2;
    }
    
    .search-input-wrapper {
        width: 100%;
    }
    
    .search-input-wrapper.expanded {
        width: 100%;
    }
}

/* Tablet - horizontal scroll */
@media (min-width: 769px) and (max-width: 1024px) {
    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .filter-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .filter-tab {
        flex-shrink: 0;
    }
}

/* Search Box */
.filter-search {
    position: relative;
    display: flex;
    align-items: center;
}

.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.search-toggle:hover {
    background: var(--gray-100);
    border-color: var(--primary-300);
}

.search-toggle svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

.search-input-wrapper {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    overflow: hidden;
    transition: width var(--duration-normal) var(--ease-out-quart);
}

.search-input-wrapper.expanded {
    width: 280px;
}

.search-input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--duration-fast);
}

.search-input:focus {
    border-color: var(--primary-400);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* View Toggle */
.view-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
}

.view-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.view-toggle-btn.active {
    background: white;
    box-shadow: var(--shadow-sm);
}

.view-toggle-btn svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.view-toggle-btn.active svg {
    color: var(--primary-600);
}

/* ===========================================
   VI. REFERENCES GRID - MODERN
   =========================================== */
.references-section-modern {
    padding: 60px 0 100px;
    background: var(--bg-secondary);
    min-height: 50vh;
}

[data-theme="dark"] .references-section-modern {
    background: var(--bg-primary);
}

.references-grid-modern {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 24px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

@media (min-width: 640px) {
    .references-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .references-grid-modern {
        grid-template-columns: repeat(3, 1fr);
        gap: 28px;
    }
}

@media (min-width: 1400px) {
    .references-grid-modern {
        grid-template-columns: repeat(4, 1fr);
        gap: 32px;
    }
}

/* ===========================================
   VII. PROJECT CARD - MODERN DESIGN
   =========================================== */
.project-card-modern {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--duration-normal) var(--ease-out-quart);
    cursor: pointer;
    /* Initial state for scroll animation - prevents FOUC */
    opacity: 0;
    transform: translateY(60px) scale(0.95);
    /* Scroll anchor offset - prevents header overlap */
    scroll-margin-top: 120px;
}

/* Highlight effect when scrolled to via hash navigation */
.project-card-modern.highlight-target {
    animation: highlightPulse 2s ease-out;
}

@keyframes highlightPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    }
    30% {
        box-shadow: 0 0 0 15px rgba(99, 102, 241, 0.3);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* Show cards after animation completes */
.project-card-modern.animation-complete {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Hover state - must override animation-complete */
.project-card-modern.animation-complete:hover,
.project-card-modern:hover {
    transform: translateY(-8px) scale(1);
    box-shadow: var(--shadow-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .project-card-modern {
    background: var(--bg-secondary);
}

/* Card Media */
.card-media {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--gray-100);
}

.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-out-quart);
}

.project-card-modern:hover .card-media img {
    transform: scale(1.08);
}

/* Card Overlay */
.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.7) 0%,
        rgba(0, 0, 0, 0.3) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity var(--duration-normal) var(--ease-smooth);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
}

.project-card-modern:hover .card-overlay {
    opacity: 1;
}

.overlay-content {
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--duration-normal) var(--ease-out-quart);
    transition-delay: 0.1s;
}

.project-card-modern:hover .overlay-content {
    transform: translateY(0);
    opacity: 1;
}

.project-year {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--primary-500);
    border-radius: 100px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Glow Effect */
.card-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(99, 102, 241, 0.15) 0%,
        transparent 50%
    );
    opacity: 0;
    transition: opacity var(--duration-normal);
    pointer-events: none;
}

.project-card-modern:hover .card-glow {
    opacity: 1;
}

/* Card Content */
.card-content {
    padding: 20px;
}

.card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 700;
    color: white;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin: 0;
    flex: 1;
}

.card-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
}

.card-tag {
    display: inline-block;
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

[data-theme="dark"] .card-tag {
    background: var(--gray-800);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-600);
    background: var(--primary-50);
    border: 1px solid var(--primary-200);
    border-radius: 100px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all var(--duration-fast);
}

.card-link:hover {
    background: var(--primary-600);
    color: white;
    border-color: var(--primary-600);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.card-link svg {
    width: 16px;
    height: 16px;
    transition: transform var(--duration-fast);
}

.card-link:hover svg {
    transform: rotate(45deg);
}

[data-theme="dark"] .card-link {
    background: rgba(99, 102, 241, 0.1);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .card-link:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

/* Featured Card - Horizontal Layout */
.project-card-modern.featured {
    grid-column: span 1;
}

@media (min-width: 1024px) {
    .project-card-modern.featured {
        grid-column: span 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr;
    }
    
    .project-card-modern.featured .card-media {
        aspect-ratio: unset;
        height: 100%;
        border-radius: 16px 0 0 16px;
    }
    
    .project-card-modern.featured .card-media img {
        height: 100%;
        object-fit: cover;
    }
    
    .project-card-modern.featured .card-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 24px 28px;
    }
    
    .project-card-modern.featured .card-description {
        -webkit-line-clamp: 3;
    }
}

/* ===========================================
   VIII. STATS SECTION - MODERN
   =========================================== */
.stats-section-modern {
    padding: 80px 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.stat-card {
    text-align: center;
    padding: 32px 20px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    transition: all var(--duration-normal) var(--ease-smooth);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: rgba(99, 102, 241, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    border-radius: 12px;
    font-size: 1.5rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===========================================
   IX. NO RESULTS STATE
   =========================================== */
.no-results-modern {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
}

.no-results-icon {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.5;
}

.no-results-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.no-results-description {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* ===========================================
   X. SCROLL PROGRESS BAR
   =========================================== */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    z-index: 9999;
}

.scroll-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    width: 0%;
    transition: width 0.1s linear;
}

/* ===========================================
   XI. DARK MODE TOGGLE
   =========================================== */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all var(--duration-normal) var(--ease-smooth);
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-glow);
}

.theme-toggle svg {
    width: 22px;
    height: 22px;
    color: var(--text-primary);
}

.theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: block;
}

/* ===========================================
   XII. GSAP ANIMATION STATES
   =========================================== */
/* Initial states for GSAP animations */
.gsap-reveal {
    opacity: 0;
    transform: translateY(40px);
}

.gsap-reveal-left {
    opacity: 0;
    transform: translateX(-40px);
}

.gsap-reveal-right {
    opacity: 0;
    transform: translateX(40px);
}

.gsap-reveal-scale {
    opacity: 0;
    transform: scale(0.9);
}

/* Ensure smooth animations */
.will-animate {
    will-change: transform, opacity;
}

/* Remove will-change after animation completes */
.animation-complete {
    will-change: auto;
}

/* ===========================================
   XIII. REDUCED MOTION
   =========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .gsap-reveal,
    .gsap-reveal-left,
    .gsap-reveal-right,
    .gsap-reveal-scale {
        opacity: 1;
        transform: none;
    }
    
    /* Show cards immediately for reduced motion users */
    .project-card-modern {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .hero-orb {
        animation: none;
    }
    
    .hero-scroll-indicator {
        animation: none;
    }
}

/* No-JS fallback - show cards if JavaScript fails to load */
.no-js .project-card-modern,
html:not(.js-loaded) .project-card-modern {
    opacity: 1;
    transform: none;
}

/* ===========================================
   XIV. MODERN MODAL STYLES
   =========================================== */
.modal-backdrop-modern {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
}

.modal-backdrop-modern.active {
    display: flex;
}

.modal-container-modern {
    position: relative;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-modal);
}

[data-theme="dark"] .modal-container-modern {
    background: var(--bg-secondary);
}

.modal-close-modern {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: all var(--duration-fast);
}

.modal-close-modern:hover {
    background: var(--gray-200);
    transform: rotate(90deg);
}

[data-theme="dark"] .modal-close-modern:hover {
    background: var(--gray-700);
}

.modal-close-modern svg {
    width: 20px;
    height: 20px;
    color: var(--text-primary);
}

.modal-content-modern {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-body-modern {
    padding: 0;
}

/* Modal Header */
.modal-header-modern {
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-100);
    color: var(--primary-700);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

[data-theme="dark"] .modal-category {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-400);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

/* Modal Image */
.modal-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--gray-100);
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal Description */
.modal-description {
    padding: 24px 32px;
}

.modal-description p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin: 0;
}

/* Modal Actions */
.modal-actions {
    padding: 0 32px 32px;
    display: flex;
    gap: 12px;
}

.modal-actions .btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-smooth);
}

.modal-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.modal-actions .btn-primary svg {
    width: 16px;
    height: 16px;
}

/* ===========================================
   XV. PRINT STYLES
   =========================================== */
@media print {
    .filter-bar,
    .hero-scroll-indicator,
    .theme-toggle,
    .scroll-progress,
    .modal-backdrop-modern {
        display: none;
    }
    
    .project-card-modern {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ===========================================
   XVI. LEGACY CARD SUPPORT (Transition Period)
   =========================================== */
/* Support for old card format during migration */
.reference-card {
    position: relative;
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all var(--duration-normal) var(--ease-out-quart);
}

.reference-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card-hover);
}

.reference-card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.reference-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow);
}

.reference-card:hover .reference-card-image img {
    transform: scale(1.08);
}

.reference-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 100%);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 20px;
    transition: opacity var(--duration-normal);
}

.reference-card:hover .reference-overlay {
    opacity: 1;
}

.reference-card-content {
    padding: 20px;
}

.reference-card-content h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.reference-card-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reference-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.reference-tags .tag {
    padding: 4px 10px;
    background: var(--gray-100);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.reference-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: var(--primary-500);
    color: white;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
    z-index: 5;
}

.reference-badge.featured {
    background: linear-gradient(135deg, var(--accent-orange), var(--accent-pink));
}

.btn-visit,
.btn-view-details {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-600);
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.btn-view-details {
    padding: 10px 20px;
    background: white;
    border-radius: 100px;
    color: var(--text-primary);
}

/* ===========================================
   CASE STUDY MODAL - FULL REDESIGN
   =========================================== */
.case-study-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.case-study-modal.active {
    opacity: 1;
    visibility: visible;
}

.case-study-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.case-study-container {
    position: relative;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-primary);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.case-study-modal.active .case-study-container {
    transform: translateY(0) scale(1);
}

.case-study-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.case-study-close:hover {
    background: var(--primary-500);
    color: white;
    transform: rotate(90deg);
}

.case-study-scroll {
    max-height: 90vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Header */
.case-study-header {
    padding: 48px 48px 32px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--gray-200);
}

.case-study-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.case-study-category,
.case-study-year,
.case-study-type {
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 100px;
}

.case-study-category {
    background: var(--primary-500);
    color: white;
}

.case-study-year {
    background: var(--accent-500);
    color: white;
}

.case-study-type {
    background: var(--gray-200);
    color: var(--gray-700);
}

.case-study-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 8px;
    line-height: 1.2;
}

.case-study-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Body */
.case-study-body {
    padding: 32px 48px;
}

.case-study-section {
    margin-bottom: 40px;
}

.case-study-section:last-child {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px;
}

.section-icon {
    font-size: 1.5rem;
}

.section-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.section-text.formatted {
    white-space: pre-line;
}

/* Project Info Grid */
.project-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.info-item {
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
    text-align: center;
}

.info-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.info-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary-50) 0%, var(--bg-secondary) 100%);
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--primary-100);
}

.result-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-600);
    margin-bottom: 4px;
}

.result-metric {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.result-description {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tech-item {
    padding: 10px 18px;
    background: var(--gray-100);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.tech-item:hover {
    background: var(--primary-500);
    color: white;
    transform: translateY(-2px);
}

/* Features List */
.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-50);
    border: 1px solid var(--accent-200);
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--accent-700);
}

.feature-item::before {
    content: '✓';
    font-weight: 700;
    color: var(--accent-500);
}

/* Testimonial - Elegant Quote Style */
.testimonial-section {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
}

.testimonial-card {
    position: relative;
    padding: 24px 0 24px 32px;
    border-left: 3px solid var(--primary-500);
}

.testimonial-quote {
    position: absolute;
    top: -8px;
    left: -8px;
    font-size: 5rem;
    font-family: Georgia, serif;
    color: var(--primary-500);
    opacity: 0.15;
    line-height: 1;
    pointer-events: none;
}

.testimonial-text {
    font-size: 1.125rem;
    font-style: italic;
    line-height: 1.8;
    margin: 0 0 24px;
    color: var(--text-secondary);
    position: relative;
}

.testimonial-text::before {
    content: '"';
    color: var(--primary-500);
    font-weight: 700;
}

.testimonial-text::after {
    content: '"';
    color: var(--primary-500);
    font-weight: 700;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 12px;
}

.testimonial-author::before {
    content: '';
    width: 32px;
    height: 2px;
    background: var(--primary-500);
    flex-shrink: 0;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.author-role {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Footer */
.case-study-footer {
    display: flex;
    gap: 16px;
    padding: 24px 48px 32px;
    border-top: 1px solid var(--gray-200);
}

.case-study-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 100px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.case-study-btn.primary {
    background: var(--primary-600);
    color: white;
}

.case-study-btn.primary:hover {
    background: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.case-study-btn.secondary {
    background: var(--gray-100);
    color: var(--text-primary);
}

.case-study-btn.secondary:hover {
    background: var(--gray-200);
}

/* Dark Mode */
[data-theme="dark"] .case-study-container {
    background: var(--gray-900);
    border: 1px solid var(--gray-700);
}

[data-theme="dark"] .case-study-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--gray-900) 100%);
    border-color: var(--gray-700);
}

[data-theme="dark"] .case-study-close {
    background: var(--gray-800);
    color: var(--gray-300);
}

[data-theme="dark"] .case-study-type {
    background: var(--gray-700);
    color: var(--gray-300);
}

[data-theme="dark"] .info-item {
    background: var(--gray-800);
}

[data-theme="dark"] .result-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, var(--gray-800) 100%);
    border-color: var(--gray-700);
}

[data-theme="dark"] .tech-item {
    background: var(--gray-800);
}

[data-theme="dark"] .feature-item {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--gray-700);
    color: var(--accent-400);
}

[data-theme="dark"] .case-study-footer {
    border-color: var(--gray-700);
}

[data-theme="dark"] .case-study-btn.secondary {
    background: var(--gray-800);
    color: var(--gray-300);
}

[data-theme="dark"] .testimonial-section {
    border-color: var(--gray-700);
}

[data-theme="dark"] .testimonial-card {
    border-left-color: var(--primary-400);
}

[data-theme="dark"] .testimonial-text {
    color: var(--gray-300);
}

[data-theme="dark"] .author-name {
    color: var(--gray-100);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .case-study-container {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }
    
    .case-study-header {
        padding: 60px 24px 24px;
    }
    
    .case-study-body {
        padding: 24px;
    }
    
    .case-study-footer {
        flex-direction: column;
        padding: 24px;
    }
    
    .case-study-btn {
        width: 100%;
        justify-content: center;
    }
    
    .project-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonial-card {
        padding: 20px 0 20px 20px;
    }
    
    .testimonial-text {
        font-size: 1rem;
    }
    
    .testimonial-quote {
        font-size: 3rem;
        top: -4px;
        left: -4px;
    }
    
    .testimonial-author::before {
        width: 20px;
    }
}

/* ===========================================
   XVII. CUSTOM CURSOR
   =========================================== */
.custom-cursor {
    pointer-events: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
    mix-blend-mode: difference;
}

.cursor-dot {
    position: absolute;
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.cursor-ring {
    position: absolute;
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s, border-color 0.2s;
}

.custom-cursor.cursor-hover .cursor-ring {
    width: 60px;
    height: 60px;
    border-color: rgba(99, 102, 241, 0.8);
}

.custom-cursor.cursor-hidden {
    opacity: 0;
}

/* Custom cursor disabled - using normal cursor */

/* ===========================================
   XVIII. SKELETON LOADING
   =========================================== */
.skeleton-loading {
    position: relative;
    overflow: hidden;
    background: var(--gray-200);
}

.skeleton-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.skeleton-loading img {
    opacity: 0;
}

.card-media img.loaded {
    opacity: 1;
    transition: opacity 0.3s ease-out;
}

.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
}

.image-error::before {
    content: '🖼️';
    font-size: 2rem;
    opacity: 0.5;
}

[data-theme="dark"] .skeleton-loading {
    background: var(--gray-800);
}

[data-theme="dark"] .skeleton-loading::after {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
}

/* ===========================================
   XIX. FOCUS STYLES (Accessibility)
   =========================================== */
.project-card-modern:focus {
    outline: none;
}

.project-card-modern:focus-visible {
    outline: 3px solid var(--primary-500);
    outline-offset: 4px;
    border-radius: 20px;
}

.filter-tab:focus-visible,
.card-link:focus-visible,
.theme-toggle:focus-visible {
    outline: 3px solid var(--primary-500);
    outline-offset: 2px;
}

/* Skip link */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--primary-600);
    color: white;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* ===========================================
   XX. MAGNETIC BUTTON STYLE ENHANCEMENT
   =========================================== */
.card-link,
.filter-tab,
.theme-toggle {
    position: relative;
    will-change: transform;
}

/* ===========================================
   XXI. ENHANCED MOBILE STYLES
   =========================================== */
@media (max-width: 768px) {
    .references-hero {
        min-height: auto;
        padding: 120px 20px 80px;
    }
    
    .hero-content {
        padding: 0;
    }
    
    .hero-badge {
        padding: 8px 16px;
        font-size: 0.8rem;
        margin-bottom: 24px;
    }
    
    .hero-title {
        font-size: clamp(2.2rem, 12vw, 3.5rem);
        margin-bottom: 20px;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 40px;
        padding: 0 10px;
    }
    
    .hero-stats {
        gap: 32px;
        margin-bottom: 40px;
    }
    
    .hero-stat-number {
        font-size: 2.2rem;
    }
    
    .hero-stat-label {
        font-size: 0.8rem;
    }
    
    .hero-scroll-indicator {
        font-size: 0.8rem;
    }
    
    .hero-scroll-indicator svg {
        width: 24px;
        height: 24px;
    }
    
    /* Note: Filter bar mobile styles are now in V.1 MOBILE FILTER DROPDOWN section */
    
    .references-grid-modern {
        gap: 16px;
        padding: 0 16px;
    }
    
    .project-card-modern {
        border-radius: 12px;
    }
    
    .card-content {
        padding: 16px;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .stats-section-modern {
        padding: 60px 0;
    }
    
    .stats-grid {
        gap: 16px;
    }
    
    .stat-card {
        padding: 24px 16px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Hide custom cursor on mobile */
    .custom-cursor {
        display: none;
    }
    
    /* Touch-friendly card actions */
    .card-overlay {
        opacity: 1;
        background: linear-gradient(
            to top,
            rgba(0, 0, 0, 0.5) 0%,
            transparent 50%
        );
    }
    
    .overlay-content {
        transform: none;
        opacity: 1;
    }
}

@media (max-width: 480px) {
    .references-hero {
        padding: 100px 16px 60px;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 14vw, 2.8rem);
    }
    
    .hero-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px 40px;
        justify-content: center;
    }
    
    .hero-stat {
        min-width: 80px;
    }
    
    .hero-stat-number {
        font-size: 1.8rem;
    }
    
    .filter-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .filter-search {
        width: 100%;
    }
    
    .search-input-wrapper.expanded {
        width: 100%;
    }
}

/* Note: XXII. SWIPE INDICATOR removed - now using dropdown on mobile */

/* ===========================================
   XXIII. PRINT OPTIMIZATIONS
   =========================================== */
@media print {
    .references-hero {
        min-height: auto;
        padding: 20px;
    }
    
    .hero-orb,
    .hero-grid-pattern,
    .card-glow,
    .card-overlay {
        display: none;
    }
    
    .project-card-modern {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
