/* ===========================
   Phoenix Therapy — Custom Styles
   =========================== */

/* Smooth page transitions */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Navigation
   =========================== */

#nav {
  background: rgba(255, 255, 255, 0);
  backdrop-filter: blur(0);
  border-bottom: 1px solid transparent;
}

#nav.scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom-color: rgba(226, 232, 240, 0.6);
}

/* ===========================
   Scroll Reveal Animations
   =========================== */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal:nth-child(2) { transition-delay: 0.08s; }
.reveal:nth-child(3) { transition-delay: 0.16s; }
.reveal:nth-child(4) { transition-delay: 0.24s; }
.reveal:nth-child(5) { transition-delay: 0.32s; }
.reveal:nth-child(6) { transition-delay: 0.40s; }

/* Feature cards staggered entrance */
.feature-card.reveal:nth-child(1) { transition-delay: 0s; }
.feature-card.reveal:nth-child(2) { transition-delay: 0.05s; }
.feature-card.reveal:nth-child(3) { transition-delay: 0.10s; }
.feature-card.reveal:nth-child(4) { transition-delay: 0.15s; }
.feature-card.reveal:nth-child(5) { transition-delay: 0.20s; }
.feature-card.reveal:nth-child(6) { transition-delay: 0.25s; }
.feature-card.reveal:nth-child(7) { transition-delay: 0.30s; }
.feature-card.reveal:nth-child(8) { transition-delay: 0.35s; }

/* ===========================
   AI Typing Effect
   =========================== */

.ai-typing {
  background: linear-gradient(
    90deg,
    rgba(148, 163, 184, 1) 0%,
    rgba(203, 213, 225, 1) 50%,
    rgba(148, 163, 184, 1) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===========================
   FAQ Accordion
   =========================== */

.faq-item.open .faq-icon {
  transform: rotate(45deg);
  color: #e8552a;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              padding 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.faq-item.open .faq-content {
  max-height: 300px;
}

/* ===========================
   Hero mockup hover & floating cards
   =========================== */

.hero-mockup {
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-mockup:hover {
  transform: translateY(-4px);
}

@keyframes float-slow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

@keyframes float-medium {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes float-fast {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.float-slow { animation: float-slow 6s ease-in-out infinite; }
.float-medium { animation: float-medium 5s ease-in-out infinite 0.5s; }
.float-fast { animation: float-fast 4s ease-in-out infinite 1s; }

/* ===========================
   Sparkline draw animation
   =========================== */

.sparkline-chart.animate .sparkline-line {
  animation: draw-line 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sparkline-chart.animate .sparkline-fill {
  animation: fade-in 1s ease-out 1s forwards;
}

@keyframes draw-line {
  to { stroke-dashoffset: 0; }
}

@keyframes fade-in {
  to { opacity: 1; }
}

/* ===========================
   Section headings slide-in
   =========================== */

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ===========================
   Focus & Accessibility
   =========================== */

:focus-visible {
  outline: 2px solid #e8552a;
  outline-offset: 2px;
  border-radius: 4px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
  outline: none;
}

/* ===========================
   Selection
   =========================== */

::selection {
  background: rgba(232, 85, 42, 0.15);
  color: #40110a;
}

/* ===========================
   Reduced Motion
   =========================== */

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .ai-typing {
    animation: none;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: rgb(203 213 225);
  }

  .float-slow, .float-medium, .float-fast {
    animation: none;
  }

  .sparkline-chart .sparkline-line {
    stroke-dashoffset: 0 !important;
  }

  .sparkline-chart .sparkline-fill {
    opacity: 1 !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===========================
   Scrollbar (subtle)
   =========================== */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgb(203 213 225);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgb(148 163 184);
}
