/* ============================================================
   MBN — 애니메이션 시스템 v2 | animation.css
   ============================================================ */

/* ──────────────────────────────────────────
   프리로더
────────────────────────────────────────── */
#page-preloader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .6s ease, visibility .6s ease;
}
#page-preloader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.preloader-inner { text-align: center; color: #fff; }
.preloader-ring {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,.18);
  border-top-color: var(--accent);
  animation: preloaderSpin .9s linear infinite;
  margin: 0 auto 20px;
}
.preloader-bar-wrap {
  width: 160px; height: 2px;
  background: rgba(255,255,255,.18);
  margin: 0 auto 14px;
  overflow: hidden;
  border-radius: 2px;
}
.preloader-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  animation: preloaderFill 1s ease forwards;
}
.preloader-text {
  font-size: .78rem;
  color: rgba(255,255,255,.5);
  letter-spacing: .18em;
}
@keyframes preloaderSpin { to { transform: rotate(360deg); } }
@keyframes preloaderFill { to { width: 100%; } }

/* ──────────────────────────────────────────
   스크롤 진행 바
────────────────────────────────────────── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
  z-index: 1001;
  width: 0%;
  pointer-events: none;
  border-radius: 0 2px 2px 0;
}

/* ──────────────────────────────────────────
   스크롤 리빌 — data-reveal 기반
────────────────────────────────────────── */
[data-reveal="up"] {
  opacity: 0;
  transform: translateY(52px);
  transition: opacity .75s cubic-bezier(.4,0,.2,1),
              transform .75s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}
[data-reveal="left"] {
  opacity: 0;
  transform: translateX(-52px);
  transition: opacity .75s cubic-bezier(.4,0,.2,1),
              transform .75s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}
[data-reveal="scale"] {
  opacity: 0;
  transform: scale(.85);
  transition: opacity .75s cubic-bezier(.4,0,.2,1),
              transform .75s cubic-bezier(.4,0,.2,1);
  will-change: opacity, transform;
}
[data-reveal].revealed {
  opacity: 1 !important;
  transform: none !important;
}

/* ──────────────────────────────────────────
   섹션 헤더 밑줄 드로우
────────────────────────────────────────── */
.section-header h2 {
  position: relative;
  display: inline-block;
  padding-bottom: 18px;
}
.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 52px; height: 3px;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%) scaleX(0);
  transform-origin: center;
  transition: transform .7s cubic-bezier(.4,0,.2,1) .2s;
}
.section-header.revealed h2::after {
  transform: translateX(-50%) scaleX(1);
}
.trust-section .section-header h2::after { background: rgba(255,255,255,.7); }

/* ──────────────────────────────────────────
   Hero 파티클 캔버스
────────────────────────────────────────── */
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.hero-slides   { z-index: 0; }
.hero-overlay  { z-index: 1; }
.hero-content  { z-index: 3; }
.hero-dots     { z-index: 4; }
.hero-btn-prev,
.hero-btn-next { z-index: 4; }

/* ──────────────────────────────────────────
   Hero 플로팅 장식 원
────────────────────────────────────────── */
.hero-deco {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-deco-1 {
  width: 100px; height: 100px;
  top: 15%; right: 10%;
  background: rgba(52,196,176,.12);
  border: 2px solid rgba(52,196,176,.3);
  z-index: 2;
  animation: decoFloat 6s ease-in-out infinite;
}
.hero-deco-2 {
  width: 50px; height: 50px;
  top: 55%; right: 20%;
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.2);
  z-index: 2;
  animation: decoFloat 8s ease-in-out infinite;
  animation-delay: -3s;
}
.hero-deco-3 {
  width: 160px; height: 160px;
  bottom: 12%; right: 4%;
  background: rgba(43,22,103,.35);
  border: 2px solid rgba(255,255,255,.1);
  z-index: 2;
  animation: decoFloat 10s ease-in-out infinite;
  animation-delay: -6s;
}
.hero-deco-4 {
  width: 24px; height: 24px;
  top: 40%; left: 8%;
  background: rgba(52,196,176,.25);
  z-index: 2;
  animation: decoFloat 5s ease-in-out infinite;
  animation-delay: -1.5s;
}
@keyframes decoFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  40%       { transform: translateY(-22px) rotate(5deg); }
  70%       { transform: translateY(11px) rotate(-3deg); }
}

/* ──────────────────────────────────────────
   그라디언트 배경 애니메이션 (순수 CSS)
────────────────────────────────────────── */
.trust-section {
  background: linear-gradient(135deg, #180c3e 0%, #2B1667 30%, #3c2090 65%, #180c3e 100%) !important;
  background-size: 300% 300% !important;
  animation: gradShift 10s ease infinite;
  position: relative;
  overflow: hidden;
}
.trust-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
  z-index: 0;
}
.trust-section .section-inner { position: relative; z-index: 1; }

/* cta-section — style.css의 이미지 배경 방식 사용, 여기선 오버라이드 없음 */
/* glow drift 제거: 이미지 배경과 충돌 */

@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes glowDrift {
  0%, 100% { transform: translate(0, 0); }
  50%       { transform: translate(30px, -20px); }
}

/* ──────────────────────────────────────────
   버튼 시머 & 리플
────────────────────────────────────────── */
.btn-primary {
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  transition: left .55s ease;
  pointer-events: none;
}
.btn-primary:hover::before { left: 150%; }

@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }

/* ──────────────────────────────────────────
   카드 호버 글로우 강화
────────────────────────────────────────── */
.car-card {
  transition: transform .35s cubic-bezier(.4,0,.2,1), box-shadow .35s cubic-bezier(.4,0,.2,1);
}
.car-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 24px 56px rgba(43,22,103,.18), 0 0 0 1px rgba(52,196,176,.15) !important;
}
.car-card-img img {
  transition: transform .5s cubic-bezier(.4,0,.2,1) !important;
}
.car-card:hover .car-card-img img { transform: scale(1.08) !important; }

.service-card {
  position: relative;
  overflow: hidden;
}
.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 3px;
  background: var(--accent);
  transition: width .4s ease;
}
.service-card:hover::after { width: 100%; }
.service-card:hover {
  box-shadow: 0 16px 40px rgba(43,22,103,.13) !important;
  border-left-color: var(--accent) !important;
}

/* ──────────────────────────────────────────
   헤더 glassmorphism
────────────────────────────────────────── */
.site-header {
  transition: background .4s ease, box-shadow .4s ease;
}
.site-header.scrolled {
  background: rgba(255,255,255,.95) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ──────────────────────────────────────────
   Floating CTA 바운스 (순수 CSS)
────────────────────────────────────────── */
.floating-cta {
  animation: ctaBounce 2.8s ease-in-out infinite;
}
@keyframes ctaBounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}

/* region-card-v2 — scroll reveal용 (style.css에서 hover 정의) */
[data-reveal="left"].region-card-v2 {
  transform: translateX(-32px);
}

/* ──────────────────────────────────────────
   Stat 강화
────────────────────────────────────────── */
.stat-item { transition: transform .3s ease; }
.stat-item:hover { transform: translateY(-6px); }
.stat-item.counted .stat-number { animation: statPulse .5s ease; }
@keyframes statPulse {
  50% { transform: scale(1.1); }
}

/* ──────────────────────────────────────────
   서비스 카드 진입 효과
────────────────────────────────────────── */
.sp-cta-band {
  animation: gradShift 8s ease infinite;
}

/* ──────────────────────────────────────────
   prefers-reduced-motion
────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-reveal="up"],
  [data-reveal="left"],
  [data-reveal="scale"] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .trust-section { animation: none !important; }
  .cta-section   { animation: none !important; }
  .cta-section::before { display: none; }
  .hero-deco-1, .hero-deco-2,
  .hero-deco-3, .hero-deco-4 { animation: none !important; }
  .floating-cta  { animation: none !important; }
  .scroll-progress { display: none; }
  #page-preloader  { display: none !important; }
}
