/* =========================================================
   Priscila Rodrigues — Psicologia Clínica
   Custom styles: organic shapes, breathing, accordion, motion
   ========================================================= */

:root {
  --terracotta: #d89a7e;
  --nude: #e8c3b9;
  --sage: #8a9a86;
  --sage-deep: #6f7e6b;
  --sage-light: #ebf0ea;
  --cream: #fafaf7;
  --ink: #2d3748;
  --ink-soft: #5a6675;
  --shadow-soft: 0 24px 60px -24px rgba(45, 55, 72, 0.22);
}

/* ---------- Base ---------- */
html {
  -webkit-text-size-adjust: 100%;
}

body {
  text-rendering: optimizeLegibility;
}

img {
  display: block;
  max-width: 100%;
}

/* ---------- Breathing organic shapes ---------- */
.breathing {
  transform-origin: center;
  will-change: transform, opacity;
  animation: breathe 14s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1) translate3d(0, 0, 0);
    opacity: 0.42;
  }
  50% {
    transform: scale(1.12) translate3d(0, -12px, 0);
    opacity: 0.6;
  }
}

/* ---------- Header states ---------- */
#header {
  background-color: transparent;
}

#header.is-scrolled {
  background-color: rgba(250, 250, 247, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 40px -24px rgba(45, 55, 72, 0.28);
}

#header.is-scrolled nav {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

/* ---------- Link underline micro-interaction ---------- */
.link-underline {
  position: relative;
}

.link-underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 1.5px;
  width: 100%;
  background: var(--sage);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.link-underline:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background-image: linear-gradient(135deg, #d89a7e 0%, #cf8a6a 55%, #c97e5c 100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
  will-change: transform;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 26px 50px -20px rgba(216, 154, 126, 0.7);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.99);
}

.btn-light {
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.btn-light:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 55px -22px rgba(0, 0, 0, 0.5);
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.35s ease;
  opacity: 0;
}

.mobile-menu.is-open {
  max-height: 26rem;
  opacity: 1;
}

/* ---------- Portrait photo ---------- */
.photo-frame {
  transition: transform 1.2s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}

.photo-frame:hover {
  transform: scale(1.025) translateY(-4px);
}

/* ---------- Timeline ---------- */
.timeline-path {
  z-index: 0;
}

.timeline-path path {
  filter: drop-shadow(0 6px 12px rgba(216, 154, 126, 0.25));
}

.step-card {
  z-index: 1;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.5s ease;
  will-change: transform;
}

.step-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}

/* ---------- FAQ accordion ---------- */
.faq-item {
  transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
  overflow: hidden;
}

.faq-item.is-open {
  background-color: #ffffff;
  border-color: rgba(138, 154, 134, 0.35);
  box-shadow: var(--shadow-soft);
}

.faq-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  opacity: 0;
}

.faq-item.is-open .faq-panel {
  opacity: 1;
}

.faq-icon {
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s ease, color 0.4s ease;
}

.faq-item.is-open .faq-icon {
  transform: rotate(135deg);
  background-color: var(--terracotta);
  color: #ffffff;
}

/* ---------- Word highlight (Sobre) ---------- */
/* Default to an inherited, readable colour so the text stays legible
   even if the GSAP highlight animation never runs. */
#about-highlight .hl-word {
  color: inherit;
  transition: color 0.2s linear;
  will-change: color;
}

/* ---------- Floating WhatsApp ---------- */
.wa-float {
  will-change: transform;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s ease;
}

.wa-float:hover {
  transform: translateY(-4px) scale(1.03);
}

.wa-ring {
  border: 2px solid rgba(37, 211, 102, 0.55);
  animation: wa-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

@keyframes wa-pulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.55);
    opacity: 0;
  }
  100% {
    transform: scale(1.55);
    opacity: 0;
  }
}

.wa-ring::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  border: 2px solid rgba(37, 211, 102, 0.35);
  animation: wa-pulse 2.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  animation-delay: 1.3s;
}

/* ---------- Motion-armed initial state ----------
   Set on <html> before first paint so animated elements do not flash.
   It is removed by main.js as soon as GSAP takes over, or by a timeout
   if the animation libraries never load. */
.motion-armed .hero-item,
.motion-armed .hero-photo,
.motion-armed .hero-float,
.motion-armed [data-reveal],
.motion-armed .demand-card,
.motion-armed .adv-card,
.motion-armed .step-card,
.motion-armed .testimonial-card,
.motion-armed .wa-float {
  opacity: 0;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
