/* ==========================================================================
   CAIL — Compute and Artificial Intelligence Lab
   Enhanced CSS Design System with Animations
   ========================================================================== */

/* --- Custom Variables --- */
:root {
    --color-navy: #195078;
    --color-navy-rgb: 25, 80, 120;
    --color-deep-navy: #0F3854;
    --color-deep-navy-rgb: 15, 56, 84;
    --color-rust: #843B0F;
    --color-rust-rgb: 132, 59, 15;
    --color-red: #E62518;
    --color-red-rgb: 230, 37, 24;
    --color-ink: #16232E;
    --color-mist: #F3F6F8;
    --color-white: #FFFFFF;
    --color-border: #E2E8F0;
    --color-border-dark: rgba(255, 255, 255, 0.15);
    
    --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    --header-height: 72px;
}

/* --- Reset & Global Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-ink);
    background-color: var(--color-white);
    overflow-x: hidden;
}

/* --- Accessibility & Focus States --- */
a, button {
    outline: none;
}

a:focus-visible, 
button:focus-visible, 
input:focus-visible, 
textarea:focus-visible {
    outline: 2px solid var(--color-navy);
    outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *, *::before, *::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }
    .fade-in-up, .reveal-hero, .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
    .hero-shapes .shape {
        display: none;
    }
}

/* --- Utility Classes --- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

/* Color spans for CAIL Acronym & Text */
.c-rust { color: var(--color-rust); }
.a-navy { color: var(--color-navy); }
.i-navy { color: var(--color-navy); }
.l-red { color: var(--color-red); }

/* --- Signature Brand Elements --- */
.tri-stripe {
    height: 4px;
    width: 100%;
    background: linear-gradient(to right, 
        var(--color-rust) 33.33%, 
        var(--color-navy) 33.33%, 
        var(--color-navy) 66.66%, 
        var(--color-red) 66.66%
    );
    position: relative;
    overflow: hidden;
}

/* Animated shimmer on tri-stripe */
.tri-stripe::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255,255,255,0.4), 
        transparent
    );
    animation: shimmer 4s infinite;
}

@keyframes shimmer {
    0% { left: -60%; }
    100% { left: 160%; }
}

/* --- Sticky Header & Navigation --- */
.main-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition-smooth);
}

.main-header.scrolled {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.nav-logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-cail {
    font-family: var(--font-sans);
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0.5px;
    line-height: 1;
}

.logo-subline {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-ink);
    margin-top: 4px;
    opacity: 0.8;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-ink);
    text-decoration: none;
    transition: var(--transition-smooth);
    position: relative;
    padding: 6px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: var(--color-navy);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateX(-50%);
}

.nav-link:hover {
    color: var(--color-navy);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-link.active {
    color: var(--color-navy);
}

.nav-link.active::after {
    width: 100%;
}

.nav-btn {
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-white);
    background-color: var(--color-navy);
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition-smooth);
    border: 1px solid var(--color-navy);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.15);
    transform: translate(-50%,-50%);
    transition: width 0.5s ease, height 0.5s ease;
}

.nav-btn:hover::before {
    width: 300px;
    height: 300px;
}

.nav-btn:hover {
    box-shadow: 0 4px 16px rgba(var(--color-navy-rgb), 0.3);
    transform: translateY(-2px);
}

/* Mobile Toggle Hamburger */
.mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 110;
}

.mobile-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--color-ink);
    transition: var(--transition-smooth);
    transform-origin: center;
}

.mobile-toggle.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.mobile-toggle.active .bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-toggle.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-border);
}

.hero-pin-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Huge Background Typography */
.huge-bg-text-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 0;
    pointer-events: none;
    width: 100%;
}

.huge-text {
    font-family: var(--font-sans);
    font-size: 18vw;
    font-weight: 800;
    line-height: 0.85;
    text-transform: uppercase;
    white-space: nowrap;
    letter-spacing: -0.04em;
}

.stroke-text {
    color: transparent;
    -webkit-text-stroke: 2px rgba(var(--color-navy-rgb), 0.08);
}

.fill-text {
    color: rgba(var(--color-rust-rgb), 0.04);
}

/* Central Animated Logo */
.center-object-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 450px;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* initial GSAP states will be applied via JS */
}

.center-3d-object {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.hero-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(25, 80, 120, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(25, 80, 120, 0.04) 1px, transparent 1px);
    background-size: 28px 28px;
    z-index: 1;
    animation: gridFadeIn 1.5s ease-out;
}

@keyframes gridFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Floating Decorative Shapes */
.hero-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: floatShape 20s ease-in-out infinite;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    right: -80px;
    background: radial-gradient(circle, rgba(var(--color-navy-rgb), 0.06) 0%, transparent 70%);
    animation-delay: 0s;
    animation-duration: 18s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    bottom: 60px;
    left: -60px;
    background: radial-gradient(circle, rgba(var(--color-rust-rgb), 0.05) 0%, transparent 70%);
    animation-delay: 3s;
    animation-duration: 22s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    top: 40%;
    right: 10%;
    background: radial-gradient(circle, rgba(var(--color-red-rgb), 0.04) 0%, transparent 70%);
    animation-delay: 6s;
    animation-duration: 25s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 15%;
    border-radius: 4px;
    border: 1px solid rgba(var(--color-navy-rgb), 0.06);
    background: transparent;
    animation-delay: 2s;
    animation-duration: 30s;
}

.shape-5 {
    width: 60px;
    height: 60px;
    bottom: 20%;
    right: 20%;
    border-radius: 4px;
    border: 1px solid rgba(var(--color-rust-rgb), 0.06);
    background: transparent;
    animation-delay: 8s;
    animation-duration: 28s;
    transform: rotate(45deg);
}

@keyframes floatShape {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    10% {
        opacity: 1;
    }
    50% {
        transform: translateY(-30px) scale(1.05) rotate(5deg);
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateY(20px) scale(0.9) rotate(0deg);
    }
}

.hero-content {
    position: absolute;
    bottom: 8vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 820px;
    width: 90%;
    opacity: 0;
    visibility: hidden;
}

/* Hero reveal animations */
.reveal-hero {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-hero.visible {
    opacity: 1;
    transform: translateY(0);
}

.kicker-pill {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--color-navy);
    background-color: rgba(var(--color-navy-rgb), 0.06);
    padding: 8px 20px;
    border-radius: 100px;
    margin-bottom: 32px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(var(--color-navy-rgb), 0.12);
}

/* Pulsing dot in kicker */
.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-navy);
    border-radius: 50%;
    display: inline-block;
    position: relative;
}

.pulse-dot::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--color-navy);
    opacity: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
        transform: scale(0.8);
    }
    100% {
        opacity: 0;
        transform: scale(1.8);
    }
}

.hero-logo-wrapper {
    width: 100%;
    max-width: 520px;
    margin: 0 auto 36px;
    display: flex;
    justify-content: center;
}

.hero-logo-img {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 20px rgba(var(--color-navy-rgb), 0.08));
    transition: filter 0.6s ease, transform 0.6s ease;
}

.hero-logo-img:hover {
    filter: drop-shadow(0 8px 30px rgba(var(--color-navy-rgb), 0.15));
    transform: scale(1.02);
}

.hero-lead {
    font-family: var(--font-sans);
    font-size: 19px;
    line-height: 1.8;
    color: #4A5568;
    margin-bottom: 40px;
    font-weight: 400;
}

.hero-actions {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin-bottom: 64px;
    width: 100%;
}

.btn {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 8px;
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    color: var(--color-white);
    background-color: var(--color-navy);
    border: 1px solid var(--color-navy);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.12);
    transform: translate(-50%,-50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:hover::before {
    width: 400px;
    height: 400px;
}

.btn-primary:hover {
    box-shadow: 0 8px 24px rgba(var(--color-navy-rgb), 0.3);
    transform: translateY(-3px);
}

/* Glow pulse on primary button */
.btn-glow {
    animation: btnGlow 3s ease-in-out infinite;
}

@keyframes btnGlow {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(var(--color-navy-rgb), 0.15);
    }
    50% {
        box-shadow: 0 4px 24px rgba(var(--color-navy-rgb), 0.35);
    }
}

.btn-glow:hover {
    animation: none;
}

.btn-outline {
    color: var(--color-ink);
    background-color: transparent;
    border: 1px solid #CBD5E1;
}

.btn-outline:hover {
    border-color: var(--color-navy);
    color: var(--color-navy);
    background-color: rgba(var(--color-navy-rgb), 0.03);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(var(--color-navy-rgb), 0.08);
}

/* Stat strip below hero */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    background-color: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(4px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 28px 12px;
    transition: var(--transition-smooth);
}

.stat-item:hover {
    background-color: rgba(var(--color-navy-rgb), 0.02);
}

.stat-item:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

.stat-num {
    font-family: var(--font-mono);
    font-size: 28px;
    font-weight: 700;
    color: var(--color-deep-navy);
    margin-bottom: 6px;
    line-height: 1;
}

.stat-label {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #A0AEC0;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.scroll-mouse {
    width: 24px;
    height: 38px;
    border: 2px solid #CBD5E0;
    border-radius: 12px;
    position: relative;
    transition: border-color 0.3s;
}

.scroll-indicator:hover .scroll-mouse {
    border-color: var(--color-navy);
}

.scroll-wheel {
    width: 4px;
    height: 8px;
    background-color: #CBD5E0;
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s infinite;
}

@keyframes scrollWheel {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(16px);
    }
}

/* --- Section Layouts --- */
.section-container {
    padding: 100px 0;
    border-bottom: 1px solid var(--color-border);
    position: relative;
}

.bg-mist {
    background-color: var(--color-mist);
}

.section-header {
    margin-bottom: 56px;
    max-width: 700px;
}

.section-header.text-center {
    margin-left: auto;
    margin-right: auto;
}

.eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--color-navy);
    text-transform: uppercase;
    display: block;
    margin-bottom: 12px;
}

h2 {
    font-family: var(--font-sans);
    font-size: 38px;
    font-weight: 700;
    color: var(--color-deep-navy);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

/* Decorative heading accent line */
.heading-accent {
    width: 0;
    height: 3px;
    margin-top: 18px;
    background: linear-gradient(90deg, var(--color-rust), var(--color-navy), var(--color-red));
    border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.3s;
}

.heading-accent.center {
    margin-left: auto;
    margin-right: auto;
}

.heading-accent.visible {
    width: 60px;
}

.section-subtitle {
    font-size: 17px;
    color: #4A5568;
    margin-top: 14px;
}

/* --- Scroll Reveal Animations --- */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in-up.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Team Section --- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.member-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.member-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
}

.member-photo-placeholder {
    aspect-ratio: 1 / 1;
    background-color: #EDF2F7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #A0AEC0;
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.member-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.6s ease;
}

.member-card:hover .member-photo {
    transform: scale(1.05);
}

.member-card:hover .member-photo-placeholder {
    background-color: #E8EEF4;
}

.member-photo-placeholder::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(25, 80, 120, 0.02) 0%, rgba(132, 59, 15, 0.02) 100%);
}

/* Animated scan line on photo placeholder */
.member-photo-placeholder::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(var(--color-navy-rgb), 0.2), transparent);
    z-index: 3;
    transition: top 0.8s ease;
}

.member-card:hover .member-photo-placeholder::before {
    top: 100%;
}

.placeholder-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    color: #CBD5E0;
    z-index: 2;
    transition: var(--transition-smooth);
}

.member-card:hover .placeholder-icon {
    transform: scale(1.1);
    color: var(--color-navy);
}

.placeholder-text {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    z-index: 2;
}

.member-info {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    border-top: 4px solid transparent;
    transition: var(--transition-smooth);
}

.member-info.border-rust { border-top-color: var(--color-rust); }
.member-info.border-navy { border-top-color: var(--color-navy); }
.member-info.border-red { border-top-color: var(--color-red); }

.member-name {
    font-family: var(--font-sans);
    font-size: 18px;
    font-weight: 700;
    color: var(--color-ink);
    margin-bottom: 4px;
}

.member-role {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-navy);
    margin-bottom: 12px;
}

.member-bio {
    font-size: 14px;
    color: #4A5568;
    line-height: 1.5;
}

/* --- Projects Section --- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.project-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
}

.project-header {
    height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    color: var(--color-white);
    position: relative;
    overflow: hidden;
}

.project-header.has-image {
    height: 240px;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: transform 0.6s ease;
}

.project-card:hover .project-image {
    transform: scale(1.05);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
    z-index: 2;
    transition: opacity 0.4s ease;
}

.project-card:hover .project-overlay {
    opacity: 0.5;
}

.project-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.7;
}

/* Sliding light sweep on project header hover */
.project-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    z-index: 2;
    transition: left 0.6s ease;
}

.project-card:hover .project-header::before {
    left: 160%;
}

.bg-navy-project { background-color: var(--color-navy); }
.bg-rust-project { background-color: var(--color-rust); }
.bg-deepnavy-project { background-color: var(--color-deep-navy); }
.bg-darkred-project { background-color: #8c1009; }

.project-icon {
    width: 44px;
    height: 44px;
    color: var(--color-white);
    position: relative;
    z-index: 3;
    transition: var(--transition-smooth);
}

.project-card:hover .project-icon {
    transform: scale(1.12) rotate(3deg);
}

.project-code {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    position: relative;
    z-index: 3;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 3;
}

.project-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-family: var(--font-sans);
    font-size: 21px;
    font-weight: 700;
    color: var(--color-deep-navy);
    margin-bottom: 12px;
}

.project-desc {
    font-size: 15px;
    color: #4A5568;
    margin-bottom: 24px;
    line-height: 1.6;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-chip {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: var(--color-mist);
    color: var(--color-navy);
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    transition: var(--transition-smooth);
}

.tag-chip:hover {
    background-color: rgba(var(--color-navy-rgb), 0.08);
    border-color: rgba(var(--color-navy-rgb), 0.2);
    transform: translateY(-2px);
}

.projects-footer {
    margin-top: 56px;
    text-align: center;
}

.projects-footer p {
    font-size: 16px;
    color: #718096;
    margin-bottom: 8px;
}

.projects-cta-link {
    font-family: var(--font-sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-navy);
    text-decoration: none;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.projects-cta-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-navy);
    transition: width 0.3s ease;
}

.projects-cta-link:hover::after {
    width: 100%;
}

.projects-cta-link:hover {
    color: var(--color-rust);
}

/* --- Services Section --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.service-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 32px;
    display: flex;
    flex-direction: column;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.4s ease;
    position: relative;
}

/* Animated top accent border on hover */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 14px;
    right: 14px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-rust), var(--color-navy), var(--color-red));
    border-radius: 0 0 4px 4px;
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.07);
    border-color: rgba(var(--color-navy-rgb), 0.15);
}

.service-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.service-icon-box {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background-color: rgba(var(--color-navy-rgb), 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-navy);
    border: 1px solid rgba(var(--color-navy-rgb), 0.1);
    transition: var(--transition-smooth);
}

.service-card:hover .service-icon-box {
    background-color: var(--color-navy);
    color: var(--color-white);
    border-color: var(--color-navy);
    transform: rotate(-5deg) scale(1.05);
}

.service-icon {
    width: 28px;
    height: 28px;
    transition: var(--transition-smooth);
}

.service-code {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #A0AEC0;
    transition: var(--transition-smooth);
}

.service-card:hover .service-code {
    color: var(--color-navy);
}

.service-title {
    font-family: var(--font-sans);
    font-size: 19px;
    font-weight: 700;
    color: var(--color-deep-navy);
    margin-bottom: 12px;
}

.service-desc {
    font-size: 14px;
    color: #4A5568;
    line-height: 1.6;
}

/* --- Order Section --- */
.order-dark-panel {
    background-color: var(--color-deep-navy);
    color: var(--color-white);
    border-radius: 20px;
    padding: 72px 64px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(15, 56, 84, 0.2);
}

.order-grid-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    z-index: 1;
    pointer-events: none;
}

/* Animated glow orbs */
.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: 1;
    pointer-events: none;
}

.glow-orb-1 {
    width: 300px;
    height: 300px;
    background: rgba(var(--color-navy-rgb), 0.25);
    top: -80px;
    right: -60px;
    animation: orbFloat1 8s ease-in-out infinite;
}

.glow-orb-2 {
    width: 250px;
    height: 250px;
    background: rgba(var(--color-rust-rgb), 0.15);
    bottom: -80px;
    left: -40px;
    animation: orbFloat2 10s ease-in-out infinite;
}

@keyframes orbFloat1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 20px); }
}

@keyframes orbFloat2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -30px); }
}

.order-panel-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.panel-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    margin-bottom: 16px;
    display: block;
}

.panel-title {
    font-family: var(--font-sans);
    font-size: 34px;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 16px;
    max-width: 600px;
    line-height: 1.2;
}

.panel-desc {
    font-size: 17px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 48px;
    max-width: 600px;
}

.paths-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 48px;
}

/* Glassmorphism Path Cards with animated border */
.path-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 28px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Animated gradient border on hover */
.path-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-rust), var(--color-navy), var(--color-red));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.path-card:hover::before {
    opacity: 1;
}

.path-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.path-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 16px;
    display: block;
    transition: var(--transition-smooth);
}

.path-card:hover .path-label {
    color: rgba(255, 255, 255, 0.8);
}

.path-title {
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 10px;
}

.path-desc {
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

.order-actions {
    display: flex;
    gap: 16px;
}

.btn-white {
    background-color: var(--color-white);
    color: var(--color-deep-navy);
    border: 1px solid var(--color-white);
}

.btn-white::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background-color: rgba(var(--color-navy-rgb), 0.08);
    transform: translate(-50%,-50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-white:hover::before {
    width: 400px;
    height: 400px;
}

.btn-white:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.15);
}

/* White glow pulse */
.btn-glow-white {
    animation: btnGlowWhite 3s ease-in-out infinite;
}

@keyframes btnGlowWhite {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255,255,255,0.1);
    }
    50% {
        box-shadow: 0 4px 28px rgba(255,255,255,0.25);
    }
}

.btn-glow-white:hover {
    animation: none;
}

.btn-outline-white {
    color: var(--color-white);
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-outline-white:hover {
    border-color: var(--color-white);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px);
}

.btn-icon {
    margin-right: 8px;
}

/* --- Contacts Section --- */
.contacts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 820px;
    margin: 0 auto 56px;
}

.contact-card {
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 28px;
    display: flex;
    gap: 20px;
    align-items: center;
    text-decoration: none;
    color: var(--color-ink);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

/* Light sweep on contact card hover */
.contact-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--color-navy-rgb), 0.03), transparent);
    transition: left 0.5s ease;
}

.contact-card:hover::after {
    left: 160%;
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.06);
    border-color: #CBD5E1;
}

.contact-icon-box {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.contact-card:hover .contact-icon-box {
    transform: scale(1.08) rotate(-3deg);
}

.tg-bg { background-color: #2AABEE; }
.li-bg { background-color: #0A66C2; }

.contact-icon {
    width: 32px;
    height: 32px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.contact-label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #718096;
    margin-bottom: 4px;
}

.contact-handle {
    font-family: var(--font-sans);
    font-size: 19px;
    font-weight: 700;
    color: var(--color-deep-navy);
    margin-bottom: 4px;
}

.contact-desc {
    font-size: 13px;
    color: #718096;
}

.contact-arrow {
    width: 24px;
    height: 24px;
    color: #CBD5E0;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.contact-card:hover .contact-arrow {
    color: var(--color-navy);
    transform: translateX(4px);
}

.contact-location-note {
    font-family: var(--font-sans);
    font-size: 15px;
    color: #718096;
}

/* --- Footer --- */
.main-footer {
    background-color: var(--color-ink);
    color: var(--color-white);
    position: relative;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 64px;
    padding-top: 72px;
    padding-bottom: 72px;
}

.footer-brand-col {
    display: flex;
    flex-direction: column;
}

.footer-brand-col .logo-cail {
    font-size: 32px;
    margin-bottom: 20px;
}

.footer-desc {
    font-size: 14.5px;
    color: #A0AEC0;
    line-height: 1.6;
    margin-bottom: 24px;
    max-width: 440px;
}

.social-links {
    display: flex;
    gap: 14px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-links a svg {
    width: 18px;
    height: 18px;
    transition: var(--transition-smooth);
}

.social-links a:hover {
    background-color: var(--color-navy);
    color: var(--color-white);
    border-color: var(--color-navy);
    transform: translateY(-4px) rotate(-3deg);
    box-shadow: 0 8px 20px rgba(var(--color-navy-rgb), 0.3);
}

.social-links a:hover svg {
    transform: scale(1.1);
}

.footer-links-col {
    display: flex;
    flex-direction: column;
}

.footer-links-col h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    margin-bottom: 24px;
}

.footer-links-col a {
    font-size: 14px;
    color: #CBD5E0;
    text-decoration: none;
    margin-bottom: 12px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: fit-content;
    position: relative;
}

.footer-links-col a::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: var(--color-white);
    transition: width 0.3s ease;
}

.footer-links-col a:hover {
    color: var(--color-white);
    transform: translateX(6px);
}

.footer-links-col a:hover::after {
    width: 100%;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 28px 0;
    background-color: rgba(0, 0, 0, 0.15);
}

.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #718096;
}

.acronym-bar {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1px;
    color: #A0AEC0;
}

/* ================================================================
   RESPONSIVE MEDIA QUERIES
   ================================================================ */

@media (max-width: 1024px) {
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 64px;
    }
    
    .section-container {
        padding: 72px 0;
    }
    
    /* Navigation responsive menu */
    .mobile-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: rgba(255,255,255,0.98);
        backdrop-filter: blur(16px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 36px;
        padding: 48px 24px;
        border-top: 1px solid var(--color-border);
        transform: translateY(100%);
        opacity: 0;
        transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                    opacity 0.4s ease;
        z-index: 105;
        overflow-y: auto;
    }
    
    .nav-menu.active {
        transform: translateY(0);
        opacity: 1;
    }
    
    .nav-link {
        font-size: 18px;
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    
    .nav-btn {
        font-size: 16px;
        width: 100%;
        max-width: 280px;
        text-align: center;
        padding: 12px 24px;
    }
    
    /* Hero Adjustments */
    .hero-section {
        padding: 64px 0 80px;
    }
    
    .hero-logo-wrapper {
        margin-bottom: 24px;
    }
    
    .hero-lead {
        font-size: 16px;
        margin-bottom: 32px;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 48px;
    }
    
    .btn {
        width: 100%;
    }
    
    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-item {
        padding: 16px 8px;
    }
    
    .stat-item:nth-child(2) {
        border-right: none;
    }
    
    .stat-item:nth-child(1), .stat-item:nth-child(2) {
        border-bottom: 1px solid var(--color-border);
    }
    
    .scroll-indicator {
        display: none;
    }
    
    h2 {
        font-size: 30px;
    }
    
    /* Projects Grid */
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    /* Order dark panel */
    .order-dark-panel {
        padding: 48px 24px;
    }
    
    .panel-title {
        font-size: 26px;
    }
    
    .paths-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .order-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Contacts */
    .contacts-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 40px;
        padding-top: 48px;
        padding-bottom: 48px;
    }
    
    .bottom-bar {
        flex-direction: column;
        text-align: center;
        gap: 16px;
    }
    
    /* Hide some floating shapes on mobile */
    .shape-3, .shape-4, .shape-5 {
        display: none;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }
    
    .team-grid {
        grid-template-columns: 1fr;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 16px;
    }
    
    .contact-arrow {
        display: none;
    }
}
