/* --- DYNAMIC THEME ENGINE --- */
:root {
    /* DEFAULT (DARK) VARIABLES */
    --bg-main: #000000;
    --bg-card: rgba(17, 17, 17, 0.7); /* Semi-transparent for glass effect */
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(0, 0, 0, 0.8);
    --accent-blue: #2997FF;
    --card-shadow: none;
    --hero-overlay: linear-gradient(to top, #000 0%, transparent 60%);
    --btn-text: #fff;
    --transition-speed: 0.5s;

    /* ADD THIS: Dark Mode Ambient Colors */
    --gradient-1: #000000;
    --gradient-2: #020617; /* Slate 900 */
    --gradient-3: #172554; /* Indigo 950 */

    /* ADD THIS: Light Mode Ambient Colors */
    --gradient-1: #ffffff;
    --gradient-2: #f0f9ff; /* Sky 50 */
    --gradient-3: #f8fafc; /* Slate 50 */
}

[data-theme="light"] {
    /* LIGHT MODE OVERRIDES */
    --bg-main: #F5F5F7;
    --bg-card: rgba(255, 255, 255, 0.75); /* Semi-transparent White */
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(255, 255, 255, 0.7);
    --accent-blue: #0071e3;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --hero-overlay: linear-gradient(to top, #F5F5F7 0%, transparent 60%);
    --btn-text: #fff;
    

    /* LIGHT GRADIENT PALETTE (Cloud/Sky) */
    --gradient-1: #ffffff;
    --gradient-2: #e0f2fe;    /* Sky 100 */
    --gradient-3: #f1f5f9;    /* Slate 100 */
}

/* --- BASE STYLES --- */
html {
    background-color: var(--bg-main); /* This ensures the 'Skeleton' matches the theme */
}

/* 2. DARK MODE (Explicit) */
html[data-theme="dark"] {
    --bg-main: #000000;
    --bg-card: rgba(17, 17, 17, 0.6);
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(0, 0, 0, 0.8);
    --accent-blue: #2997FF;
    --card-shadow: none;
    --hero-overlay: linear-gradient(to top, #000 0%, transparent 60%);
    --btn-text: #fff;
    
    /* DARK GRADIENT (Midnight) */
    --gradient-1: #000000;
    --gradient-2: #020617; /* Slate 950 */
    --gradient-3: #1e1b4b; /* Indigo 950 */
}

/* 3. LIGHT MODE (Explicit) */
html[data-theme="light"] {
    --bg-main: #F5F5F7;
    --bg-card: rgba(255, 255, 255, 0.6);
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(255, 255, 255, 0.7);
    --accent-blue: #0071e3;
    --card-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --hero-overlay: linear-gradient(to top, #F5F5F7 0%, transparent 60%);
    --btn-text: #fff;

    /* LIGHT GRADIENT (Sky) */
    --gradient-1: #ffffff;
    --gradient-2: #e0f2fe; /* Sky 100 */
    --gradient-3: #f1f5f9; /* Slate 100 */
}


body {
    background-color: transparent; /* Allows gradient to show */
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    transition: color var(--transition-speed) ease;
    position: relative; /* Ensures stacking context works */
}

/* NAVBAR */
.glass-nav {
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.5s ease, border-color 0.5s ease;
}

/* BENTO CARDS */
.bento-card {
    
    /* Update this line to use a semi-transparent background */
    background: rgba(17, 17, 17, 0.8); /* For Dark Mode */
    backdrop-filter: blur(20px); /* This blurs the moving background behind the card */
    
    background: var(--bg-card);
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.5s ease;
}

[data-theme="light"] .bento-card {
    background: rgba(255, 255, 255, 0.8); /* For Light Mode */
}

/* --- GLOBAL HOVER ENGINE (PREMIUM MOTION) --- */

.bento-card:hover {
    transform: scale(1.01);
    border-color: var(--accent-blue);
}


/* 1. PHOTO ZOOM (For all images inside Bento/Team cards) */
.bento-card img,
.team-card img,
.reveal-img {
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.5s ease;
    will-change: transform; /* optimizing performance */
    transform-origin: center center;
}

/* The Trigger */
.bento-card:hover img,
.team-card:hover img {
    transform: scale(1.06); /* 6% Zoom is the "Goldilocks" zone. Not too much, not too little. */
    filter: contrast(110%); /* Subtle pop in contrast on hover */
}

/* 2. WATERMARK BREATHING (For the Icon backgrounds in About page) */
.watermark-icon,
.watermark-pillar {
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.5s ease;
    will-change: transform;
}

/* Rotated Icons Zoom */
.bento-card:hover .watermark-icon {
    /* Keep the rotation (-10deg) but add scale */
    transform: rotate(-10deg) scale(1.15); 
    opacity: 0.08; /* Make it slightly more visible on hover */
}

/* Pillar Icon Zoom (Needs to stay upright) */
.bento-card:hover .watermark-pillar {
    /* Keep upright, just scale */
    transform: scale(1.1);
    opacity: 0.08;
}

/* 3. CARD LIFT (Subtle 3D feel for the container) */
.bento-card {
    /* Existing transition... */
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease, border-color 0.3s ease;
}

.bento-card:hover {
    transform: translateY(-5px); /* Lift the card up physically */
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3); /* Add depth shadow below */
}

/* Light Mode Shadow Adjustment */
[data-theme="light"] .bento-card:hover {
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
}

/* TYPOGRAPHY UTILS */
.text-gradient {
    background: linear-gradient(180deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-sub { color: var(--text-secondary); }

/* BUTTONS & TOGGLES */
.btn-apple {
    background: var(--accent-blue);
    color: var(--btn-text);
    padding: 10px 20px;
    border-radius: 980px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}
.btn-apple:hover {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.theme-toggle {
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
    color: var(--text-primary);
}
.theme-toggle:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

/* HERO GRADIENT */
.hero-gradient { background: var(--hero-overlay); }

/* ANIMATIONS */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-hero { animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; opacity: 0; }
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.3s; }
.delay-300 { animation-delay: 0.5s; }

/* --- INFINITE MARQUEE --- */
.marquee-container {
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    /* Glass effect for the track */
    background: var(--bg-card); 
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 24px 0;
}

.marquee-track {
    display: inline-block;
    animation: marquee 40s linear infinite; /* Adjust speed here (40s = slow/classic) */
    will-change: transform;
}

/* The infinite loop calculation */
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Hover Effect: Pause on hover so people can read */
.marquee-container:hover .marquee-track {
    animation-play-state: paused;
}

/* Typography for the Marquee */
.marquee-item {
    display: inline-block;
    font-size: 3rem; /* Massive Text */
    font-weight: 800; /* Extra Bold */
    text-transform: uppercase;
    color: transparent;
    -webkit-text-stroke: 1px var(--text-secondary); /* Outline Style (Classic) */
    margin: 0 40px;
    letter-spacing: -2px;
    transition: all 0.3s ease;
}

/* Fill the text on hover for a cool interaction */
.marquee-item:hover {
    color: var(--text-primary);
    -webkit-text-stroke: 0px;
}

/* --- AMBIENT MESH BACKGROUND --- */
.ambient-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Changed from -50 to -1 to ensure it stays visible */
    background: linear-gradient(
        -45deg, 
        var(--gradient-1), 
        var(--gradient-2), 
        var(--gradient-3), 
        var(--gradient-1)
    );
    background-size: 400% 400%; /* Make the gradient huge so we can scroll through it */
    animation: gradientShift 20s ease infinite; /* Slow, breathing movement */
    opacity: 1;
    transition: opacity 0.5s ease;
}

/* The Animation Logic */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* --- FORM DROPDOWN FIX --- */
select option {
    /* Force solid colors because dropdowns don't support transparency well */
    background-color: var(--bg-main); 
    color: var(--text-primary);
    padding: 12px;
}

/* Specific Override for Dark Mode to ensure high contrast */
[data-theme="dark"] select option {
    background-color: #000000;
    color: #ffffff;
}

/* Specific Override for Light Mode */
[data-theme="light"] select option {
    background-color: #ffffff;
    color: #000000;
}