/* ===================================================
   HMP — Premium Design System
   =================================================== */

html {
  scroll-behavior: smooth;
  font-size: 87.5%; /* Aumentato da 75% per migliorare leggibilità (1rem = ~14px) */
}

:root {
  /* Colors */
  --primary: #04829B;
  --primary-light: #06a4c2;
  --primary-glow: rgba(4, 130, 155, 0.15);
  --secondary: #133A56;
  --secondary-deep: #0b2233;
  --accent-gold: #D4A843;
  --white: #ffffff;
  --light-gray: #f4f6f8;
  --text-dark: #1a2332;
  --text-light: #6b7b8d;
  --card-bg: #ffffff;
  --border-subtle: rgba(0, 0, 0, 0.06);

  /* Gradients */
  --gradient-hero: linear-gradient(160deg, rgba(11, 34, 51, 0.95) 0%, rgba(19, 58, 86, 0.9) 60%, rgba(4, 130, 155, 0.8) 100%);
  --gradient-dark: linear-gradient(180deg, #0f2b3f 0%, #133A56 100%);
  --gradient-card: linear-gradient(135deg, rgba(4, 130, 155, 0.05) 0%, rgba(19, 58, 86, 0.08) 100%);
  --gradient-icon: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 10px 30px rgba(19, 58, 86, 0.1);
  --shadow-glow: 0 4px 15px rgba(19, 58, 86, 0.15);

  /* Typography (Solenne) */
  --font-heading: 'Playfair Display', serif;
  --font-body: 'Lora', serif;

  /* Layout */
  --max-width: 1500px; /* Aumentato da 1280px a 1500px per maggiore ampiezza su schermi grandi */
  --header-height: 52px;

  /* Radii (More solid, less pill) */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 6px;
}

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

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  line-height: 1.7;
  background-color: var(--white);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--secondary);
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

/* === Scroll Progress Bar === */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--gradient-icon);
  z-index: 9999;
  width: 0%;
  transition: width 0.1s linear;
}

/* === Typography Utilities === */
.text-center {
  text-align: center;
}

.text-primary {
  color: var(--primary);
}

.text-secondary {
  color: var(--secondary);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
}

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

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

.btn-light {
  background: rgba(255, 255, 255, 0.15);
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(10px);
}

.btn-light:hover {
  background: var(--white);
  color: var(--primary);
  border-color: var(--white);
  transform: translateY(-3px);
}

/* === Header & Navigation === */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(255, 255, 255, 0.0);
  backdrop-filter: blur(0px);
  z-index: 1000;
  transition: all 0.4s ease;
}

/* Solid white header for inner pages (non-homepage) */
header.header-solid {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(19, 58, 86, 0.08);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

header.scrolled {
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(19, 58, 86, 0.08);
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.04);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo img {
  height: 30px;
  transition: filter 0.3s ease;
}

/* White logo only on homepage hero (not scrolled, not solid) */
header:not(.scrolled):not(.header-solid) .logo img {
  filter: brightness(10);
}

nav ul {
  display: flex;
  gap: 2rem;
}

nav a {
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--secondary);
  transition: color 0.3s ease;
  position: relative;
  padding: 0.3rem 0;
}

/* White nav text only on homepage hero (not scrolled, not solid) */
header:not(.scrolled):not(.header-solid) nav a {
  color: rgba(255, 255, 255, 0.9);
}

header:not(.scrolled):not(.header-solid) nav a:hover {
  color: var(--white);
}

/* Header transparent homepage: subtle bottom border for legibility */
header:not(.scrolled):not(.header-solid) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(11, 34, 51, 0.5) 0%, transparent 100%);
  backdrop-filter: blur(0px);
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 2px;
}

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

nav a:hover::after {
  width: 100%;
}

/* Sub-menus */
nav li {
  position: relative;
}

.submenu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--white);
  min-width: 260px;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 0;
  border-radius: var(--radius-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1001;
  border: 1px solid var(--border-subtle);
}

nav li:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.submenu li {
  width: 100%;
}

.submenu a {
  padding: 0.75rem 1.5rem;
  display: block;
  text-transform: none;
  font-size: 0.9rem;
  color: var(--text-dark) !important;
  letter-spacing: 0;
}

.submenu a:hover {
  background-color: var(--light-gray);
  color: var(--primary) !important;
}

.submenu a::after {
  display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--secondary);
  cursor: pointer;
  background: none;
  border: none;
}

header:not(.scrolled):not(.header-solid) .mobile-menu-btn {
  color: var(--white);
}

/* === Scroll anchor offset (fixed header compensation) === */
[id] {
  scroll-margin-top: calc(var(--header-height) + 24px);
}

/* === Hero Split Layout - Amalgamated === */
.hero-split {
  display: flex;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--secondary-deep);
}

.hero-split-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8rem 5rem 5rem 5rem;
  color: var(--white);
  position: relative;
  z-index: 3;
  max-width: 55%;
}

/* Subtle decorative glow */
.hero-split-content::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 150%;
  height: 100%;
  background: linear-gradient(90deg, rgba(11, 34, 51, 1) 40%, rgba(11, 34, 51, 0) 100%);
  pointer-events: none;
  z-index: -1;
}

.hero-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: 0 4px 15px rgba(6, 164, 194, 0.4);
  padding: 0.5rem 1.2rem;
  border-radius: var(--radius-pill);
  margin-bottom: 2rem;
  width: fit-content;
}

/* Hero Split — staggered entrance animations */
.hero-split-content .hero-badge {
  animation: heroFadeUp 0.7s 0.1s both ease-out;
}

.hero-split-content h1 {
  font-size: clamp(2.2rem, 3.5vw, 3.2rem);
  color: var(--white);
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 1.5rem;
  animation: heroFadeUp 0.8s 0.3s both ease-out;
}

.hero-split-content p {
  font-size: clamp(1rem, 1.3vw, 1.15rem);
  line-height: 1.8;
  opacity: 0.85;
  margin-bottom: 2.5rem;
  max-width: 500px;
  animation: heroFadeUp 0.8s 0.5s both ease-out;
}

.hero-split-content .hero-btns {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
  animation: heroFadeUp 0.8s 0.7s both ease-out;
  max-width: 600px; /* Contain the width of both buttons so they don't stretch too much */
}

.hero-split-content .hero-btns .btn,
.hero-split-content .hero-btns .btn-outline-light {
  flex: 1; /* Makes them identically sized */
  min-width: 200px;
  justify-content: center;
  text-align: center;
  padding: 1.2rem 1.5rem; /* Better symmetric padding */
}

.hero-split-content .hero-trust {
  animation: heroFadeUp 0.7s 0.9s both ease-out;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-outline-light {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2.5rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95rem;
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-outline-light:hover {
  background: var(--white);
  color: var(--secondary);
  border-color: var(--white);
  transform: translateY(-2px);
}

.hero-trust {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.hero-trust span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-trust i {
  color: var(--primary-light);
  font-size: 0.9rem;
}

/* Right side: Video — Amalgamated */
.hero-split-media {
  position: absolute;
  top: 0;
  right: 0;
  width: 65%;
  height: 100%;
  z-index: 1;
}

.hero-video-frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
  /* Maschera il video per sfumarlo morbidamente nel nero/blu verso sinistra e in basso */
  mask-image: linear-gradient(to right, transparent 0%, black 35%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 35%);
}

.hero-split-media::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
  background: linear-gradient(to top, var(--white) 0%, transparent 100%);
  z-index: 2;
  pointer-events: none;
}

.hero-split-media .hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-split-media .audio-toggle {
  position: absolute;
  bottom: 3rem;
  right: 3rem;
}

/* === Responsive Hero Split === */
@media (max-width: 992px) {
  .hero-split {
    flex-direction: column;
  }

  .hero-split-content {
    max-width: 100%;
    padding: 7rem 2rem 4rem;
  }

  .hero-split-content::after {
    display: none;
  }

  .hero-split-media {
    position: relative;
    width: 100%;
    max-width: 100%;
    min-height: 40vh;
  }

  .hero-video-frame {
    mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 20%);
  }

  .hero-split-media::after {
    height: 10%;
  }
}

@media (max-width: 768px) {
  .hero-split-content h1 {
    font-size: 1.8rem;
  }

  .hero-split-content p {
    font-size: 0.95rem;
  }

  .hero-split-media {
    min-height: 40vh;
  }
}

.hero {
  position: relative;
  height: 100vh;
  min-height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  overflow: hidden;
}

.hero-video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--gradient-hero);
  z-index: -1;
  transition: opacity 0.6s ease;
}

/* Video Relief Mode */
.hero.video-active .hero-overlay {
  opacity: 0;
}

.hero.video-active .hero-content {
  opacity: 0;
  pointer-events: none;
}

.hero.video-active .hero-video-wrapper {
  z-index: 10;
}

/* Audio Toggle */
.audio-toggle {
  position: absolute;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.audio-toggle:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.hero.video-active .audio-toggle {
  z-index: 1002;
  background: var(--primary);
  border-color: var(--primary);
}

/* Hero Content */
.hero-content {
  text-align: center;
  max-width: 900px;
  padding: 0 2rem;
  animation: heroReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.5s ease;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  margin-bottom: 1.5rem;
  color: var(--white);
  font-weight: 800;
  letter-spacing: -0.5px;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  margin-bottom: 3rem;
  opacity: 0.9;
  line-height: 1.8;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero-btns {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  z-index: 10;
}

.scroll-indicator i {
  animation: bounceDown 2s infinite;
  font-size: 1.2rem;
}

/* === Stats Counter Section === */
.stats-section {
  /* background removed */
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 3rem;
  text-align: center;
  color: var(--white);
}

.stat-item {
  position: relative;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  font-weight: 800;
  color: var(--white);
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--white) 30%, var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  line-height: 1.5;
}

.stat-divider {
  width: 40px;
  height: 3px;
  background: var(--primary);
  margin: 1rem auto 0;
  border-radius: 3px;
}

/* === Section Headers === */
.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h2 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  color: var(--secondary);
  margin-bottom: 1rem;
  letter-spacing: -0.3px;
}

.section-header p {
  color: var(--text-light);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

/* === News Carousel Section === */
.news-section {
  padding: 2rem 0;
  background-color: transparent;
  overflow: hidden;
}

.carousel-wrapper {
  position: relative;
  overflow: hidden;
  padding: 0 2rem;
}

.carousel-wrapper .carousel-nav {
  z-index: 10;
}

.carousel-container {
  display: flex;
  gap: 2rem;
  /* overflow is managed by JS (set to visible) and clipped by the wrapper */
  overflow: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* scroll-snap removed — JS handles positioning via transform */
}

.carousel-container:active {
  cursor: grabbing;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

/* Carousel Navigation Arrows */
.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: var(--secondary);
  font-size: 1.1rem;
  transition: all 0.3s ease;
}

.carousel-nav:hover {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.carousel-nav.prev {
  left: 0;
}

.carousel-nav.next {
  right: 0;
}

.carousel-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 2rem;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(19, 58, 86, 0.2);
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--primary);
}

.news-card {
  /* Show 1 full card + ~15% peek of next: fixed px on desktop */
  min-width: min(580px, calc(82% - 1rem));
  max-width: min(580px, calc(82% - 1rem));
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  scroll-snap-align: start;
}

.news-card:hover {
  transform: translateY(-12px);
  box-shadow: var(--shadow-hover);
}

.news-image {
  height: 220px;
  background-color: #e0e5ea;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  transition: all 0.5s ease;
}

/* Image zoom on hover */
.news-card:hover .news-image {
  background-size: 110%;
}

/* Gradient overlay on images */
.news-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
  pointer-events: none;
}

.news-date {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(11, 34, 51, 0.82);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.news-content {
  padding: 1.8rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.news-title {
  font-size: 1.15rem;
  color: var(--secondary);
  margin-bottom: 0.8rem;
  line-height: 1.4;
  font-weight: 700;
}

.news-excerpt {
  color: var(--text-light);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
  line-height: 1.7;
}

.read-more {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.3s ease;
}

.read-more i {
  transition: transform 0.3s ease;
  font-size: 0.75rem;
}

.news-card:hover .read-more {
  gap: 1rem;
}

.news-card:hover .read-more i {
  transform: translateX(4px);
}

/* === Features Section (Dark variant) === */
.features-section {
  padding: 8rem 0;
  background-color: var(--white);
}

.features-section.dark {
  background: var(--gradient-dark);
}

.features-section.dark .section-header h2 {
  color: var(--white);
}

.features-section.dark .section-header p {
  color: rgba(255, 255, 255, 0.7);
}

.features-section.dark .section-label {
  color: var(--primary-light);
}

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

.feature-item {
  text-align: center;
  padding: 2.5rem 2rem;
  border-radius: var(--radius-lg);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.features-section.dark .feature-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.features-section.dark .feature-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(4, 130, 155, 0.3);
}

.feature-item:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(4, 130, 155, 0.2);
}

.feature-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.5rem;
  background: var(--gradient-card);
  color: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: all 0.4s ease;
  position: relative;
}

.features-section.dark .feature-icon {
  background: rgba(4, 130, 155, 0.15);
}

.feature-item:hover .feature-icon {
  background: var(--gradient-icon);
  color: var(--white);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}

.feature-item h3 {
  font-size: 1.15rem;
  color: var(--secondary);
  margin-bottom: 0.8rem;
}

.features-section.dark .feature-item h3 {
  color: var(--white);
}

.feature-item p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.7;
}

.features-section.dark .feature-item p {
  color: rgba(255, 255, 255, 0.6);
}

/* === Video Pitch Banner === */
.pitch-banner {
  padding: 6rem 0;
  background: var(--gradient-card);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.pitch-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('img/generiche/B-STANZA_PROCED_B014C001_250412ZW.01_35_20_41.Still012.png') center/cover no-repeat;
  opacity: 0.06;
}

.pitch-banner h2 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
}

.pitch-banner p {
  color: var(--text-light);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* === Contact Section === */
.contact-section {
  padding: 8rem 0;
  background: var(--gradient-dark);
  color: var(--white);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: '';
  position: absolute;
  top: 20%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  pointer-events: none;
}

.contact-section h2 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.contact-section>.container>p {
  max-width: 600px;
  margin: 0 auto 3rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 1.1rem;
}

.contact-form {
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 1.1rem 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* === Footer === */
footer {
  background-color: var(--secondary-deep);
  color: rgba(255, 255, 255, 0.6);
  padding: 5rem 0 2rem;
  font-size: 0.95rem;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 992px) {
  .footer-top {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 768px) {
  .footer-top {
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.footer-brand {
  max-width: 320px;
}
@media (max-width: 768px) {
  .footer-brand { margin: 0 auto; }
}

.footer-logo-img {
  height: 40px;
  margin-bottom: 1.5rem;
  filter: brightness(0) invert(1);
}

.footer-description {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.footer-contact-info p {
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
@media (max-width: 768px) {
  .footer-contact-info p { justify-content: center; }
}
.footer-contact-info i {
  color: var(--primary-light);
  width: 16px;
  text-align: center;
}
.footer-contact-info a {
  color: inherit;
  transition: color 0.3s ease;
}
.footer-contact-info a:hover {
  color: var(--white);
}

.footer-links-group h4 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-heading);
}

.footer-links-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links-group ul li {
  margin-bottom: 0.8rem;
  color: rgba(255,255,255,0.6);
}

.footer-links-group ul a {
  color: rgba(255,255,255,0.6);
  transition: color 0.3s ease;
}

.footer-links-group ul a:hover {
  color: var(--primary-light);
}

.footer-socials {
  display: flex;
  gap: 1rem;
}
@media (max-width: 768px) {
  .footer-socials { justify-content: center; }
}
.footer-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  color: var(--white);
  transition: all 0.3s ease;
}

.footer-socials a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-partners {
  margin-top: 3rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.footer-partners p {
  font-size: 0.85rem;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.partner-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 2.5rem;
  opacity: 0.5;
  transition: opacity 0.4s ease;
}

.partner-grid:hover {
  opacity: 0.9;
}

.partner-grid img {
  height: 36px;
  max-width: 140px;
  object-fit: contain;
  filter: grayscale(1) brightness(2);
  transition: filter 0.3s ease;
}

.partner-grid img:hover {
  filter: grayscale(0) brightness(1);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
@media (max-width: 768px) {
  .footer-bottom {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}
.footer-bottom p {
  font-size: 0.85rem;
  margin: 0;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.footer-bottom-links a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.3s ease;
}
.footer-bottom-links a:hover {
  color: var(--white);
}

/* === Project Page Styles === */
.project-mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 4rem;
  align-items: stretch;
}

.project-device-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.project-device-image {
  width: 100%;
  height: 420px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
  cursor: pointer;
}

.roadmap-timeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
  position: relative;
  z-index: 2;
}

.roadmap-line {
  position: absolute;
  left: 50%;
  top: 4rem;
  bottom: 4rem;
  width: 4px;
  background: rgba(0,0,0,0.05);
  transform: translateX(-50%);
  z-index: 1;
}

.roadmap-timeline-icon {
  width: 60px;
  height: 60px;
  background: white;
  border: 4px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 0 8px white;
  z-index: 3;
}

.roadmap-reverse {
  flex-direction: row-reverse;
}

.roadmap-content,
.roadmap-image-container {
  width: 45%;
}

.roadmap-content {
  text-align: right;
  padding-right: 3rem;
}

.roadmap-timeline-item.roadmap-reverse .roadmap-content {
  text-align: left;
  padding-left: 3rem;
  padding-right: 0;
}

.roadmap-image-container {
  padding-left: 3rem;
}

.roadmap-timeline-item.roadmap-reverse .roadmap-image-container {
  padding-right: 3rem;
  padding-left: 0;
  text-align: right;
}

.roadmap-image {
  width: 100%;
  max-width: 250px;
  border-radius: 15px;
  box-shadow: 0 10px 20px rgba(0,0,0,0.08);
  transition: transform 0.3s;
}

/* === News Page Styles === */
.news-page-grid {
  max-width: 900px;
  margin: 4rem auto 0;
  position: relative;
}

/* Timeline line */
.news-page-grid::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(to bottom, var(--primary), var(--primary-light), transparent);
  border-radius: 3px;
}

.news-article {
  background: var(--card-bg);
  padding: 2.5rem 2.5rem 2.5rem 3.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 3rem;
  margin-left: 2rem;
  scroll-margin-top: 120px;
  position: relative;
  border: 1px solid var(--border-subtle);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.news-article:hover {
  box-shadow: var(--shadow-hover);
  transform: translateX(4px);
}

/* Timeline dot */
.news-article::before {
  content: '';
  position: absolute;
  left: -2.6rem;
  top: 2.5rem;
  width: 14px;
  height: 14px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--white);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.news-article-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
}

.news-article-header h2 {
  font-size: 1.4rem;
  line-height: 1.4;
  margin-top: 0.5rem;
}

.news-article-content {
  line-height: 1.9;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.news-article-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.news-tag {
  background: var(--gradient-icon);
  color: white;
  padding: 0.35rem 1.2rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.news-date-inline {
  color: var(--text-light);
  font-size: 0.85rem;
  float: right;
  margin-top: 0.3rem;
}

/* === Animations === */
@keyframes heroReveal {
  from {
    opacity: 0;
    transform: translateY(40px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes bounceDown {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(8px);
  }

  60% {
    transform: translateY(4px);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll reveal */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  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-up.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children animation */
.stagger-children>*:nth-child(1) {
  transition-delay: 0ms;
}

.stagger-children>*:nth-child(2) {
  transition-delay: 80ms;
}

.stagger-children>*:nth-child(3) {
  transition-delay: 160ms;
}

.stagger-children>*:nth-child(4) {
  transition-delay: 240ms;
}

.stagger-children>*:nth-child(5) {
  transition-delay: 320ms;
}

.stagger-children>*:nth-child(6) {
  transition-delay: 400ms;
}

.stagger-children>*:nth-child(7) {
  transition-delay: 480ms;
}

.stagger-children>*:nth-child(8) {
  transition-delay: 560ms;
}

/* === Homepage Dark Flow (Continuous Gradient) === */
.homepage-dark-flow {
  background: linear-gradient(180deg, #081b2b 0%, #0d2a40 15%, var(--secondary) 35%, #0f2b3f 60%, #0b2233 80%, var(--secondary-deep) 100%);
}

/* Make internal sections transparent so the gradient flows uniquely */
.homepage-dark-flow .hero-split,
.homepage-dark-flow .hero-split-content,
.homepage-dark-flow .hero-split-media,
.homepage-dark-flow .stats-section,
.homepage-dark-flow .news-section,
.homepage-dark-flow .features-section {
  background: transparent !important;
}

/* Fix text colors for news section (now sitting on dark background) */
.homepage-dark-flow .news-section h2,
.homepage-dark-flow .news-section p {
  color: var(--white);
}

.homepage-dark-flow .news-section .section-label {
  color: var(--primary-light);
}

.homepage-dark-flow .news-card {
  background: var(--white);
}

.homepage-dark-flow .news-card .news-title {
  color: var(--secondary-deep);
}

.homepage-dark-flow .news-card .news-excerpt {
  color: var(--text-medium);
}

/* === News Split Layout === */
.news-split-layout {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  padding: 2rem 0;
  /* adds some breathing room */
}

.news-split-left {
  text-align: left;
}

.news-split-left .section-label {
  margin-left: 0;
}

.news-split-right {
  width: 100%;
  overflow: hidden;
  /* clip the carousel gap correctly */
}

@media (min-width: 992px) {
  .news-split-layout {
    flex-direction: row;
    align-items: center;
    /* vertically align text header and carousel */
    justify-content: space-between;
  }

  .news-split-left {
    flex: 0 0 35%;
    /* text takes 35% of the container width */
    padding-right: 2rem;
  }

  .news-split-right {
    flex: 0 0 60%;
    /* carousel takes 60% of width */
  }
}

/* === Media Queries === */
@media (max-width: 992px) {
  .hero h1 {
    font-size: 2.8rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    padding: 1.5rem 0 2rem;
    z-index: 999;
    border-top: 1px solid var(--border-subtle);
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  body.menu-open {
    overflow: hidden;
  }

  nav.nav-open {
    display: block;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }

    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0 1.5rem;
  }

  nav>ul>li>a {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--secondary) !important;
  }

  /* Inline submenus on mobile */
  .submenu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    padding: 0.25rem 0 0.5rem 1rem;
    background: transparent;
    min-width: auto;
  }

  .submenu a {
    font-size: 0.85rem;
    padding: 0.5rem 0;
    color: var(--text-light) !important;
  }

  .mobile-menu-btn {
    display: block;
  }

  .hero h1 {
    font-size: 2.2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .news-card {
    min-width: 320px;
    max-width: 320px;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* Simplified timeline on mobile */
  .news-page-grid::before {
    display: none;
  }

  .news-article {
    margin-left: 0;
    padding-left: 2.5rem;
  }

  .news-article::before {
    display: none;
  }

  .hero-btns {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  
  .hero-btns .btn,
  .hero-btns .btn-outline-light {
    width: 100%;
  }

  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .project-device-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-device-image {
    height: 250px;
  }

  .roadmap-line {
    display: none;
  }

  .roadmap-timeline-item,
  .roadmap-timeline-item.roadmap-reverse {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
    margin-bottom: 3rem;
  }

  .roadmap-content,
  .roadmap-image-container,
  .roadmap-timeline-item.roadmap-reverse .roadmap-content,
  .roadmap-timeline-item.roadmap-reverse .roadmap-image-container {
    width: 100%;
    padding: 0;
    text-align: center;
  }

  .roadmap-timeline-item .roadmap-timeline-icon {
    position: static;
    transform: none;
    margin: 0 auto;
  }
}
/* === Language Switcher Visibility === */
.lang-switch-mobile {
    display: none !important;
}

@media (max-width: 768px) {
    .lang-switch.desktop-only {
        display: none !important;
    }
    .lang-switch-mobile {
        display: flex !important;
    }
}
