.bg-grid-pattern {
  background-size: 40px 40px;
  background-image: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}
.dark .bg-grid-pattern {
  background-image: linear-gradient(
      to right,
      rgba(255, 255, 255, 0.05) 1px,
      transparent 1px
    ),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

.bg-noise {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
}

.preserve-3d {
  transform-style: preserve-3d;
}
.perspective-1000 {
  perspective: 1000px;
}
.backface-hidden {
  backface-visibility: hidden;
}
.parallax-img {
  will-change: transform;
}
.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

#preloader {
  transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.6s;
}
#preloader.hide {
  opacity: 0;
  visibility: hidden;
}

/* Toast Animation */
.toast-enter {
  transform: translateY(100%) scale(0.9);
  opacity: 0;
}
.toast-enter-active {
  transform: translateY(0) scale(1);
  opacity: 1;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.toast-exit {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.toast-exit-active {
  transform: translateY(20px) scale(0.9);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

*:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 4px;
}

/* Filter Button Active State */
.filter-btn.active {
  background-color: #2563eb;
  color: white;
  border-color: #2563eb;
}
.dark .filter-btn.active {
  color: white;
}

/* Spotlight & Hover Effects */
.spotlight-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.4s ease;
}
.spotlight-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}
.dark .spotlight-card:hover {
  box-shadow: 0 20px 40px -10px rgba(255, 255, 255, 0.05);
}
.spotlight-overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(
    600px circle at var(--mouse-x) var(--mouse-y),
    rgba(37, 99, 235, 0.1),
    transparent 40%
  );
  z-index: 20;
}
.spotlight-card:hover .spotlight-overlay {
  opacity: 1;
}

/* Modern Scroll Reveal */
.reveal-on-scroll {
  opacity: 0;
  filter: blur(10px);
  transform: translateY(30px) scale(0.95);
  transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, filter, transform;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0) scale(1);
}

/* Stagger Delays */
.delay-100 {
  transition-delay: 100ms;
}
.delay-200 {
  transition-delay: 200ms;
}
.delay-300 {
  transition-delay: 300ms;
}
.delay-400 {
  transition-delay: 400ms;
}

/* Magnetic Button Effect Base Class */
.magnetic-btn {
  display: inline-block;
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== HERO SECTION ANIMATIONS ===== */
@keyframes heroFadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes badgeReveal {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes heroHeadingReveal {
  from {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes profileImageEnter {
  from {
    opacity: 0;
    transform: scale(0.85) rotateY(20deg);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) rotateY(0);
    filter: blur(0);
  }
}

@keyframes circleRotateIn {
  from {
    opacity: 0;
    transform: rotate(90deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes glowPulse {
  0%,
  100% {
    filter: drop-shadow(0 0 20px rgba(37, 99, 235, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 40px rgba(37, 99, 235, 0.6));
  }
}

@keyframes buttonScaleIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Hero Badge Animation */
.hero-badge {
  animation: badgeReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.1s;
}

/* Hero Heading Lines Animation */
.hero-heading-line {
  animation: heroHeadingReveal 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.hero-heading-line:nth-child(1) {
  animation-delay: 0.2s;
}
.hero-heading-line:nth-child(2) {
  animation-delay: 0.35s;
}
.hero-heading-line:nth-child(3) {
  animation-delay: 0.5s;
}

/* Hero Paragraph Animation */
.hero-description {
  animation: heroFadeInUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.65s;
  opacity: 0;
}

/* Hero Buttons Container Animation */
.hero-buttons {
  animation: heroFadeInUp 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.8s;
  opacity: 0;
}

/* Hero Image Container Animation */
.hero-image-container {
  animation: profileImageEnter 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.4s;
  opacity: 0;
  perspective: 1000px;
}

/* Circular Elements Animation */
.hero-circle-outer {
  animation: circleRotateIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.5s;
  opacity: 0;
}

.hero-circle-middle {
  animation: circleRotateIn 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.6s;
  opacity: 0;
  animation-direction: reverse;
}

/* Profile Image Glow Effect */
.hero-image-glow {
  animation: glowPulse 3s ease-in-out infinite;
  animation-delay: 1.4s;
}

/* Hero Profile Image */
.hero-profile-img {
  animation: profileImageEnter 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: 0.4s;
}
/* .fa-arrow-down {
  margin-bottom: 0.7rem;
  margin-left: 1rem;
} */

@media (max-width: 768px) {
  /* .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  .bento-card {
    padding: 1.5rem !important;
  } */
  .hero-image-container {
    height: 200px !important;
    margin-top: 2.5rem;
  }
  .arsenalhh h3,
  .arsenalhh p {
    display: none;
  }
  .arsenalhh {
    height: 108px;
  }
  .bento-card {
    display: flex !important;
    flex-direction: row !important;
  }
  .bento-card .ikkinchi {
    margin-right: 5rem;
  }
  .container {
    padding-right: 1rem;
    padding-left: 1rem;
  }
}
/* === FIX: My Arsenal "Based in" mobile layout === */
@media (max-width: 768px) {
  .bento-card .ikkinchi {
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: space-between; */
    gap: 3rem;
    margin-top: 3rem;
  }

  .bento-card .ikkinchi p#local-time {
    font-size: 1.25rem; /* 20px */
    line-height: 1.2;
  }
  .kingquote {
    margin-top: 5rem !important;
  }
  .experience-section,
  .project-section,
  .contact-section,
  .skills-section,
  .about-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
  .project-h2 {
    align-items: center !important;
  }
  .project-filters {
    gap: 0.1rem !important;
    margin-bottom: 1.6rem;
    justify-content: center;
  }
  footer {
    margin-top: 2rem !important;
  }
  .fa-arrow-down {
    margin-top: 0.5rem;
    margin-left: 1.5px;
  }
  .about-h2 {
    text-align: center;
  }
  .filter-btn {
    padding-left: 1.2rem;
    padding-right: 1.2rem;
  }
}
/* === FIX: Skills descriptions visible on mobile === */
@media (max-width: 768px) {
  #services .spotlight-card p {
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 20;
  }

  #services .spotlight-overlay {
    opacity: 0.25; /* spotlightni yumshatamiz */
  }
}
/* === FIX: Project descriptions on mobile === */
@media (max-width: 768px) {
  #projects-grid .project-item h3,
  #projects-grid .project-item p {
    position: relative;
    z-index: 30;
    opacity: 1 !important;
  }

  #projects-grid .spotlight-overlay {
    opacity: 0.3;
  }
}
