/* ==========================================================================
   Nautica Rugiada — design system (da DESIGN.md, base Apple)
   ========================================================================== */

:root {
  --primary: #2E86C1;
  --primary-hover: #2574A9;
  --primary-on-dark: #5DADE2;
  --ink: #0A2540;
  --body-muted: #5A6B7C;
  --on-dark: #FFFFFF;
  --muted-on-dark: #B8C7D4;
  --canvas: #FFFFFF;
  --canvas-alt: #F5F8FB;
  --surface-navy: #0A2540;
  --surface-navy-2: #0D2C4B;
  --hairline: #E2E8F0;

  --font-display: "Montserrat", system-ui, sans-serif;
  --font-text: "Inter", system-ui, sans-serif;

  --radius-sm: 8px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --section-pad: 96px;
  --container: 1200px;
  --container-text: 760px;

  --img-shadow: rgba(10, 37, 64, 0.22) 3px 5px 30px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --------------------------------------------------------------------------
   Tipografia
   -------------------------------------------------------------------------- */

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--ink); }

.hero-title { font-size: 56px; line-height: 1.07; letter-spacing: -0.5px; font-weight: 700; }
.display-lg { font-size: 40px; line-height: 1.1; }
.display-md { font-size: 32px; line-height: 1.2; }
.lead { font-size: 24px; line-height: 1.4; font-weight: 400; color: var(--body-muted); }

.kicker {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--primary);
  display: block;
  margin-bottom: 16px;
}

.muted { color: var(--body-muted); }

.on-dark h2, .on-dark h3, .on-dark p { color: var(--on-dark); }
.on-dark .muted { color: var(--muted-on-dark); }
.on-dark .kicker { color: var(--primary-on-dark); }
.on-dark a:not(.btn) { color: var(--primary-on-dark); }

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

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

.tile { padding: var(--section-pad) 0; }
.tile-alt { background: var(--canvas-alt); }
.tile-navy { background: var(--surface-navy); }

.section-head { text-align: center; max-width: 720px; margin: 0 auto 56px; }
.section-head p { margin-top: 16px; }

/* --------------------------------------------------------------------------
   Bottoni
   -------------------------------------------------------------------------- */

.btn {
  display: inline-block;
  font-family: var(--font-text);
  font-size: 17px;
  border-radius: var(--radius-pill);
  padding: 12px 26px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease, transform 0.1s ease;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: var(--on-dark); }
.btn-primary:hover { background: var(--primary-hover); }

.btn-ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-ghost:hover { background: rgba(46, 134, 193, 0.08); }

.on-dark .btn-ghost { color: var(--on-dark); border-color: rgba(255, 255, 255, 0.5); }
.on-dark .btn-ghost:hover { background: rgba(255, 255, 255, 0.1); }

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s ease;
}
.nav.scrolled { border-bottom-color: var(--hairline); }

.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav-logo { display: flex; align-items: center; }
.nav-logo img { height: 60px; width: auto; }

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: 14px;
  color: var(--ink);
  font-weight: 400;
}
.nav-links a:hover { color: var(--primary); text-decoration: none; }
.nav-links a.active { color: var(--primary); font-weight: 600; }
.nav-links .btn { font-size: 14px; padding: 9px 20px; color: var(--on-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: 82vh;
  display: flex;
  align-items: center;
  color: var(--on-dark);
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(10, 37, 64, 0.55), rgba(10, 37, 64, 0.35));
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: var(--container);
  margin: 0 auto;
  padding: 120px 24px;
}
.hero-content .kicker { color: var(--primary-on-dark); }
.hero-content h1 { color: var(--on-dark); max-width: 15ch; }
.hero-content .lead { color: rgba(255, 255, 255, 0.88); max-width: 44ch; margin: 24px 0 40px; }
.hero-ctas { display: flex; gap: 16px; flex-wrap: wrap; }

/* Hero pagine interne */
.page-hero { padding: 88px 0 64px; text-align: center; }
.page-hero .lead { max-width: 620px; margin: 20px auto 0; }

/* --------------------------------------------------------------------------
   Card servizi
   -------------------------------------------------------------------------- */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 24px;
}

.card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.card img {
  border-radius: var(--radius-sm);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-bottom: 20px;
}
.card h3 { font-size: 21px; margin-bottom: 10px; }
.card p { color: var(--body-muted); font-size: 15px; flex: 1; }
.card .card-link { margin-top: 16px; font-weight: 600; font-size: 15px; }

/* --------------------------------------------------------------------------
   Sezioni a due colonne
   -------------------------------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.split img {
  border-radius: var(--radius-lg);
  box-shadow: var(--img-shadow);
}
.split h2 { margin-bottom: 20px; }
.split p + p { margin-top: 14px; }

/* --------------------------------------------------------------------------
   Numeri (tile navy)
   -------------------------------------------------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 48px;
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 700;
  color: var(--on-dark);
  line-height: 1;
}
.stat-number .suffix { color: var(--primary-on-dark); }
.stat-label {
  margin-top: 12px;
  color: var(--muted-on-dark);
  font-size: 15px;
}

/* --------------------------------------------------------------------------
   Galleria
   -------------------------------------------------------------------------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}
.gallery-grid figure {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
}
.gallery-grid img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
  transition: transform 0.4s ease;
}
.gallery-grid figure:hover img { transform: scale(1.03); }
.gallery-grid figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 32px 20px 16px;
  background: linear-gradient(transparent, rgba(10, 37, 64, 0.75));
  color: var(--on-dark);
  font-size: 14px;
}

/* --------------------------------------------------------------------------
   Servizi — pagina dettaglio
   -------------------------------------------------------------------------- */

.service-block { padding: 72px 0; }
.service-block:nth-child(even) { background: var(--canvas-alt); }
.service-block .split img { aspect-ratio: 16 / 10; object-fit: cover; }
.service-list { list-style: none; margin-top: 20px; }
.service-list li {
  padding-left: 28px;
  position: relative;
  margin-bottom: 10px;
  color: var(--body-muted);
}
.service-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 14px;
  height: 2px;
  background: var(--primary);
}

/* --------------------------------------------------------------------------
   Contatti
   -------------------------------------------------------------------------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: start;
}
.contact-info h3 { font-size: 18px; margin: 28px 0 6px; }
.contact-info h3:first-child { margin-top: 0; }
.contact-info a.tel {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 600;
}
.map-frame {
  border: 0;
  width: 100%;
  height: 460px;
  border-radius: var(--radius-lg);
}
.social-links { display: flex; gap: 16px; margin-top: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------------
   Pagine legali
   -------------------------------------------------------------------------- */

.legal { padding: 72px 0; }
.legal h1 { font-size: 36px; margin-bottom: 8px; }
.legal .updated { color: var(--body-muted); font-size: 14px; margin-bottom: 40px; }
.legal h2 { font-size: 24px; margin: 40px 0 12px; }
.legal p, .legal li { color: var(--body-muted); font-size: 16px; }
.legal ul { padding-left: 22px; margin: 12px 0; }
.legal table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15px; }
.legal th, .legal td { border: 1px solid var(--hairline); padding: 10px 14px; text-align: left; color: var(--body-muted); }
.legal th { color: var(--ink); background: var(--canvas-alt); }

/* --------------------------------------------------------------------------
   CTA finale
   -------------------------------------------------------------------------- */

.cta-final { text-align: center; }
.cta-final .btn { margin-top: 32px; }
.cta-final .tel-note { margin-top: 20px; font-size: 15px; color: var(--body-muted); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
  background: var(--surface-navy);
  color: var(--muted-on-dark);
  padding: 64px 0 32px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}
.footer h4 {
  font-family: var(--font-display);
  color: var(--on-dark);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer ul { list-style: none; }
.footer li { margin-bottom: 10px; }
.footer a { color: var(--muted-on-dark); }
.footer a:hover { color: var(--on-dark); }
.footer-brand img { height: 68px; width: auto; margin-bottom: 20px; }
.footer-legal {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 24px;
  font-size: 12px;
  color: rgba(184, 199, 212, 0.7);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Animazioni (attivate da js/main.js)
   -------------------------------------------------------------------------- */

.fade-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .fade-up { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  :root { --section-pad: 56px; }

  .hero-title { font-size: 38px; }
  .display-lg { font-size: 30px; }
  .display-md { font-size: 26px; }
  .lead { font-size: 19px; }

  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 92px;
    left: 0;
    right: 0;
    background: var(--canvas);
    border-bottom: 1px solid var(--hairline);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 18px;
    display: none;
  }
  .nav-links.open { display: flex; }

  .split { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .hero { min-height: 70vh; }
  .stat-number { font-size: 42px; }
}
