/* ===================================================
   [NOME AZIENDA] - Stile principale
   Palette: Lino caldo + Antracite + Terracotta
   =================================================== */

/* -- Variabili ------------------------------------ */
:root {
  --cream:      #F4EFE4;
  --cream-dark: #E8E0D0;
  --dark:       #1C1916;
  --dark-mid:   #3A332C;
  --terra:      #B86B2F;
  --terra-dark: #9A5820;
  --terra-light:#D4895A;
  --white:      #FDFAF5;
  --gray:       #8A8278;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  --nav-h: 72px;
  --section-gap: clamp(80px, 12vw, 140px);
  --container:    1160px;
  --radius:       4px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* -- Reset ---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--dark);
  line-height: 1.7;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
select, input, textarea { font-family: var(--font-body); font-size: 1rem; }

/* -- Container ------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
}

/* -- Buttons -------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  transition: all 0.25s var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--terra); color: var(--white); }
.btn-primary:hover {
  background: var(--terra-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(184,107,47,0.35);
}
.btn-ghost { border: 1.5px solid rgba(255,255,255,0.5); color: var(--white); }
.btn-ghost:hover {
  border-color: var(--white);
  background: rgba(255,255,255,0.1);
  transform: translateY(-2px);
}
.btn-full { width: 100%; justify-content: center; }

/* -- Sezioni -------------------------------------- */
.section { padding: var(--section-gap) 0; }
.section-label {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terra);
  font-weight: 500;
  margin-bottom: 24px;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 28px;
}
.section-title em { font-style: italic; color: var(--terra); font-weight: 400; }
.section-intro {
  font-size: 1.1rem;
  color: var(--dark-mid);
  max-width: 580px;
  margin-bottom: 60px;
}
.desktop-br { display: inline; }

/* -- Reveal animations ----------------------------
   opacity:0 di default; JS aggiunge .visible per mostrare.
   Il tag <noscript> nell'HTML fa da fallback se JS e' disabilitato. */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s var(--ease), transform 0.65s var(--ease);
}
.reveal.visible {
  opacity: 1;
  transform: none;
}

/* ===================================================
   HEADER - Barra bianca sfocata, logo nero sempre visibile
   =================================================== */
#header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(253, 250, 245, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(228, 220, 210, 0.6);
  box-shadow: 0 2px 16px rgba(28,25,22,0.06);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
#header.scrolled {
  background: rgba(253, 250, 245, 0.97);
  box-shadow: 0 2px 24px rgba(28,25,22,0.10);
}
.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo img {
  height: 44px;
  width: auto;
}

#main-nav ul { display: flex; gap: 36px; align-items: center; }
#main-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--dark-mid);
  transition: color 0.2s;
}
#main-nav a:hover { color: var(--terra); }

.nav-cta {
  background: var(--terra) !important;
  color: var(--white) !important;
  padding: 10px 22px;
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.2s !important;
}
.nav-cta:hover { background: var(--terra-dark) !important; transform: translateY(-1px); }

/* Burger */
.burger { display: none; flex-direction: column; gap: 5px; padding: 6px; }
.burger span {
  display: block; width: 24px; height: 2px;
  background: var(--dark); border-radius: 2px;
  transition: all 0.3s var(--ease);
}
.burger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===================================================
   HERO
   =================================================== */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg { position: absolute; inset: 0; }
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(28,25,22,0.78) 0%,
    rgba(28,25,22,0.48) 60%,
    rgba(28,25,22,0.28) 100%
  );
}
.hero-content {
  position: relative; z-index: 2;
  max-width: var(--container); margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 60px);
  padding-top: var(--nav-h);
}
.hero-eyebrow {
  font-size: 0.78rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--terra-light);
  font-weight: 500; margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 700; line-height: 1.0; color: var(--white);
  letter-spacing: -0.02em; margin-bottom: 28px;
}
.hero-title em { font-weight: 400; font-style: italic; color: var(--terra-light); }
.hero-sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: rgba(255,255,255,0.80); max-width: 520px;
  margin-bottom: 48px; line-height: 1.7;
}
.hero-sub strong { color: var(--white); font-weight: 500; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; }

.scroll-hint {
  position: absolute; bottom: 40px; left: 50%;
  transform: translateX(-50%); z-index: 2;
}
.scroll-line {
  display: block; width: 1px; height: 60px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), rgba(255,255,255,0));
  margin: 0 auto;
  animation: scrollDrop 2s ease-in-out infinite;
}
@keyframes scrollDrop {
  0%   { transform: scaleY(0); transform-origin: top; opacity: 1; }
  50%  { transform: scaleY(1); transform-origin: top; opacity: 1; }
  100% { transform: scaleY(1); transform-origin: bottom; opacity: 0; }
}

/* ===================================================
   CHI SONO
   =================================================== */
.chi-siamo { background: var(--white); }
.chi-siamo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.chi-siamo-text p { color: var(--dark-mid); margin-bottom: 20px; font-size: 1.05rem; }
.numbers-row {
  display: flex; gap: 40px; margin-top: 48px;
  padding-top: 40px; border-top: 1px solid var(--cream-dark); flex-wrap: wrap;
}
.number-item { display: flex; flex-direction: column; gap: 4px; }
.number {
  font-family: var(--font-display); font-size: 2.8rem;
  font-weight: 700; color: var(--terra); line-height: 1;
}
.number-label {
  font-size: 0.82rem; letter-spacing: 0.08em;
  color: var(--gray); text-transform: uppercase;
}
.chi-siamo-img { position: relative; }
.chi-siamo-img img {
  width: 100%; height: 520px;
  object-fit: cover; border-radius: var(--radius);
}
.img-badge {
  position: absolute; bottom: -24px; left: -24px;
  background: var(--terra); color: var(--white);
  padding: 20px 28px; border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 8px 32px rgba(184,107,47,0.4);
}
.img-badge span { font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.img-badge strong { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }

/* ===================================================
   SERVIZI
   =================================================== */
.servizi { background: var(--cream); }
.servizi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 2px; background: var(--cream-dark);
  border: 2px solid var(--cream-dark);
  border-radius: calc(var(--radius) + 2px); overflow: hidden;
}
.servizio-card {
  background: var(--white); padding: 36px 28px;
  transition: background 0.25s, transform 0.25s;
}
.servizio-card:hover {
  background: var(--dark); transform: translateY(-4px);
  z-index: 1; box-shadow: 0 12px 40px rgba(28,25,22,0.2);
}
.servizio-card:hover h3,
.servizio-card:hover p,
.servizio-card:hover .servizio-icon { color: var(--white); }
.servizio-icon {
  width: 48px; height: 48px; margin-bottom: 20px;
  color: var(--terra); transition: color 0.25s;
}
.servizio-icon svg { width: 100%; height: 100%; }
.servizio-card h3 {
  font-family: var(--font-display); font-size: 1.25rem;
  font-weight: 600; margin-bottom: 10px; transition: color 0.25s;
}
.servizio-card p {
  font-size: 0.9rem; color: var(--gray);
  line-height: 1.6; transition: color 0.25s;
}

/* ===================================================
   GALLERIA LAVORI
   =================================================== */
.lavori { background: var(--dark); padding-bottom: var(--section-gap); }
.lavori .section-label { color: var(--terra-light); }
.lavori .section-title { color: var(--white); }
.lavori .section-intro { color: rgba(255,255,255,0.6); }
.lavori .container { margin-bottom: 48px; }

.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}
.gallery-item:first-child { grid-column: span 2; }
.gallery-item {
  position: relative; overflow: hidden;
  cursor: pointer; aspect-ratio: 4/3;
}
.gallery-item:first-child { aspect-ratio: 16/9; }
.gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease);
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(28,25,22,0.75) 0%, transparent 60%);
  display: flex; align-items: flex-end; padding: 20px;
  opacity: 0; transition: opacity 0.3s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span {
  color: var(--white); font-size: 0.85rem;
  letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500;
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10,8,6,0.96);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.lightbox.open { opacity: 1; pointer-events: all; }
.lightbox-img-wrap { max-width: 90vw; max-height: 88vh; text-align: center; }
.lightbox-img-wrap img { max-height: 82vh; max-width: 88vw; object-fit: contain; border-radius: var(--radius); }
#lightbox-caption { color: rgba(255,255,255,0.6); margin-top: 16px; font-size: 0.9rem; }
.lightbox-close, .lightbox-prev, .lightbox-next {
  position: fixed; color: rgba(255,255,255,0.8);
  font-size: 1.8rem; padding: 12px;
  transition: color 0.2s, transform 0.2s; z-index: 201;
}
.lightbox-close { top: 20px; right: 24px; font-size: 2.5rem; }
.lightbox-prev  { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-close:hover { color: var(--terra-light); transform: rotate(90deg); }
.lightbox-prev:hover  { color: var(--terra-light); transform: translateY(-50%) translateX(-4px); }
.lightbox-next:hover  { color: var(--terra-light); transform: translateY(-50%) translateX(4px); }

/* ===================================================
   TESTIMONIANZE
   =================================================== */
.testimonianze { background: var(--cream-dark); }
.testi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 16px; }
.testi-card {
  background: var(--white); padding: 36px 32px;
  border-radius: var(--radius); border-left: 3px solid var(--terra);
  position: relative;
}
.testi-card::before {
  content: '"'; font-family: var(--font-display); font-size: 5rem;
  color: var(--terra); opacity: 0.2;
  position: absolute; top: 10px; left: 28px; line-height: 1; pointer-events: none;
}
.testi-card p { font-style: italic; font-size: 1rem; color: var(--dark-mid); line-height: 1.7; margin-bottom: 20px; }
.testi-card cite { font-size: 0.85rem; font-weight: 500; color: var(--terra); font-style: normal; letter-spacing: 0.05em; }

/* ===================================================
   CONTATTI
   =================================================== */
.contatti { background: var(--white); }
.contatti-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 80px; align-items: start; }
.contatti-info p { color: var(--dark-mid); font-size: 1.05rem; margin-bottom: 40px; }
.contact-list { display: flex; flex-direction: column; gap: 18px; }
.contact-list li { display: flex; align-items: center; gap: 14px; font-size: 0.95rem; }
.contact-list svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--terra); }
.contact-list a:hover { color: var(--terra); }

.contact-form {
  display: flex; flex-direction: column; gap: 20px;
  background: var(--cream); padding: 44px 40px; border-radius: var(--radius);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label {
  font-size: 0.82rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--dark-mid);
}
.form-group input, .form-group select, .form-group textarea {
  padding: 12px 16px; border: 1.5px solid var(--cream-dark);
  border-radius: var(--radius); background: var(--white);
  color: var(--dark); transition: border-color 0.2s; outline: none; resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--terra); }
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--gray); }
.form-check { flex-direction: row; align-items: flex-start; gap: 12px; }
.form-check input { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--terra); margin-top: 2px; }
.form-check label { font-size: 0.85rem; text-transform: none; letter-spacing: 0; color: var(--dark-mid); line-height: 1.5; }
.form-check label a { color: var(--terra); text-decoration: underline; }
.form-feedback { font-size: 0.9rem; text-align: center; min-height: 20px; transition: all 0.3s; }
.form-feedback.success { color: #2d7a3a; }
.form-feedback.error   { color: #b83a2f; }

.zone-wrap {
  margin-top: 64px; background: var(--cream);
  border-radius: var(--radius); padding: 36px 40px;
  border: 1.5px solid var(--cream-dark);
}
.zone-header {
  display: flex; align-items: center; gap: 10px;
  color: var(--terra); font-weight: 500;
  font-size: 0.85rem; letter-spacing: 0.1em;
  text-transform: uppercase; margin-bottom: 14px;
}
.zone-wrap p { color: var(--dark-mid); font-size: 1rem; margin-bottom: 24px; max-width: 600px; }
.zone-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.zone-tags span {
  background: var(--white); border: 1.5px solid var(--cream-dark);
  color: var(--dark-mid); padding: 6px 16px;
  border-radius: 100px; font-size: 0.85rem; font-weight: 500;
}

/* ===================================================
   FOOTER
   =================================================== */
.footer { background: var(--dark); padding: 48px 0; }
.footer-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 32px; }
.footer-brand { display: flex; flex-direction: column; gap: 8px; }
.footer-logo { height: 36px; width:fit-content; filter: brightness(0) invert(1); opacity: 0.8; }
.footer-brand p { font-size: 0.8rem; color: rgba(255,255,255,0.4); }
.footer-nav { display: flex; gap: 28px; }
.footer-nav a { font-size: 0.85rem; color: rgba(255,255,255,0.55); transition: color 0.2s; }
.footer-nav a:hover { color: var(--terra-light); }
.footer-copy { font-size: 0.78rem; color: rgba(255,255,255,0.3); text-align: right; }

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
  .servizi-grid { grid-template-columns: repeat(2, 1fr); }
  .chi-siamo-grid { gap: 48px; }
  .contatti-grid { gap: 48px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .footer-copy { text-align: center; }
  .footer-brand { align-items: center; }
  .footer-nav { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 768px) {
  :root { --nav-h: 64px; }
  .desktop-br { display: none; }

  #main-nav {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--white);
    display: flex; align-items: center; justify-content: center;
    transform: translateX(100%);
    transition: transform 0.4s var(--ease); z-index: 99;
  }
  #main-nav.open { transform: translateX(0); }
  #main-nav ul { flex-direction: column; gap: 0; text-align: center; width: 100%; }
  #main-nav a {
    display: block; padding: 20px;
    font-size: 1.5rem; font-family: var(--font-display);
    color: var(--dark) !important;
    border-bottom: 1px solid var(--cream-dark);
  }
  .nav-cta {
    margin: 16px 24px 0 !important;
    padding: 16px !important;
    border-radius: var(--radius) !important;
  }
  .burger { display: flex; z-index: 100; }

  .chi-siamo-grid { grid-template-columns: 1fr; gap: 40px; }
  .chi-siamo-img img { height: 300px; }
  .img-badge { left: 0; bottom: -20px; }
  .chi-siamo { padding-bottom: calc(var(--section-gap) + 20px); }
  .servizi-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-item:first-child { grid-column: span 2; }
  .testi-grid { grid-template-columns: 1fr; }
  .contatti-grid { grid-template-columns: 1fr; gap: 48px; }
  .contact-form { padding: 28px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .numbers-row { gap: 24px; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .footer-nav { gap: 16px; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item:first-child { grid-column: span 1; }
  .servizio-card { padding: 24px 20px; }
  .contact-form { padding: 24px 16px; }
  .zone-wrap { padding: 24px 20px; }
}
