/* Base Styles & Smooth Scroll */
html {
    scroll-behavior: smooth;
}

/* Animated mesh gradient for hero */
.hero-gradient-bg {
    background: linear-gradient(-45deg, #ffffff, #eef2ff, #ecfeff, #f5f3ff, #ffffff);
    background-size: 400% 400%;
    animation: heroMeshShift 20s ease infinite;
}
.hero-gradient-bg::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 80%;
    height: 100%;
    background: radial-gradient(ellipse, rgba(58,134,255,0.12) 0%, transparent 70%);
    animation: heroOrb1 15s ease-in-out infinite alternate;
}
.hero-gradient-bg::after {
    content: "";
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 60%;
    height: 80%;
    background: radial-gradient(ellipse, rgba(131,56,236,0.10) 0%, transparent 70%);
    animation: heroOrb2 18s ease-in-out infinite alternate;
}
@keyframes heroMeshShift {
    0%   { background-position: 0% 50%; }
    25%  { background-position: 100% 50%; }
    50%  { background-position: 100% 0%; }
    75%  { background-position: 0% 100%; }
    100% { background-position: 0% 50%; }
}
@keyframes heroOrb1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-8%, 12%) scale(1.2); }
}
@keyframes heroOrb2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(10%, -8%) scale(1.15); }
}

/* Skip to main content link (a11y) - hidden until focused */
.skip-link {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: #3A86FF;
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
    z-index: 100;
    border-radius: 0.5rem;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform 0.2s ease;
}
.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid #FFBE0B;
    outline-offset: 2px;
}

body {
    font-family: 'Poppins', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    background-color: #f7fafc;
    color: #1a202c;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

a[href="#contact"] span {
    white-space: nowrap !important;
}

/* Modern Color Palette - Based on Demo */
:root {
    --primary-color: #3A86FF; /* Blue shade */
    --secondary-color: #8338EC; /* Purple shade */
    --accent-color: #FFBE0B; /* Yellow shade */
    --light-color: #F8F9FA; /* Light gray - background color */
    --dark-color: #212529; /* Dark gray/black - text color */
    --text-color: #212529; /* Dark gray text for better readability */
    --text-color-light: #6c757d; /* Softer gray text for secondary content */
    --border-radius: 12px;
    --box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.8s ease forwards;
    opacity: 0;
}

/* Contact Form Success Message Animation */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Popup Modal Animations */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

/* Popup Overlay Styles */
.submission-popup-overlay {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.submission-popup-overlay .bg-white {
    position: relative;
}

/* Animation Delay Classes */
.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

.delay-400 {
    animation-delay: 0.4s;
}

/* Active Navigation Link Styles */
.modern-nav-link.active {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.modern-nav-link.active i {
    color: var(--primary-color) !important;
}

.modern-nav-link.active span {
    color: var(--primary-color) !important;
}

/* Mobile navigation active states */
.mobile-nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)) !important;
    color: white !important;
    border-radius: 8px;
}

/* Desktop navigation hover effects for non-active links */
.modern-nav-link:not(.active):hover {
    background: rgba(58, 134, 255, 0.1);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.delay-500 {
    animation-delay: 0.5s;
}

/* Light/Dark Mode color transitions (scoped to bg/color only) */
body,
header,
footer,
section,
.card {
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Modern Header & Navigation Styles */
header {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease, box-shadow 0.3s ease;
}

header nav a {
    position: relative;
    transition: color 0.3s ease;
    font-weight: 500;
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

header nav a:hover {
    color: var(--primary-color);
    background-color: rgba(36, 99, 235, 0.05);
}

/* Modern Button Styles & Hover Effects */
.btn-primary {
    background-color: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    box-shadow: 0 10px 15px -3px rgba(36, 99, 235, 0.3);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.025em;
}

/* Modern Card Styles */
.modern-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
}

.modern-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.15);
}

/* Gradient Text — extended by Tier 1 gradient-text below */

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Custom Form Styling — base rules, Tier 4 glassmorphism overrides below */
input, textarea {
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

/* Timeline Styles */
#experience-items .relative.border-l-2::before,
#education-items .relative.border-l-2::before {
    content: '';
    position: absolute;
    height: 100%;
    left: 0;
    top: 0;
    background: linear-gradient(to bottom, transparent, var(--primary-color), transparent);
    width: 2px;
    opacity: 0.3;
}

/* btn-primary hover — handled by Tier 1 gradient CTA rules below */

/* Card Hover Effects — see Tier 1 block below for transform/shadow */

/* Section Styles */
section {
    position: relative;
    overflow: hidden;
}

.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
    font-weight: 700;
    color: #1e293b;
    z-index: 1;
}

.dark .section-title {
    color: white;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #3A86FF, #8338EC);
    border-radius: 2px;
}

/* Form Element Styles — base; #contact-form glassmorphism overrides below */
input, textarea {
    border: 1px solid #e2e8f0;
    outline: none;
}

.dark input, .dark textarea {
    background-color: #1f2937;
    border-color: #374151;
    color: #f3f4f6;
}

.dark input:focus, .dark textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Footer Styles — accent bar handled by Tier 4 footer::before below */
footer {
    position: relative;
}

/* Social Icons Hover Effect — see Tier 3 icon bounce below */
footer svg {
    transition: transform 0.3s ease, color 0.3s ease;
}

/* Nav Bar Action Buttons */
.nav-container a[href="#contact"], .bg-\[\#0077b5\] {
    transition: background-color 0.3s ease, transform 0.2s ease;
    position: relative; /* Ensure it has its own stacking context */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

.nav-container a[href="#contact"]:hover, .bg-\[\#0077b5\]:hover {
    transform: scale(1.05);
}

/* LinkedIn Button Specific */
.bg-\[\#0077b5\]:hover {
    transform: scale(1.1);
}

/* Mobile Menu */
#mobileMenu.active {
    display: block;
}

/* Hover Effect for Card Links */
.card a {
    position: relative;
    display: inline-block;
    transition: transform 0.3s ease;
}

.card a:hover {
    transform: translateX(5px);
}

/* Custom Scrollbar — now handled by Tier 3 gradient scrollbar below */

/* Specific Dark Mode Styles */
.dark body {
    background-color: #111827;
    color: #f3f4f6;
}

.dark header {
    background-color: #1f2937;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.dark .card {
    background-color: #1f2937;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.dark footer {
    background-color: #111827;
    border-top: 1px solid #374151;
}

/* Media Queries — see comprehensive reduced-motion block at EOF */


/* -----------------------------------------------------------------
   Floating WhatsApp chat button (injected by initializeWhatsAppButton
   in js/script.js). Sits above the back-to-top button.
   ----------------------------------------------------------------- */
.whatsapp-float {
    position: fixed;
    right: 2rem;
    bottom: 5.5rem;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 9999px;
    background-color: #25D366;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
    z-index: 50;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: whatsapp-pulse 2.5s ease-in-out infinite;
}

.whatsapp-float:hover,
.whatsapp-float:focus {
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.55);
    outline: none;
}

.whatsapp-float:focus-visible {
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 6px #25D366;
}

.whatsapp-float svg {
    width: 1.75rem;
    height: 1.75rem;
    display: block;
}

@keyframes whatsapp-pulse {
    0%, 100% {
        box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35),
                    0 0 0 0 rgba(37, 211, 102, 0.5);
    }
    50% {
        box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35),
                    0 0 0 14px rgba(37, 211, 102, 0);
    }
}

@media (max-width: 640px) {
    .whatsapp-float {
        right: 1rem;
        bottom: 5rem;
        width: 3rem;
        height: 3rem;
    }
    .whatsapp-float svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* WhatsApp reduced-motion — see comprehensive block at EOF */

/* ============================================================
   TIER 1 — Typography, spacing, surfaces, cards, gradients
   ============================================================ */

/* Typography hierarchy */
h1, h2, h3, h4, h5, h6 {
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
}
h1 { font-weight: 800; }
h2 { font-weight: 700; }
h3, h4 { font-weight: 600; }
p, li { text-wrap: pretty; }

/* Consistent section spacing – 24/32 rhythm */
section#hero      { padding-top: 8rem; }
section#about,
section#expertise,
section#testimonials,
section#education,
section#contact {
    padding-top: clamp(4rem, 6vw + 2rem, 8rem);
    padding-bottom: clamp(4rem, 6vw + 2rem, 8rem);
}

/* Soft alternating surfaces (subtle, not garish) */
section#about        { background: linear-gradient(180deg, #ffffff 0%, #f8faff 100%); }
section#expertise    { background: linear-gradient(135deg, #eef2ff 0%, #ffffff 60%, #ecfeff 100%); }
section#testimonials { background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%, #f0fdfa 100%); }
section#education    { background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 60%, #faf5ff 100%); }
section#contact      { background: linear-gradient(180deg, #f8f9fa 0%, #eef2ff 100%); }

/* Feature-row banner backgrounds – softer */
main > section.bg-gray-50 {
    background: linear-gradient(180deg, #f8faff 0%, #ffffff 100%);
}

/* Card polish – layered shadow + subtle border + smooth hover lift */
.card,
.expertise-card,
.education-card,
.testimonial-card,
[class*="rounded-xl"].bg-white,
[class*="rounded-2xl"].bg-white,
[class*="rounded-3xl"].bg-white {
    border: 1px solid rgba(58, 134, 255, 0.08);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 12px 32px -18px rgba(58, 134, 255, 0.35);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.35s ease;
}
.card:hover,
.expertise-card:hover,
.education-card:hover,
.testimonial-card:hover,
[class*="rounded-xl"].bg-white:hover,
[class*="rounded-2xl"].bg-white:hover,
[class*="rounded-3xl"].bg-white:hover {
    transform: translateY(-4px);
    box-shadow:
        0 4px 8px rgba(15, 23, 42, 0.05),
        0 24px 60px -20px rgba(58, 134, 255, 0.45);
    border-color: rgba(58, 134, 255, 0.18);
}

/* Gradient text utility – applied to eyebrows & primary headings */
.gradient-text,
h1 .highlight,
h2 .highlight,
.section-eyebrow {
    background: linear-gradient(90deg, #3A86FF 0%, #8338EC 60%, #3A86FF 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Gradient CTAs — primary button upgrade */
.btn-primary,
a[href*="wa.me"].bg-primary,
button.bg-primary {
    background-image: linear-gradient(135deg, #3A86FF 0%, #8338EC 100%);
    background-size: 200% 100%;
    background-position: 0% 50%;
    transition: background-position 0.5s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 24px -8px rgba(58, 134, 255, 0.55);
}
.btn-primary:hover,
a[href*="wa.me"].bg-primary:hover,
button.bg-primary:hover {
    background-position: 100% 50%;
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -8px rgba(131, 56, 236, 0.55);
}

/* ============================================================
   TIER 2 — Hero glow, banner shapes, buttons, testimonials, icons
   ============================================================ */

/* Hero image – soft radial glow + subtle float */
#hero {
    position: relative;
}
#hero .relative:has(> img),
#hero [class*="rounded"]:has(> img) {
    position: relative;
}
#hero .relative:has(> img)::before,
#hero [class*="rounded"]:has(> img)::before {
    content: "";
    position: absolute;
    inset: -14%;
    background: radial-gradient(closest-side, rgba(58, 134, 255, 0.35), rgba(131, 56, 236, 0.15) 55%, transparent 75%);
    filter: blur(30px);
    z-index: 0;
    pointer-events: none;
    animation: heroGlow 8s ease-in-out infinite alternate;
}
@keyframes heroGlow {
    0%   { transform: scale(0.95); opacity: 0.75; }
    100% { transform: scale(1.05); opacity: 1; }
}
@keyframes floatY {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
#hero img { animation: floatY 6s ease-in-out infinite; position: relative; z-index: 1; }

/* Hero floating badges must sit above the image */
#hero .relative > .absolute:not(.-z-10) {
    z-index: 5;
}

/* Feature-row banner images + about profile — gentle breathing scale (overflow-hidden safe) */
@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.025); }
}
main img[width="1200"][height="800"],
#about-profile-image {
    animation: breathe 7s ease-in-out infinite;
}
main img[width="1200"][height="800"]:nth-of-type(2n) { animation-duration: 8s; animation-delay: -1.5s; }
main img[width="1200"][height="800"]:nth-of-type(3n) { animation-duration: 6.5s; animation-delay: -3s; }
main img[width="1200"][height="800"]:nth-of-type(5n) { animation-duration: 7.5s; animation-delay: -2s; }
#about-profile-image { animation-duration: 8s; animation-delay: -1s; }

/* Feature-row banner images – large radius + hover scale */
main img[width="1200"][height="800"] {
    border-radius: 1.5rem;
    box-shadow:
        0 20px 60px -25px rgba(58, 134, 255, 0.45),
        0 4px 12px rgba(15, 23, 42, 0.06);
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
main img[width="1200"][height="800"]:hover {
    transform: scale(1.015);
    box-shadow:
        0 30px 80px -25px rgba(131, 56, 236, 0.5),
        0 4px 12px rgba(15, 23, 42, 0.08);
}

/* Button + form focus – consistent ring */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid #FFBE0B;
    outline-offset: 3px;
    border-radius: 0.5rem;
}

/* Testimonials — decorative quote mark behind cards */
#testimonials .testimonial-card,
.testimonial-item {
    position: relative;
    overflow: hidden;
}
#testimonials .testimonial-card::before,
.testimonial-item::before {
    content: "\201C";
    position: absolute;
    top: -1.25rem;
    left: 0.75rem;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 8rem;
    line-height: 1;
    color: rgba(58, 134, 255, 0.09);
    font-weight: 700;
    pointer-events: none;
    z-index: 0;
}
#testimonials .testimonial-card > *,
.testimonial-item > * {
    position: relative;
    z-index: 1;
}

/* Icon chips */
.icon-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 0.9rem;
    background: linear-gradient(135deg, rgba(58,134,255,0.12), rgba(131,56,236,0.12));
    color: #3A86FF;
    font-size: 1.25rem;
}

/* ============================================================
   TIER 3 — Scrollbar, selection, focus rings, eyebrows, reveals
   ============================================================ */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3A86FF, #8338EC);
    border-radius: 999px;
    border: 3px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #2A6FE0, #6B22D4);
}
* {
    scrollbar-color: #3A86FF #f1f5f9;
    scrollbar-width: thin;
}

/* Text selection */
::selection {
    background: #3A86FF;
    color: #ffffff;
    text-shadow: none;
}
::-moz-selection {
    background: #3A86FF;
    color: #ffffff;
}

/* Section eyebrow */
.section-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

/* Animated section-header icons (pulse + gentle spin) */
@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.15); }
}
@keyframes iconSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
section .inline-flex.items-center svg,
section .inline-flex.items-center i.fas,
section .inline-flex.items-center i.far {
    animation: iconPulse 3s ease-in-out infinite;
}
section .inline-flex.items-center:hover svg,
section .inline-flex.items-center:hover i {
    animation: iconSpin 0.6s ease-in-out;
}

/* Reveal-on-scroll */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ============================================================
   MEDIUM IMPACT — Page transitions, text reveal, card hovers,
   custom cursor, magnetic buttons
   ============================================================ */

/* 7. Page transitions (View Transitions API fallback) */
@keyframes pageSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
body {
    animation: pageSlideIn 0.5s ease-out;
}
@view-transition {
    navigation: auto;
}
::view-transition-old(root) {
    animation: 0.3s ease-out both fade-out;
}
::view-transition-new(root) {
    animation: 0.4s ease-out both fade-in;
}
@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(8px); } }

/* 9. Text reveal on headings — clip-path slide up */
.text-reveal {
    overflow: hidden;
    display: inline-block;
}
.text-reveal > span {
    display: inline-block;
    transform: translateY(110%);
    transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.text-reveal.is-visible > span {
    transform: translateY(0);
}

/* 10. Testimonial carousel indicators */
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}
.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: #10B981;
}

/* 11. Expanding bottom-line on bento/expertise cards */
.group[class*="rounded-3xl"]::after,
.bento-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, #3A86FF, #8338EC);
    border-radius: 2px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.group[class*="rounded-3xl"]:hover::after,
.bento-card:hover::after {
    transform: translateX(-50%) scaleX(1);
}

/* 12. Custom cursor (desktop only) */
@media (hover: hover) and (pointer: fine) {
    .custom-cursor {
        position: fixed;
        top: 0;
        left: 0;
        width: 8px;
        height: 8px;
        background: #3A86FF;
        border-radius: 50%;
        pointer-events: none;
        z-index: 9999;
        mix-blend-mode: difference;
        transition: transform 0.15s ease, width 0.3s ease, height 0.3s ease, opacity 0.3s ease;
        opacity: 0;
    }
    .custom-cursor.visible { opacity: 1; }
    .custom-cursor.expanded {
        width: 40px;
        height: 40px;
        background: rgba(58, 134, 255, 0.15);
        border: 2px solid #3A86FF;
    }
    .cursor-ring {
        position: fixed;
        top: 0;
        left: 0;
        width: 36px;
        height: 36px;
        border: 1.5px solid rgba(58, 134, 255, 0.4);
        border-radius: 50%;
        pointer-events: none;
        z-index: 9998;
        transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
        opacity: 0;
    }
    .cursor-ring.visible { opacity: 1; }
}

/* ============================================================
   LOW EFFORT / HIGH CLASS — Noise, nav underlines, gradient
   border, skeleton loading, icon micro-interactions
   ============================================================ */

/* 13. Noise texture overlay */
section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
    opacity: 0.018;
    pointer-events: none;
    z-index: 0;
    mix-blend-mode: overlay;
}
/* Don't double-noise hero which already has gradient bg */
#hero::before { display: none; }

/* 14. Animated underlines on nav links */
.modern-nav-link {
    position: relative;
    padding-bottom: 4px;
}
.modern-nav-link::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #3A86FF, #8338EC);
    border-radius: 1px;
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.modern-nav-link:hover::after,
.modern-nav-link.active::after {
    width: 100%;
}

/* 15. Gradient rotating border on hero image container */
#hero-image-container {
    border: none !important;
    padding: 4px;
    background: conic-gradient(from var(--border-angle, 0deg), #3A86FF, #8338EC, #FFBE0B, #3A86FF);
    animation: rotateBorder 4s linear infinite;
    border-radius: 1rem;
}
#hero-image-container > img {
    border-radius: calc(1rem - 4px);
}
@property --border-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}
@keyframes rotateBorder {
    to { --border-angle: 360deg; }
}
/* Fallback for browsers without @property */
@supports not (background: conic-gradient(from 0deg, red, blue)) {
    #hero-image-container {
        border: 4px solid;
        border-image: linear-gradient(135deg, #3A86FF, #8338EC, #FFBE0B) 1;
        animation: none;
    }
}

/* 16. Skeleton shimmer loading for images */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
img[loading="lazy"] {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s ease-in-out infinite;
}
img[loading="lazy"][src]:not([src=""]) {
    animation: none;
    background: none;
}

/* 17. Micro-interactions on icons — bounce on hover */
@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    30%      { transform: translateY(-4px); }
    60%      { transform: translateY(-2px); }
}
#contact-info i,
#contact-info svg,
footer i,
footer svg,
.icon-chip:hover {
    transition: transform 0.3s ease, color 0.3s ease;
}
#contact-info i:hover,
#contact-info svg:hover,
footer a:hover i,
footer a:hover svg,
.icon-chip:hover {
    animation: iconBounce 0.5s ease;
    color: #FFBE0B;
}

/* 8. Magnetic button — slight pull toward cursor (JS adds inline transform) */
.magnetic-btn {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================================
   TIER 4 — Sticky nav blur, container caps, footer polish
   ============================================================ */

/* Sticky navigation glass effect when scrolled */
/* Sticky navigation glass effect when scrolled */
header.scrolled,
nav.scrolled,
#main-nav.scrolled,
header nav.scrolled {
    background-color: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    box-shadow: 0 6px 24px -12px rgba(15, 23, 42, 0.15);
}

/* Container width caps for readability */
section > .container,
section > .max-w-7xl {
    max-width: min(1200px, 92vw);
    margin-inline: auto;
}
section p:not([class*="text-center"]),
section li {
    max-width: 68ch;
}

/* Glassmorphism contact form inputs */
#contact-form input,
#contact-form textarea,
#contact-form select {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(58, 134, 255, 0.15);
    border-radius: 0.9rem;
    padding: 0.85rem 1.1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}
#contact-form input:focus,
#contact-form textarea:focus,
#contact-form select:focus {
    border-color: #3A86FF;
    box-shadow: 0 0 0 4px rgba(58, 134, 255, 0.12);
    background: rgba(255, 255, 255, 0.8);
    outline: none;
}
#contact-form button[type="submit"] {
    border-radius: 0.9rem;
    background-image: linear-gradient(135deg, #3A86FF 0%, #8338EC 100%);
    box-shadow: 0 8px 24px -8px rgba(58, 134, 255, 0.55);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}
#contact-form button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px -8px rgba(131, 56, 236, 0.55);
}

/* Footer polish — keep the page's existing gradient, add an accent bar */
footer {
    position: relative;
    overflow: hidden;
}
footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3A86FF, #8338EC, #FFBE0B);
    z-index: 1;
}
footer a {
    transition: color 0.2s ease, transform 0.2s ease;
}
footer a:hover {
    color: #FFBE0B;
}

/* ============================================================
   TYPING EFFECT
   ============================================================ */
.typing-cursor::after {
    content: '|';
    display: inline-block;
    color: var(--primary-color, #3A86FF);
    font-weight: 300;
    animation: blinkCursor 0.7s steps(1) infinite;
    margin-left: 2px;
}
.typing-cursor.done::after {
    display: none;
}
@keyframes blinkCursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}
/* Hide text until typing starts */
[data-typing] {
    min-height: 1.2em;
}

/* Reduced motion overrides — comprehensive */
@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;
    }
    .fade-in,
    .reveal {
        opacity: 1;
        transform: none;
    }
    body {
        animation: none;
    }
    .hero-gradient-bg,
    .hero-gradient-bg::before,
    .hero-gradient-bg::after,
    #hero img,
    main img[width="1200"][height="800"],
    #about-profile-image,
    #testimonials img,
    .whatsapp-float,
    section .inline-flex.items-center svg {
        animation: none !important;
    }
    .card:hover,
    .expertise-card:hover,
    .education-card:hover,
    .testimonial-card:hover,
    main img[width="1200"][height="800"]:hover,
    .btn-primary:hover,
    .magnetic-btn {
        transform: none !important;
    }
    .custom-cursor,
    .cursor-ring {
        display: none !important;
    }
    /* Typing: show full text immediately */
    .typing-cursor::after {
        display: none !important;
    }
}

/* ============================================================
   RESPONSIVE — All screen sizes compatibility
   ============================================================ */

/* Extra small screens (< 375px) */
@media (max-width: 374px) {
    section > .container,
    section > .relative.container {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    h2[class*="text-5xl"],
    h2[class*="text-4xl"] {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }

    h3[class*="text-2xl"] {
        font-size: 1.25rem !important;
    }

    p[class*="text-xl"] {
        font-size: 0.95rem !important;
    }

    .grid.grid-cols-2 {
        grid-template-columns: 1fr !important;
    }

    #hero-image-container {
        height: 16rem !important;
    }

    footer .grid {
        grid-template-columns: 1fr !important;
    }
}

/* Small screens (375px – 639px) */
@media (max-width: 639px) {
    h2[class*="text-5xl"] {
        font-size: clamp(1.75rem, 6vw, 2.5rem) !important;
    }

    p[class*="text-xl"] {
        font-size: 1rem !important;
    }

    .grid[class*="md:grid-cols"] {
        grid-template-columns: 1fr !important;
    }

    /* Bento grid single column on mobile */
    .grid[class*="md:grid-cols-4"] > * {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }

    /* Stats grid stays 2 columns */
    .grid.grid-cols-2:not([class*="md:grid-cols-4"]) {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    /* Testimonial carousel single card */
    .testimonial-card {
        width: 100% !important;
        min-width: 100% !important;
    }

    /* Testimonial carousel buttons closer to edges */
    #testimonial-prev {
        transform: translate(0, -50%) !important;
        left: 0.25rem !important;
    }
    #testimonial-next {
        transform: translate(0, -50%) !important;
        right: 0.25rem !important;
    }

    /* Footer grid single column */
    footer .grid[class*="md:grid-cols"] {
        grid-template-columns: 1fr !important;
        text-align: center;
    }

    /* Section dividers scale down */
    .section-divider {
        height: 80px;
        margin-top: -25px;
        margin-bottom: -25px;
    }
    .divider-icon {
        width: 50px;
        height: 50px;
    }
    .divider-icon svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Medium screens (640px – 767px) — tablet portrait */
@media (min-width: 640px) and (max-width: 767px) {
    h2[class*="text-5xl"] {
        font-size: 2.25rem !important;
    }

    /* Keep bento grid stacked */
    .grid[class*="md:grid-cols-4"] {
        grid-template-columns: 1fr !important;
    }
    .grid[class*="md:grid-cols-4"] > * {
        grid-column: span 1 !important;
        grid-row: span 1 !important;
    }
}

/* Ensure images never overflow horizontally */
img:not([class*="h-"]):not([class*="object-cover"]) {
    max-width: 100%;
    height: auto;
}

/* Images with explicit height classes should respect container width */
img[class*="object-cover"] {
    max-width: 100%;
}

/* Prevent horizontal scroll globally */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Absolute-positioned badges must not cause horizontal scroll */
.absolute[class*="-right-"],
.absolute[class*="-left-"] {
    max-width: calc(100vw - 2rem);
}

/* Contact section responsive */
@media (max-width: 767px) {
    #contact .flex-col.md\:flex-row {
        flex-direction: column !important;
    }
    #contact .md\:w-1\/2 {
        width: 100% !important;
    }
}

/* Featured testimonial badges responsive */
@media (max-width: 639px) {
    #testimonials .absolute.-top-4.-right-4,
    #testimonials .absolute[class*="-top-4"][class*="-right-4"] {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        margin-bottom: 0.75rem;
    }
    #testimonials .absolute.-bottom-4.-left-4,
    #testimonials .absolute[class*="-bottom-4"][class*="-left-4"] {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        margin-top: 0.75rem;
    }
}

/* Ensure footer bottom bar wraps nicely */
@media (max-width: 639px) {
    footer .flex-col.md\:flex-row {
        gap: 0.75rem !important;
    }
    footer .flex.items-center.gap-4 {
        flex-wrap: wrap;
        justify-content: center;
    }
}
