/* 
  Studio Commercialista Roma - Andrea Sapienza
  Design: Signature Edition - Royal Blue & Pearl White
  Features: Organic curves, Dual-tone, High-end Typography.
*/

:root {
  --header-height: 80px;
  --bg: #ffffff;
  --bg-dark: #0a1128;
  --text: #0a1128;
  --gold: #b8953d;
  --font-body: "Source Sans 3", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ease-wow: cubic-bezier(0.8, 0, 0.2, 1);
  --radius: 24px;
  --shadow-wow: 0 40px 80px -20px rgba(10, 17, 40, 0.15);
  --maxw: 1200px;
  --surface: rgba(255, 255, 255, 0.98);
  --border: rgba(10, 17, 40, 0.12);
}

@media (max-width: 899px) {
  :root { --header-height: 70px; }
}

/* Base resets & Performance Improvements */
html { scroll-behavior: smooth; overflow-x: hidden; background: #fdfdfd; }
body { margin: 0; padding: 0; font-family: var(--font-body); color: var(--text); line-height: 1.7; -webkit-font-smoothing: antialiased; min-height: 100vh; position: relative; overflow-x: hidden; }

/* Desktop stability - Reserve space for common elements */
.site-header { 
  position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; 
  padding-block: 1rem; transition: all 0.6s var(--ease-wow); 
  height: var(--header-height); background: rgba(255, 255, 255, 0.98); 
  display: flex; align-items: center; border-bottom: 1px solid rgba(0,0,0,0.05);
  contain: layout;
}

.hero {
  position: relative;
  min-height: clamp(520px, 80vh, 820px);
  display: flex;
  align-items: center;
  padding-top: var(--header-height);
  background: transparent;
  contain: layout;
}

/* Global button styles for stability */
.btn {
  display: inline-flex;
  padding: 0.9rem 2rem;
  border-radius: 100px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  min-width: 180px;
  min-height: 48px;
  border: 1px solid transparent;
  transition: all 0.3s var(--ease-wow);
  white-space: nowrap;
}

.btn-sm { min-width: 120px; padding: 0.6rem 1.2rem; min-height: 40px; }

/* Prose for legal pages - Improvement */
.prose { max-width: 800px; margin-inline: auto; }
.prose h1, .prose h2, .prose h3 { margin-top: 2rem; margin-bottom: 1rem; }
.prose p { margin-bottom: 1.25rem; }
.prose ul { margin-bottom: 1.5rem; padding-left: 1.5rem; list-style: disc; }
.prose li { margin-bottom: 0.5rem; }

.legal-header { padding-block: 4rem 2rem; text-align: center; }
.legal-main { padding-bottom: 8rem; }
.legal-page .logo { justify-content: center; margin-bottom: 2rem; }

/* Map & Container Wow */
.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; position: relative; }

/* Image Stability */
img { max-width: 100%; height: auto; display: block; font-style: italic; background-repeat: no-repeat; background-size: cover; shape-margin: 0.75rem; }

/* Font size tweaks for stability */
h1 { line-height: 1.15; letter-spacing: -0.02em; }
h2 { line-height: 1.2; letter-spacing: -0.01em; }
p { line-height: 1.7; }

/* Reveal fix for CLS - ensure element is in flow even when hidden */
.reveal { opacity: 0; transition: opacity 0.8s var(--ease-wow); }
.reveal.is-visible { opacity: 1; }

/* --- Studio & Metodo Sections --- */
.section-padding {
  padding-block: clamp(6rem, 15vh, 12rem);
}

.card-modern {
  background: #ffffff;
  border: 1px solid rgba(184, 149, 61, 0.2);
  border-radius: 24px;
  padding: 2rem;
  transition: transform 0.4s var(--ease-wow), border-color 0.4s var(--ease-wow), background-color 0.4s var(--ease-wow), box-shadow 0.4s var(--ease-wow);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

@media (min-width: 768px) {
  .card-modern {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.card-modern:hover {
  transform: translateY(-10px);
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 40px rgba(184, 149, 61, 0.1);
}

.card-modern h3 { font-family: var(--font-display); font-size: 1.5rem; color: var(--bg-dark); margin-bottom: 0.5rem; }
.card-modern p { line-height: 1.6; }

.metodo-wrapper {
  margin-top: clamp(4rem, 10vh, 8rem);
  padding-top: clamp(3rem, 8vh, 6rem);
  border-top: 1px solid rgba(184, 149, 61, 0.15);
  position: relative;
}

.metodo-steps {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
  position: relative;
}

@media (min-width: 1024px) {
  .metodo-steps {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .metodo-steps::before {
    content: "";
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    z-index: 0;
    opacity: 0.3;
  }
}

.metodo-step {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  border: 1px solid transparent;
  transition: all 0.4s var(--ease-wow);
}

.metodo-step:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(184, 149, 61, 0.3);
  transform: scale(1.02);
}

.step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 1rem;
  display: inline-block;
  position: relative;
}

.step-num::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 20px;
  height: 2px;
  background: var(--gold);
  transform: translateX(-50%);
}

.metodo-icon {
  font-size: 2.2rem;
  margin-bottom: 1.2rem;
  display: block;
  filter: drop-shadow(0 5px 15px rgba(184, 149, 61, 0.2));
}

.step-content h4 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin-bottom: 0.8rem;
  color: var(--bg-dark);
}

.step-content p {
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --- Section Headers --- */
.section-header {
  text-align: center;
  margin-bottom: clamp(3rem, 8vh, 5rem);
}

.tagline {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.8rem;
  display: block;
}

.section-header h2, .section-header h3 {
  font-size: clamp(2rem, 5vw, 3rem);
  margin-bottom: 1rem;
}

.section-header p.muted {
  max-width: 600px;
  margin-inline: auto;
  font-size: 1.1rem;
}

/* --- Global Signature --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-dark); border-radius: 10px; border: 2px solid var(--bg); }

::selection { background: var(--gold); color: #000; }

*, *::before, *::after { box-sizing: border-box; }
img, svg, video, canvas { max-width: 100%; height: auto; display: block; }
html { 
  scroll-behavior: smooth; 
  overflow-x: hidden; 
  background: #fdfdfd; 
  margin: 0; 
  padding: 0;
}

/* Smooth scroll offset for fixed header */
@media (max-width: 899px) {
  :root { --header-height: 70px; }
  .site-header { height: 70px !important; }
}

.site-header { 
  background: #ffffff !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

.nav a { color: var(--bg-dark) !important; font-weight: 600; }
.nav a:hover { color: var(--gold) !important; }

.hero-copy h1 { 
  color: var(--bg-dark) !important; 
  text-shadow: none !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  min-height: 1.1em;
}

.hero-copy .lead {
  min-height: 3.2em;
}

@media (max-width: 768px) {
  .hero-copy h1 { min-height: 2.2em; }
  .hero-copy .lead { min-height: 6.5em; }
}

/* Performance Optimizations - Mobile Focus Extreme - Optimized Balance */
@media (max-width: 768px) {
  :root {
    --font-body: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-display: Georgia, serif;
  }
  
  /* Mantieni le animazioni Aurora ma ridotte e senza blur eccessivo per non rallentare */
  .aurora-blob {
    filter: blur(20px) !important; /* Blur ridotto per performance */
    opacity: 0.08 !important; /* Più tenue */
    will-change: transform;
  }
  
  .signature-shape, .section-curve {
    display: none !important;
  }
  
  /* Ripristina l'effetto vetro (blur) solo dove è critico per l'estetica */
  .card-modern, .service-card, .site-header {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    background: rgba(255, 255, 255, 0.85) !important;
  }

  .section-dark-island {
    background: #0a1128 !important;
    color: #fff !important;
  }

  .section-dark-island .service-card {
    background: rgba(255,255,255,0.05) !important;
    border-color: rgba(255,255,255,0.1) !important;
  }

  /* Simplify typography rendering */
  h1, h2, h3 {
    background: none !important;
    -webkit-background-clip: initial !important;
    -webkit-text-fill-color: initial !important;
    color: var(--bg-dark) !important;
    text-shadow: none !important;
  }

  .section-dark-island h1, 
  .section-dark-island h2,
  .section-dark-island .service-card h3 {
    color: #ffffff !important;
  }

  /* Content visibility for all sections except the first one */
  .section:not(#home) {
    content-visibility: auto;
    contain-intrinsic-size: 1px 400px;
  }

  /* Reduce padding for mobile speed and better LCP */
  .section {
    padding-block: 3rem !important;
  }
  
  .hero {
    min-height: 480px !important; /* Mantiene altezza fissa per evitare CLS */
    padding-top: 5rem !important;
    padding-bottom: 3rem !important;
  }

  /* Simpler reveal for mobile to avoid layout recalculations */
  .reveal {
    opacity: 0 !important;
    transform: none !important;
    transition: opacity 0.4s ease-out !important;
  }
  .reveal.is-visible {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Performance Optimizations - Content Visibility */
.section:not(#home) {
  content-visibility: auto;
  contain-intrinsic-size: 1px 500px;
}

.section { 
  scroll-margin-top: var(--header-height); 
  padding-block: clamp(5rem, 12vh, 10rem);
  position: relative;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.6s var(--ease-wow), transform 0.6s var(--ease-wow);
  will-change: opacity, transform;
}

body { 
  margin: 0; 
  padding: 0;
  font-family: var(--font-body); 
  background: transparent; 
  color: var(--text); 
  line-height: 1.7; 
  font-size: 1.05rem; 
  overflow-x: hidden; 
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow-wrap: break-word;
  display: block; /* Removed flex to allow normal flow */
  min-height: 100vh;
}

main#contenuto {
  display: block;
}

/* Skip Link Visually Hidden (Accessible) */
.skip-link {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip-link:focus { 
  width: auto;
  height: auto;
  clip: auto;
  margin: 0;
  padding: 1rem 2rem;
  top: 0;
  left: 0;
  background: var(--bg-dark);
  color: #fff;
  z-index: 10000;
  text-decoration: none;
}

/* Texture Overlay */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3%3Ffilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
  display: none;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
}

body.is-ready::before {
  display: none;
  opacity: 0;
}

/* Aurora Gradient System Masterpiece */
.aurora-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: #fdfdfd;
  pointer-events: none; /* Never capture clicks */
}

.aurora-blob {
  position: absolute;
  filter: blur(40px);
  opacity: 0.12;
  mix-blend-mode: normal;
  will-change: auto;
  animation: none;
}

.is-ready .aurora-blob {
  filter: blur(40px);
  opacity: 0.12;
}

/* Removed redundant mobile media query for performance consolidation */

.aurora-blob--1 {
  width: 80vw;
  height: 80vw;
  top: -20%;
  left: -20%;
  background: radial-gradient(circle, var(--gold) 0%, transparent 70%);
}

.aurora-blob--2 {
  width: 70vw;
  height: 70vw;
  bottom: -10%;
  right: -10%;
  background: radial-gradient(circle, var(--bg-dark) 0%, transparent 70%);
  animation-delay: -15s;
}

.aurora-blob--3 {
  width: 60vw;
  height: 60vw;
  top: 40%;
  right: 10%;
  background: radial-gradient(circle, var(--gold-dim) 0%, transparent 70%);
  animation-delay: -25s;
}

@keyframes aurora-mesh {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(3%, 3%) scale(1.05); }
  100% { transform: translate(0, 0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .aurora-blob, .signature-shape { animation: none !important; opacity: 0.15; }
}

/* Glassmorphism Floating Upgrade */
.glass-card {
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 20px 40px rgba(10, 17, 40, 0.05);
}

/* Floating "Island" Effect Compact */
.section-island {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  margin-inline: auto;
  width: min(94%, 1160px);
  border-radius: 32px; 
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem); 
  box-shadow: 0 40px 100px rgba(10, 17, 40, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
  position: relative;
  z-index: 10;
}

.section-dark-island {
  background: linear-gradient(135deg, #0a1128, #1a2a5a);
  color: #ffffff;
  margin-inline: auto;
  width: min(94%, 1160px);
  border-radius: 32px; 
  padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem); 
  box-shadow: 0 60px 120px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Typography Masterpiece */
h1 { 
  font-size: clamp(2.5rem, 7vw, 5rem); 
  background: linear-gradient(135deg, var(--bg-dark), var(--gold-dim));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.04em; 
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

h2 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.section-dark-island h1, .section-dark-island h2 {
  background: linear-gradient(135deg, #ffffff, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff; /* Fallback */
  -webkit-background-clip: initial; /* Fix contrast issue where needed */
  -webkit-text-fill-color: initial;
}

.section-dark-island p.lead {
  color: #ffffff !important;
  opacity: 1;
  font-weight: 500;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.section-dark-island .muted {
  color: rgba(255, 255, 255, 0.9) !important;
  opacity: 1;
}

/* Service Cards in Dark Island */
.section-dark-island .service-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
}

.section-dark-island .service-card h3 {
  color: var(--gold) !important;
  font-weight: 700;
  margin-bottom: 1rem;
}

.section-dark-island .service-card p {
  color: #ffffff !important;
  opacity: 0.95;
  line-height: 1.6;
}

/* Abstract Visual 3D */
.abstract-shape {
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: morph-3d 12s infinite ease-in-out;
  box-shadow: 
    0 50px 100px rgba(184, 149, 61, 0.3),
    inset 0 -20px 40px rgba(0,0,0,0.2),
    inset 0 20px 40px rgba(255,255,255,0.4);
  transform: perspective(1000px) rotateX(10deg) rotateY(-10deg);
}

@keyframes morph-3d {
  0%, 100% { transform: perspective(1000px) rotateX(10deg) rotateY(-10deg) scale(1); }
  50% { transform: perspective(1000px) rotateX(-5deg) rotateY(15deg) scale(1.05); }
}

/* Glassmorphism Global Helper */
.glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(10, 17, 40, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.container { position: relative; z-index: 5; width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

/* Section Curves */
.section-curve {
  position: absolute;
  left: 0;
  width: 100%;
  height: 150px;
  fill: var(--bg-dark);
  pointer-events: none;
  z-index: 2;
}
.section-curve--top { top: -149px; transform: scaleY(-1); }
.section-curve--bottom { bottom: -149px; }

/* --- Custom Shapes --- */
.signature-shape {
  position: absolute;
  z-index: 0;
  opacity: 0.12;
  filter: blur(60px);
  pointer-events: none;
  mix-blend-mode: normal;
  animation: none;
}

.signature-shape--1 {
  top: 10%;
  left: -5%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, var(--gold), transparent);
  border-radius: 50%;
  animation: none;
}

.signature-shape--2 {
  bottom: 10%;
  right: -5%;
  width: 45vw;
  height: 45vw;
  background: radial-gradient(circle, var(--gold-dim), transparent);
  border-radius: 50%;
  animation: none;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(3vw, 5vh) scale(1.1); }
  66% { transform: translate(-2vw, 2vh) scale(0.95); }
}

/* --- Typography --- */
h1, h2, h3 { font-family: var(--font-display); font-weight: 500; line-height: 1.1; margin: 0 0 1rem; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); letter-spacing: -0.02em; }
h3 { font-size: 1.4rem; }

.section-dark-island h1, .section-dark-island h2 {
  background: linear-gradient(135deg, #ffffff, #d4af37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #fff; /* Fallback */
  display: inline-block;
}

.serif-italic { font-family: var(--font-display); font-style: italic; font-weight: 500; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.7rem; color: var(--gold); font-weight: 800; margin-bottom: 1rem; display: block; }
.lead { font-size: clamp(1rem, 2vw, 1.2rem); color: var(--text); opacity: 1; margin-bottom: 1.2rem; font-weight: 500; }
.muted { color: var(--muted); font-size: 0.9rem; opacity: 1; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  padding: 0.9rem 2rem;
  min-height: 48px; /* Standard touch target height */
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--bg-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.4s var(--ease-wow);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  position: relative;
  overflow: hidden;
  user-select: none;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.btn:hover::before {
  left: 100%;
}

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

.btn:hover { 
  transform: translateY(-3px); 
  box-shadow: 0 8px 20px rgba(0,0,0,0.1); 
  border-color: var(--gold); 
}
.btn-primary { background: var(--bg-dark); color: #fff; border: none; }
.btn-primary:hover { background: var(--gold); color: #fff; transform: translateY(-3px); box-shadow: 0 10px 20px rgba(184, 149, 61, 0.2); }
.btn-ghost { 
  border: 1.5px solid var(--gold); 
  color: var(--gold) !important; 
  background: transparent; 
}
.btn-ghost:hover { 
  background: var(--gold); 
  color: #fff !important; 
  transform: translateY(-3px); 
  box-shadow: 0 10px 20px rgba(184, 149, 61, 0.2);
}
.btn-sm { padding: 0.6rem 1.4rem; font-size: 0.7rem; }

/* --- Header --- */
.site-header { 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  z-index: 1000; 
  padding-block: 1rem; 
  transition: all 0.6s var(--ease-wow); 
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  contain: layout;
}

.header-inner { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  gap: clamp(1rem, 3vw, 2rem);
  width: 100%;
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}
}

.logo { 
  display: inline-flex; 
  align-items: center; 
  text-decoration: none; 
  color: var(--bg-dark); 
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-text-studio {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 700;
  margin-right: 0.4em;
  font-size: 0.9em;
}

.logo span:not(.logo-text-studio) {
  font-weight: 400;
}

/* Header Navigation */
.nav { 
  display: none; 
  gap: clamp(0.4rem, 1vw, 1.2rem); 
  align-items: center; 
  flex: 1; 
  justify-content: center; 
}

.nav a { 
  text-decoration: none; 
  color: var(--bg-dark); 
  font-weight: 700; 
  font-size: 0.75rem; 
  text-transform: uppercase; 
  letter-spacing: 0.05em; 
  opacity: 0.7; 
  transition: all 0.3s; 
  position: relative; 
  white-space: nowrap; 
}

.nav a::after { 
  content: ""; 
  position: absolute; 
  bottom: -4px; 
  left: 50%; 
  width: 12px; 
  height: 2px; 
  background: var(--gold); 
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.3s var(--ease-wow); 
  border-radius: 2px;
}

.nav a:hover::after, .nav a.is-active::after { 
  transform: translateX(-50%) scaleX(1); 
}
.nav a:hover, .nav a.is-active { opacity: 1; color: var(--gold); }

.nav-mobile-btns { display: none !important; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.menu-toggle { 
  display: flex; 
  flex-direction: column; 
  justify-content: space-between; 
  width: 44px; 
  height: 44px; 
  background: none; 
  border: none; 
  cursor: pointer; 
  padding: 10px; 
  z-index: 1100; 
}

.menu-toggle span { 
  width: 24px; 
  height: 2px; 
  background-color: var(--bg-dark); 
  transition: all 0.4s var(--ease-wow); 
  transform-origin: center;
}

@media (min-width: 900px) {
  .nav { display: flex; }
  .menu-toggle { display: none; }
}

@media (max-width: 899px) {
  .header-actions { display: none !important; }
  .nav { 
    display: flex;
    position: fixed; 
    top: 0; 
    right: -100%; 
    width: 100%; 
    height: 100vh; 
    background: #fff; 
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    padding: 2rem; 
    transition: right 0.6s var(--ease-wow); 
    z-index: 1050; 
    gap: 1.5rem;
    overflow-y: auto;
  }
  .nav.open { right: 0; }
  .nav a { font-size: 1.25rem; padding: 0.5rem; width: 100%; text-align: center; }
  .nav-mobile-btns { display: flex !important; flex-direction: column; gap: 1rem; width: 100%; max-width: 280px; margin-top: 1rem; }
  .nav-mobile-btns .btn { width: 100%; min-height: 48px; }
  
  .menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-toggle.open span:nth-child(2) { opacity: 0; }
  .menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
}

/* --- Hero WOW --- */
.hero {
  position: relative;
  min-height: 75vh; /* Ridotto ancora */
  display: flex;
  align-items: center;
  padding-top: 2rem; 
  background: transparent;
}

.hero::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40px; /* Ridotto */
  background: transparent;
  clip-path: ellipse(80% 50% at 50% 100%);
  z-index: 1;
}

.hero-grid { text-align: center; max-width: 800px; margin-inline: auto; position: relative; z-index: 10; }
.hero-copy { position: relative; z-index: 15; padding-bottom: 0.5rem; } 
.hero-actions { display: flex; justify-content: center; gap: 0.8rem; margin-top: 1rem; position: relative; z-index: 50; }

/* --- Sections Liquid Transitions Compact --- */
.section { 
  padding-block: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 4vh, 3rem);
  position: relative; 
  overflow: hidden; /* Evita scroll orizzontale da animazioni off-screen */
  background: transparent; 
}

/* Floating "Island" Effect Compact - Removed duplicate */

.section-dark-island .eyebrow { color: #d4af37 !important; opacity: 1; }
.section-dark-island * { color: #ffffff !important; }
.section-dark-island h2 { color: #ffffff !important; background: none !important; -webkit-text-fill-color: initial !important; display: inline-block; font-size: clamp(1.8rem, 4vw, 2.5rem); opacity: 1; }
.section-dark-island .lead { color: #ffffff !important; opacity: 0.9; }
.section-dark-island .muted { color: rgba(255,255,255,0.7) !important; }

.section-head { margin-bottom: 2rem; text-align: center; max-width: 800px; margin-inline: auto; }
.section-head .eyebrow { margin-bottom: 0.5rem; }
.section-head h2 { margin-bottom: 1rem; }
.section-dark-island .section-head { text-align: center; margin-inline: auto; }

/* Map Signature Upgrade Big */
.map-container-modern {
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid var(--bg-dark);
  outline: 1px solid var(--gold);
  height: clamp(280px, 45vh, 420px);
  width: 100%;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.1);
  transition: transform 0.4s var(--ease-wow), outline-width 0.4s var(--ease-wow);
  cursor: pointer;
}

.map-placeholder-modern * {
  pointer-events: none;
}

.map-container-modern:hover {
  outline-width: 2px;
  transform: scale(1.005);
}

.map-placeholder-modern {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--bg-dark), #1a2a5a);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  z-index: 20;
}

.map-placeholder-modern .btn {
  background: var(--gold);
  color: var(--bg-dark);
  border: none;
}

/* Cards Wow */
.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .card-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .card-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 767px) { .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .card-grid.cols-4, .card-grid.cols-3, .card-grid.cols-2 { grid-template-columns: 1fr; } }

.service-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.4s var(--ease-wow);
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  color: var(--text);
}

.section-dark-island .service-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(10px);
}

.service-card h3 { color: var(--bg-dark); font-weight: 700; font-size: 1.2rem; }
.section-dark-island .service-card h3 { color: var(--gold) !important; }

.service-card p.muted { color: var(--text); font-weight: 400; line-height: 1.5; font-size: 0.9rem; }
.section-dark-island .service-card p.muted { color: rgba(255, 255, 255, 0.9) !important; opacity: 1; }



/* Ensure hero behaves like a section */
.hero.section {
  display: flex;
  align-items: center;
  padding-top: clamp(6rem, 15vh, 10rem);
}

/* Service Cards - Full Clickable & No Arrow */
.service-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(184, 149, 61, 0.15);
  border-radius: 28px;
  padding: 2.5rem;
  transition: transform 0.5s var(--ease-wow), border-color 0.5s var(--ease-wow), box-shadow 0.5s var(--ease-wow), background-color 0.5s var(--ease-wow);
  box-shadow: 0 10px 30px rgba(0,0,0,0.02);
  color: var(--text);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.service-card:hover { 
  transform: translateY(-12px) scale(1.02); 
  border-color: var(--gold); 
  box-shadow: 0 25px 50px rgba(184, 149, 61, 0.12);
  background: rgba(255, 255, 255, 0.95);
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 0;
  background: var(--gold);
  transition: height 0.4s var(--ease-wow);
}

.service-card:hover::before {
  height: 100%;
}

.service-card h3 { 
  color: var(--bg-dark); 
  font-weight: 700; 
  font-size: 1.3rem;
  margin: 0;
}

.section-dark-island .service-card {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.section-dark-island .service-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--gold);
}

/* About WOW */
.about-flex { display: grid; gap: 3rem; align-items: center; }
@media (min-width: 1024px) { .about-flex { grid-template-columns: 1.3fr 0.7fr; } }

.about-visual { position: relative; display: flex; justify-content: center; }
.abstract-shape {
  width: 100%;
  max-width: 350px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--gold), var(--gold-dim));
  border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: morph 15s infinite ease-in-out;
  box-shadow: 
    0 30px 60px rgba(184, 149, 61, 0.25),
    inset 0 -10px 20px rgba(0,0,0,0.1),
    inset 0 10px 20px rgba(255,255,255,0.3);
  position: relative;
}

.abstract-shape::after {
  content: "";
  position: absolute;
  inset: -15px;
  border: 1px solid var(--gold-dim);
  border-radius: inherit;
  opacity: 0.3;
  animation: morph 15s infinite ease-in-out reverse;
}

.initials { font-size: 5rem; font-weight: 800; color: #fff; opacity: 0.9; font-family: var(--font-display); }

@keyframes morph {
  0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  50% { border-radius: 30% 60% 70% 30% / 50% 60% 30% 60%; }
}

/* Timeline WOW */
.timeline { display: grid; gap: 2.5rem; position: relative; }
.timeline-item { display: flex; gap: 2rem; align-items: flex-start; }
.timeline-num { 
  font-family: var(--font-display); 
  font-size: 3rem; 
  font-weight: 700; 
  color: var(--gold); 
  opacity: 0.3; 
  line-height: 1; 
}

/* --- Footer --- */
.site-footer { 
  background: var(--bg-dark); 
  color: rgba(255, 255, 255, 0.7); 
  padding-block: 4rem 2rem; 
  border-radius: 40px 40px 0 0;
  margin-top: 0;
  position: relative;
  z-index: 20;
  box-shadow: 0 -20px 50px rgba(0,0,0,0.1);
}
.site-footer .muted { color: rgba(255, 255, 255, 0.8) !important; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: inherit; text-decoration: none; font-size: 0.8rem; }
.footer-links a:hover { color: #fff; }

/* WhatsApp Floating */
.whatsapp-float {
  position: fixed;
  bottom: 25px;
  right: 25px;
  background: #25d366;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 20px rgba(37, 211, 102, 0.2);
  z-index: 1100;
  transition: all 0.4s var(--ease-wow);
}
.whatsapp-float:hover { transform: scale(1.1); }
.whatsapp-float svg { width: 24px; height: 24px; }

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 1800;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(10, 17, 40, 0.18);
}

.cookie-inner {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 600px) {
  .cookie-inner { flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions .btn { width: 100%; }
}

/* Modals */
html.modal-open,
body.modal-open {
  overflow: hidden !important;
  height: 100dvh !important;
  width: 100vw !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  touch-action: none !important;
  -webkit-overflow-scrolling: none !important;
  overscroll-behavior: none !important; /* Blocca swipe-to-back e swipe-to-forward */
}

/* Rimuove forzatamente le scrollbar su tutti i motori di rendering */
html.modal-open::-webkit-scrollbar,
body.modal-open::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.modal-dialog-wide::-webkit-scrollbar,
.cal-iframe-wrap::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}

html.modal-open,
body.modal-open,
.modal,
.modal-dialog-wide,
.cal-iframe-wrap {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
}

.modal {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100dvh !important;
  z-index: 2000;
  background: rgba(10, 17, 40, 0.85); /* Leggermente più trasparente per vedere lo sfondo */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem !important; /* Padding per staccare il modal dai bordi */
  margin: 0 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s var(--ease-wow);
  overflow: hidden !important;
  touch-action: none !important;
}

.modal:not([hidden]) { opacity: 1; visibility: visible; display: flex !important; }

.modal-dialog {
  background: #fff;
  border-radius: 16px;
  padding: 1.25rem 1.75rem;
  width: min(100% - 2rem, 440px);
  max-height: 98vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 60px rgba(0,0,0,0.2);
}

.modal-dialog h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  margin-bottom: 0.15rem;
  color: var(--bg-dark);
}

.modal-dialog p.muted {
  margin-bottom: 0.5rem;
  font-size: 0.8rem;
  line-height: 1.4;
}

.modal-dialog-wide {
  position: relative !important;
  width: 96vw !important;
  height: 96vh !important;
  max-width: 1200px !important; /* Limite per non farlo troppo largo su schermi enormi */
  max-height: 96vh !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden !important; /* Elimina ogni scroll interno al dialog */
  background: #fff;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4) !important;
  user-select: none;
  overscroll-behavior: none !important;
}

.cal-iframe-wrap {
  flex: 1;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important; /* Blocca scroll nel wrapper */
  background: #fff;
  position: relative;
}

#calendly-iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block;
  position: absolute;
  top: 0 !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

@media (max-width: 768px) {
  .modal {
    padding: 0.5rem !important;
  }
  .modal-dialog-wide {
    width: 100% !important;
    height: 95dvh !important;
    max-height: 95dvh !important;
    border-radius: 12px !important;
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--bg-dark);
  z-index: 2100;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: all 0.3s ease;
}

.modal-close:hover {
  transform: scale(1.1);
  background: #fff;
}

.form-grid { 
  display: grid; 
  gap: 0.6rem; 
  margin-top: 0.5rem;
  grid-template-columns: 1fr;
}

.form-grid label { 
  display: block; 
  font-weight: 700; 
  margin-bottom: 0.15rem; 
  font-size: 0.65rem; 
  text-transform: uppercase; 
  letter-spacing: 0.05em;
  color: var(--muted); 
}

.form-grid input { 
  width: 100%; 
  padding: 0.5rem 0.85rem; 
  border-radius: 8px; 
  border: 1.5px solid var(--border); 
  font-family: inherit; 
  font-size: 0.9rem; 
  transition: all 0.3s var(--ease-wow);
  background: #fdfdfd;
}

.form-grid textarea { 
  width: 100%; 
  padding: 0.5rem 0.85rem; 
  border-radius: 8px; 
  border: 1.5px solid var(--border); 
  font-family: inherit; 
  font-size: 0.9rem; 
  transition: all 0.3s var(--ease-wow);
  background: #fdfdfd;
  min-height: 65px; 
  resize: vertical;
}

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.checkbox-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

.form-grid button {
  padding-block: 0.75rem;
  min-height: 42px;
}

/* Reveal Animations Upgrade */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s var(--ease-wow), transform 0.8s var(--ease-wow);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced complexity for mobile */
@media (max-width: 768px) {
  .reveal {
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
  }
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* Fix per link e contatti WOW */
a[href^="tel:"], a[href^="mailto:"], .contact-card a {
  font-weight: 700;
  color: var(--gold);
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(212, 175, 55, 0.1);
  transition: all 0.4s var(--ease-wow);
}

a[href^="tel:"]:hover, a[href^="mailto:"]:hover, .contact-card a:hover {
  background: var(--gold);
  color: #fff !important;
  transform: translateY(-1px);
}

/* --- Contact Section Restyling --- */
.contact-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: 1fr 1fr;
}

.contact-info-panel {
  display: grid;
  gap: 1.5rem;
}

.contact-card-modern {
  background: var(--bg-elev);
  padding: 1.5rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  transition: all 0.4s var(--ease-wow);
  display: flex;
  align-items: center;
  gap: 1.2rem;
  text-decoration: none;
  color: inherit;
}

.contact-card-modern:hover {
  transform: translateX(5px);
  border-color: var(--gold);
  box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.contact-icon-box {
  width: 45px;
  height: 45px;
  background: var(--bg-dark);
  color: var(--gold);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.contact-icon-box svg { width: 20px; height: 20px; }

.contact-details h3 {
  margin: 0 0 0.2rem;
  font-family: var(--font-body);
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.contact-details p {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text); 
}

.map-container-modern {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  height: clamp(280px, 45vh, 420px);
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.05);
}

.map-placeholder-modern {
  position: absolute; 
  inset: 0;
  background: var(--bg-dark);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
}

#map-embed {
  width: 100%;
  height: 100%;
}
#map-embed iframe {
  width: 100%;
  height: 100%;
}

@media (max-width: 1024px) {
  .contact-grid { grid-template-columns: 1fr; }
  .map-container-modern { height: clamp(260px, 42vh, 400px); }
}

/* Responsive */
@media (max-width: 600px) {
  .section-island, .section-dark-island {
    padding: 2.5rem 1.2rem;
    border-radius: 24px;
    margin-inline: 0.5rem;
    width: calc(100% - 1rem);
  }
  .hero { padding-top: 5rem; min-height: 40vh; }
  .hero h1 { font-size: 2rem; margin-bottom: 1rem; }
  .lead { font-size: 1rem; line-height: 1.5; }
  .btn { width: 100%; min-height: 48px; } /* Touch-friendly and full-width on mobile */
  .hero-actions { flex-direction: column; width: 100%; max-width: 280px; margin-inline: auto; }
  .map-container-modern { height: clamp(240px, 40vh, 340px); }
  .timeline-item { flex-direction: column; gap: 0.5rem; }
  .timeline-num { font-size: 2rem; }
  .about-flex { gap: 2rem; }
  .initials { font-size: 3.5rem; }
}

@media (max-width: 400px) {
  .section-island, .section-dark-island {
    padding: 2rem 1rem;
    margin-inline: 0.25rem;
    width: calc(100% - 0.5rem);
  }
  h2 { font-size: 1.8rem; }
}
