/* ============================================================
   Metodo Soluzioni Logistiche - static site styles
   (replica fedele del sito React/Tailwind originale)
   ============================================================ */

:root {
  --color-primary: #0ea5e9;
  --color-secondary: #14b8a6;
  --color-accent: #f59e0b;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #020617; /* slate-950 */
  color: #ffffff;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f172a;
}
::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

/* Selection */
::selection {
  background: rgba(14, 165, 233, 0.3);
  color: white;
}

/* lucide icons sizing: inherit from utility width/height classes */
[data-lucide] {
  display: inline-block;
  vertical-align: middle;
}

/* ------------------------------------------------------------
   Scroll-reveal animations (sostituiscono framer-motion)
   Default (no-JS) => contenuto visibile.
   Con la classe .js sull'<html> il contenuto parte nascosto e
   viene rivelato quando entra nel viewport.
   ------------------------------------------------------------ */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}
.js .reveal-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}
.js .reveal-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}
.js .reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}
.js .reveal.is-visible,
.js .reveal-left.is-visible,
.js .reveal-right.is-visible,
.js .reveal-scale.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children */
.js .stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94),
    transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.js .stagger.is-visible > * {
  opacity: 1;
  transform: none;
}
.js .stagger > *:nth-child(1) { transition-delay: 0.04s; }
.js .stagger > *:nth-child(2) { transition-delay: 0.10s; }
.js .stagger > *:nth-child(3) { transition-delay: 0.16s; }
.js .stagger > *:nth-child(4) { transition-delay: 0.22s; }
.js .stagger > *:nth-child(5) { transition-delay: 0.28s; }
.js .stagger > *:nth-child(6) { transition-delay: 0.34s; }
.js .stagger > *:nth-child(7) { transition-delay: 0.40s; }
.js .stagger > *:nth-child(8) { transition-delay: 0.46s; }
.js .stagger > *:nth-child(9) { transition-delay: 0.52s; }

/* ------------------------------------------------------------
   Keyframe animations
   ------------------------------------------------------------ */
@keyframes orb-pulse-1 {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.2); opacity: 0.5; }
}
@keyframes orb-pulse-2 {
  0%, 100% { transform: scale(1); opacity: 0.2; }
  50% { transform: scale(1.3); opacity: 0.4; }
}
.orb-1 { animation: orb-pulse-1 8s ease-in-out infinite; }
.orb-2 { animation: orb-pulse-2 10s ease-in-out infinite 2s; }

@keyframes scroll-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}
.scroll-dot-wrap { animation: scroll-bounce 1.5s ease-in-out infinite; }

/* Mobile menu collapse */
.mobile-menu {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}
.mobile-menu.open {
  max-height: 600px;
  opacity: 1;
}

/* FAQ accordion */
.faq-answer {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease;
}
.faq-answer > div {
  overflow: hidden;
}
.faq-item.open .faq-answer {
  grid-template-rows: 1fr;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}
.faq-chevron {
  transition: transform 0.3s ease;
}

/* ============================================================
   NEXT-LEVEL FX
   ============================================================ */

/* --- Cross-document View Transitions (Chrome/Edge 126+; gli altri
       browser ignorano e navigano normalmente) --- */
@view-transition {
  navigation: auto;
}
@keyframes vt-out {
  to { opacity: 0; transform: translateY(-14px) scale(0.995); filter: blur(4px); }
}
@keyframes vt-in {
  from { opacity: 0; transform: translateY(14px) scale(0.995); filter: blur(4px); }
}
::view-transition-old(root) { animation: vt-out 0.28s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vt-in 0.42s cubic-bezier(0, 0, 0.2, 1) both; }

/* Lenis smooth scroll: disattiva lo scroll-behavior nativo per evitare conflitti */
html.lenis, html.lenis body { scroll-behavior: auto !important; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

/* --- Scroll progress bar --- */
#scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #0ea5e9, #14b8a6, #a78bfa);
  z-index: 120;
  pointer-events: none;
}

/* --- Custom cursor (solo pointer fine, aggiunto da fx.js) --- */
html.fx-cursor,
html.fx-cursor a,
html.fx-cursor button,
html.fx-cursor [role="button"],
html.fx-cursor input,
html.fx-cursor textarea,
html.fx-cursor label {
  cursor: none;
}
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999; /* sopra ogni overlay: il cursore non deve mai sparire */
  pointer-events: none;
  border-radius: 9999px;
  will-change: transform;
}
.cursor-dot {
  width: 7px;
  height: 7px;
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
}
.cursor-ring {
  width: 38px;
  height: 38px;
  border: 1.5px solid rgba(56, 189, 248, 0.55);
  transition: width 0.25s ease, height 0.25s ease, border-color 0.25s ease,
    background-color 0.25s ease;
}
.cursor-ring.is-hover {
  width: 58px;
  height: 58px;
  border-color: rgba(45, 212, 191, 0.9);
  background: rgba(56, 189, 248, 0.08);
}
.cursor-ring.is-down {
  width: 28px;
  height: 28px;
}
.cursor-hidden .cursor-dot,
.cursor-hidden .cursor-ring {
  opacity: 0;
}

/* --- Testo con gradiente animato --- */
.text-gradient-animated {
  background: linear-gradient(90deg, #38bdf8, #2dd4bf, #a78bfa, #38bdf8);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s linear infinite;
}
@keyframes gradient-shift {
  to { background-position: 300% 0; }
}

/* --- Word-reveal (le parole vengono avvolte da fx.js) --- */
.word-wrap {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
}
.word-inner {
  display: inline-block;
  will-change: transform;
}

/* --- 3D tilt cards --- */
[data-tilt] {
  transform-style: preserve-3d;
  will-change: transform;
}
[data-tilt] .tilt-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(
    520px circle at var(--gx, 50%) var(--gy, 50%),
    rgba(255, 255, 255, 0.1),
    transparent 45%
  );
}
[data-tilt]:hover .tilt-glare {
  opacity: 1;
}

/* --- Shine sweep sui bottoni gradient (classe aggiunta da fx.js) --- */
.btn-shine {
  position: relative;
  overflow: hidden;
}
.btn-shine::after {
  content: "";
  position: absolute;
  top: 0;
  left: -160%;
  width: 55%;
  height: 100%;
  background: linear-gradient(
    105deg,
    transparent,
    rgba(255, 255, 255, 0.35),
    transparent
  );
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
.btn-shine:hover::after {
  left: 160%;
}

/* --- Fluttuazione lenta (pannelli hero/gestionale) --- */
@keyframes float-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.float-slow {
  animation: float-slow 7s ease-in-out infinite;
}

/* --- Marquee infinito --- */
.marquee {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 3rem;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee:hover .marquee-track {
  animation-play-state: paused;
}
@keyframes marquee {
  to { transform: translateX(-50%); }
}

/* --- Rete Italia: rotte animate + nodi pulsanti --- */
.net-route {
  stroke-dasharray: 5 13;
  animation: route-flow 1.5s linear infinite;
}
@keyframes route-flow {
  to { stroke-dashoffset: -18; }
}
.net-ping {
  transform-origin: center;
  transform-box: fill-box;
  animation: net-ping 2.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes net-ping {
  0% { transform: scale(0.4); opacity: 0.9; }
  80%, 100% { transform: scale(2.4); opacity: 0; }
}

/* --- Grafico "live" del mockup dashboard --- */
.live-bar {
  border-radius: 3px 3px 0 0;
  transition: height 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Watermark gigante nel footer --- */
.footer-watermark {
  position: absolute;
  top: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(4.5rem, 17vw, 13rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(51, 65, 85, 0.55);
  user-select: none;
  pointer-events: none;
  white-space: nowrap;
}

/* --- Navbar auto-hide --- */
#navbar.nav-hidden {
  transform: translateY(-100%);
}

/* --- Canvas hero 3D --- */
#hero-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#hero-canvas.is-ready {
  opacity: 1;
}

/* --- Intro cinematico 3D --- */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #020617;
  opacity: 1;
  transition: opacity 0.9s ease;
}
.intro-overlay.done {
  opacity: 0;
  pointer-events: none;
}
/* canvas del motion graphics */
.intro-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
/* caption cinematiche dell'atto 1 */
.intro-caption {
  position: absolute;
  left: 50%;
  bottom: max(16vh, 7vh + 4rem);
  transform: translate(-50%, 12px);
  z-index: 3;
  pointer-events: none;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  color: #cbd5e1;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.7s ease, transform 0.7s ease;
  text-shadow: 0 2px 20px rgba(2, 6, 23, 0.8);
}
.intro-caption.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* blocco centrale: logo + nome + tagline */
.intro-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 3;
  pointer-events: none;
  padding: 0 1.5rem;
}
.intro-logo {
  width: 96px;
  height: 96px;
  margin: 0 auto 1.6rem;
  border-radius: 1.6rem;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.4) rotate(-8deg);
  transition: opacity 0.5s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 60px rgba(99, 102, 241, 0.55), 0 0 120px rgba(56, 189, 248, 0.3);
}
.intro-logo img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}
.intro-logo.show {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}
.intro-center .intro-brand,
.intro-center .intro-tagline {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.intro-center .intro-brand.show,
.intro-center .intro-tagline.show {
  opacity: 1;
  transform: translateY(0);
}
/* grana pellicola animata */
.intro-grain {
  position: absolute;
  inset: -100px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.09'/%3E%3C/svg%3E");
  animation: grain-jitter 0.9s steps(4) infinite;
}
@keyframes grain-jitter {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-30px, 20px); }
  50% { transform: translate(25px, -30px); }
  75% { transform: translate(-20px, -15px); }
  100% { transform: translate(0, 0); }
}
/* letterbox cinematografico */
.intro-overlay .intro-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 7vh;
  background: #000;
  z-index: 2;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.intro-overlay .intro-bar.top { top: 0; }
.intro-overlay .intro-bar.bottom { bottom: 0; }
.intro-overlay.done .intro-bar.top { transform: translateY(-100%); }
.intro-overlay.done .intro-bar.bottom { transform: translateY(100%); }

.intro-title {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%);
  text-align: center;
  z-index: 3;
  opacity: 0;
  transition: opacity 1.1s ease, transform 1.1s ease;
  pointer-events: none;
  padding: 0 1.5rem;
}
.intro-title.show {
  opacity: 1;
  transform: translate(-50%, -50%);
}
.intro-title .intro-brand {
  font-size: clamp(2rem, 6vw, 4.5rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-shadow: 0 10px 60px rgba(2, 6, 23, 0.9);
}
.intro-title .intro-tagline {
  margin-top: 1rem;
  font-size: clamp(0.9rem, 2vw, 1.15rem);
  color: #94a3b8;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.intro-skip {
  position: absolute;
  right: max(2rem, 4vw);
  bottom: calc(7vh + 1.5rem);
  z-index: 4;
  padding: 0.55rem 1.2rem;
  border-radius: 9999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 6, 23, 0.5);
  color: #cbd5e1;
  font-size: 0.85rem;
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease;
}
.intro-skip:hover {
  border-color: rgba(56, 189, 248, 0.7);
  color: #fff;
}
.intro-progress {
  position: absolute;
  left: 0;
  bottom: 7vh;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, #0ea5e9, #14b8a6);
  z-index: 3;
}

/* ============================================================
   RETE OPERATIVA LIVE - overlay e card 3D per sede
   ============================================================ */
.rete-node text {
  user-select: none;
  pointer-events: none;
}
/* tooltip sedi sulla mappa */
.rete-tip {
  position: fixed;
  z-index: 500;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.6rem;
  padding: 0.45rem 0.7rem;
  max-width: 260px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.8);
}
.rete-tip.show {
  opacity: 1;
  transform: translateY(0);
}
.rete-tip strong {
  display: block;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.25;
}
.rete-tip span {
  display: block;
  color: #94a3b8;
  font-size: 0.68rem;
  margin-top: 0.15rem;
}
.sedi-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.sedi-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(10px);
  animation: sedi-fade 0.3s ease both;
}
@keyframes sedi-fade {
  from { opacity: 0; }
}
.sedi-panel {
  position: relative;
  width: 100%;
  max-width: 56rem;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(51, 65, 85, 0.6);
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(2, 6, 23, 0.9);
  animation: sedi-panel-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes sedi-panel-in {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
}
.sedi-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}
.sedi-panel-head h3 {
  color: #fff;
  font-weight: 700;
  font-size: 1.15rem;
}
.sedi-close {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  border: 1px solid rgba(100, 116, 139, 0.4);
  background: rgba(30, 41, 59, 0.6);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.sedi-close:hover {
  border-color: rgba(56, 189, 248, 0.7);
  color: #fff;
  transform: rotate(90deg);
}
.sedi-close [data-lucide],
.sedi-close svg { width: 18px; height: 18px; }
.sedi-cards {
  padding: 1.5rem;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  perspective: 1200px;
}

/* --- card sede --- */
.sede-card {
  position: relative;
  background: linear-gradient(160deg, rgba(30, 41, 59, 0.9), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(51, 65, 85, 0.55);
  border-top: 2px solid var(--ac, #38bdf8);
  border-radius: 1rem;
  padding: 1.15rem;
  transform-style: preserve-3d;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  will-change: transform;
}
.sede-card:hover {
  border-color: var(--ac, #38bdf8);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.7), 0 0 24px color-mix(in srgb, var(--ac, #38bdf8) 25%, transparent);
}
.sede-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.sede-ic {
  width: 42px;
  height: 42px;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, var(--ac, #38bdf8), var(--ac2, #2563eb));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ac, #38bdf8) 40%, transparent);
  transform: translateZ(18px);
}
.sede-ic [data-lucide],
.sede-ic svg { width: 20px; height: 20px; color: #fff; }
.sede-badge {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ac, #38bdf8);
  border: 1px solid color-mix(in srgb, var(--ac, #38bdf8) 45%, transparent);
  background: color-mix(in srgb, var(--ac, #38bdf8) 10%, transparent);
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.sede-card h4 {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 0.45rem;
  transform: translateZ(12px);
}
.sede-city {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
  font-size: 0.8rem;
}
.sede-city [data-lucide],
.sede-city svg { width: 13px; height: 13px; color: var(--ac, #38bdf8); }
.sede-addr {
  color: #64748b;
  font-size: 0.74rem;
  margin-top: 0.15rem;
}
.sede-area-tag {
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(71, 85, 105, 0.5);
}
.sede-area-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ac, #38bdf8);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.sede-area-desc {
  color: #94a3b8;
  font-size: 0.74rem;
  line-height: 1.45;
  margin-top: 0.3rem;
}

/* --- effetti d'ingresso: uno per macro area --- */
.fx-flip-y {
  animation: card-flip-y 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-flip-y {
  from { opacity: 0; transform: rotateY(-70deg) translateX(-20px); }
}
.fx-flip-x {
  animation: card-flip-x 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-flip-x {
  from { opacity: 0; transform: rotateX(60deg) translateY(20px); }
}
.fx-pop {
  animation: card-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes card-pop {
  from { opacity: 0; transform: scale(0.5); filter: blur(6px); }
}
.fx-tilt-in {
  animation: card-tilt-in 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes card-tilt-in {
  from { opacity: 0; transform: translateY(34px) rotateZ(-4deg) rotateX(20deg); }
}
.fx-rise {
  animation: card-rise 0.7s ease both;
}
@keyframes card-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
}
/* alone pulsante per le pulizie (violet) */
.area-pulizie:hover {
  animation: glow-pulse 1.6s ease-in-out infinite;
}
@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 18px 50px rgba(2, 6, 23, 0.7), 0 0 18px rgba(167, 139, 250, 0.25); }
  50% { box-shadow: 0 18px 50px rgba(2, 6, 23, 0.7), 0 0 34px rgba(167, 139, 250, 0.5); }
}

/* ============================================================
   Servizi — macro aree interattive (selettore + pannello 3D)
   ============================================================ */
.aree-tabs {
  perspective: 1000px;
}
.area-tab {
  position: relative;
  width: 100%;
  text-align: left;
  border-radius: 1rem;
  border: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(30, 41, 59, 0.45);
  padding: 1.25rem;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s, box-shadow 0.3s, background 0.3s;
}
.area-tab:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--ac, #38bdf8) 55%, transparent);
}
.area-tab.is-active {
  background: color-mix(in srgb, var(--ac, #38bdf8) 10%, rgba(15, 23, 42, 0.92));
  border-color: var(--ac, #38bdf8);
  box-shadow: 0 14px 44px rgba(2, 6, 23, 0.6),
    0 0 26px color-mix(in srgb, var(--ac, #38bdf8) 22%, transparent);
  transform: translateY(-4px) rotateX(3deg);
}
.area-tab-ic {
  width: 46px;
  height: 46px;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--ac, #38bdf8), var(--ac2, #2563eb));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 22px color-mix(in srgb, var(--ac, #38bdf8) 35%, transparent);
  transform: translateZ(16px);
  transition: transform 0.3s;
}
.area-tab:hover .area-tab-ic,
.area-tab.is-active .area-tab-ic {
  transform: translateZ(26px) scale(1.08);
}
.area-tab-ic [data-lucide],
.area-tab-ic svg { width: 22px; height: 22px; color: #fff; }
.area-tab-check {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  opacity: 0;
  transform: scale(0.4);
  transition: opacity 0.25s, transform 0.25s;
  color: var(--ac, #38bdf8);
}
.area-tab.is-active .area-tab-check {
  opacity: 1;
  transform: scale(1);
}
.area-tab-check [data-lucide],
.area-tab-check svg { width: 18px; height: 18px; }

.aree-stage {
  perspective: 1400px;
}
.area-panel {
  transform-style: preserve-3d;
  --ac: #38bdf8;
  --ac2: #2563eb;
}
.area-panel[hidden] {
  display: none;
}
.area-panel-card {
  border-top: 2px solid var(--ac, #38bdf8);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.55),
    0 0 40px color-mix(in srgb, var(--ac, #38bdf8) 12%, transparent);
}
.area-chip {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ac, #38bdf8);
  border: 1px solid color-mix(in srgb, var(--ac, #38bdf8) 45%, transparent);
  background: color-mix(in srgb, var(--ac, #38bdf8) 10%, transparent);
  padding: 0.3rem 0.7rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.area-fact {
  border: 1px solid rgba(51, 65, 85, 0.5);
  background: rgba(30, 41, 59, 0.4);
  border-radius: 0.8rem;
  padding: 0.8rem;
  text-align: center;
  transform: translateZ(10px);
}
.area-fact strong {
  display: block;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.area-fact span {
  color: #94a3b8;
  font-size: 0.72rem;
}

/* ============================================================
   Banner cookie
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 90;
  display: flex;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.cookie-banner.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.cookie-banner-card {
  pointer-events: auto;
  width: 100%;
  max-width: 640px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.7);
}
.cookie-banner-ic {
  width: 42px;
  height: 42px;
  border-radius: 0.8rem;
  background: linear-gradient(135deg, #0ea5e9, #14b8a6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 8px 22px rgba(14, 165, 233, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal,
  .js .reveal-left,
  .js .reveal-right,
  .js .reveal-scale,
  .js .stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
  .marquee-track {
    animation: none !important;
    transform: none !important;
  }
  .net-route,
  .net-ping,
  .float-slow {
    animation: none !important;
  }
  #hero-canvas {
    display: none;
  }
  .cursor-dot,
  .cursor-ring {
    display: none;
  }
}
