/* =========================================================
   STUDIO CAREDDU — DESIGN SYSTEM ENHANCEMENT
   Sovrascrive i default Inter + piatto con:
   - Tipografia serif/sans dual (Playfair Display + DM Sans)
   - Palette estesa con navy di autorità
   - Animazioni scroll-reveal, count-up
   - Texture grain sottile per calore cartaceo
   - Hover più tattili, ombre direzionali
   ========================================================= */

/* -------- 1. TIPOGRAFIA --------------------------------- */
:root {
  --c-cream:       #FAF7F2;
  --c-cream-deep:  #F2EDE5;
  --c-ink:         #1d1d1f;
  --c-muted:       #6e6e73;
  --c-terracotta:  #C45A3C;
  --c-terracotta-d:#A84832;
  --c-navy:        #1B2B4B;
  --c-navy-deep:   #122038;
  --c-gold:        #B89556;
}

body, body * {
  font-family: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
}

/* Headings big → serif di autorità */
h1, h2,
.font-heading,
section > div > h1,
section > div > h2,
section > div > div > h1,
section > div > div > h2 {
  font-family: 'Playfair Display', 'Libre Baskerville', Georgia, serif !important;
  font-weight: 500 !important;
  letter-spacing: -0.015em;
  line-height: 1.08;
}

h1 { font-weight: 500 !important; }
h2 { font-weight: 500 !important; }

/* Body text leggermente più aperto */
p, li, a, span, button {
  letter-spacing: -0.005em;
}

/* -------- 2. TEXTURE GRAIN (calore cartaceo) ------------ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.9 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  background-size: 220px 220px;
}
/* La nav resta sopra il grain */
nav, footer, section { position: relative; z-index: 2; }

/* -------- 3. SCROLL REVEAL ------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }

/* Stagger automatico per gruppi di card */
section .grid > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}
section .grid.is-revealed > *:nth-child(1) { transition-delay: 0.00s; opacity:1; transform:none; }
section .grid.is-revealed > *:nth-child(2) { transition-delay: 0.06s; opacity:1; transform:none; }
section .grid.is-revealed > *:nth-child(3) { transition-delay: 0.12s; opacity:1; transform:none; }
section .grid.is-revealed > *:nth-child(4) { transition-delay: 0.18s; opacity:1; transform:none; }
section .grid.is-revealed > *:nth-child(5) { transition-delay: 0.24s; opacity:1; transform:none; }
section .grid.is-revealed > *:nth-child(6) { transition-delay: 0.30s; opacity:1; transform:none; }

/* -------- 4. CARD HOVER più tattili --------------------- */
a.group:hover,
.bg-white.rounded-2xl:hover {
  transform: translateY(-3px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              border-color 0.35s ease;
}
.bg-white.rounded-2xl {
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.bg-white.rounded-2xl:hover {
  box-shadow: 0 20px 40px -18px rgba(27, 43, 75, 0.18),
              0 2px 6px -2px rgba(0, 0, 0, 0.04);
}

/* Bottoni CTA terracotta con leggero scale on hover */
a[href*="contatti"].bg-\[\#C45A3C\]:hover,
button.bg-\[\#C45A3C\]:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 28px -10px rgba(196, 90, 60, 0.45);
  transition: all 0.3s ease;
}

/* -------- 5. SEZIONI CONTRASTO NAVY --------------------- */
.section-navy {
  background: linear-gradient(180deg, var(--c-navy) 0%, var(--c-navy-deep) 100%);
  color: #ffffff;
}
.section-navy h1,
.section-navy h2,
.section-navy h3,
.section-navy h4,
.section-navy p,
.section-navy li,
.section-navy a:not(.btn-accent) {
  color: #ffffff !important;
}
.section-navy .text-\[\#6e6e73\] { color: rgba(255,255,255,0.72) !important; }
.section-navy .text-\[\#1d1d1f\] { color: #ffffff !important; }
.section-navy .bg-white {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.12) !important;
  backdrop-filter: blur(8px);
}
.section-navy .material-symbols-outlined.text-\[\#C45A3C\] {
  color: var(--c-gold) !important;
}

/* -------- 6. FOOTER NAVY (più peso visivo) -------------- */
footer.bg-\[\#F2EDE5\] {
  background: var(--c-navy-deep) !important;
  border-top: 1px solid rgba(255,255,255,0.08) !important;
}
footer h4,
footer .text-\[\#1d1d1f\],
footer strong {
  color: #ffffff !important;
}
footer p,
footer .text-\[\#6e6e73\],
footer a {
  color: rgba(255,255,255,0.68) !important;
}
footer a:hover {
  color: var(--c-gold) !important;
}
footer .border-gray-200\/50 {
  border-color: rgba(255,255,255,0.08) !important;
}

/* -------- 7. TRUST STRIP NUMERI ------------------------- */
.count-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 500;
  letter-spacing: -0.02em;
}

/* -------- 8. WHATSAPP FLOATING (iniettato da JS) -------- */
.wa-float {
  position: fixed;
  right: 20px;
  bottom: 24px;
  z-index: 45;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px -6px rgba(37, 211, 102, 0.45);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.wa-float:hover {
  transform: scale(1.08);
  box-shadow: 0 14px 36px -6px rgba(37, 211, 102, 0.6);
}
.wa-float svg { width: 28px; height: 28px; }
.wa-float::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #25D366;
  opacity: 0.5;
  animation: wa-pulse 2.2s ease-out infinite;
}
@keyframes wa-pulse {
  0%   { transform: scale(0.9); opacity: 0.6; }
  70%  { transform: scale(1.25); opacity: 0; }
  100% { transform: scale(1.25); opacity: 0; }
}
@media (max-width: 767px) {
  .wa-float { display: none; } /* la sticky bar mobile fa il suo lavoro */
}

/* -------- 9. MOBILE STICKY BAR — 3 bottoni ------------- */
.fixed.bottom-0.left-0.right-0.z-40 {
  box-shadow: 0 -8px 24px -8px rgba(0,0,0,0.08);
}

/* -------- 10. FIX ICONA GIGANTE "ai-slop" --------------- */
/* Icone gigantesche al posto di foto: le rimpiccolisco */
.material-symbols-outlined[style*="128px"],
span.text-\[128px\].material-symbols-outlined {
  font-size: 56px !important;
  opacity: 0.5;
}

/* -------- 11. MICRO-FIX: preferenza motion ridotto ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .reveal, section .grid > * {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* -------- 12. Fix HERO su mobile ------------------------ */
@media (max-width: 640px) {
  h1 { letter-spacing: -0.02em; }
}
