/* アニメーション用CSS */

/* フェードインアニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* スケールアニメーション */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 回転フェードイン */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

/* グラデーションアニメーション */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* パルスアニメーション */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* 浮遊アニメーション */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* シャインエフェクト */
@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* タイプライターエフェクト */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  50% {
    border-color: transparent;
  }
}

/* アニメーションクラス */
.animate-on-scroll {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-on-scroll.animated {
  opacity: 1;
}

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

.fade-in-left {
  animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s ease forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s ease forwards;
}

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

.rotate-in {
  animation: rotateIn 0.8s ease forwards;
}

/* 遅延アニメーション */
.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

.delay-5 {
  animation-delay: 0.5s;
}

.delay-6 {
  animation-delay: 0.6s;
}

/* ファーストビューのアニメーション */
.infinity-hero-section {
  position: relative;
  overflow: hidden;
}

.infinity-hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, #667eea, #764ba2, #667eea, #764ba2);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  opacity: 0.1;
  z-index: 0;
}

.infinity-hero-section > * {
  position: relative;
  z-index: 1;
}

/* SVGタイトルのアニメーション */
.infinity-svg-title {
  animation: fadeInUp 1s ease forwards;
}

/* メインタイトルのアニメーション */
.infinity-title {
  animation: fadeIn 1s ease 0.3s forwards;
  opacity: 0;
}

/* リード文のアニメーション */
.infinity-lead {
  animation: fadeIn 1s ease 0.6s forwards;
  opacity: 0;
}

/* ハイライトテキストのアニメーション */
.infinity-highlight {
  position: relative;
  display: inline-block;
}

.infinity-highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.6s ease;
}

.infinity-highlight.animated::after {
  transform: scaleX(1);
}

/* セクションタイトルのアニメーション */
.section-title {
  position: relative;
}

.section-title::after {
  animation: scaleIn 0.6s ease 0.3s forwards;
  transform: scale(0);
}

/* カードのスタガードアニメーション */
.website-features-grid .feature-card,
.tech-stack-grid .tech-category,
.industry-grid .industry-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.website-features-grid .feature-card.animated,
.tech-stack-grid .tech-category.animated,
.industry-grid .industry-card.animated {
  opacity: 1;
  transform: translateY(0);
}

/* アイコンの浮遊アニメーション */
.feature-icon,
.industry-icon {
  animation: float 3s ease-in-out infinite;
}

.feature-icon:hover,
.industry-icon:hover {
  animation: pulse 0.6s ease;
}

/* 技術タグのシャインエフェクト */
.tech-tag {
  position: relative;
  overflow: hidden;
}

.tech-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.6s ease;
}

.tech-tag:hover::before {
  left: 100%;
}

/* 実績数値のカウントアップアニメーション */
.stat-number {
  position: relative;
  overflow: hidden;
}

.stat-number.counting {
  animation: pulse 0.6s ease;
}

/* セキュリティカードのアニメーション */
.security-card {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.security-card:nth-child(2) {
  transform: translateX(30px);
}

.security-card.animated {
  opacity: 1;
  transform: translateX(0);
}

/* 実績数値カードのアニメーション */
.stat-item {
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stat-item.animated {
  opacity: 1;
  transform: scale(1);
}

/* ボタンのアニメーション */
.infinity-badge {
  animation: pulse 2s ease-in-out infinite;
}

/* ローディングアニメーション */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .fade-in-left,
  .fade-in-right {
    animation: fadeIn 0.8s ease forwards;
  }
  
  .security-card {
    transform: translateY(30px);
  }
  
  .security-card:nth-child(2) {
    transform: translateY(30px);
  }
}

/* パフォーマンス最適化 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
