/* ============================================================
   mzkksaw portfolio — custom styles (перед Tailwind-утилитами)
   ============================================================ */

/* ---------- Навигация: анимированное подчеркивание ---------- */
.nav-link {
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, #6366f1, #a855f7, #f97316);
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.8);
}
.nav-link:hover::after,
.nav-link.active::after {
  width: 70%;
}

/* ---------- Магнитные кнопки ---------- */
[data-magnetic] {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

/* ---------- Shimmer-блик по кнопке ---------- */
.btn-magnetic {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.btn-shimmer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.35) 50%,
    transparent 60%
  );
  transform: translateX(-120%) skewX(-15deg);
  animation: shimmer-sweep 3.2s ease-in-out infinite;
}
@keyframes shimmer-sweep {
  0%, 55% { transform: translateX(-120%) skewX(-15deg); }
  75%     { transform: translateX(120%) skewX(-15deg); }
  100%    { transform: translateX(120%) skewX(-15deg); }
}

/* ---------- Ripple-волна в точке клика ---------- */
.ripple {
  position: absolute;
  z-index: 0;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 70%);
  transform: scale(0);
  animation: ripple-wave 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes ripple-wave {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ---------- Переливающийся градиентный текст ---------- */
.gradient-shimmer-text {
  background: linear-gradient(90deg, #6366f1, #a855f7, #f97316, #a855f7, #6366f1);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-flow 6s linear infinite;
}
@keyframes gradient-flow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ---------- Пульсирующий бейдж в Hero ---------- */
.animate-badge-pulse {
  animation: badge-pulse 2.4s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3), 0 0 30px rgba(99, 102, 241, 0.1);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 30px rgba(168, 85, 247, 0.55), 0 0 60px rgba(249, 115, 22, 0.2);
    transform: scale(1.03);
  }
}

/* ---------- Медленный bounce для стрелки ---------- */
.animate-bounce-slow {
  animation: bounce-slow 1.8s ease-in-out infinite;
}
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(5px); }
}

/* ---------- Пульсирующая рамка «Хит продаж» ---------- */
.hit-card {
  animation: hit-border 2.2s ease-in-out infinite;
}
@keyframes hit-border {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.5), 0 0 25px rgba(168, 85, 247, 0.25);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.9), 0 0 55px rgba(168, 85, 247, 0.5), 0 0 90px rgba(249, 115, 22, 0.2);
  }
}

/* ---------- Spotlight-подсветка границ за курсором ---------- */
.spotlight-card {
  position: relative;
  overflow: hidden;
}
.spotlight-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(
    220px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(168, 85, 247, 0.9),
    rgba(99, 102, 241, 0.5) 40%,
    transparent 70%
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.spotlight-card:hover::before {
  opacity: 1;
}
/* мягкое внутреннее свечение */
.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    320px circle at var(--spot-x, 50%) var(--spot-y, 50%),
    rgba(99, 102, 241, 0.08),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.spotlight-card:hover::after {
  opacity: 1;
}
/* контент карточки выше свечения */
.spotlight-card > * {
  position: relative;
  z-index: 1;
}

/* ---------- Tilt 3D (perspective ставит JS) ---------- */
.tilt-card {
  transform-style: preserve-3d;
  transition: transform 0.25s ease-out, box-shadow 0.4s ease;
  will-change: transform;
}

/* ---------- Reveal при скролле ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Неоновый спиннер ---------- */
.neon-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: #6366f1;
  border-right-color: #a855f7;
  animation: spin 0.9s linear infinite;
  filter: drop-shadow(0 0 12px rgba(99, 102, 241, 0.7));
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Активная кнопка переключателя устройств ---------- */
.active-device {
  background: linear-gradient(90deg, #6366f1, #a855f7);
  color: #fff !important;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}

/* ---------- Рамка устройства (Планшет / Телефон) ---------- */
.device-frame {
  border-radius: 1rem;
  border: 1px solid rgba(63, 63, 70, 0.8); /* zinc-700/80 */
  box-shadow:
    0 25px 60px -12px rgba(0, 0, 0, 0.7),
    0 0 40px rgba(99, 102, 241, 0.12),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

/* ---------- Header при скролле ---------- */
header.scrolled #header-inner {
  background: rgba(18, 18, 26, 0.85);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(99, 102, 241, 0.12);
}

/* ---------- Инфо-шторка: заголовки из JS ---------- */
#info-content h4 {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
#info-content ul {
  margin: 0.25rem 0 0.75rem 0;
  padding-left: 1.1rem;
  list-style: none;
}
#info-content li::before {
  content: "✦ ";
  color: #a855f7;
}
#info-content p + p {
  margin-top: 0.75rem;
}
#info-content .outro-plate {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(249, 115, 22, 0.35);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(168, 85, 247, 0.12), rgba(249, 115, 22, 0.12));
  box-shadow: 0 0 24px rgba(168, 85, 247, 0.15);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  line-height: 1.6;
}
#info-content .outro-plate::before {
  content: "🎯 ";
}

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar {
  width: 9px;
}
::-webkit-scrollbar-track {
  background: #08080d;
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6366f1, #a855f7);
  border-radius: 8px;
}

/* ---------- Уважение к reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
