/* Custom CSS for enhanced styling and animations */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #2563eb;
    --secondary-color: #06b6d4;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
}

 .hero-grid {
     background-image:
         linear-gradient(rgba(99, 102, 241, 0.16) 1px, transparent 1px),
         linear-gradient(90deg, rgba(99, 102, 241, 0.16) 1px, transparent 1px);
     background-size: 64px 64px;
     mask-image: radial-gradient(circle at 50% 35%, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 70%);
 }

 .hero-blob {
     will-change: transform;
     transition: transform 120ms linear;
 }

 .hero-blob-1 {
     background: radial-gradient(circle at 30% 30%, rgba(37, 99, 235, 0.9) 0%, rgba(147, 51, 234, 0.0) 60%);
     animation: floatBlob1 10s ease-in-out infinite;
 }

 .hero-blob-2 {
     background: radial-gradient(circle at 30% 30%, rgba(236, 72, 153, 0.8) 0%, rgba(59, 130, 246, 0.0) 60%);
     animation: floatBlob2 14s ease-in-out infinite;
 }

 @keyframes floatBlob1 {
     0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
     50% { transform: translate3d(40px, 30px, 0) scale(1.05); }
 }

 @keyframes floatBlob2 {
     0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
     50% { transform: translate3d(-30px, -40px, 0) scale(1.08); }
 }

 .reveal {
     opacity: 0;
     transform: translateY(18px);
     transition: opacity 700ms ease, transform 700ms ease;
 }

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

 .section-heading {
     position: relative;
     display: inline-block;
 }

 .section-heading::after {
     content: '';
     position: absolute;
     left: 0;
     right: 0;
     bottom: -10px;
     height: 3px;
     border-radius: 999px;
     background: linear-gradient(90deg, #2563eb, #06b6d4, #0ea5e9);
     opacity: 0.9;
 }

 .text-highlight {
     position: relative;
     display: inline-block;
 }

 .text-highlight::before {
     content: '';
     position: absolute;
     left: -0.05em;
     right: -0.05em;
     bottom: 0.08em;
     height: 0.55em;
     border-radius: 0.5em;
     background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(6, 182, 212, 0.18), rgba(14, 165, 233, 0.16));
     filter: blur(0.2px);
     z-index: -1;
 }

 .accent-glow {
     box-shadow:
         0 0 0 1px rgba(59, 130, 246, 0.16) inset,
         0 12px 50px rgba(37, 99, 235, 0.16);
 }

 html.dark .accent-glow {
     box-shadow:
         0 0 0 1px rgba(59, 130, 246, 0.18) inset,
         0 18px 70px rgba(2, 132, 199, 0.18);
 }

 .glass-card {
     background: rgba(255, 255, 255, 0.60);
     backdrop-filter: blur(14px);
     -webkit-backdrop-filter: blur(14px);
     box-shadow:
         0 22px 70px rgba(0, 0, 0, 0.14),
         0 0 0 1px rgba(255, 255, 255, 0.25) inset;
 }

 html.dark .glass-card {
     background: rgba(2, 6, 23, 0.55);
     box-shadow:
         0 22px 80px rgba(0, 0, 0, 0.55),
         0 0 0 1px rgba(148, 163, 184, 0.10) inset;
 }

 .tilt-card {
     transform-style: preserve-3d;
     will-change: transform;
     transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
 }

 .tilt-card:hover {
     box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
 }

 html.dark .tilt-card:hover {
     box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
 }

 .spotlight-card {
     position: relative;
     overflow: hidden;
 }

 .spotlight-card::after {
     content: '';
     position: absolute;
     inset: -1px;
     pointer-events: none;
     opacity: 0;
     transition: opacity 360ms ease;
     background: radial-gradient(520px circle at var(--sx, 50%) var(--sy, 50%), rgba(56, 189, 248, 0.18), transparent 60%);
 }

 html.dark .spotlight-card::after {
     background: radial-gradient(520px circle at var(--sx, 50%) var(--sy, 50%), rgba(56, 189, 248, 0.22), transparent 62%);
 }

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

 .animated-border {
     position: relative;
 }

 .animated-border::before {
     content: '';
     position: absolute;
     inset: 0;
     border-radius: inherit;
     padding: 1px;
     background: linear-gradient(90deg, rgba(37, 99, 235, 0.65), rgba(6, 182, 212, 0.65), rgba(14, 165, 233, 0.65));
     background-size: 220% 220%;
     opacity: 0;
     transition: opacity 260ms ease;
     -webkit-mask:
         linear-gradient(#000 0 0) content-box,
         linear-gradient(#000 0 0);
     mask:
         linear-gradient(#000 0 0) content-box,
         linear-gradient(#000 0 0);
     -webkit-mask-composite: xor;
     mask-composite: exclude;
 }

 .animated-border:hover::before {
     opacity: 1;
     animation: borderShift 3.8s ease-in-out infinite;
 }

 .faq-item[open].animated-border::before {
     opacity: 1;
     animation: borderShift 3.8s ease-in-out infinite;
 }

 @keyframes borderShift {
     0% { background-position: 0% 50%; }
     50% { background-position: 100% 50%; }
     100% { background-position: 0% 50%; }
 }

 .skill-card,
 .project-card {
     background-image: radial-gradient(800px circle at 20% 10%, rgba(59, 130, 246, 0.10), transparent 40%);
 }

 html.dark .skill-card,
 html.dark .project-card {
     background-image:
         radial-gradient(800px circle at 20% 10%, rgba(59, 130, 246, 0.12), transparent 45%),
         radial-gradient(600px circle at 80% 20%, rgba(236, 72, 153, 0.10), transparent 45%);
 }

 .ref-name-banner {
    width: 100%;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    font-size: 1.15rem;
    font-weight: 700;
    color: #f1f5f9;
    letter-spacing: -0.01em;
    padding: 1rem 1.5rem;
    text-align: center;
}

 .project-card:hover .ref-name-banner {
    background: linear-gradient(135deg, #1e3a5f 0%, #1e293b 100%);
}

.customer-projects-swap {
   position: relative;
   height: 600px;
   max-width: 980px;
   margin: 0 auto;
   perspective: 900px;
   overflow: visible;
}

.customer-project-card {
   position: absolute;
   top: 50%;
   left: 50%;
   width: min(92vw, 760px);
   height: 430px;
   display: block;
   border-radius: 1rem;
   overflow: hidden;
   border: 1px solid rgba(148, 163, 184, 0.28);
   background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
   box-shadow: 0 14px 34px rgba(15, 23, 42, 0.1);
   opacity: var(--cp-opacity, 1);
   pointer-events: none;
   transform: translate3d(calc(-50% + var(--cp-x, 0px)), calc(-50% + var(--cp-y, 0px)), var(--cp-z, 0px)) skewY(var(--cp-skew, 0deg));
   transform-origin: center center;
   z-index: var(--cp-z-index, 1);
   transition: transform 0.8s cubic-bezier(0.22, 0.8, 0.2, 1), opacity 0.8s ease, box-shadow 0.5s ease, border-color 0.5s ease;
   will-change: transform;
   backface-visibility: hidden;
   -webkit-backface-visibility: hidden;
}

.customer-project-card.is-active {
   pointer-events: auto;
}

.customer-project-card.is-active:hover {
   box-shadow: 0 20px 42px rgba(15, 23, 42, 0.18);
   border-color: rgba(14, 165, 233, 0.5);
}

.customer-project-media {
   width: 100%;
   height: 255px;
   overflow: hidden;
   background: #0f172a;
}

.customer-project-media img {
   width: 100%;
   height: 100%;
   object-fit: cover;
   display: block;
   transition: transform 0.45s ease;
}

.customer-project-card.is-active:hover .customer-project-media img {
   transform: scale(1.04);
}

.customer-project-body {
   padding: 1.25rem 1.25rem 1.5rem;
}

.customer-project-tag {
   font-size: 0.72rem;
   letter-spacing: 0.14em;
   font-weight: 700;
   color: #0284c7;
   margin-bottom: 0.45rem;
}

.customer-projects-dots {
   margin-top: 1.2rem;
   display: flex;
   justify-content: center;
   gap: 0.5rem;
}

.customer-projects-dots span {
   width: 0.56rem;
   height: 0.56rem;
   border-radius: 999px;
   background: rgba(100, 116, 139, 0.32);
   transition: transform 0.25s ease, background-color 0.25s ease;
}

.customer-projects-dots span.is-active {
   background: #0ea5e9;
   transform: scale(1.2);
}

html.dark .customer-project-card {
   border-color: rgba(51, 65, 85, 0.75);
   background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88));
   box-shadow: 0 18px 42px rgba(2, 6, 23, 0.45);
}

html.dark .customer-project-card.is-active:hover {
   border-color: rgba(56, 189, 248, 0.55);
   box-shadow: 0 22px 52px rgba(2, 6, 23, 0.6);
}

html.dark .customer-project-tag {
   color: #38bdf8;
}

html.dark .customer-projects-dots span {
   background: rgba(100, 116, 139, 0.5);
}

html.dark .customer-projects-dots span.is-active {
   background: #38bdf8;
}

@media (max-width: 768px) {
   .customer-projects-swap {
      height: 500px;
   }

   .customer-project-card {
      width: min(94vw, 640px);
      height: 390px;
   }

   .customer-project-media {
      height: 220px;
   }
}

@media (max-width: 520px) {
   .customer-projects-swap {
      height: 480px;
   }

   .customer-project-card {
      width: min(95vw, 520px);
      height: 370px;
   }

   .customer-project-media {
      height: 200px;
   }
}

@media (max-width: 1024px) {
    .services-stack {
        display: block !important;
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }

    .services-stack .scroll-stack-card {
        position: relative;
        margin-bottom: 1rem;
        z-index: 1;
        border: 1px solid rgba(148, 163, 184, 0.32);
        box-shadow: 0 10px 28px rgba(2, 6, 23, 0.14);
        opacity: var(--card-opacity, 0.82);
        transform: scale(var(--card-scale, 0.95));
        transform-origin: center center;
        transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
    }

    .services-stack .scroll-stack-card.reveal,
    .services-stack .scroll-stack-card.reveal.is-visible {
        opacity: var(--card-opacity, 0.82);
        transform: scale(var(--card-scale, 0.95));
    }

    .services-stack .scroll-stack-card.is-focus {
        z-index: 12;
        opacity: 1;
        transform: scale(var(--card-scale, 1.02));
        border-color: rgba(14, 165, 233, 0.55);
        box-shadow: 0 22px 44px rgba(2, 6, 23, 0.24);
    }

    .services-stack .scroll-stack-card.is-focus.reveal,
    .services-stack .scroll-stack-card.is-focus.reveal.is-visible {
        opacity: 1;
        transform: scale(var(--card-scale, 1.02));
    }
}

@media (prefers-reduced-motion: reduce) {
    .services-stack .scroll-stack-card,
    .services-stack .scroll-stack-card > p,
    .services-stack .scroll-stack-card > a {
        transition: none;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

 html.dark ::-webkit-scrollbar-track {
     background: #0b1220;
 }

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #1d4ed8, #7c3aed);
}

/* Navigation animations */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

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

/* Mobile menu animations */
#mobile-menu {
    transition: all 0.3s ease;
    transform-origin: top;
}

#mobile-menu.hidden {
    opacity: 0;
    transform: scaleY(0);
}

#mobile-menu.show {
    opacity: 1;
    transform: scaleY(1);
}

/* Hero section animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.animate-fade-in-up {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-down {
    animation: fadeInDown 0.8s ease-out;
}

.animate-pulse-slow {
    animation: pulse 3s ease-in-out infinite;
}

/* Skill cards animation */
.skill-card {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.skill-card:hover::before {
    left: 100%;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

/* Project cards animation */
.project-card {
    transition: all 0.3s ease;
    position: relative;
}

.project-card:hover {
    transform: translateY(-10px);
}

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

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Form styling */
.form-input {
    transition: all 0.3s ease;
}

.form-input:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* Button animations */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 0;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* Dark mode styles */
html.dark {
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --border-color: #374151;
}

html.dark body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

html.dark .bg-white {
    background-color: var(--bg-secondary) !important;
}

html.dark .bg-gray-50 {
    background-color: #1f2937 !important;
}

html.dark .text-gray-600 {
    color: var(--text-secondary) !important;
}

html.dark .text-gray-700 {
    color: var(--text-primary) !important;
}

html.dark .text-gray-900 {
    color: var(--text-primary) !important;
}

html.dark .border-gray-300 {
    border-color: var(--border-color) !important;
}

html.dark #navbar {
    background-color: rgba(17, 24, 39, 0.9) !important;
}

html.dark .skill-card,
html.dark .project-card {
    background-color: var(--bg-secondary) !important;
}

html.dark .bg-gray-100 {
    background-color: #374151 !important;
}

html.dark .bg-gray-200 {
    background-color: #4b5563 !important;
}

/* Loading animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Success message animation */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-message {
    animation: slideInUp 0.5s ease-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .skill-card,
    .project-card {
        margin-bottom: 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for better accessibility */
button:focus,
a:focus,
input:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    nav,
    #contact,
    footer {
        display: none;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .project-card,
    .skill-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
