/* ============================================================
   GREGORINI GIARDINI — style.css
   ============================================================
   COME MODIFICARE I COLORI:
   Cerca ":root {" qui sotto e cambia i valori esadecimali.
   Le variabili CSS si applicano a tutto il sito automaticamente.
   ============================================================ */

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

/* ── VARIABILI COLORE ── */
:root {
  --verde:      #2d4a2d;   /* verde scuro principale */
  --verde-mid:  #3e6b3e;   /* verde medio (hover, accenti) */
  --verde-light:#e8f0e8;   /* verde chiaro (sfondi secondari) */
  --crema:      #f7f3ec;   /* sfondo principale */
  --grigio:     #5a5555;   /* testi secondari */
  --testo:      #2a2a2a;   /* testo principale */
  --bianco:     #ffffff;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Lato', sans-serif;
  background: var(--crema);
  color: var(--testo);
  line-height: 1.7;
}

/* ── NAV ── */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(247,243,236,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(45,74,45,0.08);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--verde);
  text-decoration: none;
  min-width: 0;
}

.nav-logo-img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  clip-path: circle(38% at 50% 50%);
  object-fit: cover;
  object-position: center;
  flex-shrink: 0;
  transform: scale(1.35);
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--verde);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 26px;
  margin-left: auto;
  margin-right: 24px;
}

.nav-links a {
  color: var(--verde);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--verde-mid); }

.nav-tel {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--verde);
  text-decoration: none;
  border: 1.5px solid var(--verde);
  padding: 7px 18px;
  border-radius: 30px;
  transition: background 0.25s, color 0.25s;
}
.nav-tel:hover { background: var(--verde); color: var(--bianco); }

/* ── HERO ── */
.hero {
  --hero-logo-mask-radius: 132px;
  --hero-logo-mask-y: calc(50% - 184px);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 120px 24px 80px;
  /* Velo crema sopra la foto: alza i due valori per schiarire, abbassali per far
     emergere di piu' la foto. A 1 / 1 lo sfondo torna crema pieno come prima. */
  --hero-velo-top: 0.90;
  --hero-velo-bottom: 0.94;
  background:
    radial-gradient(ellipse at 70% 30%, rgba(62,107,62,0.13) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(45,74,45,0.10) 0%, transparent 55%),
    var(--crema);
  position: relative;
  overflow: hidden;
}

/* cerchi decorativi */
.hero::before {
  content: '';
  position: absolute;
  width: 480px; height: 480px;
  border-radius: 50%;
  border: 1px solid rgba(45,74,45,0.12);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(
    circle var(--hero-logo-mask-radius) at 50% var(--hero-logo-mask-y),
    transparent 0 var(--hero-logo-mask-radius),
    #000 calc(var(--hero-logo-mask-radius) + 1px)
  );
  mask-image: radial-gradient(
    circle var(--hero-logo-mask-radius) at 50% var(--hero-logo-mask-y),
    transparent 0 var(--hero-logo-mask-radius),
    #000 calc(var(--hero-logo-mask-radius) + 1px)
  );
}
.hero::after {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  border-radius: 50%;
  border: 1px solid rgba(45,74,45,0.06);
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
  -webkit-mask-image: radial-gradient(
    circle var(--hero-logo-mask-radius) at 50% var(--hero-logo-mask-y),
    transparent 0 var(--hero-logo-mask-radius),
    #000 calc(var(--hero-logo-mask-radius) + 1px)
  );
  mask-image: radial-gradient(
    circle var(--hero-logo-mask-radius) at 50% var(--hero-logo-mask-y),
    transparent 0 var(--hero-logo-mask-radius),
    #000 calc(var(--hero-logo-mask-radius) + 1px)
  );
}

/* Foto di sfondo della hero + velo crema */
.hero-bg {
  position: absolute;
  left: 0; right: 0; top: -10%;
  height: 120%;
  z-index: 0;
  background: url('assets/images/oliveto-colline.jpg') center center / cover no-repeat;
  will-change: transform;
  pointer-events: none;
}

.hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    rgba(247,243,236,var(--hero-velo-top)),
    rgba(247,243,236,var(--hero-velo-bottom))
  );
}

.hero > *:not(.hero-bg) { position: relative; z-index: 1; }

/* Nav che si compatta quando si scorre */
nav {
  transition: padding 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

nav.is-scrolled {
  padding-top: 11px;
  padding-bottom: 11px;
  background: rgba(247,243,236,0.96);
  box-shadow: 0 6px 24px rgba(45,74,45,0.08);
}

.nav-logo-img { transition: transform 0.35s ease; }
nav.is-scrolled .nav-logo-img { transform: scale(0.86); }

/* Sottolineatura animata sui link della nav */
.nav-links a { position: relative; }

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -5px;
  height: 1.5px;
  background: var(--verde-mid);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* Titolo hero: le parole salgono da dietro una maschera */
.hero h1.is-split { animation: none; opacity: 1; }

.hero h1 .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: 0.3em;
  margin-bottom: -0.3em;
}

/* A animazione finita togliamo la maschera: le lettere con la coda
   (g, p, q) restano intere anche se scendono sotto la linea di base. */
.hero h1.is-done .word { overflow: visible; }

.hero h1 .word > span {
  display: inline-block;
  animation: wordUp 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wordUp {
  from { transform: translateY(115%); }
  to   { transform: translateY(0); }
}

/* Zoom morbido sulla foto attiva del carosello */
.work-frame img { transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1); }
.work-slide.is-active .work-frame { cursor: pointer; }
.work-slide.is-active .work-frame:hover img { transform: scale(1.045); }

/* logo hero */
.logo-img {
  width: 218px; height: 218px;
  margin-bottom: 8px;
  border-radius: 50%;
  clip-path: circle(40% at 50% 50%);
  object-fit: cover;
  object-position: center;
  position: relative;
  z-index: 2;
  transform: scale(1.22);
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--verde-mid);
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 600;
  color: var(--verde);
  line-height: 1.18;
  max-width: 700px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.hero h1 em {
  font-style: italic;
  font-weight: 400;
}

.hero-sub {
  font-size: 1rem;
  color: var(--grigio);
  font-weight: 300;
  letter-spacing: 0.04em;
  margin-bottom: 44px;
  position: relative;
  z-index: 1;
}

.hero-cta-group {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ── BOTTONI ── */
.btn-primary {
  background: var(--verde);
  color: var(--bianco);
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 40px;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: background 0.25s, transform 0.2s;
  display: inline-block;
}
.btn-primary:hover { background: var(--verde-mid); transform: translateY(-2px); }

.btn-ghost {
  color: var(--verde);
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 40px;
  border: 1.5px solid var(--verde);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  transition: background 0.25s, color 0.25s, transform 0.2s;
  display: inline-block;
}
.btn-ghost:hover { background: var(--verde); color: var(--bianco); transform: translateY(-2px); }

/* ── CHI SIAMO ── */
.about {
  background: var(--verde);
  color: var(--bianco);
  padding: 90px 24px;
  text-align: center;
}

.about-inner {
  max-width: 680px;
  margin: 0 auto;
}

.about h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 400;
  font-style: italic;
  margin-bottom: 24px;
  line-height: 1.3;
  opacity: 0.95;
}

.about p {
  font-size: 1rem;
  font-weight: 300;
  line-height: 1.85;
  opacity: 0.85;
  margin-bottom: 14px;
}

.about-sig {
  margin-top: 36px;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.2rem;
  opacity: 0.75;
}

/* ── SERVIZI ── */
.services {
  padding: 90px 24px;
  background: var(--crema);
}

.section-label {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--verde-mid);
  margin-bottom: 14px;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  text-align: center;
  color: var(--verde);
  margin-bottom: 56px;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.service-card {
  background: var(--bianco);
  border: 1px solid rgba(45,74,45,0.1);
  border-radius: 16px;
  padding: 36px 28px 32px;
  text-align: center;
  transition: transform 0.25s, box-shadow 0.25s;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 32px rgba(45,74,45,0.12);
}

.service-icon-badge {
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
  background: var(--verde-light);
  border: 1px solid rgba(45,74,45,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.service-icon-img {
  display: block;
  max-width: 58px;
  max-height: 58px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.service-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--verde);
  line-height: 1.3;
}

/* ── LAVORI ESEGUITI ── */
.works {
  background: var(--bianco);
  padding: 90px 24px;
}

.works-inner {
  max-width: 1040px;
  margin: 0 auto;
}

.works-carousel {
  position: relative;
  overflow: hidden;
}

.works-track-outer {
  overflow: hidden;
  padding: 0 14%;
}

.works-track {
  display: flex;
  transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.work-slide {
  flex: 0 0 72%;
  min-width: 0;
  padding: 0 10px;
  opacity: 0.4;
  transition: opacity 0.45s ease;
}

.work-slide.is-active { opacity: 1; }

/* Cornice fissa: la foto viene mostrata INTERA, mai croppata */
.work-frame {
  width: 100%;
  min-width: 0;
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--verde-light);
  border: 1px solid rgba(45,74,45,0.12);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Riempie le bande laterali con la stessa foto sfocata, invece di lasciare il vuoto */
.work-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  filter: blur(26px) brightness(0.82) saturate(1.05);
  transform: scale(1.15);
}

.work-frame img {
  position: relative;
  z-index: 1;
  display: block;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.works-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 28px;
}

.work-control {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--verde);
  background: transparent;
  color: var(--verde);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, transform 0.2s;
}

.work-control:hover {
  background: var(--verde);
  color: var(--bianco);
  transform: translateY(-2px);
}

.work-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.work-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(45,74,45,0.25);
}

.work-dots span.is-active {
  background: var(--verde);
}

/* ── CONTATTI ── */
.contact {
  background: var(--verde-light);
  padding: 90px 24px;
  text-align: center;
}

.contact-inner {
  max-width: 560px;
  margin: 0 auto;
}

.contact h2 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  color: var(--verde);
  margin-bottom: 12px;
}

.contact-sub {
  color: var(--grigio);
  font-size: 0.97rem;
  font-weight: 300;
  margin-bottom: 44px;
}

.contact-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bianco);
  border-radius: 12px;
  padding: 18px 24px;
  text-decoration: none;
  color: var(--testo);
  border: 1px solid rgba(45,74,45,0.1);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.contact-item:hover {
  border-color: var(--verde);
  box-shadow: 0 4px 16px rgba(45,74,45,0.1);
}

.contact-item-icon {
  width: 38px; height: 38px;
  background: var(--verde-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--verde);
}

.contact-item-text { text-align: left; }

.contact-item-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--grigio);
  margin-bottom: 2px;
}

.contact-item-value {
  font-size: 0.97rem;
  font-weight: 400;
  color: var(--testo);
}

/* ── FOOTER ── */
footer {
  background: var(--verde);
  color: rgba(255,255,255,0.55);
  text-align: center;
  padding: 32px 24px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  line-height: 2;
}

footer strong { color: rgba(255,255,255,0.8); }
.footer-link {
  color: rgba(255,255,255,0.62);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-link:hover { color: var(--bianco); }

/* ── PAGINA PRIVACY ── */
.legal {
  background: var(--crema);
  padding: 140px 24px 80px;
}
.legal-inner {
  max-width: 760px;
  margin: 0 auto;
}
.legal h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  color: var(--verde);
  margin-bottom: 8px;
}
.legal .legal-updated {
  color: var(--grigio);
  font-size: 0.82rem;
  margin-bottom: 40px;
}
.legal h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  color: var(--verde);
  margin: 34px 0 12px;
}
.legal p, .legal li {
  color: var(--testo);
  font-weight: 300;
  line-height: 1.85;
}
.legal ul { margin: 10px 0 0 20px; }
.legal li { margin-bottom: 8px; }
.legal a { color: var(--verde-mid); }
.legal .back-link {
  display: inline-block;
  margin-top: 44px;
  color: var(--verde);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  border-bottom: 1.5px solid var(--verde);
  padding-bottom: 3px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
}

@media (max-width: 820px) {
  .works-track-outer { padding: 0 7%; }
  .work-slide { flex: 0 0 86%; padding: 0 6px; }
}

@media (max-width: 600px) {
  nav {
    padding: 12px 16px;
    gap: 12px;
  }

  .nav-logo-img {
    width: 44px;
    height: 44px;
  }

  .nav-logo {
    font-size: 0.98rem;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-tel {
    font-size: 0.78rem;
    padding: 6px 12px;
    letter-spacing: 0.02em;
  }

  .hero {
    --hero-logo-mask-radius: 112px;
    --hero-logo-mask-y: calc(50% - 244px);
    padding: 104px 18px 64px;
  }

  .hero::before {
    width: 340px;
    height: 340px;
  }

  .hero::after {
    width: 460px;
    height: 460px;
  }

  .hero-eyebrow {
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    max-width: 320px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 15vw, 3.2rem);
  }

  .hero-sub {
    max-width: 300px;
    margin-bottom: 34px;
  }

  .hero-cta-group { flex-direction: column; align-items: center; }
  .logo-img {
    width: 176px;
    height: 176px;
    margin-bottom: 10px;
  }

  .about,
  .services,
  .works,
  .contact {
    padding: 68px 18px;
  }

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

  /* Carosello: foto piu' grande, quasi a tutta larghezza, formato 4:3 */
  .works { padding-left: 8px; padding-right: 8px; }
  .works .section-label,
  .works .section-title { padding-left: 14px; padding-right: 14px; }
  .works-track-outer { padding: 0 3%; }
  .work-slide { flex: 0 0 94%; padding: 0 5px; }
  .work-frame { aspect-ratio: 4 / 3; border-radius: 14px; }

  /* Frecce piu' grandi: 42px e' sotto la soglia di 44px per il tocco */
  .work-control { width: 46px; height: 46px; }
  .works-controls { gap: 14px; margin-top: 22px; }

  /* Titolo hero meno ingombrante sul telefono */
  .hero h1 { font-size: clamp(2.1rem, 12vw, 2.75rem); }

  .contact-item {
    align-items: flex-start;
    padding: 16px;
  }

  .contact-item-value {
    overflow-wrap: anywhere;
  }
}

/* ── COMPARSA PROGRESSIVA ALLO SCROLL ── */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .work-slide, .works-track, .hero-bg, nav, .nav-logo-img { transition: none; }
  .hero h1 .word > span { animation: none; transform: none; }
  .work-frame img { transition: none; }
}

/* ── ANIMAZIONI ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-eyebrow  { animation: fadeUp 0.7s ease both; }
.logo-img      { animation: fadeUp 0.7s 0.1s ease both; }
.hero h1       { animation: fadeUp 0.7s 0.2s ease both; }
.hero-sub      { animation: fadeUp 0.7s 0.35s ease both; }
.hero-cta-group { animation: fadeUp 0.7s 0.5s ease both; }
