/* ============================================================
   Anandam — rifiniture di stile & micro-interazioni (post-handoff)
   Caricato DOPO gli stili inline di pagina → può sovrascrivere.
   ============================================================ */

/* ---------- 1. Titoli pagine interne (un filo più grandi) ----------
   La home (.hero) resta invariata; scaliamo solo i .page-hero. */
.page-hero .display,
.page-hero h1.display,
.page-hero h1 {
  font-size: clamp(46px, 6.4vw, 104px);
  line-height: 0.98;
}

/* ---------- 2. Card a sfondo chiaro/trasparente:
   gradiente molto leggero che ENTRA IN SLIDE in hover.
   Le card NON si muovono e NON si ridimensionano. ---------- */
.service-card,
.group-card,
.metodi-card,
.member,
.pilastro,
.step {
  position: relative;
  isolation: isolate;
}
.service-card::after,
.group-card::after,
.metodi-card::after,
.member::after,
.pilastro::after,
.step::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(130% 130% at 50% 45%,
    rgba(68, 78, 255, 0.14) 0%,
    rgba(209, 69, 146, 0.12) 48%,
    rgba(68, 78, 255, 0.03) 100%);
  opacity: 0;
  transform: scale(1.015);
  transition:
    opacity 0.6s ease,
    transform 0.7s cubic-bezier(0.2, 0.7, 0.3, 1);
  pointer-events: none;
  z-index: 0;
}
.service-card:hover::after,
.group-card:hover::after,
.metodi-card:hover::after,
.member:hover::after,
.pilastro:hover::after,
.step:hover::after {
  opacity: 1;
  transform: scale(1); /* fade elegante, nessuno scorrimento laterale */
}
/* il contenuto resta sopra l'overlay */
.service-card > *,
.group-card > *,
.metodi-card > *,
.member > *,
.pilastro > *,
.step > * {
  position: relative;
  z-index: 1;
}
/* niente ingrandimento / spostamento delle card in hover (resta l'ombra) */
.service-card:hover,
.group-card:hover,
.metodi-card:hover,
.member:hover,
.pilastro:hover,
.area-card:hover,
.step:hover {
  transform: none !important;
}

/* ---------- 3. Sezioni/card con gradiente di sfondo:
   in hover lo sfondo si muove un pochino ---------- */
@keyframes anandam-grad-drift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.cta-card,
.metodi-card,
.metodi-chip {
  background-size: 200% 200% !important;
}
/* il gradiente è SEMPRE in movimento (non solo in hover) */
.cta-card,
.metodi-card {
  animation: anandam-grad-drift 12s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .cta-card, .metodi-card { animation: none; }
}

/* ---------- 4. FIX: il blob della CTA non deve essere un quadrato,
   ma fondersi morbidamente nello sfondo ---------- */
.cta-card { overflow: hidden; }
.cta-card::after {
  right: -8% !important;
  top: -35% !important;
  left: auto !important;
  bottom: auto !important;
  width: 55% !important;
  height: 150% !important;
  background: radial-gradient(closest-side,
    rgba(209, 69, 146, 0.50),
    rgba(209, 69, 146, 0.18) 55%,
    rgba(209, 69, 146, 0) 80%) !important;
  filter: blur(46px);
}

/* ---------- 5. Home: icone di sfondo delle 4 schede aree
   animate in hover (rotazione lenta + respiro) ---------- */
.lg-glyph { transform-origin: center; }
@keyframes anandam-glyph-spin {
  0%   { transform: rotate(0deg)   scale(1.06); }
  100% { transform: rotate(360deg) scale(1.06); }
}
@keyframes anandam-glyph-breathe {
  0%, 100% { opacity: 0.85; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .area-card:hover .lg-glyph {
    animation:
      anandam-glyph-spin 16s linear infinite,
      anandam-glyph-breathe 3.2s ease-in-out infinite;
  }
}

/* ---------- 6. Hero decorativo "Libera il potenziale" (home) ----------
   line-art leggera animata: anelli che pulsano + spore che salgono. */
.hero-mark svg { overflow: visible; }
.hm-rings circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: anandam-ring-pulse 6s ease-in-out infinite;
}
.hm-rings circle:nth-child(2) { animation-delay: 0.8s; }
.hm-rings circle:nth-child(3) { animation-delay: 1.6s; }
@keyframes anandam-ring-pulse {
  0%, 100% { transform: scale(1);    opacity: 0.55; }
  50%      { transform: scale(1.06); opacity: 0.9; }
}
.hm-core {
  transform-box: fill-box;
  transform-origin: center;
  animation: anandam-core 4s ease-in-out infinite;
}
@keyframes anandam-core {
  0%, 100% { transform: scale(1);   opacity: 0.9; }
  50%      { transform: scale(1.18); opacity: 1; }
}
.hm-spore {
  transform-box: fill-box;
  transform-origin: center;
  animation: anandam-rise 5.5s ease-in-out infinite;
  opacity: 0;
}
.hm-spore.s2 { animation-delay: 0.9s; }
.hm-spore.s3 { animation-delay: 1.8s; }
.hm-spore.s4 { animation-delay: 2.7s; }
.hm-spore.s5 { animation-delay: 3.6s; }
@keyframes anandam-rise {
  0%   { transform: translateY(0)     scale(0.6); opacity: 0; }
  15%  { opacity: 0.9; }
  70%  { opacity: 0.7; }
  100% { transform: translateY(-120px) scale(1);  opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .hm-rings circle, .hm-core, .hm-spore { animation: none; opacity: 0.7; }
}

/* ---------- 6b. Home hero-mark: centrato DIETRO al titolo,
   così le spore salgono fino alla scritta (e dietro). ---------- */
.hero .hero-mark {
  left: 50% !important;
  right: auto !important;
  top: 46% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) rotate(0deg) !important;
  width: clamp(420px, 58vw, 760px) !important;
  opacity: 0;
  animation: anandam-mark-in-home 3s ease 1.8s forwards;
  z-index: 0;
}
.hero .hero-grid { position: relative; z-index: 2; }
@keyframes anandam-mark-in-home { from { opacity: 0; } to { opacity: 0.42; } }

/* ---------- 7. Elemento decorativo DIETRO ogni hero interna
   ("energia che sale": pallini colorati che salgono, line-art leggera).
   Riusa il contenitore .page-hero-mark già centrato dietro al testo. ---------- */
/* il simbolo sta SEMPRE centrato dietro al testo (come in "Chi siamo") */
.page-hero-mark {
  left: 50% !important;
  right: auto !important;
  top: 46% !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) !important;
  width: clamp(420px, 64vw, 820px) !important;
  opacity: 0;
  animation: anandam-mark-in 3s ease 1.8s forwards;
  z-index: 0;
}
.page-hero .wrap { position: relative; z-index: 2; }
@keyframes anandam-mark-in { from { opacity: 0; } to { opacity: 0.38; } }
@media (prefers-reduced-motion: reduce) {
  .page-hero-mark { opacity: 0.38 !important; animation: none !important; }
  .hero .hero-mark { opacity: 0.42 !important; animation: none !important; }
}

/* ---------- 7b. Simboli hero coerenti per pagina:
   solo micro-movimenti INTERNI (pulse / breathe / twinkle),
   nessuna rotazione e nessuno scorrimento orizzontale. ---------- */
.sym { transform-box: fill-box; transform-origin: center; }
.sym-pulse   { animation: sym-pulse   5.5s ease-in-out infinite; }
.sym-breathe { animation: sym-breathe 4.5s ease-in-out infinite; }
.sym-twinkle { animation: sym-twinkle 3.2s ease-in-out infinite; }
@keyframes sym-pulse   { 0%,100%{ transform: scale(1); }            50%{ transform: scale(1.07); } }
@keyframes sym-breathe { 0%,100%{ opacity: 0.62; }                  50%{ opacity: 1; } }
@keyframes sym-twinkle { 0%,100%{ opacity: 0.6; transform: scale(0.85); } 50%{ opacity: 1; transform: scale(1.15); } }
.d1 { animation-delay: 0.4s; } .d2 { animation-delay: 0.8s; }
.d3 { animation-delay: 1.2s; } .d4 { animation-delay: 1.6s; }
.d5 { animation-delay: 2.0s; }
@media (prefers-reduced-motion: reduce) {
  .sym-pulse, .sym-breathe, .sym-twinkle { animation: none; opacity: 0.7; }
}

.he-rings circle {
  transform-box: fill-box;
  transform-origin: center;
  animation: anandam-ring-pulse 7s ease-in-out infinite;
}
.he-rings circle:nth-child(2) { animation-delay: 1s; }
.he-rings circle:nth-child(3) { animation-delay: 2s; }

.he-spore {
  transform-box: fill-box;
  transform-origin: center;
  animation: anandam-he-rise 8s ease-in-out infinite;
  opacity: 0;
}
.he-spore:nth-child(1) { animation-delay: 0s;   }
.he-spore:nth-child(2) { animation-delay: 1s;   }
.he-spore:nth-child(3) { animation-delay: 2s;   }
.he-spore:nth-child(4) { animation-delay: 3s;   }
.he-spore:nth-child(5) { animation-delay: 4s;   }
.he-spore:nth-child(6) { animation-delay: 5s;   }
.he-spore:nth-child(7) { animation-delay: 6s;   }
.he-spore:nth-child(8) { animation-delay: 7s;   }
@keyframes anandam-he-rise {
  0%   { transform: translateY(40px)   scale(0.4); opacity: 0; }
  12%  { opacity: 0.85; }
  78%  { opacity: 0.6; }
  100% { transform: translateY(-150px) scale(1);   opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .he-rings circle, .he-spore { animation: none; opacity: 0.5; }
}

/* ---------- 8. Transizione d'uscita pagina (smontaggio elegante) ---------- */
html.is-leaving { cursor: progress; }
html.is-leaving .page-leave-fade {
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease;
  opacity: 0;
  transform: translateY(-18px);
  filter: blur(6px);
}

/* ---------- 9. Burger menu mobile + overlay fullscreen elegante ---------- */
.nav-burger {
  display: none;
  margin-left: auto;
  width: 46px; height: 46px;
  border: none; background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  padding: 0; z-index: 210;
}
.nav-burger span {
  width: 25px; height: 2px; border-radius: 2px; background: var(--ink);
  transition: transform 0.35s cubic-bezier(.2,.7,.3,1), opacity 0.25s ease;
}
.nav-burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.is-open span:nth-child(2) { opacity: 0; }
.nav-burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(255, 240, 211, 0.97);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  backdrop-filter: blur(22px) saturate(160%);
  display: flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 4px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}
.nav-overlay.is-open { opacity: 1; visibility: visible; }
.nav-overlay a {
  font-weight: 700;
  font-size: clamp(30px, 9vw, 50px);
  letter-spacing: -0.02em;
  color: var(--ink);
  padding: 8px 18px;
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  filter: blur(6px);
  transition: opacity 0.55s ease, transform 0.6s cubic-bezier(.2,.7,.3,1), filter 0.55s ease;
}
.nav-overlay a.nav-overlay-cta { color: var(--tertiary); }
.nav-overlay.is-open a { opacity: 1; transform: none; filter: none; }

/* pulsante X di chiusura dentro l'overlay */
.nav-close {
  position: absolute; top: 16px; right: 18px;
  width: 48px; height: 48px;
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1; opacity: 0; transition: opacity 0.4s ease 0.2s;
}
.nav-overlay.is-open .nav-close { opacity: 1; }
.nav-close::before, .nav-close::after {
  content: ""; position: absolute;
  width: 26px; height: 2px; border-radius: 2px; background: var(--ink);
  transition: transform 0.25s ease;
}
.nav-close::before { transform: rotate(45deg); }
.nav-close::after  { transform: rotate(-45deg); }
.nav-close:hover::before { transform: rotate(45deg) scale(1.12); }
.nav-close:hover::after  { transform: rotate(-45deg) scale(1.12); }
.nav-overlay.is-open a:nth-child(1) { transition-delay: 0.10s; }
.nav-overlay.is-open a:nth-child(2) { transition-delay: 0.16s; }
.nav-overlay.is-open a:nth-child(3) { transition-delay: 0.22s; }
.nav-overlay.is-open a:nth-child(4) { transition-delay: 0.28s; }
.nav-overlay.is-open a:nth-child(5) { transition-delay: 0.34s; }
.nav-overlay.is-open a:nth-child(6) { transition-delay: 0.40s; }
body.nav-locked { overflow: hidden; }

@media (max-width: 880px) {
  .nav-links { display: none !important; }
  .nav-burger { display: flex; }
  /* simbolo di sfondo visibile anche su mobile (come desktop) */
  .hero .hero-mark, .page-hero-mark { display: block !important; }
  /* titoli hero un filo più grandi su mobile */
  .page-hero .display, .page-hero h1.display, .page-hero h1 {
    font-size: clamp(56px, 13.5vw, 96px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .nav-overlay a { filter: none; transform: none; }
}
