/* ==========================================================================
   Bovi Tiziano Torneria — stile
   ========================================================================== */

:root {
  --color-bg: #14171a;
  --color-bg-alt: #1b1e22;
  --color-surface: #22262b;
  --color-surface-2: #2a2f35;
  --color-border: rgba(255, 255, 255, 0.09);
  --color-text: #f2f1ed;
  --color-text-muted: #b7bcc3;
  --color-accent: #ff8a1e;
  --color-accent-dark: #d96f0f;
  --color-accent-2: #ffcc33;
  --font-head: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1180px;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.15;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1em; }

a { color: inherit; }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-accent);
  color: #14171a;
  padding: 0.75rem 1.25rem;
  z-index: 999;
  font-weight: 600;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  font-size: 0.95rem;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--color-accent);
  color: #17130c;
}
.btn-primary:hover { background: var(--color-accent-2); }
.btn-ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--color-text);
}
.btn-ghost:hover { border-color: var(--color-accent); color: var(--color-accent-2); }
.btn-block { width: 100%; text-align: center; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(20, 23, 26, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--color-text);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--color-accent);
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--color-accent);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--font-head);
  font-size: 1.05rem;
  letter-spacing: 0.03em;
}
.brand-text small {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--color-text-muted);
}

.main-nav ul {
  display: flex;
  gap: 1.8rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--color-text);
  position: relative;
  padding: 0.3rem 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s ease;
}
.main-nav a:hover::after { transform: scaleX(1); }
.main-nav a.nav-cta {
  background: var(--color-accent);
  color: #17130c;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
}
.main-nav a.nav-cta::after { display: none; }

.header-actions { display: flex; align-items: center; gap: 1rem; }
.phone-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--color-accent-2);
  font-weight: 600;
  white-space: nowrap;
  font-size: 0.95rem;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  cursor: pointer;
}
.menu-toggle span {
  display: block;
  height: 2px;
  margin: 0 7px;
  background: var(--color-text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.05);
}
/* Velo scuro tenuto volutamente leggero: la foto dell'officina deve restare
   riconoscibile. La leggibilita' del testo e' garantita dal gradiente laterale
   (piu' denso solo dietro al blocco di testo) e dal text-shadow su .hero-content. */
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(100deg, rgba(10,11,13,0.85) 0%, rgba(10,11,13,0.6) 42%, rgba(10,11,13,0.15) 100%),
    linear-gradient(0deg, rgba(10,11,13,0.75), rgba(10,11,13,0.05) 45%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 6rem;
  padding-bottom: 4rem;
  max-width: 780px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.75);
}
.eyebrow {
  color: var(--color-accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 0.5em;
}
.hero-sub {
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 620px;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 2rem 0 3rem;
}
/* I bottoni hanno gia' il loro sfondo pieno: l'ombra ereditata da .hero-content
   sporcherebbe il testo scuro del CTA arancione. */
.hero-actions .btn { text-shadow: none; }
.hero-stats {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  padding: 1.5rem 0 0;
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  flex-wrap: wrap;
}
.hero-stats li { display: flex; flex-direction: column; }
.hero-stats strong {
  font-family: var(--font-head);
  font-size: 1.8rem;
  color: var(--color-accent);
}
.hero-stats span { color: var(--color-text-muted); font-size: 0.85rem; }

/* ---------- Sections ---------- */
.section { padding: 5.5rem 0; }
.section-alt { background: var(--color-bg-alt); }
.kicker {
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  font-size: 0.8rem;
  margin-bottom: 0.6em;
}
.section-head { max-width: 700px; margin-bottom: 3rem; }
.section-lead { color: var(--color-text-muted); font-size: 1.05rem; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
}
.split-media img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.check-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.check-list li {
  padding-left: 1.8rem;
  position: relative;
  color: var(--color-text-muted);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--color-accent);
}

/* ---------- Cards (Lavorazioni) ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem 1.6rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-6px); border-color: var(--color-accent); }
.card-icon {
  width: 52px;
  height: 52px;
  color: var(--color-accent);
  margin-bottom: 1.2rem;
}
.card h3 { font-size: 1.15rem; margin-bottom: 0.5em; }
.card p { color: var(--color-text-muted); font-size: 0.95rem; margin: 0; }

/* ---------- Officina in azione (banda immagine) ---------- */
.media-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  line-height: 0;
}
.media-wrap img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  background: #000;
}

/* ---------- Machine grid ---------- */
.machine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.machine-card {
  margin: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.machine-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.machine-card figcaption {
  padding: 1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.machine-card figcaption strong { font-family: var(--font-head); letter-spacing: 0.02em; }
.machine-card figcaption span { color: var(--color-text-muted); font-size: 0.88rem; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gallery-item {
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  cursor: zoom-in;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.gallery-item:hover img { transform: scale(1.08); }

/* ---------- Contact ---------- */
.split-contact { align-items: start; }
.contact-list {
  list-style: none;
  padding: 0;
  margin: 1.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  color: var(--color-text-muted);
}
.contact-list svg { color: var(--color-accent); flex-shrink: 0; margin-top: 2px; }
.contact-list a { text-decoration: none; color: var(--color-text); font-weight: 600; }
.contact-list a:hover { color: var(--color-accent-2); }

.map-embed {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.map-embed iframe { width: 100%; height: 260px; border: 0; display: block; }

.contact-form {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.contact-form h3 { margin-bottom: 1rem; }
.contact-form label {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 1rem 0 0.4rem;
  color: var(--color-text-muted);
}
.contact-form input[type="text"],
.contact-form textarea {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: var(--color-text);
  font-family: inherit;
  font-size: 1rem;
  resize: vertical;
}
.contact-form input[type="text"]:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--color-accent);
}
.contact-form button { margin-top: 1.4rem; }
.hp-field { position: absolute; left: -9999px; opacity: 0; }
.form-status { min-height: 1.3em; margin: 0.9rem 0 0; font-weight: 600; }
.form-status.ok { color: #6fd18a; }
.form-status.err { color: #ff7a7a; }
.form-privacy {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin: 0.8rem 0 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #0f1113;
  padding: 2.5rem 0 1.5rem;
  border-top: 1px solid var(--color-border);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.footer-inner p { margin: 0.2rem 0 0; color: var(--color-text-muted); font-size: 0.9rem; }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { text-decoration: none; color: var(--color-text-muted); font-weight: 500; }
.footer-links a:hover { color: var(--color-accent-2); }
.footer-copy {
  text-align: center;
  color: #6b7076;
  font-size: 0.8rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
  margin: 0;
}

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-accent);
  color: #17130c;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
  z-index: 90;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.92);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: 8px; }
.lightbox-close {
  position: absolute;
  top: 1.2rem;
  right: 1.5rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}

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

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

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .machine-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--color-bg-alt);
    border-bottom: 1px solid var(--color-border);
    transform: translateY(-120%);
    transition: transform 0.25s ease;
  }
  .main-nav.open { transform: translateY(0); }
  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 1rem 1.5rem 1.5rem;
  }
  .main-nav li { border-bottom: 1px solid var(--color-border); }
  .main-nav a { display: block; padding: 0.9rem 0; }
  .main-nav a.nav-cta { display: inline-block; margin: 0.8rem 0; }
  .menu-toggle { display: flex; }
  .phone-pill span { display: none; }

  .split { grid-template-columns: 1fr; }
  .split-media { order: -1; }

  /* Su schermo stretto il testo copre tutta la larghezza: serve piu' velo
     per mantenere il contrasto. */
  .hero-overlay {
    background:
      linear-gradient(100deg, rgba(10,11,13,0.85) 0%, rgba(10,11,13,0.7) 60%, rgba(10,11,13,0.5) 100%),
      linear-gradient(0deg, rgba(10,11,13,0.8), rgba(10,11,13,0.2) 50%);
  }
}

@media (max-width: 640px) {
  .card-grid { grid-template-columns: 1fr; }
  .machine-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 1.5rem; }
  .section { padding: 3.5rem 0; }
}
