/* ==========================================================================
   Animations — Subtle & Tasteful
   名前診断スタジオ — 和モダン × ぬくもり
   ========================================================================== */

/* =======================================================================
   Keyframes
   ======================================================================= */

/* Fade in from below */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide up entrance */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slide in from left */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Slide in from right */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Scale in — for modals, cards */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Count up — used alongside JS, applies pulse on number change */
@keyframes countUp {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(8px);
  }
  60% {
    opacity: 1;
    transform: scale(1.1) translateY(-2px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Gentle pulse for emphasis */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.9;
  }
}

/* Soft breathing pulse — less aggressive */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

/* Loading shimmer — skeleton screens */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Float — gentle up-and-down hover */
@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}

/* Rotate — for loading spinners */
@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Draw line — for SVG path animations */
@keyframes drawLine {
  from {
    stroke-dashoffset: 1000;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Pop in — for step numbers, badges */
@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}

/* Reveal — clip-path based reveal */
@keyframes reveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

/* =======================================================================
   Utility Classes
   ======================================================================= */

.animate-fade-in {
  animation: fadeIn 0.6s ease forwards;
}

.animate-slide-up {
  animation: slideUp 0.6s ease forwards;
}

.animate-slide-in-left {
  animation: slideInLeft 0.5s ease forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.5s ease forwards;
}

.animate-scale-in {
  animation: scaleIn 0.4s ease forwards;
}

.animate-count-up {
  animation: countUp 0.5s var(--transition-spring) forwards;
}

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

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

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

.animate-pop-in {
  animation: popIn 0.5s var(--transition-spring) forwards;
}

.animate-shimmer {
  position: relative;
  overflow: hidden;
}

.animate-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 248, 240, 0.6) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

/* =======================================================================
   Staggered Animation Delays
   ======================================================================= */

.animate-delay-1 { animation-delay: 100ms; }
.animate-delay-2 { animation-delay: 200ms; }
.animate-delay-3 { animation-delay: 300ms; }
.animate-delay-4 { animation-delay: 400ms; }
.animate-delay-5 { animation-delay: 500ms; }
.animate-delay-6 { animation-delay: 600ms; }

/* =======================================================================
   Animation Duration Modifiers
   ======================================================================= */

.animate-fast    { animation-duration: 0.3s; }
.animate-normal  { animation-duration: 0.6s; }
.animate-slow    { animation-duration: 1s; }
.animate-slower  { animation-duration: 1.5s; }

/* =======================================================================
   Transition Utilities
   ======================================================================= */

.transition {
  transition-property: color, background-color, border-color, box-shadow, transform, opacity;
  transition-duration: 300ms;
  transition-timing-function: ease;
}

.transition-fast {
  transition-duration: 150ms;
}

.transition-slow {
  transition-duration: 500ms;
}

.transition-transform {
  transition-property: transform;
  transition-duration: 300ms;
  transition-timing-function: ease;
}

.transition-opacity {
  transition-property: opacity;
  transition-duration: 300ms;
  transition-timing-function: ease;
}

/* Hover transforms */
.hover-lift:hover {
  transform: translateY(-2px);
}

.hover-scale:hover {
  transform: scale(1.02);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(212, 168, 83, 0.2);
}

/* =======================================================================
   Skeleton Loading
   ======================================================================= */

.skeleton {
  background-color: var(--color-cream);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton--text {
  height: 1em;
  width: 100%;
  margin-bottom: var(--space-2);
}

.skeleton--text-short {
  width: 60%;
}

.skeleton--heading {
  height: 1.5em;
  width: 80%;
  margin-bottom: var(--space-4);
}

.skeleton--circle {
  border-radius: 50%;
}

.skeleton--card {
  height: 200px;
  border-radius: var(--radius-lg);
}


/* =======================================================================
   Reduced Motion — Accessibility
   ======================================================================= */

@media (prefers-reduced-motion: reduce) {
  .animate-fade-in,
  .animate-slide-up,
  .animate-slide-in-left,
  .animate-slide-in-right,
  .animate-scale-in,
  .animate-count-up {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .animate-pulse,
  .animate-breathe,
  .animate-float {
    animation: none;
  }

  .animate-shimmer::after,
  .skeleton::after {
    animation: none;
  }

  .hover-lift:hover,
  .hover-scale:hover {
    transform: none;
  }

  .transition,
  .transition-fast,
  .transition-slow,
  .transition-transform,
  .transition-opacity {
    transition: none;
  }
}
