:root {
  --gap: 200px;
  --card-width: 180px;
  /* Reduced from 216px */
  --card-height: 225px;
  /* 180 * 1.25 (4:5 ratio) */
  --anim-speed: 0.8s;
}

.magnetic-section {
  position: relative;
  height: 900px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  perspective: 1000px;
  background: var(--bg-primary, #f8fafc);
}

.magnetic-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
}

.center-magnet {
  position: relative;
  z-index: 100;
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  padding: 16px 36px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 12px 40px rgba(188, 24, 136, 0.4);
  overflow: hidden;
  border: none;
}

.center-magnet::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transform: rotate(45deg);
  transition: all 0.6s;
  pointer-events: none;
}

.center-magnet:hover::before {
  left: 100%;
}

.center-magnet svg {
  width: 24px;
  fill: #fff;
  stroke: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  transition: transform 0.3s;
}

.center-magnet:hover {
  transform: scale(1.05) translateY(-4px);
  box-shadow: 0 16px 56px rgba(188, 24, 136, 0.5);
  color: #fff;
  border-color: transparent;
}

.center-magnet:hover svg {
  stroke: none;
  transform: scale(1.1);
}

.mag-item {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);

  top: 50%;
  left: 50%;
  margin-top: calc(var(--card-height) / -2);
  margin-left: calc(var(--card-width) / -2);

  opacity: 0;
  transform: translate(0, 0) scale(0.2) rotate(45deg);
  transition: all var(--anim-speed) cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 10;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.mag-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.4s, transform 0.4s;
  /* filter: grayscale(100%); */
}

.magnetic-container.active .mag-item {
  opacity: 1;
  transform: translate(var(--tx), var(--ty)) scale(1) rotate(0deg);
  transition-delay: calc(var(--i) * 0.06s);
}

.mag-item:hover {
  z-index: 50;
  transition-delay: 0s !important;
  transform: translate(var(--tx), var(--ty)) scale(1.15) rotate(0deg) !important;
  border-color: var(--brand, #60a5fa);
  box-shadow: 0 15px 40px rgba(96, 165, 250, 0.2);
}

.mag-item:hover img {
  opacity: 1;
  filter: grayscale(0%);
  transform: scale(1.1);
}

.mag-item:nth-of-type(1) {
  --tx: -280px;
  --ty: -180px;
}

.mag-item:nth-of-type(2) {
  --tx: 0px;
  --ty: -240px;
}

.mag-item:nth-of-type(3) {
  --tx: 280px;
  --ty: -180px;
}

.mag-item:nth-of-type(4) {
  --tx: 340px;
  --ty: 0px;
}

.mag-item:nth-of-type(5) {
  --tx: 280px;
  --ty: 180px;
}

.mag-item:nth-of-type(6) {
  --tx: 0px;
  --ty: 240px;
}

.mag-item:nth-of-type(7) {
  --tx: -280px;
  --ty: 180px;
}

.mag-item:nth-of-type(8) {
  --tx: -340px;
  --ty: 0px;
}

.mag-item:nth-of-type(9) {
  --tx: 380px;
  --ty: 120px;
}

.mag-item:nth-of-type(10) {
  --tx: -380px;
  --ty: -120px;
}

@media (max-width: 768px) {
  :root {
    --card-width: 120px;
    --card-height: 150px;
  }

  .magnetic-section {
    height: 600px;
  }

  .mag-item:nth-of-type(1) {
    --tx: -110px;
    --ty: -130px;
  }

  .mag-item:nth-of-type(2) {
    --tx: 110px;
    --ty: -130px;
  }

  .mag-item:nth-of-type(3) {
    --tx: -140px;
    --ty: 0px;
  }

  .mag-item:nth-of-type(4) {
    --tx: 140px;
    --ty: 0px;
  }

  .mag-item:nth-of-type(5) {
    --tx: -110px;
    --ty: 130px;
  }

  .mag-item:nth-of-type(6) {
    --tx: 110px;
    --ty: 130px;
  }

  .mag-item:nth-of-type(7) {
    --tx: 0px;
    --ty: -175px;
  }

  .mag-item:nth-of-type(8) {
    --tx: 0px;
    --ty: 175px;
  }

  .mag-item:nth-of-type(9) {
    --tx: -150px;
    --ty: -210px;
  }

  .mag-item:nth-of-type(10) {
    --tx: 150px;
    --ty: 210px;
  }
}