/* ══════════════════════════════════════════════════
   DXデザインシステム — Shared Animation Styles
   ══════════════════════════════════════════════════ */

/* ── PAGE TRANSITION OVERLAY ── */
.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: #0d0f14;
  z-index: 10000;
  pointer-events: none;
  animation: pageReveal 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.05s forwards;
}
@keyframes pageReveal {
  0%   { opacity: 1; }
  100% { opacity: 0; }
}

/* ── SCROLL REVEAL CLASSES ── */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-right {
  opacity: 0;
  transform: translateX(50px);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.reveal.active,
.reveal-left.active,
.reveal-right.active,
.reveal-scale.active {
  opacity: 1;
  transform: none;
}

/* Stagger delays for child elements */
.stagger-1 { transition-delay: 0.08s; }
.stagger-2 { transition-delay: 0.16s; }
.stagger-3 { transition-delay: 0.24s; }
.stagger-4 { transition-delay: 0.32s; }
.stagger-5 { transition-delay: 0.40s; }
.stagger-6 { transition-delay: 0.48s; }
.stagger-7 { transition-delay: 0.56s; }
.stagger-8 { transition-delay: 0.64s; }

/* ── HERO GRADIENT ANIMATION ── */
.gradient-animate {
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── TYPING CURSOR ── */
.typing-cursor::after {
  content: '|';
  display: inline-block;
  color: #9b59b6;
  font-weight: 300;
  animation: cursorBlink 0.75s step-end infinite;
  margin-left: 2px;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0; }
}

/* ── ENHANCED CARD HOVER ── */
.card-lift {
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.card-lift:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 48px rgba(45, 27, 110, 0.12), 0 4px 12px rgba(0,0,0,0.06);
}

/* Glow border on hover */
.card-glow {
  position: relative;
  overflow: hidden;
}
.card-glow::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.4s;
  box-shadow: inset 0 0 0 2px rgba(155, 89, 182, 0.4);
  pointer-events: none;
}
.card-glow:hover::after {
  opacity: 1;
}

/* ── FLOATING PARTICLES (CSS) ── */
.particles-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: rgba(155, 89, 182, 0.3);
  border-radius: 50%;
  animation: particleFloat linear infinite;
}
.particle:nth-child(1)  { left: 10%; animation-duration: 18s; animation-delay: 0s; width: 2px; height: 2px; }
.particle:nth-child(2)  { left: 20%; animation-duration: 22s; animation-delay: -3s; width: 4px; height: 4px; background: rgba(200, 157, 224, 0.2); }
.particle:nth-child(3)  { left: 35%; animation-duration: 16s; animation-delay: -7s; }
.particle:nth-child(4)  { left: 50%; animation-duration: 24s; animation-delay: -2s; width: 2px; height: 2px; background: rgba(155, 89, 182, 0.15); }
.particle:nth-child(5)  { left: 65%; animation-duration: 20s; animation-delay: -5s; width: 4px; height: 4px; }
.particle:nth-child(6)  { left: 75%; animation-duration: 17s; animation-delay: -10s; width: 2px; height: 2px; background: rgba(200, 157, 224, 0.25); }
.particle:nth-child(7)  { left: 85%; animation-duration: 21s; animation-delay: -4s; }
.particle:nth-child(8)  { left: 45%; animation-duration: 19s; animation-delay: -8s; width: 5px; height: 5px; background: rgba(155, 89, 182, 0.1); }
.particle:nth-child(9)  { left: 5%;  animation-duration: 23s; animation-delay: -1s; width: 2px; height: 2px; }
.particle:nth-child(10) { left: 92%; animation-duration: 15s; animation-delay: -6s; background: rgba(200, 157, 224, 0.2); }

@keyframes particleFloat {
  0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-10vh) rotate(720deg); opacity: 0; }
}

/* ── SECTION DIVIDER ANIMATION ── */
.section-rule-animate {
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.section-rule-animate.active {
  transform: scaleX(1);
}

/* ── NUMBER COUNTER ── */
.counter-value {
  display: inline-block;
}

/* ── PULSE GLOW for CTA buttons ── */
.btn-pulse {
  position: relative;
  overflow: visible;
}
.btn-pulse::before {
  content: '';
  position: absolute;
  inset: -3px;
  background: inherit;
  border-radius: inherit;
  filter: blur(12px);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.4s;
}
.btn-pulse:hover::before {
  opacity: 0.5;
}

/* ── NAV SCROLL EFFECT ── */
.global-nav.nav-scrolled {
  background: #f5f2ed;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

/* ── STRENGTHS BAR MARQUEE ── */
.marquee-track {
  display: flex;
  gap: 40px;
  animation: marqueeScroll 30s linear infinite;
  width: max-content;
}
.marquee-track:hover {
  animation-play-state: paused;
}
@keyframes marqueeScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── GRADIENT BORDER for featured pricing ── */
.gradient-border {
  position: relative;
}
.gradient-border::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(135deg, #9b59b6, #2d1b6e, #c89de0, #7b3fa0);
  background-size: 300% 300%;
  animation: gradientBorder 4s ease infinite;
  z-index: -1;
}
@keyframes gradientBorder {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ── HERO TEXT SHIMMER ── */
.text-shimmer {
  background: linear-gradient(
    110deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0) 40%,
    rgba(200,157,224,0.3) 50%,
    rgba(255,255,255,0) 60%,
    rgba(255,255,255,0) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 4s ease-in-out infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── ICON BOUNCE on hover ── */
.icon-bounce:hover {
  animation: iconBounce 0.5s ease;
}
@keyframes iconBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.25); }
  50%  { transform: scale(0.95); }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* ── SECTION LABEL SLIDE-IN ── */
.label-slide {
  opacity: 0;
  transform: translateX(-20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.label-slide.active {
  opacity: 1;
  transform: translateX(0);
}

/* ── RIPPLE EFFECT for buttons ── */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple .ripple-circle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: scale(0);
  animation: rippleExpand 0.6s ease-out forwards;
  pointer-events: none;
}
@keyframes rippleExpand {
  to { transform: scale(4); opacity: 0; }
}

/* ── SMOOTH UNDERLINE for links ── */
.link-underline {
  position: relative;
  text-decoration: none;
}
.link-underline::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: currentColor;
  transition: width 0.3s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* ── PARALLAX LAYER (mouse-driven via JS) ── */
.parallax-layer {
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* ── RESPONSIVE: disable heavy animations on mobile ── */
@media (max-width: 768px) {
  .marquee-track { animation-duration: 20s; }
  .particle { display: none; }
  .particles-container { display: none; }
}

/* ── FONT SIZE IMPROVEMENTS ── */
/* Increase base font sizes for better readability */
body {
  font-size: 15px;
}

/* Slightly larger nav text */
.nav-links a {
  font-size: 12.5px;
}

/* Larger section descriptions */
.service-desc,
.whyus-desc,
.menu-card-desc,
.profile-text-strip,
.pricing-features,
.price-features {
  font-size: 13.5px;
}

/* Larger card titles */
.service-name,
.whyus-title,
.menu-card-name {
  font-size: 15.5px;
}

/* Larger section headings */
.section-heading h2 {
  font-size: 24px;
}

/* Mobile: significantly increase sizes */
@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .hero-catch {
    font-size: clamp(24px, 6vw, 36px) !important;
  }

  .hero-desc {
    font-size: 14.5px !important;
  }

  .section-heading h2 {
    font-size: 20px;
  }

  .service-name,
  .menu-card-name,
  .whyus-title {
    font-size: 15px;
  }

  .service-desc,
  .whyus-desc,
  .menu-card-desc {
    font-size: 13.5px;
    line-height: 1.9;
  }

  .nav-drawer a {
    font-size: 20px;
    padding: 22px 0;
  }

  /* Pricing readability */
  .price-name,
  .pricing-name {
    font-size: 18px;
  }

  .price-amount,
  .pricing-amount {
    font-size: 14px;
  }

  .price-features li,
  .pricing-features li {
    font-size: 13px;
  }

  /* Profile page */
  .profile-summary {
    font-size: 14px;
  }

  /* Company table */
  .company-table td {
    font-size: 14px;
  }

  /* Footer readability */
  .footer-links a {
    font-size: 13px;
  }

  .footer-address {
    font-size: 12px;
  }

  /* Form readability */
  .form-label {
    font-size: 13px;
  }

  input, textarea, select {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }

  /* Page hero */
  .page-hero h1 {
    font-size: clamp(22px, 5vw, 32px) !important;
  }

  .page-hero-desc,
  .header-sub {
    font-size: 13.5px;
  }

  /* Badges and tags */
  .badge,
  .service-tag,
  .plan-tag,
  .target-chip {
    font-size: 11.5px;
  }
}

/* ── HERO DESC FLOAT-UP REVEAL ──
   Appears after the headline typing finishes (~2.2s).
   Fades in + slides up gently.                        */
.hero-desc-reveal {
  opacity: 0;
  transform: translateY(18px);
  animation: heroDescReveal 0.9s ease 4.6s forwards;
}
@keyframes heroDescReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── X-SLIDE LOGO MARK REVEAL ──
   Uses the actual logo PNG, split into left & right halves via clip-path.
   Starts as complete X at center, spreads outward on trigger.
   Desktop: hover. Mobile: scroll + 0.5s delay.
   ─────────────────────────────────────── */

/* ── Card base ── */
.x-slide-card {
  position: relative;
  overflow: hidden;
}

/* Card content: starts hidden, revealed 0.5s after activation */
.x-slide-card .x-slide-content {
  opacity: 0;
  transition: opacity 0.8s ease 0.5s;
}
.x-slide-card.x-slide-active .x-slide-content {
  opacity: 1;
}

/* ── Logo halves ──
   Two SVG files extracted from the original logo, each half of the X mark.
   They overlap at center to form the complete X, then split apart.       */
.x-slide-card .x-sweep {
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: 15%;
  right: 15%;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  pointer-events: none;
  z-index: 4;
  opacity: 0.9;
}

/* Left half: >>> colored side */
.x-slide-card .x-sweep-left {
  background-image: url('../images/Dxlogo_left.svg');
  background-position: calc(50% + 0.5px) center;
  z-index: 4;
}
/* Right half: <<< gray side (on top so it's visible against white) */
.x-slide-card .x-sweep-right {
  background-image: url('../images/Dxlogo_right.svg');
  background-position: calc(50% - 0.5px) center;
  z-index: 5;
}

/* Activated: spread outward via transform — 2s motion */
.x-slide-card.x-slide-active .x-sweep-left {
  animation: xSpreadLeft 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
.x-slide-card.x-slide-active .x-sweep-right {
  animation: xSpreadRight 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ── Keyframes ── */

@keyframes xSpreadLeft {
  0%   { transform: translateX(0); opacity: 0.9; }
  30%  { opacity: 0.6; }
  100% { transform: translateX(-120%); opacity: 0; }
}

@keyframes xSpreadRight {
  0%   { transform: translateX(0); opacity: 0.9; }
  30%  { opacity: 0.6; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* ── PREFERS REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .page-transition-overlay { display: none; }
  .marquee-track { animation: none; }
  .particle { display: none; }
  .gradient-animate { animation: none; }
  .text-shimmer { animation: none; }
  .typing-cursor::after { animation: none; }
  .x-slide-card .x-slide-content {
    opacity: 1;
    transition: none;
  }
  .x-slide-card .x-sweep {
    display: none;
  }
}
