/* ==========================================================================
   PEIRANO VIVAI — dal 1880 · design "botanico editoriale / tech"
   Giorno e notte: l'intero sito cambia atmosfera (omaggio al vecchio hero).
   ========================================================================== */

:root {
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --max: 1240px;
  --r: 18px;
  --ease: cubic-bezier(.22, .8, .24, 1);

  /* ------ GIORNO ------ */
  --bg: #f5f2e8;
  --bg-2: #ece7d8;
  --card: #fbf9f2;
  --ink: #16301e;
  --ink-2: #29452f;
  --soft: #6d705f;
  --line: rgba(22, 48, 30, .14);
  --acc: #b5623c;          /* terracotta */
  --gold: #a98b4f;
  --leaf: #2e5d3a;
  --leaf-glow: #4a7f52;
  --hero-scrim: linear-gradient(180deg, rgba(10,20,12,.34) 0%, rgba(10,20,12,.12) 45%, rgba(15,27,17,.78) 100%);
  --nav-bg: rgba(245, 242, 232, .82);
  --shadow: 0 2px 8px rgba(15, 30, 18, .06), 0 24px 60px -28px rgba(15, 30, 18, .35);
}

html[data-mode="night"] {
  --bg: #0c110d;
  --bg-2: #11170f;
  --card: #141b14;
  --ink: #e9f2dd;
  --ink-2: #cfe3bf;
  --soft: #96a189;
  --line: rgba(233, 242, 221, .13);
  --acc: #e0906a;
  --gold: #d3b578;
  --leaf: #9fd39a;
  --leaf-glow: #b9e6a8;
  --hero-scrim: linear-gradient(180deg, rgba(4,8,5,.44) 0%, rgba(4,8,5,.18) 45%, rgba(6,10,7,.9) 100%);
  --nav-bg: rgba(10, 14, 10, .78);
  --shadow: 0 2px 8px rgba(0,0,0,.35), 0 24px 60px -28px rgba(0,0,0,.7);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg);
  line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden;
  transition: background .8s var(--ease), color .8s var(--ease);
}
::selection { background: var(--leaf); color: var(--bg); }
img { max-width: 100%; }
a { color: inherit; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 430; letter-spacing: -.01em; line-height: 1.04; margin: 0; }
h2 { font-size: clamp(2.1rem, 4.6vw, 3.6rem); color: var(--ink); margin-bottom: 22px; }
h2 em, h1 em { font-style: italic; color: var(--leaf); }
html[data-mode="night"] h2 em { color: var(--leaf); text-shadow: 0 0 34px rgba(159, 211, 154, .35); }
.eyebrow {
  font-size: .72rem; font-weight: 700; letter-spacing: .24em; text-transform: uppercase;
  color: var(--acc); margin: 0 0 14px;
}

/* ---------- progress bar ---------- */
.progress {
  position: fixed; top: 0; left: 0; height: 2.5px; width: 0; z-index: 90;
  background: linear-gradient(90deg, var(--leaf), var(--gold)); transition: width .1s linear;
}

/* ---------- NAV ---------- */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 80; transition: background .4s, box-shadow .4s, backdrop-filter .4s; }
.nav.scrolled { background: var(--nav-bg); backdrop-filter: saturate(150%) blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; gap: 20px; }
.nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; transition: color .4s; }
.nav.scrolled .nav-brand, .nav.open .nav-brand { color: var(--ink); }
.nav-logo {
  height: 44px; width: auto; display: block; background: #fff;
  padding: 5px 12px; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.nav-since { font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.nav-links a {
  text-decoration: none; font-size: .88rem; font-weight: 600; color: #fff;
  opacity: .92; transition: opacity .2s, color .4s; white-space: nowrap;
}
.nav.scrolled .nav-links a, .nav.open .nav-links a { color: var(--ink); }
.nav-links a:hover { opacity: .65; }
.nav-cta {
  border: 1.5px solid currentColor; border-radius: 999px; padding: 8px 16px;
}
.nav-actions { display: flex; align-items: center; gap: 12px; margin-left: 8px; }

/* interruttore giorno/notte */
.daynight { border: 0; background: transparent; cursor: pointer; padding: 0; }
.dn-track {
  display: block; width: 58px; height: 30px; border-radius: 999px; position: relative;
  background: rgba(255,255,255,.25); border: 1.5px solid rgba(255,255,255,.6);
  transition: background .5s, border-color .5s;
}
.nav.scrolled .dn-track { background: var(--bg-2); border-color: var(--line); }
.dn-thumb {
  position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: #b5813c; display: grid; place-items: center;
  transition: transform .5s var(--ease), background .5s, color .5s;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.dn-thumb svg { width: 14px; height: 14px; position: absolute; transition: opacity .3s, transform .5s; }
.dn-moon { opacity: 0; transform: rotate(-90deg); }
html[data-mode="night"] .dn-thumb { transform: translateX(28px); background: #22301f; color: #d3b578; }
html[data-mode="night"] .dn-sun { opacity: 0; transform: rotate(90deg); }
html[data-mode="night"] .dn-moon { opacity: 1; transform: none; }

.burger { display: none; }

/* ---------- HERO ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-img {
  position: absolute; inset: -6% 0 0 0; width: 100%; height: 106%; object-fit: cover;
  transition: opacity 1.4s var(--ease); will-change: transform;
}
.hero-img-night { opacity: 0; }
html[data-mode="night"] .hero-img-night { opacity: 1; }
.hero-scrim { position: absolute; inset: 0; background: var(--hero-scrim); transition: background .8s; }
.hero-stars { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s; pointer-events: none; }
html[data-mode="night"] .hero-stars { opacity: 1; }
.hero-stars i {
  position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff;
  animation: twinkle 3.4s infinite;
}
@keyframes twinkle { 0%,100% { opacity: .15; } 50% { opacity: .95; } }

.hero-content { position: relative; z-index: 2; max-width: var(--max); margin: 0 auto; padding: 0 24px 13vh; width: 100%; }
.hero-eyebrow {
  color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .3em; text-transform: uppercase;
  opacity: .9; margin: 0 0 18px;
}
.hero-title { color: #fff; font-size: clamp(2.7rem, 7.4vw, 6rem); font-weight: 380; }
.ht-line { display: block; overflow: hidden; }
.ht-line span { display: inline-block; transform: translateY(110%); animation: riseUp 1s var(--ease) forwards; }
.ht-line:nth-child(2) span { animation-delay: .12s; }
.ht-line:nth-child(3) span { animation-delay: .24s; }
.ht-em span { font-style: italic; color: #d8ecc7; }
@keyframes riseUp { to { transform: none; } }
.hero-sub {
  color: rgba(255,255,255,.88); max-width: 52ch; font-size: clamp(1rem, 1.4vw, 1.14rem);
  margin: 22px 0 30px; animation: fadeIn 1.2s .5s both;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; animation: fadeIn 1.2s .65s both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.hero-hint { position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 2; }
.hero-hint span {
  display: block; width: 22px; height: 36px; border: 2px solid rgba(255,255,255,.6); border-radius: 12px; position: relative;
}
.hero-hint span::after {
  content: ""; position: absolute; top: 6px; left: 50%; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 3px; background: #fff; animation: wheel 1.8s infinite;
}
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(12px); opacity: 0; } 100% { opacity: 0; } }

.hero-daynight-hint {
  position: absolute; right: 26px; bottom: 26px; z-index: 2;
  display: flex; align-items: center; gap: 7px; border: 0; cursor: pointer;
  background: rgba(0,0,0,.3); color: #fff; backdrop-filter: blur(6px);
  font: 600 .74rem var(--sans); letter-spacing: .06em;
  padding: 9px 14px; border-radius: 999px; opacity: .85; transition: opacity .2s;
}
.hero-daynight-hint:hover { opacity: 1; }
.hero-daynight-hint svg { width: 15px; height: 15px; }
html[data-mode="night"] .hero-daynight-hint { display: none; }

/* pulsanti */
.btn {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none; cursor: pointer;
  font: 600 .92rem var(--sans); border-radius: 999px; padding: 13px 24px;
  transition: transform .18s var(--ease), background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn svg { width: 17px; height: 17px; }
.btn-solid { background: #e9f2dd; color: #16301e; }
.btn-solid:hover { background: #fff; }
.btn-ghost { border: 1.5px solid rgba(255,255,255,.65); color: #fff; }
.btn-ghost:hover { border-color: #fff; }
.btn-line { border: 1.5px solid var(--line); color: var(--ink); font-size: .84rem; padding: 10px 18px; }
.btn-line:hover { border-color: var(--leaf); }
.btn.big { padding: 16px 30px; font-size: 1rem; }

/* ---------- MARQUEE ---------- */
.marquee { border-block: 1px solid var(--line); padding: 16px 0; overflow: hidden; background: var(--bg-2); transition: background .8s; }
.marquee-track {
  display: flex; gap: 34px; align-items: center; width: max-content;
  animation: marquee 36s linear infinite; white-space: nowrap;
}
.marquee-track span { font-family: var(--serif); font-size: 1.12rem; font-style: italic; color: var(--ink-2); }
.marquee-track i { color: var(--gold); font-style: normal; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- NUMERI ---------- */
.numbers { padding: 72px 0 24px; }
.num-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.num { text-align: center; }
.num b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.4rem, 5vw, 4rem); color: var(--leaf); line-height: 1;
  font-variant-numeric: tabular-nums;
}
html[data-mode="night"] .num b { text-shadow: 0 0 30px rgba(159,211,154,.3); }
.num span { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--soft); }
/* il contatore dentro <b> resta grande (es. <b><span data-count>1500</span>+</b>) */
.num b span { font: inherit; letter-spacing: inherit; text-transform: none; color: inherit; }

/* ---------- STORIA ---------- */
.story { padding: 90px 0; }
.story-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 5vw, 72px); align-items: start; }
.story-media { position: sticky; top: 100px; }
.story-photo { margin: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); position: relative; }
.story-photo img { display: block; width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.story-photo figcaption {
  position: absolute; left: 14px; bottom: 12px; color: #fff; font-size: .74rem; letter-spacing: .06em;
  background: rgba(0,0,0,.4); backdrop-filter: blur(4px); border-radius: 999px; padding: 5px 12px;
}
.story-badge {
  position: absolute; top: -22px; right: -14px; background: var(--acc); color: #fff;
  border-radius: 16px; padding: 12px 18px; text-align: center; transform: rotate(4deg);
  box-shadow: var(--shadow);
}
.story-badge b { display: block; font-family: var(--serif); font-size: 1.7rem; line-height: 1; }
.story-badge span { font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.story-text p { color: var(--ink-2); font-size: 1.04rem; max-width: 60ch; }
.story-text blockquote {
  margin: 28px 0; padding-left: 20px; border-left: 3px solid var(--gold);
  font-family: var(--serif); font-style: italic; font-size: clamp(1.25rem, 2vw, 1.6rem);
  line-height: 1.35; color: var(--ink);
}
.story-values { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 30px; }
.val { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; transition: background .8s; }
.val i { font-style: normal; font-size: 1.3rem; line-height: 1.2; }
.val b { display: block; font-size: .92rem; }
.val span { font-size: .8rem; color: var(--soft); line-height: 1.4; display: block; }

/* ---------- SERVIZI (righe editoriali alternate) ---------- */
.services { padding: 40px 0 90px; }
.services-sub { color: var(--soft); max-width: 62ch; font-size: 1.04rem; margin-top: -6px; }
.serv-rows { display: flex; flex-direction: column; gap: clamp(40px, 6vw, 76px); margin-top: 52px; }
.srow {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(24px, 4vw, 56px); align-items: center;
}
.srow:nth-child(even) .srow-img { order: 2; }
.srow-img { margin: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.srow-img img {
  display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover;
  transition: transform .9s var(--ease);
}
.srow:hover .srow-img img { transform: scale(1.045); }
.srow-txt .serv-n {
  font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--gold);
  display: inline-block; border-bottom: 2px solid var(--gold); padding-bottom: 2px; margin-bottom: 10px;
}
.srow-txt h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin-bottom: 14px; }
.srow-txt p { color: var(--ink-2); font-size: .99rem; margin: 0 0 12px; max-width: 58ch; }
.srow-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.srow-tags span {
  font-size: .76rem; font-weight: 600; color: var(--leaf);
  border: 1px solid var(--line); background: var(--card);
  border-radius: 999px; padding: 6px 13px; transition: background .8s;
}

/* illustrazione vivaio (SVG) — segue il tema giorno/notte */
.srow-art { aspect-ratio: 4/3; }
.srow-art svg { display: block; width: 100%; height: 100%; }
.srow-art [class^="a-"] { transition: opacity 1s var(--ease), fill 1s var(--ease); }
.a-sky-night, .a-moon { opacity: 0; }
html[data-mode="night"] .a-sky-day { opacity: 0; }
html[data-mode="night"] .a-sky-night { opacity: 1; }
html[data-mode="night"] .a-sun { opacity: 0; }
html[data-mode="night"] .a-moon { opacity: 1; }
html[data-mode="night"] .a-hill1 { fill: #47603f; }
html[data-mode="night"] .a-hill2 { fill: #32492f; }
html[data-mode="night"] .a-rows { fill: #24371f; }
html[data-mode="night"] .a-front { fill: #182517; }
.srow:hover .srow-art svg { transform: scale(1.03); }
.srow-art svg { transition: transform .9s var(--ease); }

/* ---------- CATALOGO DIGITALE (sempre "notte") ---------- */
.digital {
  position: relative; padding: 100px 0; color: #e9f2dd; overflow: hidden;
  background:
    radial-gradient(900px 480px at 12% -10%, rgba(74, 127, 82, .35), transparent 60%),
    radial-gradient(700px 420px at 95% 110%, rgba(181, 98, 60, .22), transparent 60%),
    #0c130d;
}
.digital .eyebrow.light { color: var(--gold); }
.digital h2 { color: #eef6e3; }
.digital h2 em { color: #a7dc9e; text-shadow: 0 0 36px rgba(159,211,154,.4); }
.digital-head { max-width: 720px; }
.digital-sub { color: #b9c6ab; font-size: 1.02rem; }
.digital-search { position: relative; max-width: 640px; margin: 36px 0 44px; }
.digital-search > svg {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: #7d9a72; pointer-events: none;
}
#plantSearch {
  width: 100%; font: 500 1.05rem var(--sans); color: #eef6e3;
  background: rgba(255,255,255,.06); border: 1.5px solid rgba(233,242,221,.22);
  border-radius: 999px; padding: 17px 24px 17px 54px; outline: none;
  backdrop-filter: blur(6px); transition: border-color .2s, box-shadow .2s;
}
#plantSearch::placeholder { color: #7d9a72; }
#plantSearch:focus { border-color: #9fd39a; box-shadow: 0 0 0 5px rgba(159,211,154,.14); }
.ds-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 5;
  background: #121a12; border: 1px solid rgba(233,242,221,.16); border-radius: 18px;
  overflow: hidden; box-shadow: 0 24px 60px -18px rgba(0,0,0,.8);
}
.ds-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-decoration: none;
  color: #e9f2dd; transition: background .12s;
}
.ds-item:hover { background: rgba(159,211,154,.1); }
.ds-item img { width: 42px; height: 42px; border-radius: 9px; object-fit: cover; background: #1c261c; }
.ds-item b { font-family: var(--serif); font-weight: 460; font-size: 1.05rem; }
.ds-item span { font-size: .74rem; color: #8ba37e; margin-left: auto; white-space: nowrap; }
.ds-more { display: block; text-align: center; padding: 11px; font-size: .8rem; font-weight: 600; color: #a7dc9e; text-decoration: none; border-top: 1px solid rgba(233,242,221,.12); }
.ds-more:hover { background: rgba(159,211,154,.08); }
.digital-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feat {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: #dfeccf;
  background: rgba(255,255,255,.05); border: 1px solid rgba(233,242,221,.14);
  border-radius: var(--r); padding: 22px; backdrop-filter: blur(4px);
  transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.feat:hover { transform: translateY(-4px); border-color: rgba(159,211,154,.5); background: rgba(159,211,154,.07); }
.feat-ic { font-size: 1.6rem; }
.feat b { font-family: var(--serif); font-weight: 480; font-size: 1.3rem; }
.feat b small { font-size: .6em; color: var(--gold); letter-spacing: .1em; vertical-align: middle; }
.feat span { font-size: .86rem; color: #a9b89b; line-height: 1.5; }
.feat i { font-style: normal; font-size: .78rem; font-weight: 600; color: #a7dc9e; margin-top: auto; }

/* ---------- SEDI ---------- */
.sedi { padding: 96px 0 60px; }
.sedi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 36px; }
.sede { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); transition: background .8s; }
.sede-img { position: relative; height: 250px; overflow: hidden; }
.sede-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.sede:hover .sede-img img { transform: scale(1.05); }
.sede-tag {
  position: absolute; top: 14px; left: 14px; background: rgba(8,16,10,.55); color: #fff;
  backdrop-filter: blur(5px); font-size: .7rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; border-radius: 999px; padding: 6px 13px;
}
.sede-body { padding: 24px; }
.sede-body h3 { font-size: 1.55rem; margin-bottom: 10px; }
.sede-body p { color: var(--ink-2); font-size: .94rem; margin: 0 0 18px; }
.sede-hours {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .86rem; font-weight: 600; color: var(--leaf);
  background: var(--bg-2); border-radius: 999px; padding: 8px 15px; width: fit-content;
}
.sede-hours svg { width: 15px; height: 15px; flex: none; }
.sede-hours i { font-style: normal; opacity: .5; }
.sede-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- CLIENTI ---------- */
.clients { border-block: 1px solid var(--line); padding: 26px 0; background: var(--bg-2); transition: background .8s; }
.clients-row { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }
.clients-row > p { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--soft); }
.clients-logos { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.clients-logos img { height: 40px; width: auto; border-radius: 6px; filter: grayscale(1); opacity: .75; transition: filter .3s, opacity .3s; }
.clients-logos img:hover { filter: none; opacity: 1; }
.clients-logos span { font-family: var(--serif); font-style: italic; color: var(--soft); }

/* ---------- CONTATTI ---------- */
.contact {
  margin: 70px 0 0; padding: 110px 0; color: #eef6e3; position: relative; overflow: hidden;
  background:
    radial-gradient(800px 420px at 85% 0%, rgba(74,127,82,.4), transparent 60%),
    radial-gradient(600px 380px at 0% 100%, rgba(181,98,60,.28), transparent 60%),
    #101911;
}
.contact .eyebrow.light { color: var(--gold); }
.contact h2 { color: #eef6e3; max-width: 21ch; }
.contact h2 em { color: #a7dc9e; }
.contact p { color: #b9c6ab; max-width: 52ch; }
.contact-actions { display: flex; gap: 14px; flex-wrap: wrap; margin: 30px 0 26px; }
.contact .btn-solid { background: #e9f2dd; color: #16301e; }
.contact .btn-ghost { border-color: rgba(233,242,221,.5); color: #eef6e3; }
.contact-info { display: flex; gap: 12px; flex-wrap: wrap; font-size: .88rem; color: #93a487; }
.contact-info i { font-style: normal; opacity: .5; }

/* ---------- FOOTER ---------- */
.footer { background: #0a0f0b; color: #adbd9e; padding: 54px 0 26px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.f-brand b { font-family: var(--serif); font-size: 1.6rem; font-weight: 480; color: #eef6e3; }
.f-brand p { font-size: .88rem; max-width: 30ch; }
.f-links { display: flex; flex-direction: column; gap: 9px; }
.f-links a, .f-contact a { color: #adbd9e; text-decoration: none; font-size: .9rem; }
.f-links a:hover, .f-contact a:hover { color: #dfeccf; }
.f-contact { display: flex; flex-direction: column; gap: 9px; font-size: .9rem; }
.f-copy { text-align: center; font-size: .74rem; color: #6c7a61; border-top: 1px solid rgba(233,242,221,.1); margin: 40px 0 0; padding-top: 22px; }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .num-grid { grid-template-columns: repeat(2, 1fr); gap: 30px 16px; }
  .story-grid { grid-template-columns: 1fr; }
  .story-media { position: static; max-width: 460px; }
  .srow { grid-template-columns: 1fr; gap: 18px; }
  .srow:nth-child(even) .srow-img { order: 0; }
  .digital-feats { grid-template-columns: 1fr; }
  .sedi-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 860px) {
  .nav-links {
    /* niente inset:0 — il backdrop-filter della nav intrappola i fixed e lo sfondo
       coprirebbe solo la barra: servono unità viewport esplicite */
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; height: 100dvh;
    padding: 110px 34px; flex-direction: column; align-items: flex-start;
    gap: 8px; background: var(--bg); transform: translateX(100%); transition: transform .45s var(--ease);
    overflow-y: auto;
  }
  .nav.open .nav-links { transform: none; }
  .nav-links a { font-family: var(--serif); font-size: 2rem; font-weight: 430; color: var(--ink); }
  .nav-cta { border: 0; padding: 8px 0; font-size: 1.2rem !important; color: var(--leaf) !important; }
  .burger {
    display: flex; flex-direction: column; justify-content: center; gap: 6px;
    width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; z-index: 5; padding: 8px;
  }
  .burger span { display: block; height: 2px; width: 100%; background: #fff; transition: transform .3s, background .4s; }
  .nav.scrolled .burger span, .nav.open .burger span { background: var(--ink); }
  .nav.open .burger span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav.open .burger span:last-child { transform: translateY(-4px) rotate(-45deg); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ============ ASSISTENTE AI (sezione in alto) ============ */
.ai {
  position: relative; padding: 90px 0; color: #e9f2dd; overflow: hidden; margin-top: 30px;
  background:
    radial-gradient(800px 460px at 88% -10%, rgba(74,127,82,.38), transparent 60%),
    radial-gradient(620px 400px at 0% 110%, rgba(181,98,60,.24), transparent 60%),
    #0c130d;
}
.ai .eyebrow.light { color: var(--gold); }
.ai h2 { color: #eef6e3; }
.ai h2 em { color: #a7dc9e; text-shadow: 0 0 36px rgba(159,211,154,.4); }
.ai-grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: clamp(28px, 4vw, 60px); align-items: center; }
.ai-intro p { color: #b9c6ab; font-size: 1.02rem; max-width: 52ch; }
.ai-suggs { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 14px; }
.ai-suggs button {
  border: 1px solid rgba(159,211,154,.4); background: rgba(159,211,154,.06); color: #cfe8b8;
  border-radius: 999px; padding: 9px 16px; font: 600 .84rem var(--sans); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.ai-suggs button:hover { background: rgba(159,211,154,.14); border-color: #9fd39a; }
.ai-note { font-size: .74rem !important; color: #8a9a7c !important; }

.ai-card {
  display: flex; flex-direction: column; border-radius: 20px; overflow: hidden;
  background: rgba(255,255,255,.05); border: 1px solid rgba(233,242,221,.16);
  backdrop-filter: blur(8px); box-shadow: 0 30px 70px -30px rgba(0,0,0,.7);
}
.ai-head {
  display: flex; align-items: center; gap: 9px; padding: 13px 18px;
  font: 600 .92rem var(--sans); color: #eef6e3; border-bottom: 1px solid rgba(233,242,221,.12);
}
.ai-head em { font-style: normal; font-size: .68rem; color: #8a9a7c; margin-left: auto; }
.ai-dot { width: 9px; height: 9px; border-radius: 50%; background: #7fd77a; box-shadow: 0 0 10px #7fd77a; animation: aiPulse 2.4s infinite; }
@keyframes aiPulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
.ai-msgs { height: 380px; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { display: flex; }
.ai-msg.user { justify-content: flex-end; }
.ai-bubble {
  max-width: 86%; padding: 10px 14px; border-radius: 15px; font-size: .9rem; line-height: 1.5;
  background: rgba(255,255,255,.07); border: 1px solid rgba(233,242,221,.1); color: #dfeccf;
}
.ai-msg.bot .ai-bubble { border-bottom-left-radius: 5px; }
.ai-msg.user .ai-bubble { background: rgba(159,211,154,.16); border-color: rgba(159,211,154,.3); border-bottom-right-radius: 5px; color: #eef6e3; }
.ai-bubble .plant-link { color: #a7dc9e; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ai-bubble img.ai-msg-img { display: block; max-width: 180px; border-radius: 9px; margin-bottom: 6px; }
.ai-typing { display: inline-flex; gap: 4px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: #7fa872; animation: aityp 1s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .15s; } .ai-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aityp { 0%,60%,100% { opacity: .25; } 30% { opacity: 1; transform: translateY(-3px); } }
.ai-imgbar { display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-top: 1px solid rgba(233,242,221,.1); font-size: .8rem; color: #b9c6ab; }
.ai-imgbar img { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; }
.ai-imgbar button { margin-left: auto; border: 0; background: rgba(255,255,255,.12); color: #dfeccf; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; }
.ai-form { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(233,242,221,.12); }
.ai-form input[type=text] {
  flex: 1; min-width: 0; border: 1px solid rgba(233,242,221,.2); border-radius: 999px;
  padding: 12px 17px; font: 500 .92rem var(--sans); background: rgba(255,255,255,.06);
  color: #eef6e3; outline: none; transition: border-color .2s;
}
.ai-form input[type=text]::placeholder { color: #7d9a72; }
.ai-form input[type=text]:focus { border-color: #9fd39a; }
.ai-imgbtn, .ai-send {
  flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.ai-imgbtn { background: rgba(255,255,255,.09); color: #cfe8b8; }
.ai-imgbtn:hover { background: rgba(255,255,255,.18); }
.ai-send { background: #7fbc6e; color: #0d130a; }
.ai-send:hover { background: #93d180; }
.ai-send:disabled { opacity: .5; cursor: default; }
.ai-imgbtn svg, .ai-send svg { width: 19px; height: 19px; }

@media (max-width: 900px) {
  .ai-grid { grid-template-columns: 1fr; }
  .ai-msgs { height: 320px; }
}

/* input chat auto-espandibile */
.ai-form textarea {
  flex: 1; min-width: 0; border: 1px solid rgba(233,242,221,.2); border-radius: 21px;
  padding: 11px 17px; font: 500 .92rem/1.45 var(--sans); background: rgba(255,255,255,.06);
  color: #eef6e3; outline: none; resize: none; max-height: 120px; overflow-y: auto;
  transition: border-color .2s;
}
.ai-form textarea::placeholder { color: #7d9a72; }
.ai-form textarea:focus { border-color: #9fd39a; }
.ai-form { align-items: flex-end; }
#aiClear {
  border: 0; background: rgba(255,255,255,.08); color: #cfe8b8; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  margin-left: 8px; transition: background .15s;
}
#aiClear:hover { background: rgba(255,255,255,.18); }
#aiClear svg { width: 15px; height: 15px; }
.lista-ok {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  background: rgba(159,211,154,.12); border: 1px solid rgba(159,211,154,.4);
  color: #cfe8b8; font-weight: 600; font-size: .78rem; border-radius: 999px; padding: 5px 12px;
}
.lista-ok a { color: #a7dc9e; }

/* ============ bolla chat flottante (stile messenger) ============ */
.aw-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: #16301e; color: #cfe8b8; display: grid; place-items: center;
  box-shadow: 0 8px 26px -6px rgba(10, 22, 12, .55);
  transition: transform .16s var(--ease), background .2s;
}
.aw-fab:hover { transform: translateY(-3px); background: #1f4229; }
.aw-fab svg { width: 27px; height: 27px; }
.aw-fab .aw-dot {
  position: absolute; top: 5px; right: 5px; width: 11px; height: 11px; border-radius: 50%;
  background: #7fd77a; border: 2px solid #16301e;
}
.aw-fab.open { background: #1f4229; }
html[data-mode="night"] .aw-fab { background: #223a28; }

.aw-panel {
  position: fixed; right: 20px; bottom: 90px; z-index: 61;
  width: 370px; max-width: calc(100vw - 32px);
  height: 520px; max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  animation: awIn .22s var(--ease);
  background: #101911;              /* pannello sempre scuro, coerente con la sezione AI */
}
.aw-panel[hidden] { display: none; }
@keyframes awIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.aw-panel .ai-msgs { flex: 1; height: auto; }
.aw-btns { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.aw-btns button {
  border: 0; background: rgba(255,255,255,.08); color: #cfe8b8; cursor: pointer;
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  font-size: 16px; line-height: 1; transition: background .15s;
}
.aw-btns button:hover { background: rgba(255,255,255,.18); }
.aw-btns svg { width: 14px; height: 14px; }
.aw-panel .ai-head em { margin-left: 6px; }

@media (max-width: 520px) {
  .aw-panel { right: 8px; left: 8px; width: auto; bottom: 84px; height: 70vh; }
  .aw-fab { right: 14px; bottom: 14px; }
}

/* ============ foto dinamiche (rotor) ============ */
.rotor { position: relative; touch-action: pan-y; }   /* swipe orizzontale nostro, scroll verticale alla pagina */
.rotor .rt-img { transition: opacity .7s var(--ease), transform .55s var(--ease); will-change: transform, opacity; }
.rotor .rt-img:not(.on) { opacity: 0; }
.rotor .rt-abs { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* transizione direzionale: la nuova entra dal lato, la vecchia esce dall'altro */
.rotor.fwd .rt-img.on { animation: rtInR .9s var(--ease); }
.rotor.bwd .rt-img.on { animation: rtInL .9s var(--ease); }
.rotor.fwd .rt-img.off { animation: rtOutL .9s var(--ease); }
.rotor.bwd .rt-img.off { animation: rtOutR .9s var(--ease); }
.rotor .rt-img.off { opacity: 0; z-index: 1; }
.rotor .rt-img.on { z-index: 2; }
@keyframes rtInR  { from { opacity: 0; transform: translateX(10%) scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes rtInL  { from { opacity: 0; transform: translateX(-10%) scale(1.08); } to { opacity: 1; transform: none; } }
@keyframes rtOutL { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-7%) scale(.97); } }
@keyframes rtOutR { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(7%) scale(.97); } }
.story-photo figcaption { z-index: 3; }

.rt-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; color: #fff;
  background: rgba(10, 18, 12, .42); backdrop-filter: blur(3px);
  opacity: .6; transition: opacity .25s, background .2s, transform .2s;
}
.rt-prev { left: 10px; }
.rt-next { right: 10px; }
.rt-arrow svg { width: 18px; height: 18px; }
.rotor:hover .rt-arrow, .rt-arrow:focus-visible { opacity: 1; }
.rt-arrow:hover { background: rgba(10, 18, 12, .68); transform: translateY(-50%) scale(1.08); }
@media (hover: none) { .rt-arrow { display: none; } }   /* su touch si swipa */

.rt-dots {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 10px; z-index: 4;
  display: flex; gap: 5px; padding: 5px 8px; border-radius: 999px;
  background: rgba(10, 18, 12, .28); backdrop-filter: blur(3px);
}
.rt-dots i {
  width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.55);
  transition: background .25s, transform .25s;
}
.rt-dots i.on { background: #fff; transform: scale(1.25); }
.story-photo .rt-dots { bottom: 46px; }   /* sopra la didascalia */

/* hint di swipe: pillola discreta, riappare a ogni foto in vista */
.rt-hint {
  position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); z-index: 5;
  display: inline-flex; align-items: center; gap: 8px; pointer-events: none;
  background: rgba(8, 14, 9, .55); backdrop-filter: blur(4px);
  color: #fff; border-radius: 999px; padding: 7px 15px 7px 10px;
  animation: rtHintIn .45s var(--ease); transition: opacity .45s;
  box-shadow: 0 4px 18px -6px rgba(0,0,0,.5);
}
.rt-hint.out { opacity: 0; }
.rt-hint b { font: 600 .8rem var(--sans); letter-spacing: .05em; }
.rt-hand { display: block; width: 26px; height: 26px; animation: rtSwipe 1.4s ease-in-out infinite; }
.story-photo .rt-hint { bottom: 74px; }   /* sopra didascalia e dots */
.rt-hand svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 6px rgba(0,0,0,.45)); }
@keyframes rtSwipe {
  0%, 100% { transform: translateX(16px) rotate(6deg); }
  50% { transform: translateX(-16px) rotate(-6deg); }
}
@keyframes rtHintIn { from { opacity: 0; } }

/* ============ NOLEGGIO EVENTI (capitolo dedicato) ============ */
.rental { padding: 96px 0; background: var(--bg-2); transition: background .8s var(--ease); }
.rental-grid {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(28px, 4.5vw, 64px);
  align-items: center; margin-bottom: clamp(36px, 5vw, 64px);
}
.rental-text p { color: var(--ink-2); font-size: 1.04rem; max-width: 58ch; }
.rental-text b { color: var(--ink); }
.rental-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.rental-photo {
  margin: 0; border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); position: relative;
}
.rental-photo img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; }

.rental-steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  counter-reset: rstep;
}
.rstep {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px 22px 20px;
  transition: transform .3s var(--ease), box-shadow .3s, background .8s var(--ease);
}
.rstep:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.rstep-n {
  position: absolute; top: 18px; right: 20px;
  font: 600 .78rem var(--sans); letter-spacing: .14em; color: var(--gold);
}
.rstep-ico {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px;
  background: color-mix(in srgb, var(--leaf) 12%, transparent);
  color: var(--leaf); margin-bottom: 14px;
}
.rstep-ico svg { width: 26px; height: 26px; }
.rstep h3 { font-size: 1.18rem; margin-bottom: 8px; color: var(--ink); }
.rstep p { margin: 0; font-size: .9rem; color: var(--soft); line-height: 1.55; }

@media (max-width: 980px) { .rental-steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) { .rental-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .rental-steps { grid-template-columns: 1fr; } }

/* modulo "parla con un tecnico" nella chat */
.tec-card {
  display: flex; flex-direction: column; gap: 8px; margin-top: 8px;
  padding: 13px 14px; border-radius: 13px; max-width: 300px;
  background: rgba(127, 188, 110, .1); border: 1px solid rgba(127, 188, 110, .4);
}
.tec-card b { font-size: .88rem; }
.tec-card input {
  border: 1px solid rgba(127,167,116,.45); border-radius: 9px; padding: 8px 11px;
  font: 500 .85rem inherit; background: rgba(255,255,255,.07); color: inherit; outline: none;
}
.tec-card input:focus { border-color: #7fbc6e; }
.tec-card .tec-send {
  border: 0; border-radius: 999px; padding: 9px 14px; cursor: pointer;
  background: #7fbc6e; color: #0d130a; font-weight: 700; font-size: .85rem;
}
.tec-card .tec-send:hover { background: #93d180; }
.tec-card .tec-send:disabled { opacity: .6; cursor: default; }
.tec-card i { font-style: normal; font-size: .7rem; opacity: .65; }

/* etichetta BETA "adesivo storto" stile startup */
.beta-tag {
  display: inline-block; transform: rotate(-6deg) translateY(-.45em);
  background: linear-gradient(118deg, #d3b578, #e0906a);
  color: #16301e; font: 800 .3em var(--sans); letter-spacing: .2em; text-transform: uppercase;
  padding: .42em .85em .38em; border-radius: .55em; vertical-align: middle; margin-left: .25em;
  box-shadow: 0 5px 16px -5px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.35);
}
.beta-tag.sm {
  font-size: .56rem; transform: rotate(-5deg); margin-left: 7px; translate: 0 -1px;
  padding: 3px 8px 2px;
}

/* ==========================================================================
   TEASER "Verde & CO₂" in home (la pagina dedicata è co2.html)
   ========================================================================== */
.co2-teaser {
  position: relative; overflow: hidden; margin: 40px 0 0;
  display: flex; align-items: center; min-height: 480px;
}
.co2-teaser-media, .co2-teaser-media img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.co2-teaser-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(8,16,10,.78) 0%, rgba(8,16,10,.55) 55%, rgba(8,16,10,.25) 100%);
}
.co2-teaser-inner { position: relative; z-index: 1; padding-top: 80px; padding-bottom: 80px; }
.co2-teaser .eyebrow.light { color: var(--gold); }
.co2-teaser h2 { color: #fff; max-width: 18ch; text-shadow: 0 2px 24px rgba(0,0,0,.35); }
.co2-teaser h2 em { color: #b9e6a8; }
.co2-teaser-sub {
  color: #dde8d0; max-width: 52ch; margin: 14px 0 28px;
  text-shadow: 0 1px 12px rgba(0,0,0,.4);
}
@media (max-width: 580px) {
  .co2-teaser { min-height: 420px; }
  .co2-teaser-scrim { background: linear-gradient(180deg, rgba(8,16,10,.72), rgba(8,16,10,.45)); }
}
