/* =========================================================
   DD Costruzioni Srls — stylesheet
   Palette presa dal logo: blu navy, tortora/taupe, accento
   terracotta (ripreso dai mattoni e dagli intonaci nelle foto)
   ========================================================= */

:root {
  --navy-900: #1c2540;
  --navy-800: #232f52;
  --navy-700: #2b3862;
  --taupe: #8f877c;
  --taupe-light: #efece6;
  --terracotta: #c1602f;
  --terracotta-600: #a94f24;
  --ink: #23262e;
  --ink-soft: #656a76;
  --white: #ffffff;
  --paper: #faf8f5;
  --border: #e6e2da;
  --bg-alt: #f3f0ea;
  --shadow: 0 10px 30px rgba(28, 37, 64, 0.08);
  --shadow-lg: 0 24px 60px rgba(28, 37, 64, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --font-heading: 'Archivo', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --max-width: 1180px;
}

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

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font: inherit; }

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

h1, h2, h3 {
  font-family: var(--font-heading);
  color: var(--navy-900);
  line-height: 1.15;
  text-wrap: balance;
  font-weight: 700;
}

h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); margin-bottom: 0.5rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.section-eyebrow {
  display: inline-block;
  color: var(--terracotta);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  margin-bottom: 0.7rem;
}
.eyebrow-light { color: #e8b78e; }

.section-lead {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 620px;
  margin-top: 0.6rem;
  margin-bottom: 3.2rem;
}

.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }

.icon { width: 20px; height: 20px; flex-shrink: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn-sm { padding: 10px 20px; font-size: 0.92rem; }
.btn-block { width: 100%; }

.btn-primary {
  background: var(--terracotta);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(193, 96, 47, 0.32);
}
.btn-primary:hover { background: var(--terracotta-600); }

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

.btn-light {
  background: var(--white);
  color: var(--navy-900);
}
.btn-light:hover { background: var(--taupe-light); }

/* ---------- Header ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy-900); color: var(--white); padding: 12px 18px; z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
/* Lo sfondo sfocato vive su uno pseudo-elemento apposta: mettere
   "backdrop-filter" direttamente su .header lo trasformerebbe nel
   "contenitore" per i suoi discendenti in position:fixed (come il menu
   mobile), facendolo aprire schiacciato dentro l'header invece che a
   schermo intero. Vedi https://developer.mozilla.org/docs/Web/CSS/filter
   ("filter" e proprietà simili creano un containing block). */
.header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(10px);
}
.header.scrolled { border-color: var(--border); box-shadow: 0 4px 20px rgba(28, 37, 64, 0.06); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 12px; padding-bottom: 12px;
}

.brand { display: flex; align-items: center; }
.brand-logo { height: 52px; width: auto; }

.main-nav { display: flex; gap: 30px; }
.main-nav a {
  font-weight: 600; font-size: 0.95rem; color: var(--navy-800);
  position: relative; padding: 6px 0;
}
.main-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 0;
  background: var(--terracotta); transition: width 0.2s ease;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.main-nav a.active { color: var(--terracotta); }

.header-actions { display: flex; align-items: center; gap: 16px; }

.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; width: 22px; height: 2px; background: var(--navy-900); margin: 0 auto;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.menu-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 110px;
  overflow: hidden;
  color: var(--white);
}
.hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 55%, #3a4574 100%);
  z-index: -2;
}
.hero-bg::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 64px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 64px);
  opacity: 0.6;
}

.hero-inner {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  margin-bottom: 1.1rem;
}
.hero-lead { color: rgba(255,255,255,0.82); font-size: 1.08rem; max-width: 520px; margin-bottom: 2rem; }

.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 2.2rem; }

.hero-trust { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.hero-trust li {
  font-size: 0.88rem; color: rgba(255,255,255,0.85); padding-left: 20px; position: relative;
}
.hero-trust li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--terracotta);
}

.hero-media { position: relative; height: 440px; }
.hero-photo {
  position: absolute; border-radius: var(--radius); object-fit: cover;
  box-shadow: var(--shadow-lg); border: 5px solid rgba(255,255,255,0.08);
}
.hero-photo-main { width: 78%; height: 88%; top: 0; right: 0; }
.hero-photo-small {
  width: 52%; height: 46%; bottom: 0; left: 0;
  border: 5px solid var(--paper);
}

/* ---------- Services ---------- */
.services-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px;
}
.service-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 30px 26px; transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.service-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--taupe-light); color: var(--terracotta); margin-bottom: 18px;
}
.service-icon svg { width: 26px; height: 26px; }

.service-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Portfolio ---------- */
.portfolio-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px;
}
.work-card-lg { grid-column: 1 / -1; }

.work-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column;
}

/* Base: fotografie in numero variabile, disposte in colonne uguali
   (2 foto = 2 colonne, 1 foto = 1 colonna a piena larghezza, ecc.) */
.work-photos { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; }

.work-photo {
  position: relative; display: block; border: none; padding: 0; cursor: zoom-in;
  background: none; overflow: hidden; aspect-ratio: 4 / 3;
}
.work-photo-wide { aspect-ratio: 16 / 9; }
.work-photo img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease;
}
.work-photo:hover img { transform: scale(1.06); }

/* Card "in evidenza": 1 foto grande + 2 affiancate impilate a destra */
.work-card-lg .work-photos {
  grid-auto-flow: unset;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
  aspect-ratio: 2.3 / 1;
}
.work-card-lg .work-photo { aspect-ratio: unset; height: 100%; }
.work-card-lg .work-photo-main { grid-row: 1 / 3; }

/* Sequenza "prima / durante / dopo" */
.work-photos-steps { grid-auto-flow: unset; grid-template-columns: repeat(3, 1fr); }
.work-photos-steps .work-photo { aspect-ratio: 3 / 4; }
.work-step-tag {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(28, 37, 64, 0.82); color: var(--white);
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}

.work-info { padding: 22px 24px 26px; }
.work-info p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Perché noi ---------- */
.reasons-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; margin-top: 2rem;
}
.reason-card { padding-top: 6px; }
.reason-number {
  display: block; font-family: var(--font-heading); font-weight: 800;
  font-size: 1.6rem; color: var(--taupe); margin-bottom: 10px;
}
.reason-card p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Chi siamo ---------- */
.about-inner {
  display: grid; grid-template-columns: 0.85fr 1.15fr; gap: 56px; align-items: center;
}
.about-media { position: relative; }
.about-media img { border-radius: var(--radius); box-shadow: var(--shadow); aspect-ratio: 4/5; object-fit: cover; object-position: 50% 30%; }
.about-badge {
  position: absolute; left: 20px; bottom: 20px; right: 20px;
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px);
  border-radius: 999px; padding: 12px 18px; box-shadow: var(--shadow);
  font-weight: 700; font-size: 0.88rem; color: var(--navy-900);
}
.about-badge-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--terracotta); flex-shrink: 0; }

.about-lead { font-size: 1.08rem; color: var(--navy-800); font-weight: 500; }
.about-copy p { margin-bottom: 1.1rem; color: var(--ink-soft); }
.about-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 1.6rem; }
.about-tags span {
  font-size: 0.82rem; font-weight: 600; color: var(--navy-800);
  background: var(--taupe-light); border-radius: 999px; padding: 7px 14px;
}
.about-copy .btn { margin-top: 0.2rem; }

/* ---------- CTA banner ---------- */
.cta-banner { background: var(--navy-900); color: var(--white); padding: 60px 0; }
.cta-banner-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-banner h2 { color: var(--white); margin-bottom: 0.3rem; }
.cta-banner p { color: rgba(255,255,255,0.78); }

/* ---------- Contatti ---------- */
.contact-inner {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 60px; align-items: start;
}

.contact-list { display: flex; flex-direction: column; gap: 20px; }
.contact-list li { display: flex; align-items: flex-start; gap: 14px; }
.contact-icon {
  width: 42px; height: 42px; border-radius: 12px; background: var(--taupe-light);
  color: var(--terracotta); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.contact-icon svg { width: 20px; height: 20px; }
.contact-list strong { display: block; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.contact-list a, .contact-list span { font-weight: 600; color: var(--navy-900); }
.contact-list a:hover { color: var(--terracotta); }

.contact-form {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 34px; box-shadow: var(--shadow);
}
.form-row { margin-bottom: 18px; }
.form-row-split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.form-row-split .form-row { margin-bottom: 0; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; color: var(--navy-800); }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.95rem; background: var(--paper); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--terracotta); outline-offset: 1px; }
textarea { resize: vertical; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-note { text-align: center; margin-top: 14px; font-size: 0.85rem; color: var(--ink-soft); }
.form-note.success { color: #2b7a4b; font-weight: 600; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: rgba(255,255,255,0.75); padding-top: 56px; }
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 40px; justify-content: space-between;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-logo { height: 60px; width: auto; border-radius: 8px; margin-bottom: 10px; }
.footer-brand p { font-size: 0.9rem; max-width: 240px; }
.footer-nav, .footer-contact { display: flex; flex-direction: column; gap: 10px; }
.footer-nav a:hover, .footer-contact a:hover { color: var(--white); }
.footer-bottom {
  padding: 20px 24px; font-size: 0.82rem;
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 20px;
}
.footer-bottom p { margin: 0; }
.footer-credit { font-weight: 600; color: rgba(255, 255, 255, 0.75); }
.footer-credit-cta {
  display: inline-flex; align-items: center; padding: 5px 16px; border-radius: 999px;
  background: var(--terracotta); color: var(--white); font-weight: 700; font-size: 0.78rem;
  transition: background 0.15s ease;
}
.footer-credit-cta:hover { background: var(--terracotta-600); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(20, 24, 38, 0.94); z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox-img { max-width: min(90vw, 1000px); max-height: 74vh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.lightbox-caption { color: rgba(255,255,255,0.85); margin-top: 16px; font-size: 0.9rem; text-align: center; max-width: 600px; }
.lightbox-close, .lightbox-nav {
  position: absolute; background: rgba(255,255,255,0.1); color: var(--white); border: none;
  border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
}
.lightbox-close:hover, .lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-close { top: 22px; right: 22px; width: 44px; height: 44px; font-size: 1.6rem; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; font-size: 2rem; }
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-media { height: 340px; margin-top: 20px; }
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .reasons-grid { grid-template-columns: repeat(2, 1fr); }
  .about-inner { grid-template-columns: 1fr; }
  .about-media { order: -1; }
  .about-media img { aspect-ratio: 16/9; }
  .contact-inner { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed; top: 76px; left: 0; right: 0; bottom: 0; z-index: 150;
    background: var(--paper); flex-direction: column; gap: 0;
    padding: 20px 24px; transform: translateX(100%); transition: transform 0.25s ease;
    overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--border); }
  .menu-toggle { display: flex; }
  .header-actions .btn-sm { display: none; }

  .section { padding: 72px 0; }
  .services-grid { grid-template-columns: 1fr; }
  .reasons-grid { grid-template-columns: 1fr; }
  .portfolio-grid { grid-template-columns: 1fr; }
  .work-card-lg .work-photos {
    grid-template-columns: 1fr; grid-template-rows: none; aspect-ratio: unset;
  }
  .work-card-lg .work-photo { aspect-ratio: 4 / 3 !important; height: auto; grid-row: auto !important; }
  .work-card-lg .work-photo-main { aspect-ratio: 16 / 10 !important; }
  .form-row-split { grid-template-columns: 1fr; }
  .cta-banner-inner { flex-direction: column; text-align: center; }
  .footer-inner { flex-direction: column; }
}
