/* --- Apple-Grade Overrides --- */

/* Hero Section Updates */
.hero {
    position: relative;
    padding-top: 15vh;
}

.hero-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.hero::before {
    background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.02) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 6.5rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(135deg, #ffffff 0%, #8a8a8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    padding-bottom: 0.1em;
    margin-bottom: -0.1em;
}

.hero-chips {
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.chip {
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.chip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.chip-ads .chip-dot { background: var(--color-05); box-shadow: 0 0 10px var(--color-05); }
.chip-tech .chip-dot { background: var(--color-08); box-shadow: 0 0 10px var(--color-08); }


/* Bento Card Premium Glassmorphism */
.bento-item {
    background: rgba(20, 20, 22, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: 24px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.glass-reflection {
    position: absolute;
    top: 0; left: 0; right: 0; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.05) 0%, transparent 40%);
    pointer-events: none;
    z-index: 2;
}

.bento-item:hover {
    transform: translateY(-8px) scale(1.02) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    background: rgba(30, 30, 32, 0.7) !important;
}

.card-bg-icon {
    position: absolute;
    right: -10%;
    bottom: -10%;
    width: 60%;
    height: auto;
    opacity: 0.03;
    color: #ffffff;
    z-index: 0;
    transform: rotate(-15deg);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.7s;
    pointer-events: none;
}

.bento-item:hover .card-bg-icon {
    transform: rotate(0deg) scale(1.1) translate(-5%, -5%);
    opacity: 0.08;
}

.card-visual, .card-content {
    z-index: 3 !important;
}

.icon-group {
    display: flex;
    gap: 12px;
}

.service-icon {
    width: 56px !important;
    height: 56px !important;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.brand-icon {
    width: 48px !important;
    height: 48px !important;
}

.bento-item:hover .service-icon {
    transform: scale(1.15) translateY(-4px) !important;
}

.card-meta {
    font-weight: 600;
    letter-spacing: 2px !important;
}

.giant-title {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    margin-bottom: 0.5rem;
    line-height: 1.05;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-top: 0;
}

.card-glow {
    width: 250px !important;
    height: 250px !important;
    filter: blur(80px) !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 0 !important;
}

.bento-item:hover .card-glow {
    opacity: 0.15 !important;
}


/* --- Intro Loader --- */
.loader-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.loader-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-text {
    display: inline-block;
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: #ffffff;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid rgba(255,255,255,0.75);
    animation: typing 1.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: rgba(255,255,255,0.75); }
}

/* --- Hero Interactive Canvas --- */
.hero-interactive-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none; /* Let clicks pass through to content */
}

/* --- Light Mode --- */
body.light-mode {
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --accent-color: #1d1d1f;
    --border-color: rgba(0, 0, 0, 0.08);
}

/* Light Mode Overrides */
body.light-mode .hero-bg, 
body.light-mode .hero::before {
    background: radial-gradient(circle at 50% 0%, rgba(0,0,0,0.03) 0%, transparent 60%);
}

body.light-mode .text-gradient {
    background: linear-gradient(135deg, #1d1d1f 0%, #86868b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .bento-item {
    background: rgba(255, 255, 255, 0.6) !important;
    border: 1px solid rgba(0, 0, 0, 0.06) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.04), inset 0 1px 0 rgba(255, 255, 255, 1) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

body.light-mode .bento-item:hover {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 1) !important;
}

body.light-mode .glass-reflection {
    background: linear-gradient(135deg, rgba(255,255,255,0.8) 0%, transparent 40%);
}

body.light-mode .card-glow {
    opacity: 0.1; /* Reduce glow intensity in light mode */
}

body.light-mode .header {
    background: rgba(245, 245, 247, 0.7);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .nav-links a {
    color: var(--text-primary);
}

body.light-mode .btn-link {
    background-color: #1d1d1f;
    color: #ffffff !important;
}

body.light-mode .btn-link:hover {
    background-color: #333336;
}

body.light-mode .modal {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

body.light-mode .modal-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

body.light-mode .btn-email {
    background: rgba(0,0,0,0.04) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

body.light-mode .btn-email:hover {
    background: rgba(0,0,0,0.08) !important;
}

body.light-mode .btn-email-small {
    background: rgba(0,0,0,0.05) !important;
    border-color: rgba(0,0,0,0.1) !important;
}

body.light-mode .btn-email-small:hover {
    background: rgba(0,0,0,0.08) !important;
}

body.light-mode .noise-overlay {
    opacity: 0.03; /* Softer noise in light mode */
}

/* --- Scroll Animations --- */
.fade-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

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

.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }

/* --- Light Mode Deep Fixes --- */
body.light-mode .logo {
    color: var(--text-primary) !important;
}

body.light-mode .nav-links a {
    color: var(--text-secondary) !important;
}
body.light-mode .nav-links a:hover {
    color: var(--text-primary) !important;
}

/* Fix the washed out cards */
body.light-mode .glass-reflection {
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, transparent 40%) !important;
    pointer-events: none;
    z-index: 1; /* Keep it below text if possible, or just lower opacity */
}

body.light-mode .card-content, 
body.light-mode .card-visual, 
body.light-mode .card-meta {
    position: relative;
    z-index: 2; /* Keep text above the reflection */
}

/* Fix the glowing blobs (card-glow) entirely in light mode */
body.light-mode .card-glow {
    display: none !important; /* The blobs look like smudges in light mode, remove them for a clean Apple look */
}

/* Fix SVG colors in cards */
body.light-mode .bento-item .service-icon {
    opacity: 0.9;
}

body.light-mode .bento-item {
    background: rgba(255, 255, 255, 0.7) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}
body.light-mode .bento-item:hover {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1) !important;
}

body.light-mode .giant-title {
    color: #1d1d1f !important;
}

body.light-mode .section-subtitle, 
body.light-mode .about-desc p {
    color: #424245 !important;
}

body.light-mode .header {
    background: rgba(245, 245, 247, 0.85) !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
}

@media (max-width: 768px) {
    .mobile-only-contacts {
        display: flex !important;
    }
    .header {
        padding: 1rem 0 !important;
    }
}

/* Hamburger menu fix for Light Mode */
body.light-mode .bar {
    background-color: var(--text-primary) !important;
}

/* --- Light Mode Mobile Menu Fix --- */
@media (max-width: 768px) {
    body.light-mode .nav-links {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(25px) !important;
        -webkit-backdrop-filter: blur(25px) !important;
        border-left: 1px solid rgba(0,0,0,0.1) !important;
        box-shadow: -10px 0 40px rgba(0,0,0,0.1) !important;
    }
    body.light-mode .nav-links a {
        color: #1d1d1f !important;
    }
    body.light-mode .nav-links a:hover {
        color: #000000 !important;
        background: rgba(0,0,0,0.05) !important;
    }
}


/* --- Light Mode Nav Text Fix --- */
body.light-mode .header a:not(.btn-link):not(.logo) {
    color: #1d1d1f !important;
}
body.light-mode .header a:not(.btn-link):not(.logo):hover {
    color: #000000 !important;
}
body.light-mode .header .logo {
    color: #1d1d1f !important;
}
body.light-mode .header .btn-link {
    background: #1d1d1f !important;
    color: #ffffff !important;
}
body.light-mode .header .btn-link:hover {
    background: #000000 !important;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1) !important;
}
body.light-mode .mobile-toggle .bar {
    background-color: #1d1d1f !important;
}

/* --- Vibrant Service Cards (Both Modes) --- */
.service-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease !important;
}
.service-card:hover {
    transform: translateY(-8px) !important;
    border-color: rgba(99, 102, 241, 0.5) !important; /* Indigo glow */
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15) !important;
}

body.light-mode .service-card:hover {
    border-color: rgba(99, 102, 241, 0.8) !important;
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.25), 0 0 15px rgba(236, 72, 153, 0.2) !important; /* Indigo & Pink glow */
}

/* Give icons inside cards a gradient pop on hover */
.service-card:hover .service-icon {
    background: linear-gradient(135deg, #6366f1, #ec4899) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
    transform: scale(1.1);
    transition: all 0.3s ease;
}

/* --- Contact Form Styling --- */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
    width: 100%;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}
.contact-form textarea {
    min-height: 120px;
    resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #6366f1;
    background: rgba(255,255,255,0.05);
}
.btn-submit {
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.btn-submit:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

body.light-mode .contact-form input,
body.light-mode .contact-form textarea {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.1);
}
body.light-mode .contact-form input:focus,
body.light-mode .contact-form textarea:focus {
    border-color: #6366f1;
    background: rgba(0,0,0,0.05);
}


/* --- Refined Premium Tags --- */
.chip {
    padding: 0.4rem 0.8rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.05em !important;
    text-transform: uppercase !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
}
body.light-mode .chip {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

/* --- Loader Fixes --- */
.loader-text {
    font-family: var(--font-heading) !important;
    letter-spacing: -0.03em !important;
    font-weight: 600 !important;
}
body.light-mode #intro-loader {
    background: #f5f5f7 !important;
    color: #1d1d1f !important;
}
body.light-mode .loader-text {
    border-right-color: #1d1d1f !important;
}


/* --- Fix Let's Talk Button Shape --- */
.btn-link {
    padding: 0.7rem 1.5rem !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    font-size: 0.85rem !important;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.btn-link:hover {
    transform: translateY(-2px) !important;
}

/* --- Fix Text Contrast --- */
.intro-text strong {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

/* --- Make Card Colors Pop (Light & Dark) --- */
/* Override the previous display:none in light mode */
body.light-mode .card-glow {
    display: block !important;
    opacity: 0.1 !important; 
    filter: blur(50px) !important;
    background: var(--service-color) !important;
    width: 200px !important;
    height: 200px !important;
}

/* Dark mode default pop increase */
.card-glow {
    opacity: 0.2 !important;
}

/* Extreme pop on hover for both modes */
.service-card:hover .card-glow {
    opacity: 0.5 !important;
    transform: translate(-50%, -50%) scale(1.6) !important;
    filter: blur(60px) !important;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
body.light-mode .service-card:hover .card-glow {
    opacity: 0.3 !important;
}


/* --- Fix Hero Centering & Blue Accent --- */
.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: 0 auto;
    max-width: 800px;
}

.text-gradient {
    background: linear-gradient(135deg, #0070F3, #3291FF) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;
}

/* --- Fix Loader Light Mode Text --- */
body.light-mode .loader-text {
    color: #1d1d1f !important;
    border-right-color: #0070F3 !important;
}

/* --- Fix Free Consultation Icon & General Service Icons in Light Mode --- */
body.light-mode .service-icon {
    color: #1d1d1f; /* Ensure stroke="currentColor" icons are dark in light mode */
}
/* Ensure the hover state still overrides it */
body.light-mode .service-card:hover .service-icon {
    color: transparent !important; /* Let the gradient show */
}


/* --- Fix SVG Icon Hover Bug (Overrides previous text-clip hack) --- */
.service-card:hover .service-icon,
body.light-mode .service-card:hover .service-icon {
    background: transparent !important;
    -webkit-text-fill-color: initial !important;
    color: #0070F3 !important; /* Premium Vercel Blue Accent */
    filter: drop-shadow(0 0 10px rgba(0, 112, 243, 0.5)) !important;
    transform: scale(1.1) !important;
    transition: all 0.3s ease !important;
}

/* Also ensure the brand icons with specific inline colors don't get overwritten 
   unintentionally when NOT hovered in light mode */
body.light-mode .service-icon:not(.brand-icon) {
    color: #1d1d1f !important;
}


/* --- Fix SVG Icon Hover Bug (Absolute Override) --- */
.service-card:hover .service-icon,
body.light-mode .service-card:hover .service-icon {
    background: transparent !important;
    -webkit-background-clip: border-box !important;
    -webkit-text-fill-color: #0070F3 !important; /* Force the text-fill to blue instead of transparent or initial */
    color: #0070F3 !important; 
    filter: drop-shadow(0 0 10px rgba(0, 112, 243, 0.5)) !important;
}

/* --- Desktop Service Card Hover Details --- */
.card-hover-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    line-height: 1.5;
}

/* Only enable the hover expansion on desktop devices (laptops/desktops) */
@media (min-width: 1024px) {
    .service-card:hover .card-hover-desc {
        opacity: 1;
        max-height: 150px; /* Expand to fit text */
        margin-top: 1rem;
    }
    
    /* Slightly lift the whole content block up on hover for a parallax feel */
    .service-card:hover .card-content {
        transform: translateY(-5px);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .card-content {
        transition: transform 0.4s ease;
    }
}
