/* --- Core Styles --- */
body {
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    cursor: none;
    /* Custom cursor logic handles visibility */
}

/* Mobile optimizations */
@media (hover: none) {
    body {
        cursor: auto;
    }

    #custom-cursor,
    #cursor-dot {
        display: none !important;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #6366f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4338ca;
}

/* --- Custom Cursor --- */
#cursor-dot,
#custom-cursor {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
}

#cursor-dot {
    width: 8px;
    height: 8px;
    background-color: #6366f1;
}

#custom-cursor {
    width: 40px;
    height: 40px;
    border: 1px solid #6366f1;
    transition: transform 0.1s ease-out, width 0.2s, height 0.2s, background-color 0.2s;
}

body.hovering #custom-cursor {
    transform: translate(-50%, -50%) scale(1.5);
    background-color: rgba(99, 102, 241, 0.1);
    border-color: transparent;
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Spotlight */
.spotlight-card {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.spotlight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

.dark .spotlight-card {
    background: rgba(30, 41, 59, 0.4);
}

.spotlight-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(600px circle at var(--mouse-x) var(--mouse-y), rgba(99, 102, 241, 0.1), transparent 40%);
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

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

/* 3D Effects */
.perspective-1000 {
    perspective: 1000px;
}

.preserve-3d {
    transform-style: preserve-3d;
}

.backface-hidden {
    backface-visibility: hidden;
}

.rotate-y-180 {
    transform: rotateY(180deg);
}

.flip-card:hover .flip-inner {
    transform: rotateY(180deg);
}

.flip-card.flipped .flip-inner {
    transform: rotateY(180deg);
}

.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.1s ease-out;
}

/* Animation Utilities */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}

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

.typing-cursor::after {
    content: '|';
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

#bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* --- Fixed Contact Button Styles --- */
.contact-send-btn {
    font-family: inherit;
    font-size: 18px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 0.8em 2em;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 25px;
    box-shadow: 0px 5px 10px rgba(99, 102, 241, 0.3);
    transition: all 0.3s;
    cursor: pointer;
    width: 100%;
    /* Full width on mobile */
}

/* Desktop sizing */
@media (min-width: 768px) {
    .contact-send-btn {
        width: auto;
        /* Natural width on desktop */
        padding: 0.8em 3em;
    }
}

.contact-send-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0px 8px 15px rgba(99, 102, 241, 0.5);
}

.contact-send-btn span {
    display: block;
    margin-left: 0.4em;
    transition: all 0.3s;
}

.contact-send-btn svg {
    width: 18px;
    height: 18px;
    fill: white;
    transition: all 0.3s;
}

.contact-send-btn .svg-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
    margin-right: 8px;
}

.contact-send-btn:hover .svg-wrapper {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

.contact-send-btn:hover svg {
    transform: rotate(45deg);
}

/* --- Lenis Smooth Scroll --- */
html.lenis,
html.lenis body {
    height: auto;
}

.lenis.lenis-smooth {
    scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
    overscroll-behavior: contain;
}

.lenis.lenis-stopped {
    overflow: hidden;
}

.lenis.lenis-scrolling iframe {
    pointer-events: none;
}

/* --- Experience Card Professional Hover --- */
.experience-card {
    /* Inherit Glass */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.3);

    /* Transitions */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy "Pop" */
    position: relative;
    z-index: 1;
}

.dark .experience-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.experience-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.3);
    /* Indigo glow */
    border-color: rgba(99, 102, 241, 0.5);
    z-index: 10;
}

/* Specific glows for different roles based on icons if needed, 
   but general glow is cleaner for consistency. */

/* --- Logo Images (Replaces Icon Fonts) --- */
.skill-card img,
.spotlight-card img {
    transition: transform 0.3s ease;
    width: 2.5rem;
    /* Default size matching previous icons approx */
    height: 2.5rem;
    object-fit: contain;
}

@media (min-width: 768px) {

    .skill-card img,
    .spotlight-card img {
        width: 3rem;
        height: 3rem;
    }
}

/* Specific adjustments for larger cards if needed */
.spotlight-card img {
    margin-bottom: 0.5rem;
}

/* Hover effects for logos */
.skill-card:hover img,
.spotlight-card:hover img {
    transform: scale(1.1);
}

.experience-card h3,
.experience-card h4 {
    transition: color 0.3s ease;
}

.experience-card:hover h3 {
    color: #6366f1;
    /* Accent Color */
}


/* --- Testimonials Section --- */
.testimonial-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.5s ease;
}

.dark .testimonial-card {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.2);
}

.quote-icon {
    font-size: 3rem;
    line-height: 1;
    opacity: 0.2;
}

/* --- Project Modals --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 1.5rem;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.dark .modal-content {
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.dark .modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
}

.modal-close-btn:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}

/* --- Live Stats --- */
.stat-card {
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}