/**
 * Background Patterns
 * メッシュパターン・ドットパターン・グラデーションオーバーレイ
 */

/* ===================================
 * Mesh Background Pattern
 * =================================== */
.l-section::before {
  display: none; /* Temporarily disabled for visibility */
}

@keyframes meshFloat {
  0%, 100% {
    background-position: 0 0, 40px 60px, 130px 270px;
  }
  50% {
    background-position: 100px 100px, 140px 160px, 230px 370px;
  }
}

.l-section {
  position: relative;
  overflow: hidden;
}

.l-section > .l-inner {
  position: relative;
  z-index: 1;
}

/* Hero セクションは別の背景を持つのでメッシュを無効化 */
.p-hero::before {
  display: none;
}

/* ===================================
 * Dot Pattern Background
 * =================================== */
.l-section::after {
  display: none; /* Temporarily disabled for visibility */
}

@keyframes dotPulse {
  0%, 100% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.15;
  }
}

.p-hero::after {
  display: none;
}

/* ===================================
 * Section Gradient Overlays
 * =================================== */
.p-service {
  background: #ffffff;
}

.p-works {
  background: #f9f9f9;
}

.p-news {
  background: #ffffff;
}

/* ===================================
 * Neural Network Style Mesh
 * =================================== */
.p-hero__mesh {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 1;
  animation: meshMove 20s linear infinite;
}

@keyframes meshMove {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 60px 60px;
  }
}

/* ===================================
 * Contact CTA Background Enhancement
 * =================================== */
.p-contact-cta {
  position: relative;
  background: linear-gradient(135deg, #007a8a, #006064, #006064);
  background-size: 200% 200%;
  animation: gradientShift 15s ease infinite;
  overflow: hidden;
}

.p-contact-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.2) 0%, transparent 70%);
  animation: rotateGlow 30s linear infinite;
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.p-contact-cta > * {
  position: relative;
  z-index: 1;
}

/* ===================================
 * Glassmorphism Section Backgrounds
 * =================================== */
.c-card--glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at top right, rgba(0, 229, 255, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.5s;
  pointer-events: none;
}

.c-card--glass:hover::before {
  opacity: 1;
}

/* ===================================
 * Floating Particles Background (CSS only)
 * =================================== */
@keyframes floatParticle {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(20px, -30px) scale(1.2);
    opacity: 1;
  }
}

/* 各セクションにランダムな浮遊粒子風の装飾 */
.p-service::before,
.p-works::before {
  animation: floatParticle 8s ease-in-out infinite;
}

.p-news::before {
  animation: floatParticle 10s ease-in-out infinite;
}

/* ===================================
 * Reduced Motion
 * =================================== */
@media (prefers-reduced-motion: reduce) {
  .l-section::before,
  .l-section::after,
  .p-hero__mesh,
  .p-contact-cta,
  .p-contact-cta::before,
  .c-card--glass::before {
    animation: none;
  }

  @keyframes meshFloat,
  @keyframes dotPulse,
  @keyframes meshMove,
  @keyframes rotateGlow,
  @keyframes floatParticle {
    0%, 100% {
      background-position: 0 0;
      transform: none;
      opacity: 0.3;
    }
  }
}

/* ===================================
 * モバイルでは一部エフェクトを軽量化
 * =================================== */
@media (max-width: 768px) {
  .l-section::before {
    opacity: 0.5;
    animation: none;
  }

  .l-section::after {
    opacity: 0.2;
    background-size: 60px 60px;
  }

  .p-hero__mesh {
    opacity: 0.3;
  }
}
