/* ============================================================
   Vikario — style.css · v2
   Palette direzione B · Fraunces + Inter (self-hosted)
   JS opzionale (solo animazioni di ingresso)
   ============================================================ */

/* ---------- Font ---------- */
@font-face { font-family:"Fraunces"; font-style:normal; font-weight:400; font-display:swap;
  src:url("fonts/fraunces-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Fraunces"; font-style:normal; font-weight:600; font-display:swap;
  src:url("fonts/fraunces-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:400; font-display:swap;
  src:url("fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:500; font-display:swap;
  src:url("fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family:"Inter"; font-style:normal; font-weight:600; font-display:swap;
  src:url("fonts/inter-latin-600-normal.woff2") format("woff2"); }

/* ---------- Token ---------- */
:root {
  --verde: #1F3D2E;
  --accento: #3A6B4F;
  --fondo: #F4F6F5;
  --salvia: #8FA89A;
  --testo: #111F18;
  --bianco: #FDFEFD;
  --linea: rgba(31, 61, 46, 0.13);
  --ombra: 0 10px 30px -12px rgba(17, 31, 24, 0.18);

  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, "Segoe UI", sans-serif;

  --misura: 68ch;
  --largo: 1140px;
  --raggio: 10px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--testo);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a { color: var(--accento); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--verde); }

:focus-visible { outline: 2px solid var(--accento); outline-offset: 3px; border-radius: 2px; }
::selection { background: var(--salvia); color: var(--testo); }

/* ---------- Tipografia ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--verde);
  line-height: 1.12;
  margin: 0 0 0.6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.7rem, 8vw, 5rem); letter-spacing: -0.018em; }
h2 { font-size: clamp(1.85rem, 4.2vw, 2.7rem); letter-spacing: -0.01em; }
h3 { font-size: 1.22rem; line-height: 1.3; }

p { margin: 0 0 1em; max-width: var(--misura); }
p:last-child { margin-bottom: 0; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--accento);
  margin: 0 0 1.6rem;
}
.eyebrow::after { content: ""; flex: 0 0 3rem; height: 1px; background: var(--salvia); }

/* ---------- Struttura ---------- */
.wrap { width: min(var(--largo), 100% - 3rem); margin-inline: auto; }
section { padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.sez-bianca { background: var(--bianco); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--fondo) 90%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linea);
}
.header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 0.9rem;
}
.wordmark {
  display: flex; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.28rem; letter-spacing: 0.14em;
  color: var(--verde); text-decoration: none;
}
.wordmark svg { width: 26px; height: 26px; flex: none; }
.nav { display: flex; align-items: center; gap: 1.9rem; }
.nav a { font-size: 0.92rem; font-weight: 500; color: var(--testo); text-decoration: none; }
.nav a:hover { color: var(--accento); }
.nav a.btn { color: var(--fondo); font-size: 0.92rem; padding: 0.55rem 1.15rem; }
.nav a.btn:hover { color: var(--fondo); }
@media (max-width: 640px) { .nav a:not(.btn) { display: none; } }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  background: var(--verde);
  color: var(--fondo);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.9rem 1.8rem;
  border-radius: 7px;
  text-decoration: none;
  transition: background-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}
.btn:hover { background: var(--accento); color: var(--fondo); transform: translateY(-2px); box-shadow: var(--ombra); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn--inverso { background: var(--fondo); color: var(--verde); }
.btn--inverso:hover { background: #ffffff; color: var(--verde); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(5rem, 12vw, 9.5rem); }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 46% 62% at 84% 42%, rgba(143, 168, 154, 0.20), transparent 70%),
    radial-gradient(ellipse 30% 42% at 70% 82%, rgba(58, 107, 79, 0.10), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero-sub {
  font-size: clamp(1.12rem, 2.2vw, 1.32rem);
  line-height: 1.55;
  max-width: 33em;
  margin-bottom: 2.4rem;
}
.hero-motivo {
  position: absolute;
  right: -3rem; top: 50%;
  transform: translateY(-50%);
  width: clamp(300px, 40vw, 560px);
  pointer-events: none;
}
@media (max-width: 900px) {
  .hero-motivo {
    position: static; transform: none; display: block;
    width: min(360px, 82%); margin: 3.2rem 0 0; opacity: 0.85;
  }
}

/* tratto animato del motivo */
.traccia { stroke-dasharray: 420; stroke-dashoffset: 420; animation: disegna 1.7s cubic-bezier(.5,0,.2,1) forwards; }
.traccia--2 { animation-delay: 260ms; }
.punto { opacity: 0; animation: appari 400ms ease-out forwards; }
.punto--t1 { animation-delay: 1.5s; }
.punto--t2 { animation-delay: 1.75s; }
@keyframes disegna { to { stroke-dashoffset: 0; } }
@keyframes appari { to { opacity: 1; } }

.rivelato { animation: sali 700ms ease-out both; }
.rivelato-2 { animation: sali 700ms ease-out 130ms both; }
.rivelato-3 { animation: sali 700ms ease-out 260ms both; }
@keyframes sali { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- Ingressi allo scroll (progressive enhancement) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 600ms ease, transform 600ms ease; }
.js .reveal.in { opacity: 1; transform: translateY(0); }
.js .reveal:nth-child(2) { transition-delay: 80ms; }
.js .reveal:nth-child(3) { transition-delay: 160ms; }
.js .reveal:nth-child(4) { transition-delay: 240ms; }
.js .reveal:nth-child(5) { transition-delay: 320ms; }
.js .reveal:nth-child(6) { transition-delay: 400ms; }

/* ---------- Card ---------- */
.griglia { display: grid; gap: 1.4rem; margin-top: 2.8rem; }
.griglia--3 { grid-template-columns: repeat(3, 1fr); }
.griglia--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) { .griglia--3, .griglia--2 { grid-template-columns: 1fr; } }

.card {
  background: var(--bianco);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  padding: 1.7rem 1.7rem 1.8rem;
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--ombra); border-color: var(--salvia); }
.card h3 { margin: 0 0 0.5em; }
.card p { font-size: 0.99rem; color: color-mix(in srgb, var(--testo) 86%, var(--salvia)); }

.icona {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--accento) 10%, var(--bianco));
  color: var(--accento);
  margin-bottom: 1.05rem;
}
.icona svg { width: 24px; height: 24px; }

/* card su sezione bianca: superfici sul fondo grigio */
.sez-bianca .card { background: var(--fondo); }
.sez-bianca .icona { background: color-mix(in srgb, var(--accento) 10%, var(--fondo)); }

.chiusura {
  margin: 3.6rem auto 0;
  max-width: 34em;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  line-height: 1.42;
  color: var(--verde);
}

/* ---------- Come lavoriamo ---------- */
.passi {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 2rem; margin-top: 3rem;
  counter-reset: passo;
  position: relative;
}
@media (min-width: 881px) {
  .passi::before {
    content: "";
    position: absolute; top: 1.55rem; left: 4rem; right: 4rem;
    height: 1px; background: var(--linea);
  }
}
@media (max-width: 880px) { .passi { grid-template-columns: 1fr; } }
.passo { counter-increment: passo; position: relative; }
.passo::before {
  content: counter(passo);
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.1rem; height: 3.1rem;
  border-radius: 50%;
  background: var(--verde);
  color: var(--fondo);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.35rem;
  margin-bottom: 1.1rem;
  position: relative; z-index: 1;
}
.passo h3 { margin-bottom: 0.4em; }
.passo p { font-size: 0.99rem; }

.principio {
  margin-top: 3.4rem;
  padding: 1.7rem 2rem;
  background: color-mix(in srgb, var(--accento) 7%, var(--bianco));
  border: 1px solid color-mix(in srgb, var(--accento) 22%, transparent);
  border-left: 4px solid var(--accento);
  border-radius: 0 var(--raggio) var(--raggio) 0;
  max-width: 54em;
}
.principio p { max-width: none; font-size: 1.05rem; }
.principio strong { color: var(--verde); }

/* ---------- Sezione scura ---------- */
.scura { background: var(--verde); color: var(--fondo); position: relative; overflow: hidden; }
.scura::before {
  content: "";
  position: absolute; right: -8%; top: -12%;
  width: 620px; height: 620px;
  background:
    radial-gradient(circle at 50% 50%, rgba(143, 168, 154, 0.14), transparent 65%);
  pointer-events: none;
}
.scura .wrap { position: relative; }
.scura h2, .scura h3 { color: var(--fondo); }
.scura .eyebrow { color: var(--salvia); }
.scura .eyebrow::after { background: var(--accento); }
.scura .card {
  background: rgba(253, 254, 253, 0.05);
  border-color: rgba(253, 254, 253, 0.14);
}
.scura .card:hover { border-color: var(--salvia); box-shadow: 0 12px 34px -14px rgba(0,0,0,0.5); }
.scura .card p { color: color-mix(in srgb, var(--fondo) 80%, var(--salvia)); }
.scura .icona { background: rgba(143, 168, 154, 0.14); color: var(--salvia); }
.filigrana {
  position: absolute; right: -60px; bottom: -60px;
  width: 420px; opacity: 0.07; pointer-events: none;
}

/* ---------- FAQ ---------- */
.faq { margin-top: 2.6rem; max-width: 100%; }
.faq details {
  background: var(--fondo);
  border: 1px solid var(--linea);
  border-radius: var(--raggio);
  margin-bottom: 0.7rem;
  transition: border-color 200ms ease;
}
.faq details[open] { border-color: var(--salvia); }
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: baseline; gap: 1.5rem;
  padding: 1.15rem 1.4rem;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.12rem; color: var(--verde);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-family: var(--font-body); font-weight: 400;
  font-size: 1.45rem; color: var(--accento); line-height: 1;
  transition: transform 180ms ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 1.4rem 1.35rem; font-size: 1rem; }

/* ---------- Contatto ---------- */
.contatto { text-align: center; }
.contatto h2 { margin-bottom: 0.5em; }
.contatto p { margin-inline: auto; max-width: 36em; }
.contatto .btn { margin-top: 2rem; font-size: 1.06rem; }
.contatto .nota-mail {
  display: block; margin-top: 1.1rem;
  font-size: 0.92rem;
  color: color-mix(in srgb, var(--fondo) 72%, var(--salvia));
}
.contatto .eyebrow { justify-content: center; }
.contatto .eyebrow::after { display: none; }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--linea);
  padding-block: 2rem;
  font-size: 0.88rem;
  color: color-mix(in srgb, var(--testo) 72%, var(--salvia));
  background: var(--fondo);
}
.footer .wrap {
  display: flex; flex-wrap: wrap;
  gap: 0.6rem 2rem;
  justify-content: space-between; align-items: center;
}
.footer a { color: inherit; }

/* ---------- Pagina privacy ---------- */
.pagina-testo { padding-block: clamp(3rem, 7vw, 5rem); }
.pagina-testo h1 { font-size: clamp(2rem, 5vw, 3rem); }
.pagina-testo h2 { font-size: 1.45rem; margin-top: 2.2em; }
.pagina-testo .aggiornamento {
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--testo) 70%, var(--salvia));
  margin-bottom: 2.5rem;
}
.pagina-testo ul { max-width: var(--misura); padding-left: 1.2rem; }
.pagina-testo li { margin-bottom: 0.4em; }

/* ---------- Utilità e accessibilità ---------- */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--verde); color: var(--fondo);
  padding: 0.6rem 1rem; z-index: 20;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .traccia { stroke-dashoffset: 0; }
  .punto { opacity: 1; }
  .js .reveal { opacity: 1; transform: none; }
}
