/* ==========================================================
   Gruppo Mascalcia Castagnola - stile del sito
   Colori principali modificabili qui sotto.
   ========================================================== */
:root {
  /* Palette del logo: nero, bianco, grigio, verde */
  --black: #111311;
  --charcoal: #2a2d2b;
  --green: #2e8540;
  --green-dark: #236b33;
  --green-bright: #5cbf6e;
  --green-light: #e4f1e6;
  --grey-100: #f2f3f2;
  --paper: #ffffff;
  --ink: #151715;
  --ink-soft: #5b615c;
  --line: #e1e3e1;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .08);
  --font-head: "Outfit", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--green-dark); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .6em; color: var(--black); font-weight: 700; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.8rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--green-dark); }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }

.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--green-dark); margin-bottom: .8em;
}
.eyebrow-light { color: var(--green-bright); }
.lead { font-size: 1.2rem; max-width: 640px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .85em 1.5em; border-radius: 999px; border: 2px solid var(--green);
  background: var(--green); color: #fff; font-weight: 600; text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); transform: translateY(-1px); }
.btn-small { padding: .5em 1.1em; font-size: .92rem; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.6); }
.btn-ghost-light:hover { background: rgba(255,255,255,.12); border-color: #fff; }
.btn-outline { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.btn-outline:hover { background: var(--charcoal); color: #fff; border-color: var(--charcoal); }
.btn-light { background: #fff; color: var(--black); border-color: #fff; }
.btn-light:hover { background: var(--grey-100); border-color: var(--grey-100); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 2px 14px rgba(0,0,0,.05); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--black); }
.brand-mark { width: 44px; height: 44px; border-radius: 10px; background: #000; object-fit: contain; padding: 4px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-size: 1.15rem; }
.brand-text small { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

.main-nav { display: flex; align-items: center; gap: 28px; }
.main-nav a:not(.btn) { color: var(--ink); text-decoration: none; font-weight: 500; font-size: .96rem; }
.main-nav a:not(.btn):hover, .main-nav a[aria-current="page"] { color: var(--green-dark); }

.nav-toggle { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: var(--black); margin: 5px 0; transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px 20px 20px; display: none;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a:not(.btn) { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav .btn { margin-top: 16px; }
}

/* ---------- Hero ---------- */
/* La foto di sfondo si imposta in content/home.json (hero.immagine_sfondo) */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(100deg, rgba(10, 12, 10, .94) 0%, rgba(18, 20, 18, .82) 55%, rgba(18, 20, 18, .5) 100%),
    var(--charcoal);
  background-size: cover; background-position: center;
  padding: 120px 0 0;
}
.hero-inner { position: relative; padding-bottom: 90px; }
.hero h1 { color: #fff; max-width: 760px; }
.hero .eyebrow { color: var(--green-bright); }
.hero .lead { color: rgba(255,255,255,.88); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 2em; }

.stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--paper); color: var(--ink); border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
}
.stats li { padding: 26px 28px; border-right: 1px solid var(--line); }
.stats li:last-child { border-right: 0; }
.stats strong { display: block; font-family: var(--font-head); font-size: 1.8rem; color: var(--charcoal); line-height: 1.1; }
.stats span { color: var(--ink-soft); font-size: .95rem; }
@media (max-width: 640px) {
  .hero { padding-top: 80px; }
  .hero-inner { padding-bottom: 60px; }
  .stats { grid-template-columns: 1fr; }
  .stats li { border-right: 0; border-bottom: 1px solid var(--line); padding: 18px 22px; }
  .stats li:last-child { border-bottom: 0; }
}

.page-hero {
  position: relative; overflow: hidden; color: #fff; padding: 100px 0 90px;
  background:
    radial-gradient(ellipse at 85% 20%, rgba(46,133,64,.38), transparent 55%),
    linear-gradient(120deg, var(--black), var(--charcoal));
}
.page-hero .container { position: relative; }
.page-hero h1 { color: #fff; max-width: 820px; }
.page-hero .lead { color: rgba(255,255,255,.88); }

/* ---------- Sezioni ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--grey-100); }
.section-head { max-width: 720px; margin-bottom: 48px; }
.section-head p:last-child { color: var(--ink-soft); }
@media (max-width: 640px) { .section { padding: 64px 0; } }

.split { display: grid; grid-template-columns: 1fr 1.1fr; gap: 64px; align-items: center; }
.split-reverse { grid-template-columns: 1.1fr 1fr; }
@media (max-width: 860px) {
  .split, .split-reverse { grid-template-columns: 1fr; gap: 40px; }
}

.founder-photo { margin: 0; position: relative; }
.founder-photo img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius);
  box-shadow: var(--shadow); background: var(--green-light);
}
.founder-photo::after {
  content: ""; position: absolute; inset: 18px -18px -18px 18px; z-index: -1;
  border: 2px solid var(--green); border-radius: var(--radius);
}
@media (max-width: 860px) {
  .founder-photo { max-width: 420px; margin-right: 12px; }
  .founder-photo::after { inset: 12px -12px -12px 12px; }
}

.quote {
  margin: 1.6em 0 0; padding: 1.2em 1.4em; border-left: 4px solid var(--green);
  background: var(--grey-100); border-radius: 0 var(--radius) var(--radius) 0;
  font-family: var(--font-head); font-size: 1.15rem; color: var(--black);
}
.quote cite { display: block; margin-top: .6em; font-family: var(--font-body); font-style: normal; font-size: .9rem; color: var(--ink-soft); }

/* ---------- Card ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 28px; box-shadow: var(--shadow);
}
.card p { color: var(--ink-soft); margin: 0; }
.card-icon {
  width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center;
  background: var(--green-light); color: var(--green-dark); margin-bottom: 20px;
}
.card-icon svg { width: 30px; height: 30px; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.4em; }
.checklist li { position: relative; padding-left: 30px; margin-bottom: .55em; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .42em; width: 18px; height: 18px; border-radius: 50%;
  background: var(--green-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3 3 7-7' fill='none' stroke='%23236b33' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Mockup app COW ---------- */
.app-mock { margin: 0; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.tablet {
  position: relative; width: 100%; max-width: 640px; padding: 18px; border-radius: 30px;
  background: var(--black); box-shadow: 0 30px 60px rgba(0,0,0,.25);
}
/* fotocamera sul bordo laterale */
.tablet::before {
  content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
  border-radius: 50%; background: #3b3f3c;
}
.tablet-screen {
  aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper); border-radius: 14px; padding: 24px 26px;
}
.tablet-screen.has-shot { padding: 0; }
.tablet-track {
  display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; outline: none;
}
.tablet-track::-webkit-scrollbar { display: none; }
.tablet-track:focus-visible { box-shadow: inset 0 0 0 3px var(--green-bright); }
.tablet-shot {
  flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; object-position: top;
  scroll-snap-align: start; scroll-snap-stop: always;
}
.tablet-controls { display: flex; align-items: center; gap: 14px; }
.tablet-arrow {
  width: 40px; height: 40px; padding: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--paper); color: var(--black);
  transition: border-color .2s, background .2s, color .2s;
}
.tablet-arrow:hover { border-color: var(--black); background: var(--black); color: #fff; }
.tablet-arrow svg { width: 18px; height: 18px; }
.tablet-arrow-next svg { transform: scaleX(-1); }
.tablet-dots { display: flex; gap: 8px; }
.tablet-dots button {
  width: 9px; height: 9px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: #c9ccc9; transition: width .25s, background .25s;
}
.tablet-dots button.is-active { width: 24px; background: var(--green); }
.mock-title { font-family: var(--font-head); font-weight: 700; color: var(--black); margin-bottom: 14px; font-size: 1.1rem; }
.mock-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 10px; background: var(--grey-100); margin-bottom: 8px; font-size: .88rem;
}
.tag { font-style: normal; font-size: .72rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.tag.ok { background: #dcebd9; color: #2f6b34; }
.tag.warn { background: #f6e7c8; color: #8a6114; }
.tag.alert { background: #f4d6d0; color: #9a3423; }
.mock-chart { display: flex; align-items: flex-end; gap: 8px; height: 90px; margin-top: 16px; padding: 0 4px; }
.mock-chart span { flex: 1; background: linear-gradient(var(--green), var(--green-dark)); border-radius: 5px 5px 0 0; }
.mock-caption { font-size: .75rem; color: var(--ink-soft); margin-top: 8px; text-align: center; }
.mock-cols { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: stretch; }
.mock-panel {
  display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--grey-100); border-radius: 10px; padding: 14px 14px 10px;
}
.mock-panel .mock-chart { flex: 1; height: auto; min-height: 60px; margin-top: 0; }
@media (max-width: 520px) {
  .tablet { padding: 12px; border-radius: 22px; }
  .tablet::before { left: 4px; width: 4px; height: 4px; margin-top: -2px; }
  .tablet-screen { padding: 12px 14px; border-radius: 10px; }
  .mock-title { font-size: .9rem; margin-bottom: 8px; }
  .mock-cols { gap: 10px; }
  .mock-row { padding: 5px 7px; margin-bottom: 5px; font-size: .68rem; border-radius: 7px; }
  .tag { font-size: .6rem; padding: 2px 6px; }
  .mock-panel { padding: 8px 8px 6px; }
  .mock-caption { font-size: .62rem; }
}

/* ---------- Banner laser ---------- */
.laser-teaser {
  color: #fff; padding: 72px 0;
  background:
    radial-gradient(circle at 10% 50%, rgba(46,133,64,.38), transparent 50%),
    linear-gradient(120deg, var(--black), var(--charcoal));
}
.laser-teaser h2 { color: #fff; }
.laser-teaser p { color: rgba(255,255,255,.85); max-width: 640px; margin-bottom: 0; }
.laser-teaser-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
@media (max-width: 860px) { .laser-teaser-inner { flex-direction: column; align-items: flex-start; } }

/* ---------- Pannello info laser ---------- */
.info-panel { background: var(--grey-100); border-radius: var(--radius); padding: 34px; border: 1px solid var(--line); }
.info-group + .info-group { margin-top: 18px; }
.info-panel .checklist { margin-bottom: 0; }

/* ---------- Prima / dopo ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.filter-btn {
  font: inherit; font-size: .92rem; font-weight: 500; cursor: pointer;
  padding: .5em 1.2em; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink);
}
.filter-btn:hover { border-color: var(--green-dark); }
.filter-btn.is-active { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }

.cases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }
@media (max-width: 760px) { .cases { grid-template-columns: 1fr; } }
.case { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.case[hidden] { display: none; }
.case-body { padding: 22px 24px 26px; }
.case-body p { color: var(--ink-soft); margin: 0; }
.case-tag {
  display: inline-block; font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--green-dark); margin-bottom: .5em;
}

.compare { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--green-light); user-select: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare-before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-handle {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 3px; margin-left: -1.5px;
  background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.3); pointer-events: none;
}
.compare-handle::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; transform: translate(-50%, -50%);
  border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l-5 6 5 6M15 6l5 6-5 6' fill='none' stroke='%23111311' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px no-repeat;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
  opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.compare input[type="range"]:focus-visible ~ .compare-handle,
.compare:has(input:focus-visible) .compare-handle::after { outline: 3px solid var(--green); outline-offset: 2px; }
.compare-label {
  position: absolute; top: 14px; padding: 4px 12px; border-radius: 999px;
  background: rgba(17,19,17,.78); color: #fff; font-size: .78rem; font-weight: 600; letter-spacing: .05em;
  pointer-events: none;
}
.compare-label-before { left: 14px; }
.compare-label-after { right: 14px; }

.disclaimer { margin-top: 32px; font-size: .88rem; color: var(--ink-soft); max-width: 720px; }

/* ---------- Contatti ---------- */
/* Telefono · Email (più larga, per non mandare a capo l'indirizzo) · Social */
.contact-grid { display: grid; grid-template-columns: 1fr 1.6fr 1fr; gap: 20px; }
@media (max-width: 960px) {
  .contact-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-email { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 520px) {
  .contact-grid { grid-template-columns: 1fr; }
  .contact-email { order: 0; }
  .contact-card.contact-email { padding-right: 12px; overflow-wrap: normal; }
  .contact-card.contact-email strong { font-size: .86rem; }
}
.contact-card {
  display: block; padding: 26px 24px; border-radius: var(--radius); text-decoration: none;
  background: var(--grey-100); border: 1px solid var(--line); color: var(--ink);
  transition: transform .2s, box-shadow .2s, border-color .2s; overflow-wrap: anywhere;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--green); }
.contact-label { display: block; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--green-dark); font-weight: 600; margin-bottom: .4em; }
.contact-card strong { font-size: 1.02rem; color: var(--black); }
.contact-social:hover { transform: none; box-shadow: none; border-color: var(--line); }
.social-links { display: flex; gap: 14px; margin-top: 4px; }
.social-links a { display: block; width: 40px; height: 40px; border-radius: 10px; transition: transform .2s, box-shadow .2s; }
.social-links a:hover { transform: translateY(-3px) scale(1.06); box-shadow: 0 6px 14px rgba(0,0,0,.15); }
.social-links a:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.social-links svg { width: 100%; height: 100%; display: block; }

/* ---------- Footer ---------- */
.site-footer { background: var(--black); color: rgba(255,255,255,.85); padding: 32px 0; font-size: .92rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.site-footer p { margin: 0; }
.site-footer .muted { color: rgba(255,255,255,.55); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- Logo ---------- */
/* Il logo ha sfondo nero: "screen" lo rende trasparente sugli sfondi scuri */
/* Il logo sta dentro il blocco del titolo ed è centrato verticalmente sul testo */
.hero-logo {
  position: absolute; z-index: 0; right: 20px; top: 50%; transform: translateY(-50%);
  width: 420px; height: auto; opacity: .16; mix-blend-mode: screen; pointer-events: none;
}
/* nella home il blocco ha 90px di spazio sotto il testo: si escludono dal centro */
.hero-inner > .hero-logo { top: calc(50% - 45px); }
.hero-inner > :not(.hero-logo),
.page-hero .container > :not(.hero-logo) { position: relative; z-index: 1; }
@media (max-width: 860px) { .hero-logo { width: 260px; right: -70px; opacity: .1; } }
.footer-brand { display: flex; align-items: center; gap: 12px; }
.footer-brand img { width: 36px; height: 36px; mix-blend-mode: screen; }
.footer-inner { align-items: center; }

/* ---------- Errore di caricamento contenuti ---------- */
.load-error {
  position: relative; z-index: 100; padding: 14px 20px; background: #fdecea; color: #8a1f11;
  border-bottom: 1px solid #f3c5bd; font-size: .95rem;
}
