/* ==========================================================================
   Palette e variabili
   ========================================================================== */
:root {
  /* Tema scuro. I nomi delle variabili sono rimasti quelli della prima versione chiara:
     --ivory è il fondo, --ink il testo, --sage-deep il colore d'accento */
  color-scheme: dark;
  --ivory: #1C1E17;        /* fondo: nero caldo con una punta di oliva */
  --paper: #24271D;        /* superfici in rilievo */
  --sage: #4D5238;         /* oliva profondo: riempimenti, ambito "aziendale" */
  --sage-deep: #B6BB8D;    /* oliva pastello: accenti e testi in evidenza */
  --forest: #2C2F22;       /* fascia della citazione */
  --blush: #5E5346;        /* tortora profondo: ambito "d'affari" */
  --tortora: #BBAD99;      /* tortora pastello */
  --bronze: #C9A066;
  --bronze-light: #EBD3A2;
  --butter: #54482A;
  --ink: #ECE6D8;          /* testo: avorio caldo */
  --ink-soft: #B9B4A4;
  --line: rgba(236, 230, 216, .16);
  --error: #E39A8B;

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  /* solo per il nome della società: Copperplate è un carattere di sistema (Mac, iPhone, parte dei PC Windows) */
  --name: Copperplate, "Copperplate Gothic Light", "Copperplate Gothic", "Cormorant Garamond", Georgia, serif;
  --script: "Pinyon Script", "Snell Roundhand", "Apple Chancery", cursive;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;

  --container: 1160px;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(72px, 11vw, 144px);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

/* tutto il sito è proporzionato a questa misura: 17px invece dei 16 standard */
html { font-size: 106.25%; scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 390;
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 570;
  line-height: 1.12;
  letter-spacing: -.005em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6.2vw, 4.75rem); }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-size: 1.6rem; }
h1 em { font-style: italic; font-weight: 460; color: var(--sage-deep); }

p { margin: 0 0 1.1em; }
a { color: inherit; }
ol, ul { list-style: none; margin: 0; padding: 0; }
dl, dd { margin: 0; }
svg { display: block; }

:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 3px; }
::selection { background: var(--sage); }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--ivory);
  padding: 10px 16px; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 16px; }

.eyebrow {
  font-size: .75rem;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin: 0 0 1.4rem;
  display: flex; align-items: center; gap: 14px;
}
.eyebrow::before { content: ""; width: 32px; height: 1px; background: currentColor; }

/* ==========================================================================
   Pulsanti e link
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 30px;
  font: 500 .8125rem/1 var(--sans);
  letter-spacing: .16em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--ink); border-radius: 999px;
  cursor: pointer;
  transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease);
}
.btn { position: relative; isolation: isolate; overflow: hidden; }
.btn::before {
  content: ""; position: absolute; inset: -1px; z-index: -1; border-radius: inherit;
  background: var(--sage-deep); transform: translateY(102%);
  transition: transform .55s var(--ease);
}
.btn:hover::before, .btn:focus-visible::before { transform: none; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--bronze); border-color: var(--bronze); color: #1A1710; }
.btn-primary::before { background: var(--bronze-light); }
.btn-primary:hover { border-color: var(--bronze-light); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost::before { background: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ivory); }

.text-link {
  display: inline-flex; gap: 10px; margin-top: .6rem;
  font-weight: 500; font-size: .8125rem; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; padding-bottom: 6px; border-bottom: 1px solid var(--ink);
}
.text-link span { transition: transform .3s var(--ease); }
.text-link:hover span { transform: translateX(5px); }

/* ==========================================================================
   Intestazione
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(28, 30, 23, .84);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .4s;
}
/* in cima alla pagina l'intestazione è trasparente, così lo sfondo scorre senza stacchi */
.site-header:not(.is-scrolled) { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.site-header.is-scrolled { border-bottom-color: var(--line); }

.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 24px; }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; transition: opacity .5s var(--ease), transform .5s var(--ease); }
/* nella pagina principale il nome compare nell'intestazione solo quando il titolo è uscito dallo schermo */
.js .home .site-header:not(.show-brand) .brand-text { opacity: 0; transform: translateX(-10px); }
.brand-name { font-family: var(--name); font-size: 1.12rem; font-weight: 460; letter-spacing: .03em; }
.brand-sub { font-size: .64rem; font-weight: 500; letter-spacing: .26em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }

.nav { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); }
.nav a {
  font-size: .8125rem; font-weight: 460; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; padding: 8px 0; position: relative;
}
.nav a:not(.nav-cta)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav a:not(.nav-cta):hover::after, .nav a.is-active::after { transform: scaleX(1); }
.nav-cta { border: 1px solid var(--ink); border-radius: 999px; padding: 11px 22px !important; transition: background .3s, color .3s; }
.nav-cta:hover { background: var(--ink); color: var(--ivory); }

.nav-toggle { display: none; width: 44px; height: 44px; background: none; border: 0; padding: 0; cursor: pointer; position: relative; }
.nav-toggle span { position: absolute; left: 10px; right: 10px; height: 1px; background: var(--ink); transition: transform .3s var(--ease), top .3s var(--ease); }
.nav-toggle span:first-child { top: 18px; }
.nav-toggle span:last-child { top: 26px; }
.nav-toggle[aria-expanded="true"] span:first-child { top: 22px; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { top: 22px; transform: rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-top: clamp(40px, 7vw, 88px); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.hero-copy .lead { font-size: clamp(1.1rem, 1.5vw, 1.25rem); color: var(--ink-soft); max-width: 34em; margin: 1.3rem 0 2.4rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-art { min-height: clamp(380px, 44vw, 540px); }
.hero-art svg { width: 100%; max-width: 460px; height: auto; margin-inline: auto; overflow: visible; }

/* Il nome dello studio è il titolo della pagina */
.wordmark { font-family: var(--name); font-weight: 300; font-size: clamp(2.5rem, 6.4vw, 5.3rem); line-height: 1.08; letter-spacing: .01em; }
.wordmark em { font-style: normal; font-weight: inherit; }
.wordmark .line { white-space: nowrap; }
.tagline { font-family: var(--serif); font-size: clamp(1.5rem, 2.7vw, 2.15rem); line-height: 1.25; margin: 1.5rem 0 0; text-wrap: balance; }
.tagline em { color: var(--sage-deep); }
h1 .line { display: block; overflow: hidden; padding: .06em .08em .16em 0; margin-bottom: -.22em; }
h1 .line > span { display: block; animation: lineUp 1.2s var(--ease) .15s both; }
h1 .line:nth-child(2) > span { animation-delay: .32s; }



.figures {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: clamp(48px, 8vw, 96px);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.figures > div { padding: 30px 24px; display: flex; flex-direction: column-reverse; gap: 6px; }
.figures > div + div { border-left: 1px solid var(--line); }
.figures dt { font-size: .75rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); font-weight: 460; }
.figures dd { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; font-variant-numeric: lining-nums; }
.figures dd.figures-text { font-style: italic; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.5; }
.contact-list small { font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); }
.check a { color: var(--ink); text-underline-offset: 3px; }

/* ==========================================================================
   Sezioni
   ========================================================================== */
.section { padding-block: var(--section); }
.section-tint { background: rgba(182, 187, 141, .055); }
.section-head { max-width: 720px; margin-bottom: clamp(40px, 6vw, 72px); }
.section-intro { color: var(--ink-soft); font-size: 1.125rem; margin-top: 1.4rem; max-width: 34em; }

/* Lo studio */
.split { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 7vw, 104px); }
.split-body p { color: var(--ink-soft); }
.split-body .drop { font-family: var(--serif); font-size: clamp(1.35rem, 2.1vw, 1.7rem); line-height: 1.45; color: var(--ink); }
.values { margin-top: 2.6rem; border-top: 1px solid var(--line); }
.values li { display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--ink-soft); }
.values span { font-family: var(--serif); font-size: 1.35rem; font-style: italic; color: var(--ink); line-height: 1.3; }

/* Grafico illustrativo */
.chart { width: 100%; max-width: 340px; height: auto; margin-top: clamp(32px, 5vw, 60px); overflow: visible; }
.chart .bar { transform-box: fill-box; transform-origin: 50% 100%; }
.b-sage { fill: #6F7552; }
.b-powder { fill: var(--powder); }
.b-blush { fill: var(--bronze); }
.chart .axis { stroke: var(--ink); stroke-opacity: .5; }
.chart .trend { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 1; }
.chart .dot { fill: var(--ink); }
.chart .ring { fill: none; stroke: var(--bronze); transform-box: fill-box; transform-origin: center; animation: pulse 2.8s ease-out infinite; }

/* Servizi */
.service-group + .service-group { margin-top: clamp(48px, 6vw, 80px); }
.group-head { display: grid; grid-template-columns: .9fr 1.1fr; gap: 12px clamp(32px, 7vw, 104px); align-items: baseline; margin-bottom: 28px; }
.group-head h3 { font-size: clamp(1.7rem, 2.8vw, 2.2rem); font-style: italic; font-weight: 460; display: flex; align-items: center; gap: 16px; }
.group-head h3::before { content: ""; width: 12px; height: 12px; border-radius: 50%; flex: none; }
.group-head p { color: var(--ink-soft); margin: 0; }
.group-aziendale .group-head h3::before, .group-aziendale .service-icon { background: var(--sage); }
.group-affari .group-head h3::before, .group-affari .service-icon { background: var(--blush); }
.services { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.service {
  padding: clamp(28px, 3.4vw, 44px);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: transparent;
  transition: background .45s var(--ease);
}
.service { position: relative; isolation: isolate; }
.service::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(236, 230, 216, .045); opacity: 0; transition: opacity .5s var(--ease);
}
.service::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: var(--sage-deep); transform: scaleX(0); transform-origin: left;
  transition: transform .6s var(--ease);
}
.service:hover::before { opacity: 1; }
.service:hover::after { transform: none; }
.service:hover .service-icon { transform: translateY(-4px) scale(1.08); }
.service-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 58px; height: 58px; border-radius: 50%;
  font-family: var(--serif); font-size: 1.05rem; letter-spacing: .06em;
  margin-bottom: 26px;
  transition: transform .5s var(--ease);
}
.service-index { position: absolute; top: clamp(28px, 3.4vw, 44px); right: clamp(28px, 3.4vw, 44px); font-family: var(--serif); font-style: italic; font-size: 1.1rem; color: var(--ink-soft); }
.icon { width: 26px; height: 26px; }
.icon * { fill: none; stroke: var(--ink); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; }
.service:hover .icon * { animation: redraw 1.1s var(--ease); }
.service h4 { font-family: var(--serif); font-weight: 570; font-size: 1.45rem; line-height: 1.15; margin: 0 0 12px; text-wrap: balance; }
.service p { color: var(--ink-soft); margin: 0; font-size: .97rem; }

/* Metodo */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 40px); counter-reset: none; }
.step { position: relative; padding-top: 24px; }
.step::after {
  content: ""; position: absolute; top: -4px; left: 0; width: 9px; height: 9px; border-radius: 50%;
  background: var(--sage-deep);
}
.step::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--ink); transform-origin: left; }
.step-num { display: block; font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--sage-deep); margin-bottom: 34px; }
.step h3 { margin-bottom: 10px; }
.step p { color: var(--ink-soft); font-size: 1rem; margin: 0; }

/* Citazione */
.quote-band { background: var(--forest); color: var(--ink); border-block: 1px solid var(--line); padding-block: clamp(64px, 9vw, 120px); text-align: center; }
.quote-band blockquote { margin: 0; }
.quote-band p { font-family: var(--script); font-size: clamp(2rem, 4.4vw, 3.4rem); line-height: 1.45; margin: 0; text-wrap: balance; }
.quote-author { font-family: var(--script); font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.3; margin-top: 2.2rem; color: var(--bronze-light); }
.quote-author::before { content: ""; display: block; width: 56px; height: 1px; margin: 0 auto 1.6rem; background: var(--bronze); }

/* Contatti */
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 104px); align-items: start; }
.contact-list { margin-top: 2.6rem; display: grid; grid-template-columns: 1fr 1fr; gap: 30px 24px; }
.contact-list dt { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--sage-deep); font-weight: 500; margin-bottom: 8px; }
.contact-list dd { font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; overflow-wrap: anywhere; }
.contact-list > div:has(a[href^="mailto"]) { grid-column: 1 / -1; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color .3s; }
.contact-list a:hover { border-color: var(--ink); }

.contact-form { background: var(--paper); padding: clamp(26px, 4vw, 48px); border: 1px solid var(--line); border-radius: 4px; }
.field { margin-bottom: 24px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field label { display: block; font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }
.optional { text-transform: none; letter-spacing: 0; font-weight: 390; }
.field input, .field textarea {
  width: 100%; background: transparent; color: var(--ink);
  font: 390 1.0625rem/1.5 var(--sans);
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  padding: 10px 0; transition: border-color .3s;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { box-shadow: 0 1px 0 var(--ink); }
.field.has-error input, .field.has-error textarea { border-bottom-color: var(--error); }

.check { display: flex; gap: 12px; align-items: flex-start; font-size: .9rem; color: var(--ink-soft); margin-bottom: 22px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 4px 0 0; accent-color: var(--sage-deep); flex: none; }
.check.has-error { color: var(--error); }
.form-note { font-size: .92rem; margin: 0 0 18px; min-height: 1.4em; color: var(--sage-deep); }
.form-note.is-error { color: var(--error); }

/* ==========================================================================
   Piè di pagina
   ========================================================================== */
.site-footer { background: #121410; color: var(--ink-soft); border-top: 1px solid var(--line); padding-block: 56px 36px; font-size: .92rem; }
.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 32px 48px; }
.footer-mark { width: 64px; height: 64px; margin-bottom: 18px; }
.footer-name { font-family: var(--name); font-weight: 300; font-size: clamp(1.5rem, 3.4vw, 2.5rem); line-height: 1.1; letter-spacing: .01em; color: var(--ink); margin-bottom: .5rem; }
.footer-inner p { margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 12px 30px; align-content: start; }
.footer-nav a { text-decoration: none; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; padding: 6px 0; transition: color .3s; }
.footer-nav a:hover { color: var(--ink); }
.footer-legal { grid-column: 1 / -1; padding-top: 26px; border-top: 1px solid rgba(236, 230, 216, .14); font-size: .82rem; }

/* ==========================================================================
   Sfondo: aloni e tracciati che seguono lo scorrimento
   ========================================================================== */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; will-change: transform; }
.glow { border-radius: 50%; animation: wander 26s ease-in-out infinite; }
.g-sage {
  width: 62vmax; height: 62vmax; top: -18vmax; right: -20vmax;
  background: radial-gradient(closest-side, rgba(160, 166, 118, .20), rgba(160, 166, 118, 0));
  transform: translate3d(0, calc(var(--scroll, 0) * -.10px), 0);
}
.g-blush {
  width: 54vmax; height: 54vmax; top: 55vh; left: -24vmax;
  background: radial-gradient(closest-side, rgba(187, 173, 153, .15), rgba(187, 173, 153, 0));
  transform: translate3d(0, calc(var(--scroll, 0) * -.16px), 0);
  animation-duration: 32s; animation-delay: -9s;
}
.g-powder {
  width: 48vmax; height: 48vmax; top: 130vh; right: -14vmax;
  background: radial-gradient(closest-side, rgba(201, 160, 102, .12), rgba(201, 160, 102, 0));
  transform: translate3d(0, calc(var(--scroll, 0) * -.22px), 0);
  animation-duration: 38s; animation-delay: -17s;
}
/* Il logo nello sfondo. --k vale 1 in cima alla pagina (emblema a destra del nome)
   e scende a 0 scorrendo (filigrana tenue al centro) */
.mark {
  --size: min(92vh, 92vw);
  --k: calc(1 - var(--t, 1));
  position: absolute; top: 50%; left: 50%;
  width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  /* la dissolvenza (--f) si completa molto prima dello spostamento, poi l'opacità resta costante */
  opacity: calc(.09 + .91 * (1 - var(--f, 1)));
  transform:
    translate(calc(var(--k) * 24vw + var(--px, 0) * 14px), calc(var(--k) * -4vh + var(--py, 0) * 14px))
    scale(calc(1 - .42 * var(--k)));
  will-change: transform, opacity;
}
.mark img {
  width: 100%; height: 100%; display: block;
  transform: rotate(calc(var(--scroll, 0) * .025deg));
  animation: markIn 2.4s var(--ease) both, breathe 18s ease-in-out 2.4s infinite;
}
.mark img { position: absolute; inset: 0; will-change: transform; }
.mark .shine {
  -webkit-mask: linear-gradient(115deg, transparent 42%, #000 50%, transparent 58%) 0 0 / 300% 100% no-repeat;
          mask: linear-gradient(115deg, transparent 42%, #000 50%, transparent 58%) 0 0 / 300% 100% no-repeat;
  animation: markIn 2.4s var(--ease) both, breathe 18s ease-in-out 2.4s infinite, sheen 7s ease-in-out 2.6s infinite;
}
/* il riflesso ridisegna ogni fotogramma: lo si ferma quando il logo è ormai una filigrana tenue */
.backdrop.is-faded .mark .shine { animation-play-state: running, running, paused; }
@keyframes sheen {
  0% { -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  45%, 100% { -webkit-mask-position: 0 0; mask-position: 0 0; }
}
@keyframes markIn { from { opacity: 0; rotate: -40deg; scale: .86; } }
@keyframes breathe { 50% { scale: 1.025; } }
@keyframes wander {
  0%, 100% { translate: 0 0; scale: 1; }
  33% { translate: 3vmax -2vmax; scale: 1.06; }
  66% { translate: -2vmax 3vmax; scale: .96; }
}

/* ==========================================================================
   Pagine legali
   ========================================================================== */
.legal { padding-block: clamp(48px, 8vw, 104px) var(--section); }
.legal .container { max-width: calc(780px + var(--gutter) * 2); }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: .6rem; }
.legal .updated { color: var(--ink-soft); font-size: .9rem; margin-bottom: 3rem; }
.legal h2 { font-size: clamp(1.5rem, 2.6vw, 1.9rem); margin: 3rem 0 1rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.legal p, .legal li { color: var(--ink-soft); }
.legal ul { list-style: disc; padding-left: 1.2em; margin: 0 0 1.1em; }
.legal li { margin-bottom: .4em; }
.legal a { color: var(--ink); text-underline-offset: 3px; }
.legal dl { display: grid; grid-template-columns: minmax(150px, 220px) 1fr; border-top: 1px solid var(--line); margin-bottom: 1.4em; }
.legal dt, .legal dd { padding: 12px 0; border-bottom: 1px solid var(--line); }
.legal dt { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 500; color: var(--sage-deep); padding-top: 16px; }
.legal dd { color: var(--ink); }
.legal mark { background: var(--butter); color: var(--ink); padding: 0 .3em; border-radius: 2px; }
.back-link { font-size: .8125rem; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.back-link:hover { text-decoration: underline; text-underline-offset: 5px; }
@media (max-width: 600px) {
  .legal dl { grid-template-columns: 1fr; }
  .legal dt { border-bottom: 0; padding-bottom: 0; }
  .legal dd { padding-top: 4px; }
}

/* ==========================================================================
   Animazioni
   ========================================================================== */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60;
  background: var(--bronze); transform: scaleX(var(--progress, 0)); transform-origin: left;
}

.site-header { animation: headerIn 1s var(--ease) both; }

@keyframes headerIn { from { transform: translateY(-100%); } }
@keyframes lineUp { from { transform: translateY(110%); } }
@keyframes shapeIn { from { opacity: 0; transform: translateY(56px) scale(.92); } }
@keyframes drift { 50% { translate: 0 var(--drift, -8px); } }
@keyframes redraw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes pulse { from { transform: scale(1); opacity: .9; } to { transform: scale(3.6); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* Comparsa allo scorrimento */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* Filetti che si disegnano */
.eyebrow::before { transform-origin: left; }
.js .reveal .eyebrow::before, .js .eyebrow.reveal::before { transform: scaleX(0); transition: transform 1s var(--ease) .25s; }
.js .reveal.is-visible .eyebrow::before, .js .eyebrow.reveal.is-visible::before { transform: none; }
.js .step.reveal::before { transform: scaleX(0); transition: transform 1.3s var(--ease) .15s; }
.js .step.reveal.is-visible::before { transform: none; }

/* Grafico: barre che crescono, linea che si traccia */
.js .reveal .chart .bar { transform: scaleY(0); transition: transform 1.3s var(--ease); transition-delay: calc(var(--n) * 110ms + 350ms); }
.js .reveal.is-visible .chart .bar { transform: none; }
.js .reveal .chart .trend { stroke-dashoffset: 1; transition: stroke-dashoffset 2s var(--ease) 1s; }
.js .reveal.is-visible .chart .trend { stroke-dashoffset: 0; }
.js .reveal .chart .endpoint { opacity: 0; transition: opacity .6s 2.7s; }
.js .reveal.is-visible .chart .endpoint { opacity: 1; }

/* Icone dei servizi che si disegnano */
.js .service.reveal .icon * { stroke-dashoffset: 1; transition: stroke-dashoffset 1.6s var(--ease); transition-delay: calc(var(--stagger, 0ms) + 350ms); }
.js .service.reveal.is-visible .icon * { stroke-dashoffset: 0; }

/* Marcatori delle fasi */
.js .step.reveal::after { transform: scale(0); transition: transform .7s var(--ease); transition-delay: calc(var(--stagger, 0ms) + 100ms); }
.js .step.reveal.is-visible::after { transform: none; }
.js .step.reveal::before { transition-delay: calc(var(--stagger, 0ms) + 250ms); }

/* Citazione parola per parola */
.split-words .w { display: inline-block; overflow: hidden; vertical-align: bottom; padding: .2em .22em .34em; margin: -.2em -.22em -.34em; }
.split-words .w > span { display: inline-block; transform: translateY(150%); transition: transform 1s var(--ease); transition-delay: calc(var(--i) * 55ms + 150ms); }
.reveal.is-visible .split-words .w > span { transform: none; }
.js .reveal .quote-author { opacity: 0; transition: opacity 1.2s var(--ease) 1.3s; }
.js .reveal.is-visible .quote-author { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal, .split-words .w > span,
  .js .reveal .eyebrow::before, .js .eyebrow.reveal::before, .js .step.reveal::before { opacity: 1; transform: none; }
  .js .reveal .chart .bar, .js .step.reveal::after { transform: none; }
  .js .reveal .chart .endpoint { opacity: 1; }
  .js .reveal .quote-author { opacity: 1; }
  .chart .ring { display: none; }
  .glow { transform: none; }
  .mark img { transform: none; }
  .mark .shine { display: none; }
  .progress { display: none; }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 980px) {
  .services { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 48px; }
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ivory); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 28px;
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
  }
  .nav.is-open { visibility: visible; opacity: 1; transform: none; }
  .nav a { padding: 16px 0; border-bottom: 1px solid var(--line); }
  .nav a:not(.nav-cta)::after { display: none; }
  .nav-cta { margin-top: 22px; text-align: center; padding: 16px 22px !important; border: 1px solid var(--ink) !important; }

  .hero-grid, .split, .contact, .group-head { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .mark { --k: 0; --f: 1; --size: 130vw; }
}

@media (max-width: 600px) {
  body { font-size: 1rem; }
  .services, .steps { grid-template-columns: 1fr; }
  .steps { row-gap: 36px; }
  .step-num { margin-bottom: 18px; }
  .values li { grid-template-columns: 1fr; gap: 4px; }
  .field-row, .contact-list { grid-template-columns: 1fr; }
  .field-row { gap: 0; }
  .figures { grid-template-columns: 1fr; }
  .figures > div { padding: 18px 0; }
  .figures > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .hero-actions .btn { width: 100%; }
  .footer-inner { grid-template-columns: 1fr; }
  .quote-band br { display: none; }
}
