/* Verdeo, sito istituzionale. Font ospitati in locale (nessuna richiesta a terzi). */
@font-face {
  font-family: "Instrument Sans";
  src: url("assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Newsreader";
  src: url("assets/fonts/newsreader-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --bosco: #0b3d22;
  --testo: #1c3326;
  --foglia: #1f7a3a;
  --germoglio: #9cd14e;
  --carta: #f6f8f3;
  --tratto: #dbe4d5;
  --ocra: #b8781a;
  --ruggine: #a9482a;
  --bianco: #fff;
  --muto: #4d6155;
  --header: 4.5rem;
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header) + 1rem); -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; color: var(--testo); background: var(--carta); font: 400 1.0625rem/1.6 "Instrument Sans", "Helvetica Neue", Arial, sans-serif; font-kerning: normal; }
body.menu-open { overflow: hidden; }
img, svg { display: block; max-width: 100%; }
a { color: var(--foglia); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; color: var(--bosco); font-weight: 600; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: 1.02; letter-spacing: -.035em; }
h2 { font-size: clamp(1.85rem, 3.6vw, 2.9rem); line-height: 1.08; letter-spacing: -.028em; }
h3 { font-size: 1.125rem; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0 0 1.1rem; }
:focus-visible { outline: 3px solid var(--foglia); outline-offset: 3px; border-radius: 4px; }
.wrap { width: min(100% - 2rem, 76rem); margin-inline: auto; }
.section { padding: clamp(4.5rem, 10vw, 8.5rem) 0; }
.section-title { max-width: 22ch; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; z-index: 100; top: .75rem; left: .75rem; padding: .7rem 1rem; color: var(--bianco); background: var(--bosco); border-radius: 8px; transform: translateY(-200%); }
.skip-link:focus { transform: none; }

/* Pulsanti */
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 3rem; padding: .75rem 1.35rem; color: var(--bianco); font-weight: 600; text-decoration: none; background: var(--foglia); border: 0; border-radius: 999px; transition: background-color .2s, transform .12s var(--ease-out); }
.button:hover { background: var(--bosco); }
.button:active { transform: scale(.97); }
.button-small { min-height: 2.6rem; padding: .55rem 1.1rem; font-size: .95rem; }
.button-light { color: var(--bosco); background: var(--germoglio); }
.button-light:hover { background: var(--bianco); }
.text-link { font-weight: 600; }

/* Header */
.site-header { position: sticky; z-index: 50; top: 0; background: rgb(246 248 243 / .92); border-bottom: 1px solid transparent; transition: border-color .2s; }
@supports (backdrop-filter: blur(1px)) { .site-header { background: rgb(246 248 243 / .8); backdrop-filter: blur(12px); } }
.site-header.is-scrolled { border-color: var(--tratto); }
.header-inner { display: flex; min-height: var(--header); align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; color: var(--bosco); border-radius: 6px; }
.logo { width: auto; height: 2.5rem; overflow: visible; }
.main-nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.main-nav a:not(.button) { color: var(--testo); font-size: .97rem; font-weight: 500; text-decoration: none; }
.main-nav a:not(.button):hover { color: var(--foglia); }
.menu-toggle { display: none; width: 2.75rem; height: 2.75rem; place-content: center; gap: .4rem; background: transparent; border: 1px solid var(--tratto); border-radius: 999px; cursor: pointer; }
.menu-bar { display: block; width: 1.1rem; height: 2px; background: var(--bosco); border-radius: 2px; transition: transform .25s var(--ease-out); }
.menu-toggle[aria-expanded="true"] .menu-bar:first-of-type { transform: translateY(.21rem) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-bar:last-of-type { transform: translateY(-.21rem) rotate(-45deg); }

@media (max-width: 52rem) {
  .menu-toggle { display: grid; }
  .main-nav { position: fixed; inset: var(--header) 0 auto; flex-direction: column; align-items: stretch; gap: 0; padding: .5rem 1rem 1.25rem; background: var(--carta); border-bottom: 1px solid var(--tratto); visibility: hidden; opacity: 0; transform: translateY(-.5rem); transition: opacity .2s, transform .25s var(--ease-out), visibility 0s .25s; }
  .main-nav.is-open { visibility: visible; opacity: 1; transform: none; transition: opacity .2s, transform .25s var(--ease-out); }
  .main-nav a:not(.button) { padding: .9rem 0; font-size: 1.1rem; border-bottom: 1px solid var(--tratto); }
  .main-nav .button { margin-top: 1rem; }
}

/* Hero */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(4rem, 8vw, 6.5rem); overflow-x: clip; }
.hero-grid { display: grid; gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
@media (min-width: 60rem) { .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.hero-lead { max-width: 34rem; margin-top: 1.5rem; color: var(--muto); font-size: clamp(1.1rem, 1.6vw, 1.25rem); line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.75rem; margin: 2rem 0; }
.hero-notes { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; padding: 0; list-style: none; }
.hero-notes li { padding: .3rem .8rem; color: var(--bosco); font-size: .9rem; font-weight: 500; border: 1px solid var(--tratto); border-radius: 999px; }

/* Mappa dimostrativa */
.demo { position: relative; margin: 0; }
.map { position: relative; aspect-ratio: 640 / 560; overflow: hidden; background: #e7ede2; border: 1px solid var(--tratto); border-radius: 22px; }
.map-svg { width: 100%; height: 100%; }
.m-bg { fill: #e7ede2; }
.m-bld rect { fill: #d9e1d3; }
.m-park { fill: #cfe5bc; }
.m-walk { fill: none; stroke: #f4f8ef; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 2 9; }
.m-water { fill: #cfdfe3; }
.m-road path { fill: none; stroke: #fbfcf9; stroke-width: 13; }
.m-viale { fill: none; stroke: #fbfcf9; stroke-width: 22; }
.m-label { fill: #4f6357; font-size: 13px; font-weight: 500; letter-spacing: .02em; paint-order: stroke; stroke: #fbfcf9; stroke-width: 4px; stroke-linejoin: round; }
.m-label-park { fill: #335c39; stroke: #cfe5bc; }
.m-trees .sa { fill: #2f9a3e; }
.m-trees .sb { fill: var(--ocra); }
.m-trees .sc { fill: var(--ruggine); }
.m-trees circle { stroke: rgb(255 255 255 / .75); stroke-width: 1.5; }
.map-sweep { position: absolute; inset: 0 auto 0 0; width: 35%; background: linear-gradient(90deg, transparent, rgb(156 209 78 / .35) 70%, rgb(156 209 78 / .7)); opacity: 0; pointer-events: none; }

.pin { position: absolute; width: 2.75rem; height: 2.75rem; margin: -1.375rem 0 0 -1.375rem; padding: 0; background: transparent; border: 0; border-radius: 50%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.pin::before, .pin::after { content: ""; position: absolute; inset: .55rem; border: 2px solid var(--bosco); border-radius: 50%; transition: transform .2s var(--ease-out), border-color .2s; }
.pin::after { border-color: var(--bosco); opacity: 0; }
.pin:hover::before { transform: scale(1.15); }
.pin:active::before { transform: scale(.92); }
.pin.is-active::before { border-width: 3px; background: rgb(255 255 255 / .35); }
.pin-viale { left: 20.3%; top: 79.39%; }
.pin-parco { left: 46.04%; top: 31.95%; }
.pin-via { left: 71.56%; top: 50.71%; }

.tree-card { position: relative; z-index: 2; width: min(100%, 19.5rem); margin: -2.5rem 0 0 auto; margin-right: 1rem; padding: 1.1rem 1.25rem 1rem; background: var(--bianco); border: 1px solid var(--tratto); border-radius: 16px; box-shadow: 0 18px 40px -18px rgb(11 61 34 / .35); }
@media (min-width: 60rem) { .tree-card { position: absolute; right: -1.5rem; bottom: -1.5rem; margin: 0; } }
.tree-card.is-changing [data-field] { opacity: 0; transform: translateY(4px); }
.tree-card [data-field] { transition: opacity .18s ease, transform .18s var(--ease-out); }
.tree-code { margin: 0 0 .2rem; color: var(--muto); font-size: .82rem; }
.tree-species { display: flex; flex-direction: column; margin: 0 0 .8rem; color: var(--bosco); font-weight: 600; line-height: 1.25; }
.latin { font-family: "Newsreader", Georgia, serif; font-size: 1.3rem; font-style: italic; font-weight: 400; letter-spacing: -.005em; }
.tree-facts { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.25rem; margin: 0; font-size: .9rem; line-height: 1.35; }
.tree-facts div:last-child { grid-column: 1 / -1; }
.tree-facts dt { color: var(--muto); font-size: .8rem; }
.tree-facts dd { margin: 0; color: var(--testo); }
.state { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.state::before { content: ""; width: .6rem; height: .6rem; border-radius: 50%; background: currentColor; }
.state-a { color: #1f7a3a; }
.state-b { color: #8a5a12; }
.state-c { color: var(--ruggine); }

.demo-caption { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin-top: 1.1rem; color: var(--muto); font-size: .88rem; }
@media (min-width: 60rem) { .demo-caption { max-width: calc(100% - 19.5rem); } }
.legend { display: inline-flex; align-items: center; gap: .4rem; }
.dot { width: .65rem; height: .65rem; border-radius: 50%; }
.dot-a { background: #2f9a3e; } .dot-b { background: var(--ocra); } .dot-c { background: var(--ruggine); }
.demo-note { flex-basis: 100%; }

/* Perché */
.why { background: var(--bianco); border-block: 1px solid var(--tratto); }
.why-grid { display: grid; gap: 3rem; }
@media (min-width: 56rem) { .why-grid { grid-template-columns: 1.2fr 1fr; gap: 5rem; align-items: start; } }
.why-text { max-width: 36rem; margin-top: 1.5rem; color: var(--muto); font-size: 1.15rem; }
.before-after { padding: 1.75rem; background: var(--carta); border-radius: 20px; }
.ba-title { margin: 0 0 .6rem; color: var(--bosco); font-weight: 600; }
.ba-old { margin: 0 0 1.75rem; padding: 0; list-style: none; color: var(--muto); }
.ba-old li { padding: .35rem 0; text-decoration: line-through; text-decoration-color: rgb(169 72 42 / .55); text-decoration-thickness: 2px; }
.ba-new { margin: 0; font-size: 1.1rem; color: var(--testo); }

/* Passi */
.steps { position: relative; display: grid; gap: 2.5rem; margin: 0; padding: 0; list-style: none; counter-reset: passo; }
@media (min-width: 52rem) { .steps { grid-template-columns: repeat(3, 1fr); gap: 3rem; } }
.steps li { position: relative; padding-top: 3.75rem; counter-increment: passo; }
.steps li::before { content: counter(passo); position: absolute; top: 0; left: 0; display: grid; width: 2.6rem; height: 2.6rem; place-items: center; color: var(--bianco); font-weight: 600; background: var(--foglia); border-radius: 50%; }
.steps h3 { margin-bottom: .6rem; font-size: 1.3rem; }
.steps p { max-width: 30rem; color: var(--muto); }
.steps::before { content: ""; position: absolute; top: 1.3rem; left: 1.3rem; right: 1.3rem; height: 2px; background: repeating-linear-gradient(90deg, var(--foglia) 0 8px, transparent 8px 14px); transform-origin: left; }
@media (max-width: 51.99rem) { .steps::before { top: 1.3rem; bottom: 1.3rem; right: auto; width: 2px; height: auto; background: repeating-linear-gradient(180deg, var(--foglia) 0 8px, transparent 8px 14px); transform-origin: top; } }

/* Funzioni come legenda */
.features { background: var(--bianco); border-block: 1px solid var(--tratto); }
.legend-list { display: grid; gap: 0 4rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 52rem) { .legend-list { grid-template-columns: 1fr 1fr; } }
.legend-list li { display: grid; grid-template-columns: 2.75rem 1fr; gap: 1rem; padding: 1.4rem 0; border-top: 1px solid var(--tratto); }
.legend-list svg { width: 2.75rem; height: 2.75rem; padding: .55rem; fill: none; stroke: var(--foglia); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; background: #eaf3e2; border-radius: 12px; }
.legend-list h3 { margin-bottom: .3rem; }
.legend-list p { margin: 0; color: var(--muto); }

/* Destinatari */
.audience-list { margin: 0; }
.audience-list div { display: grid; gap: .4rem 3rem; padding: 1.6rem 0; border-top: 1px solid var(--tratto); }
.audience-list div:last-child { border-bottom: 1px solid var(--tratto); }
@media (min-width: 52rem) { .audience-list div { grid-template-columns: 18rem 1fr; } }
.audience-list dt { color: var(--bosco); font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em; }
.audience-list dd { max-width: 40rem; margin: 0; color: var(--muto); font-size: 1.08rem; }

/* Tecnologia */
.technology { background: var(--bianco); border-top: 1px solid var(--tratto); }
.technology-grid { display: grid; gap: 3rem; }
@media (min-width: 56rem) { .technology-grid { grid-template-columns: 1fr 1fr; gap: 5rem; } }
.technology-grid h2 + p { max-width: 32rem; margin-top: 1.5rem; color: var(--muto); font-size: 1.12rem; }
.facts { margin: 0; padding: 0; list-style: none; }
.facts li { display: grid; gap: .2rem; padding: 1.1rem 0 1.1rem 1.75rem; border-top: 1px solid var(--tratto); background: radial-gradient(circle at .4rem 1.75rem, var(--germoglio) .3rem, transparent .32rem); }
.facts strong { color: var(--bosco); font-weight: 600; }
.facts span { color: var(--muto); }

/* Contatti */
.contact { position: relative; padding: clamp(4.5rem, 10vw, 8rem) 0; overflow: hidden; color: #d9ead0; background: var(--bosco); }
.contact-inner { position: relative; }
.contact-inner > * { max-width: 40rem; }
.contact-mark { position: absolute; right: max(-4rem, calc(50% - 46rem)); bottom: -5rem; width: clamp(15rem, 32vw, 28rem); height: auto; opacity: .14; transform-origin: 50% 100%; pointer-events: none; }
.contact h2 { color: var(--bianco); }
.contact p { margin: 1.25rem 0 2rem; font-size: 1.15rem; }

/* Footer */
.site-footer { padding: 3rem 0; color: #b9cdb9; background: #072a17; font-size: .95rem; }
.footer-inner { display: grid; gap: 1rem 2rem; align-items: center; }
@media (min-width: 52rem) { .footer-inner { grid-template-columns: auto 1fr auto; } .footer-copy { grid-column: 1 / -1; } }
.footer-logo { height: 2.25rem; width: auto; }
.site-footer p { margin: 0; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 0; list-style: none; }
.site-footer a { color: var(--bianco); }

/* Pagine legali */
.legal { padding: clamp(3rem, 7vw, 5.5rem) 0; }
.legal .wrap { max-width: 46rem; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.3rem); margin-bottom: 1rem; }
.legal h2 { margin: 2.25rem 0 .6rem; font-size: 1.35rem; letter-spacing: -.01em; }
.legal-updated { color: var(--muto); }
.legal-notice { margin: 1.5rem 0; padding: 1rem 1.25rem; background: #fdf3e2; border-left: 4px solid var(--ocra); border-radius: 6px; }
.legal-header .header-inner { min-height: var(--header); }

/* Movimento: solo se l'utente non ha chiesto di ridurlo. Solo transform e opacity. */
@media (prefers-reduced-motion: no-preference) {
  /* Logo: la foglia cresce dalla punta, poi la scritta, poi la fogliolina sulla o. */
  .logo .lm { transform-box: view-box; transform-origin: 141px 332px; animation: logo-grow .7s var(--ease-spring) both; }
  .logo .lm1 { animation-delay: .05s; } .logo .lm2 { animation-delay: .12s; } .logo .lm3 { animation-delay: .19s; } .logo .lm4 { animation-delay: .26s; } .logo .lm5 { animation-delay: .33s; }
  .logo .lw, .logo .lo { transform-box: fill-box; transform-origin: 50% 100%; animation: logo-letter .5s var(--ease-out) both; }
  .logo .lw1 { animation-delay: .3s; } .logo .lw2 { animation-delay: .35s; } .logo .lw3 { animation-delay: .4s; } .logo .lw4 { animation-delay: .45s; } .logo .lw5 { animation-delay: .5s; } .logo .lo { animation-delay: .55s; }
  .logo .ll { transform-box: fill-box; transform-origin: 0% 100%; animation: logo-leaf .8s var(--ease-spring) .75s both; }
  .brand:hover .ll { animation: logo-sway .7s var(--ease-out); }

  /* Mappa: il censimento passa da sinistra a destra e gli alberi compaiono al suo passaggio. */
  .m-trees circle { transform-box: fill-box; transform-origin: center; animation: tree-pop .45s var(--ease-spring) both; }
  .m-trees.g1 circle { animation-delay: .35s; } .m-trees.g2 circle { animation-delay: .47s; } .m-trees.g3 circle { animation-delay: .59s; }
  .m-trees.g4 circle { animation-delay: .71s; } .m-trees.g5 circle { animation-delay: .83s; } .m-trees.g6 circle { animation-delay: .95s; }
  .map-sweep { animation: sweep 1.15s cubic-bezier(.45, 0, .55, 1) .2s both; }
  .pin { animation: fade-in .3s ease 1.15s both; }
  .pin.is-active::after { animation: ring 1.6s var(--ease-out) 1.4s 3; }
  .tree-card { animation: card-in .55s var(--ease-out) 1.2s both; }

  /* Passi: il tracciato si disegna mentre la sezione entra nello schermo. */
  @supports (animation-timeline: view()) {
    .steps::before { animation: draw-x linear both; animation-timeline: view(); animation-range: entry 20% cover 45%; }
    @media (max-width: 51.99rem) { .steps::before { animation-name: draw-y; } }
    /* Contatti: il marchio cresce mentre la sezione sale nello schermo. */
    .contact-mark { animation: mark-grow linear both; animation-timeline: view(); animation-range: entry 0% cover 55%; }
  }
}

@keyframes logo-grow { from { opacity: 0; transform: scale(.3); } }
@keyframes logo-letter { from { opacity: 0; transform: translateY(35%); } }
@keyframes logo-leaf { from { opacity: 0; transform: rotate(-55deg) scale(.4); } }
@keyframes logo-sway { 30% { transform: rotate(-14deg); } 65% { transform: rotate(6deg); } }
@keyframes tree-pop { from { opacity: 0; transform: scale(0); } }
@keyframes sweep { 0% { opacity: 1; transform: translateX(-100%); } 85% { opacity: 1; } 100% { opacity: 0; transform: translateX(290%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(2.1); } }
@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes draw-y { from { transform: scaleY(0); } }
@keyframes mark-grow { from { opacity: 0; transform: scale(.55) rotate(-10deg); } }
