:root {
  --primary-gradient: linear-gradient(135deg, #3b82f6 0%, #a855f7 50%, #ec4899 100%);
  --dark-bg: #0f172a;
  --darker-bg: #020617;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(180deg, #020617 0%, #0f172a 60%, #020617 100%);
  color: #f1f5f9;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.2;
}

a {
  text-decoration: none;
  transition: all 0.3s ease;
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8b5cf6 0%, #6366f1 100%);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a78bfa 0%, #818cf8 100%);
}

::selection {
  background: #8b5cf6;
  color: #ffffff;
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }
}

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

.animate-gradient {
  background-size: 200% 200%;
  animation: gradient 15s ease infinite;
}

.category-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(168, 85, 247, 0.15);
}

.category-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.5), rgba(59, 130, 246, 0.5), transparent);
  background-size: 200% 100%;
  animation: shimmer-line 4s ease infinite;
}

@keyframes shimmer-line {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.category-header-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #d8b4fe;
  font-weight: 600;
  transition: all 0.3s ease;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid transparent;
}

.back-btn:hover {
  color: #ffffff;
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.2);
}

.search-bar-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.search-input {
  width: 100%;
  max-width: 42rem;
  margin: 0 auto;
  display: block;
  padding: 0.85rem 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(168, 85, 247, 0.15);
  border-radius: 1rem;
  color: #ffffff;
  outline: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

.search-input:focus {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15), 0 8px 32px rgba(168, 85, 247, 0.1);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.search-input::placeholder {
  color: rgba(148, 163, 184, 0.6);
  font-weight: 300;
}

.projects-grid-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem 5rem 1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 1.5rem;
}

@keyframes card-enter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.96);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.projects-grid > * {
  animation: card-enter 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.projects-grid > *:nth-child(1) { animation-delay: 0.05s; }
.projects-grid > *:nth-child(2) { animation-delay: 0.1s; }
.projects-grid > *:nth-child(3) { animation-delay: 0.15s; }
.projects-grid > *:nth-child(4) { animation-delay: 0.2s; }
.projects-grid > *:nth-child(5) { animation-delay: 0.25s; }
.projects-grid > *:nth-child(6) { animation-delay: 0.3s; }
.projects-grid > *:nth-child(7) { animation-delay: 0.35s; }
.projects-grid > *:nth-child(8) { animation-delay: 0.4s; }
.projects-grid > *:nth-child(9) { animation-delay: 0.42s; }
.projects-grid > *:nth-child(10) { animation-delay: 0.44s; }
.projects-grid > *:nth-child(n+11) { animation-delay: 0.46s; }

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-header-wrap, .search-bar-wrap, .projects-grid-wrap {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .category-header-wrap, .search-bar-wrap, .projects-grid-wrap {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

@media (min-width: 1280px) {
  .projects-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.category-footer {
  background: rgba(2, 6, 23, 0.6);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid rgba(168, 85, 247, 0.1);
  padding: 1.5rem 0;
  position: relative;
}

.category-footer::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168, 85, 247, 0.4), rgba(59, 130, 246, 0.4), transparent);
}

.category-footer-wrap {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (min-width: 640px) {
  .category-footer-wrap {
    flex-direction: row;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

.glowing-card {
  position: relative;
}
.glowing-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: radial-gradient(350px circle at var(--mouse-x, 0px) var(--mouse-y, 0px), rgba(168, 85, 247, 0.4), transparent 50%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.glowing-card:hover::before {
  opacity: 1;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(168, 85, 247, 0.3);
  border-radius: 8px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(168, 85, 247, 0.6);
}

.noise-overlay::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}
#inline-sidebar.collapsed {
  width: 0px !important;
  border-right-width: 0px !important;
}

#sidebar-backdrop.active {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#inline-iframe.device-mobile {
  width: 375px !important;
}

#inline-iframe.device-tablet {
  width: 768px !important;
}

/* Splash Loader & FLIP Heading Animation */
#splash-loader {
  background-color: #020617;
  overflow: hidden;
}

#splash-logo-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  will-change: transform;
}

.splash-logo-animate {
  animation: logo-entrance 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes logo-entrance {
  0% {
    transform: scale(0.85);
    opacity: 0;
    filter: blur(8px);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: blur(0px);
  }
}

/* Shiny sweep animation for loader text colored components */
.splash-loader-text .bg-gradient-to-r,
.splash-loader-text .text-purple-400,
.splash-loader-text .text-pink-400 {
  background: linear-gradient(
    90deg,
    #60a5fa 0%,
    #a855f7 25%,
    #ec4899 50%,
    #a855f7 75%,
    #60a5fa 100%
  ) !important;
  background-size: 200% auto !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  animation: shiny-sweep 2.5s linear infinite !important;
  filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.3));
}

@keyframes shiny-sweep {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.splash-logo-shadow-glow {
  position: absolute;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.3) 0%, rgba(59, 130, 246, 0.1) 50%, transparent 75%);
  filter: blur(35px);
  pointer-events: none;
  animation: pulse-glow 3s ease-in-out infinite;
  z-index: -1;
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

/* Staggered slide and fade-in classes for landing sections */
.stagger-prepare {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1.6s cubic-bezier(0.16, 1, 0.3, 1), transform 1.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, opacity;
}

.stagger-fade-in {
  opacity: 1 !important;
  transform: translateY(0) !important;
}


