/* Google Fonts now loaded in HTML <head> for better performance */

:root {
  --primary: #b52022;
  --primary-hover: #8f191b;
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --text-dark: #0f172a;
  --text-light: #475569;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: 1px solid rgba(255, 255, 255, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background: var(--bg-color);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

h1 {
  font-size: 2.75rem;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

p {
  margin-bottom: 1.25rem;
  color: var(--text-light);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--primary-hover);
}

/* Layout & Utility */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-center {
  text-align: center;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

/* Bottoni */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  gap: 0.5rem;
  text-decoration: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

/* Header & Navigazione */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: var(--glass-border);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: var(--transition-smooth);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
}

.logo img {
  height: 48px;
  border-radius: 8px;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-dark);
  font-size: 1rem;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.75rem;
  cursor: pointer;
  color: var(--text-dark);
}

/* Hero Section */
.hero {
  padding: 6rem 0 4rem;
  min-height: 60vh;
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  right: -10%;
  top: -10%;
  width: 50%;
  height: 120%;
  background: radial-gradient(circle, rgba(181, 32, 34, 0.05) 0%, rgba(255, 255, 255, 0) 70%);
  border-radius: 50%;
}

.hero-content {
  max-width: 800px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 1rem;
  background: rgba(181, 32, 34, 0.08);
  color: var(--primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  font-weight: 600;
  border: 1px solid rgba(181, 32, 34, 0.2);
}

/* AI-Ready SGE Content */
.topic-cluster-answer {
  background: white;
  border-left: 4px solid var(--primary);
  padding: 1.5rem 2rem;
  border-radius: 0 12px 12px 0;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
  color: #334155;
  font-size: 1.1rem;
  line-height: 1.7;
}

/* Griglie e Card */
section {
  padding: 6rem 0;
}

.tab-section {
  scroll-margin-top: 100px;
}

.bg-light {
  background: white;
}

.section-title {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 700px;
  margin-inline: auto;
}

.section-title h2 {
  font-size: 2.5rem;
}

.section-title p {
  font-size: 1.125rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4rem;
  align-items: center;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2.5rem;
}

.reviews-slider {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding: 1rem 0.5rem 2rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.reviews-slider::-webkit-scrollbar {
  display: none;
}

.review-card {
  min-width: 340px;
  max-width: 400px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  justify-content: flex-start;
  padding: 1.5rem;
}

.card {
  background: var(--surface-color);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  transition: var(--transition-smooth);
  border: 1px solid rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(181, 32, 34, 0.1);
}

.card-icon {
  font-size: 2.75rem;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.card h3 {
  font-size: 1.5rem;
}

/* Contatti & Footer */
.contact-map {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  height: 400px;
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

footer {
  background: #0f172a;
  color: white;
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: block;
  color: white;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: #cbd5e1;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 0.875rem;
}

/* Animazioni */
@keyframes float {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-15px);
  }

  100% {
    transform: translateY(0px);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 {
  transition-delay: 100ms;
}

.delay-200 {
  transition-delay: 200ms;
}

.delay-300 {
  transition-delay: 300ms;
}

/* Responsive */
@media (max-width: 992px) {
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .nav-links {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  h1 {
    font-size: 2.25rem !important;
  }

  h2 {
    font-size: 1.875rem;
  }

  .logo-text {
    display: none;
  }

  .hero .container {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    text-align: center;
  }

  .hero {
    padding: 5rem 0 3rem;
    min-height: 40vh;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--surface-color);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border-top: 1px solid #f1f5f9;
    clip-path: circle(0% at 100% 0);
    transition: clip-path 0.4s ease-in-out;
  }

  .nav-links.nav-active {
    clip-path: circle(150% at 100% 0);
  }

  .mobile-toggle {
    display: block;
  }
}

/* Slider Controls */
.slider-container {
  position: relative;
  display: flex;
  align-items: center;
}

.slider-arrow {
  background: white;
  border: 1px solid #e2e8f0;
  color: var(--primary);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  transition: var(--transition-smooth);
}

.slider-arrow:hover {
  background: var(--primary);
  color: white;
}

.slider-arrow.prev {
  left: -10px;
}

.slider-arrow.next {
  right: -10px;
}

@media (max-width: 768px) {
  .slider-arrow {
    display: none;
  }
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
  z-index: 999;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  color: white;
}