:root {
  --blue-900: #0b2545;
  --blue-800: #123a6b;
  --blue-700: #1a4f8f;
  --blue-600: #2166b3;
  --blue-100: #e8f0fb;
  --gray-900: #16202b;
  --gray-700: #43505c;
  --gray-500: #6b7785;
  --gray-300: #cdd5dd;
  --gray-100: #f4f6f8;
  --white: #ffffff;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(11, 37, 69, 0.08);
  --container-w: 1160px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--gray-900);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3 { font-weight: 700; line-height: 1.2; color: var(--blue-900); }
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.15rem; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue-600);
  margin-bottom: 12px;
}

.section-lead {
  color: var(--gray-700);
  font-size: 1.05rem;
  max-width: 640px;
  margin-top: 12px;
}

.section { padding: 96px 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 26px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--blue-700);
  color: var(--white);
  border-color: var(--blue-700);
}
.btn-primary:hover { background: var(--blue-800); border-color: var(--blue-800); }
.btn-outline {
  background: transparent;
  color: var(--blue-700);
  border-color: var(--blue-300, var(--gray-300));
}
.btn-outline:hover { border-color: var(--blue-700); background: var(--blue-100); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-300);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.logo {
  display: flex;
  align-items: center;
}
.logo-img {
  height: 42px;
  width: auto;
  display: block;
}
.logo-mark { letter-spacing: 0.03em; }
.logo-sub { font-weight: 500; font-size: 0.9rem; color: var(--gray-500); }
.footer-logo-img {
  height: 34px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}
.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--gray-700);
  transition: color 0.2s ease;
}
.main-nav a:hover { color: var(--blue-700); }
.main-nav .nav-cta { color: var(--white); padding: 10px 20px; }
.main-nav .nav-cta:hover { color: var(--white); }

/* Dropdown Servizi */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dropdown-caret { transition: transform 0.2s ease; }
.nav-dropdown.open .dropdown-caret { transform: rotate(180deg); }

.dropdown-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px;
  min-width: 340px;
  display: grid;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 60;
}
.nav-dropdown.open .dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.dropdown-panel a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.dropdown-panel a:hover { background: var(--blue-100); }
.dropdown-panel a strong { font-size: 0.92rem; color: var(--blue-900); font-weight: 600; }
.dropdown-panel a span { font-size: 0.8rem; color: var(--gray-500); }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--blue-900);
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.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 */
.hero {
  position: relative;
  overflow: hidden;
  background-color: var(--blue-900);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--white);
  padding: 120px 0 100px;
}
.hero-logo-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 560px;
  max-width: 70vw;
  height: auto;
  transform: translate(-50%, -50%);
  opacity: 0.08;
  filter: brightness(0) invert(1);
  pointer-events: none;
  animation: hero-logo-spin 40s linear infinite;
  z-index: 0;
}
@keyframes hero-logo-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}
.hero-inner { max-width: 760px; position: relative; z-index: 1; }
.hero .eyebrow { color: #9fc4f0; }
.hero h1 { color: var(--white); margin-bottom: 20px; }
.hero-lead {
  font-size: 1.1rem;
  color: #d7e5f7;
  max-width: 620px;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }
.hero .btn-outline { color: var(--white); border-color: rgba(255,255,255,0.5); }
.hero .btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }

.hero-stats {
  display: flex;
  gap: 48px;
  list-style: none;
  flex-wrap: wrap;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.8rem; font-weight: 800; }
.hero-stats span { color: #b9cee9; font-size: 0.9rem; }

/* Chi siamo */
.chi-siamo { background: var(--white); }
.chi-siamo h2 { max-width: 720px; margin-bottom: 40px; }
.chi-siamo-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: start;
}
.chi-siamo-text p { color: var(--gray-700); margin-bottom: 16px; }
.chi-siamo-values {
  display: grid;
  gap: 20px;
}
.value-card {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 24px;
  border-left: 3px solid var(--blue-600);
}
.value-card h3 { margin-bottom: 6px; }
.value-card p { color: var(--gray-700); font-size: 0.95rem; }

.azienda-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 48px;
}
.azienda-strip img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Servizi */
.servizi { background: var(--gray-100); }
.servizi-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-top: 40px;
}
.servizi-intro-text p { color: var(--gray-700); margin-bottom: 14px; }
.servizi-intro-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.servizi-intro-photos img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.servizi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.servizio-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
  overflow: hidden;
}
.servizio-card:hover { transform: translateY(-4px); }
.servizio-thumb {
  display: block;
  width: calc(100% + 48px);
  height: 140px;
  object-fit: cover;
  margin: -32px -24px 20px;
}
.servizio-card.has-gallery { cursor: pointer; }
.servizio-card.has-gallery:hover { box-shadow: 0 16px 36px rgba(11,37,69,0.14); }
.servizio-cta {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--blue-700);
}
.servizio-icon {
  font-size: 1.8rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue-100);
  border-radius: 12px;
  margin-bottom: 18px;
}
.servizio-icon-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}
.servizio-card h3 { margin-bottom: 10px; }
.servizio-card p { color: var(--gray-700); font-size: 0.93rem; }

/* Contatti */
.contatti { background: var(--white); }
.contatti-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
}
.contatti-info h2 { margin-bottom: 8px; }
.contatti-list {
  list-style: none;
  margin-top: 36px;
  display: grid;
  gap: 20px;
}
.contatti-list li { display: flex; flex-direction: column; gap: 2px; }
.contatti-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-500); font-weight: 600; }
.contatti-list a { color: var(--blue-700); font-weight: 600; }
.contatti-list a:hover { text-decoration: underline; }

.contatti-form {
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 36px;
  display: grid;
  gap: 18px;
}
.form-row { display: grid; gap: 6px; }
.form-row label { font-size: 0.9rem; font-weight: 600; color: var(--gray-900); }
.form-row input, .form-row textarea {
  border: 1px solid var(--gray-300);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--white);
  resize: vertical;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px var(--blue-100);
}
.form-submit { margin-top: 6px; width: 100%; }
.form-note { font-size: 0.9rem; color: var(--blue-700); min-height: 1.2em; }

/* Footer */
.site-footer {
  background: var(--blue-900);
  color: #b9cee9;
  padding: 48px 0 28px;
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 32px;
}
.footer-brand { color: var(--white); font-weight: 800; font-size: 1.2rem; }
.footer-brand p { color: #9fb6d4; font-weight: 400; font-size: 0.9rem; margin-top: 8px; }
.footer-nav { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-nav a { font-size: 0.9rem; }
.footer-nav a:hover { color: var(--white); }
.footer-copy {
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 24px;
  padding-top: 20px;
  font-size: 0.82rem;
  color: #8fa8c9;
}

/* Responsive */
@media (max-width: 900px) {
  .chi-siamo-grid, .contatti-grid { grid-template-columns: 1fr; }
  .servizi-grid { grid-template-columns: repeat(2, 1fr); }
  .servizi-intro { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 8px 24px 24px;
    border-bottom: 1px solid var(--gray-300);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
  }
  .main-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .main-nav a { padding: 14px 0; width: 100%; border-bottom: 1px solid var(--gray-100); }
  .main-nav .nav-cta { text-align: center; margin-top: 10px; border-bottom: none; }
  .menu-toggle { display: flex; }
  .nav-dropdown { width: 100%; }
  .nav-dropdown-trigger { width: 100%; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--gray-100); }
  .dropdown-panel {
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border: none;
    padding: 4px 0 4px 12px;
    max-height: 0;
    overflow: hidden;
    opacity: 1;
  }
  .nav-dropdown.open .dropdown-panel {
    max-height: 600px;
    transform: none;
  }
  .dropdown-panel a { padding: 10px 8px; }
  .section { padding: 64px 0; }
  .hero { padding: 90px 0 64px; }
  .servizi-grid { grid-template-columns: 1fr; }
  .hero-stats { gap: 32px; }
  .azienda-strip { grid-template-columns: 1fr; }
  .azienda-strip img { height: 200px; }
}

/* Gallery modal */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gallery-modal.open { display: flex; }
.gallery-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(11, 21, 37, 0.7);
  backdrop-filter: blur(2px);
}
.gallery-modal-panel {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  max-width: 920px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.35);
}
.gallery-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-300);
}
.gallery-modal-header h3 { color: var(--blue-900); font-size: 1.2rem; }
.gallery-modal-desc {
  padding: 18px 24px 0;
  color: var(--gray-700);
  font-size: 0.95rem;
  line-height: 1.6;
}
.gallery-close {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--gray-500);
  cursor: pointer;
  padding: 0 4px;
}
.gallery-close:hover { color: var(--blue-900); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 24px;
  overflow-y: auto;
}
.gallery-grid img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.gallery-grid img:hover { transform: scale(1.03); opacity: 0.92; }

@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 20, 0.92);
  padding: 40px;
}
.lightbox.open { display: flex; }
.lightbox-img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2.2rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.12);
  border: none;
  color: var(--white);
  font-size: 2.4rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.24); }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

@media (max-width: 640px) {
  .lightbox { padding: 16px; }
  .lightbox-nav { width: 42px; height: 42px; font-size: 1.8rem; }
  .lightbox-close { top: 10px; right: 14px; }
}
