/* ------------------------------------------------------------------ *
 * Pagina a scorrimento
 * ------------------------------------------------------------------ */

/* ---- Barra superiore ---- */
.nav {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 0 var(--gut);
  background: rgba(247,247,247,.9); backdrop-filter: blur(10px);
}
.wordmark { font: 500 16px/1 var(--ff); letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.nav nav { display: flex; gap: clamp(16px, 2.6vw, 36px); }
.nav nav a { font: 400 13px/1 var(--ff); text-decoration: none; color: var(--muted); padding: 8px 0; border-bottom: 1px solid transparent; }
.nav nav a:hover { color: var(--ink); }
.nav nav a[aria-current="true"] { color: var(--ink); border-bottom-color: var(--accent); }


/* ---- Indice laterale ---- */
.rail {
  position: fixed; left: 0; top: var(--nav-h); bottom: 0; width: var(--rail-w); z-index: 40;
  display: flex; flex-direction: column; align-items: center; padding: 32px 0 28px;
}
.rail-text { writing-mode: vertical-rl; transform: rotate(180deg); font: 400 11px/1 var(--ff); letter-spacing: .08em; color: var(--faint); }
.rail-line { position: relative; flex: 1; width: 1px; margin: 24px 0; background: var(--line-2); }
.rail-line i { position: absolute; left: -1px; top: 0; width: 3px; height: 0; border-radius: 3px; background: var(--accent); transition: height .15s linear; }
.rail-index { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font: 400 11px/1 var(--ff); }
.rail-index li { color: var(--faint); transition: color .2s; }
.rail-index li.on { color: var(--ink); }

main, .foot { margin-left: var(--rail-w); }
main > section > * { max-width: var(--maxw); }

/* ---- Intro ---- */
.hero { padding: clamp(72px, 12vw, 160px) var(--gut) clamp(80px, 10vw, 140px); display: flex; flex-direction: column; gap: clamp(28px, 4vw, 48px); }
.hero h1 { font: 500 clamp(54px, 8.4vw, 128px)/.98 var(--ff); letter-spacing: -.045em; }
.hero-lead { font-size: clamp(17px, 1.6vw, 21px); line-height: 1.65; color: var(--muted); max-width: 32ch; }

.quote {
  margin: clamp(40px, 7vw, 96px) 0 0; position: relative; padding-left: clamp(28px, 4vw, 48px);
  font: 400 clamp(22px, 2.5vw, 34px)/1.4 var(--ff); letter-spacing: -.01em; color: var(--faint); max-width: 30ch;
}
.quote::before { content: "“"; position: absolute; left: 0; top: -.05em; font: 600 1.6em/1 var(--ff); color: var(--ink); }
.quote b { color: var(--ink); font-weight: 500; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 28px); align-items: start; max-width: 1000px; }
.stat { border-radius: var(--r-xl); padding: 30px 32px; display: flex; flex-direction: column; gap: 6px; min-height: 200px; }
.stat .v { font: 600 clamp(38px, 3.6vw, 52px)/1 var(--ff); letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: .38em; margin-left: 4px; letter-spacing: 0; }
.stat .k { font-size: 14px; line-height: 1.5; }
.stat.solid { background: var(--accent); color: #fff; }
.stat.glow { background: radial-gradient(120% 90% at 50% 75%, var(--glow-1) 0%, var(--glow-2) 45%, var(--pale) 100%); min-height: 420px; }
.stat.white { background: var(--white); margin-top: clamp(120px, 14vw, 200px); }
.stat .viz { margin-top: auto; }
.stat.glow .viz { display: grid; place-items: center; padding-top: 18px; }

/* barra a righe (rif. "31%") */
.stripe { position: relative; height: 26px; border-radius: 999px; margin-top: 26px;
  background: repeating-linear-gradient(-55deg, #ececec 0 6px, #fafafa 6px 12px); overflow: visible; }
.stripe i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--accent); }
.stripe i::after { content: ""; position: absolute; right: -13px; top: 0; width: 26px; height: 26px; border-radius: 50%;
  background: radial-gradient(circle, #fff 0 40%, rgba(255,255,255,.6) 70%, rgba(255,255,255,0) 100%); }

.cta { align-self: flex-start; font: 500 14px/1 var(--ff); text-decoration: none; padding: 16px 26px; border-radius: 999px; background: var(--ink); color: #fff; }
.cta:hover { background: var(--accent); }

/* ---- Sezioni ---- */
.sec { padding: clamp(80px, 11vw, 160px) var(--gut); }
.sec-head { display: flex; align-items: baseline; gap: clamp(14px, 1.6vw, 22px); margin-bottom: 22px; }
.sec-num { font: 500 clamp(44px, 5.4vw, 76px)/1 var(--ff); color: var(--faint); letter-spacing: -.04em; }
.sec-head h2 { font: 500 clamp(34px, 4.4vw, 60px)/1 var(--ff); letter-spacing: -.035em; }
.sec-lead { font-size: 17px; line-height: 1.75; color: var(--muted); max-width: 46ch; margin-bottom: clamp(40px, 5vw, 72px); }
.sub-h { font: 500 clamp(24px, 2.4vw, 32px)/1.2 var(--ff); letter-spacing: -.02em; margin-top: clamp(96px, 12vw, 160px); }
.sub-lead { color: var(--muted); max-width: 46ch; margin: 12px 0 clamp(36px, 4vw, 56px); }
.note { font-size: 13px; color: var(--muted); line-height: 1.6; }

/* ---- Controlli ---- */
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 22px 36px; margin-bottom: 28px; }
.ctl { display: flex; flex-direction: column; gap: 10px; }
.ctl.grow { flex: 1 1 240px; max-width: 320px; }
.ctl-l { font-size: 12px; color: var(--muted); }
.ctl-row { display: flex; gap: 8px; flex-wrap: wrap; }

.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--white); border-radius: 999px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 9px 20px; font-size: 13px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.chip { display: inline-flex; align-items: center; gap: 9px; border: 0; background: var(--white); border-radius: 999px; padding: 9px 16px; font-size: 13px; color: var(--muted); }
.chip .box { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.chip[aria-pressed="true"] { color: var(--ink); }
.chip[aria-pressed="true"] .box { background: var(--accent); }
.chip .n { font-size: 12px; color: var(--faint); }

.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; background: var(--white); border-radius: 999px; padding: 9px 36px 9px 16px; font-size: 13px; position: relative; user-select: none; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary::after { content: ""; position: absolute; right: 16px; top: 50%; width: 6px; height: 6px; border: solid var(--muted); border-width: 0 1.5px 1.5px 0; transform: translateY(-70%) rotate(45deg); }
.dd-panel { position: absolute; left: 0; top: calc(100% + 8px); z-index: 30; min-width: 260px; background: var(--white); border-radius: var(--r-l); padding: 10px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 18px 40px rgba(0,0,0,.08); }
.dd-panel .chip { justify-content: flex-start; }
.dd-panel .chip:hover { background: var(--bg); }
.dd-panel .linkbtn { align-self: flex-start; margin: 6px 16px; }

.linkbtn { border: 0; background: none; padding: 0; font-size: 13px; color: var(--ink); text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 5px; }

/* Combobox */
.combo { position: relative; }
.combo input {
  width: 100%; border: 0; border-radius: 999px; padding: 11px 40px; font-size: 14px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%236e6e6e' stroke-width='1.5'%3E%3Ccircle cx='7' cy='7' r='4.5'/%3E%3Cpath d='M10.5 10.5 14 14' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 16px 50% / 14px;
}
.combo input:focus { outline: none; box-shadow: 0 0 0 2px var(--accent); }
.combo-clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 8px; list-style: none; max-height: 300px; overflow-y: auto; background: var(--white); border-radius: var(--r-l); box-shadow: 0 18px 40px rgba(0,0,0,.08); }
.combo-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; cursor: pointer; }
.combo-list li small { color: var(--faint); font-size: 12px; }
.combo-list li[aria-selected="true"] { background: var(--bg); }
.combo-list li.empty { color: var(--muted); cursor: default; }
.combo-list mark { background: none; color: var(--accent); }

/* ---- Geografia: numeri collegati al grafico radiale ---- */
.geo { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: stretch; }
.geo-list { display: flex; flex-direction: column; justify-content: space-between; gap: 56px; padding: 12px 0; }
.gstat { position: relative; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.gstat .v { font: 600 clamp(48px, 5vw, 72px)/1 var(--ff); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.gstat .v small { font-size: .42em; margin-left: 4px; letter-spacing: 0; }
.gstat p { font-size: 15px; color: var(--muted); line-height: 1.65; max-width: 32ch; }
.pill { display: inline-block; background: var(--white); border-radius: 10px; padding: 6px 14px; font-size: 13px; color: var(--ink); }
.gstat .wire { position: absolute; left: calc(100% - 10px); top: 34px; height: 1px; width: var(--w, 120px); background: var(--accent-2); }
.gstat .wire::after { content: ""; position: absolute; right: -5px; top: -4.5px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); }

.radial { position: relative; width: 100%; padding-bottom: 32px; align-self: center; }
/* lo SVG è nel flusso e dà l'altezza al riquadro (quadrato): niente aspect-ratio sul contenitore, che Safari iOS fa collassare */
.radial svg { position: relative; display: block; width: 100%; height: auto; max-height: 720px; overflow: visible; }
.radial-cap { position: absolute; left: 0; bottom: 0; font-size: 12.5px; color: var(--muted); }
.fog { position: absolute; left: 50%; top: 0; right: 0; bottom: 32px; overflow: hidden; }
.fog::before { content: ""; position: absolute; left: -45%; top: 8%; width: 90%; height: 84%; border-radius: 50%;
  background: radial-gradient(circle, var(--fog-1) 0%, var(--fog-2) 40%, var(--fog-3) 72%); filter: blur(34px); }
.fog::after { content: ""; position: absolute; inset: 0; background: rgba(247,247,247,.28); backdrop-filter: blur(14px); }
.fog-pills { position: absolute; right: 0; top: 0; bottom: 32px; z-index: 2; display: flex; flex-direction: column; justify-content: space-around; gap: 16px; width: min(46%, 230px); }
.fog-pill { border-radius: var(--r-l); padding: 20px 22px; background: rgba(255,255,255,.55); backdrop-filter: blur(12px); font-size: 14px; line-height: 1.4; }
.fog-pill b { display: block; font: 600 28px/1.1 var(--ff); letter-spacing: -.02em; margin-bottom: 4px; }

/* ---- Matrice a punti ---- */
.matrix-wrap { overflow-x: auto; padding-bottom: 8px; }
.matrix { display: grid; grid-template-columns: 190px repeat(5, minmax(96px, 1fr)); min-width: 720px; }
.mx-h { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 14px; padding-bottom: 18px; }
.mx-h .nm { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 13px; line-height: 1.3; max-height: 170px; color: var(--ink); }
.mx-h .nm i { font-style: normal; color: var(--faint); margin-bottom: 6px; display: inline-block; }
.mx-h .val { font-size: 12.5px; font-weight: 600; border-bottom: 1px solid var(--ink); padding-bottom: 2px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mx-l { font-size: 12.5px; line-height: 1.35; padding: 14px 16px 14px 0; border-top: 1px solid var(--line-2); }
.mx-l span { display: block; color: var(--muted); }
.mx-l b { font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.mx-c { position: relative; border-top: 1px solid var(--line-2); min-height: 50px; }
.mx-c::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line-2); }
.mx-c i { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--ink); transform: translate(-50%, -50%); }
.mx-c i.acc { background: var(--accent); width: 11px; height: 11px; }
.mx-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px 40px; margin-top: 40px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.mx-notes b { color: var(--ink); font-weight: 500; margin-right: 6px; }

/* ---- Schede (numeri) ---- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(18px, 2.4vw, 32px); }
.card { background: var(--white); border-radius: var(--r-xl); padding: clamp(28px, 3vw, 44px); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.card.glow { background: radial-gradient(110% 80% at 50% 100%, var(--glow-1) 0%, var(--glow-2) 50%, var(--glow-3) 100%); }
.card h3 { font: 500 20px/1.3 var(--ff); letter-spacing: -.01em; }
.card .desc { font-size: 14px; color: var(--muted); line-height: 1.65; max-width: 40ch; margin-top: -10px; }

.pairs { display: flex; flex-direction: column; gap: 26px; }
.pair-l { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.pair-row { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: center; margin-bottom: 8px; }
.pair-row .bar { height: 10px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.pair-row .bar i { display: block; height: 100%; border-radius: 999px; }
.pair-row b { font: 600 19px/1 var(--ff); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.key { display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: 8px; }
.key i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

.rings { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; justify-items: center; text-align: center; margin-top: auto; }
.rings svg { width: 100%; max-width: 150px; height: auto; }
.rings p { font-size: 13px; color: var(--muted); margin-top: 10px; }
.rings b { display: block; font: 600 30px/1.1 var(--ff); color: var(--ink); letter-spacing: -.02em; }

.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.rank li { display: grid; grid-template-columns: 22px minmax(90px, 160px) 1fr auto; gap: 14px; align-items: center; font-size: 14px; cursor: pointer; }
.rank li:hover .nm { color: var(--accent); }
.rank .rk { color: var(--faint); font-size: 12px; }
.rank .bar { height: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }
.rank .bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.rank .val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

.dotrows { display: flex; flex-direction: column; gap: 16px; }
.dotrow { display: grid; grid-template-columns: 120px 1fr 36px; gap: 16px; align-items: center; font-size: 13px; color: var(--muted); }
.dotrow .dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dotrow .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); }
.dotrow .n { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---- Comuni ---- */
.comuni-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.scheda { position: sticky; top: calc(var(--nav-h) + 24px); display: flex; flex-direction: column; gap: 22px; }
.scheda-card { background: var(--white); border-radius: var(--r-xl); padding: 32px; display: flex; flex-direction: column; gap: 22px; }
.scheda h3 { font: 500 30px/1.1 var(--ff); letter-spacing: -.03em; }
.scheda .meta { font-size: 13px; color: var(--muted); margin-top: 8px; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 18px; }
.kv .v { font: 600 26px/1.1 var(--ff); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv .v small { font-size: 12px; margin-left: 3px; color: var(--muted); letter-spacing: 0; }
.kv .k { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.kv .hero-v { grid-column: 1 / -1; }
.kv .hero-v .v { font-size: 44px; color: var(--accent); }
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--bg); }
.split i { display: block; height: 100%; }
.items { list-style: none; margin: 0; padding: 0 8px 0 0; max-height: 300px; overflow-y: auto; }
.items li + li { border-top: 1px solid var(--line); }
.items button { width: 100%; border: 0; background: none; text-align: left; display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 12px 0; }
.items button:hover .nm { color: var(--accent); }
.items .nm { font-size: 14px; line-height: 1.35; }
.items .sub { font-size: 12px; color: var(--muted); }
.items .val { text-align: right; font-size: 14px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.items .val small { display: block; color: var(--muted); font-size: 11.5px; }
.empty { padding: 32px; border-radius: var(--r-xl); background: var(--white); color: var(--muted); font-size: 14px; text-align: center; line-height: 1.7; }
.acts { display: flex; gap: 22px; flex-wrap: wrap; }

.tabella { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.t-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.t-tools input[type=search] { flex: 1 1 200px; border: 0; border-radius: 999px; padding: 11px 18px; font-size: 14px; background: var(--white); }
.t-wrap { overflow: auto; max-height: 680px; background: var(--white); border-radius: var(--r-l); padding: 6px 18px; }
table.a3 { width: 100%; border-collapse: collapse; font-size: 13px; }
table.a3 th, table.a3 td { padding: 11px 10px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.a3 th:first-child, table.a3 td:first-child { text-align: left; padding-left: 0; }
table.a3 thead th { position: sticky; background: var(--white); z-index: 1; font: 400 12px/1.2 var(--ff); color: var(--muted); }
table.a3 thead tr:first-child th { top: 0; height: 32px; }
table.a3 thead tr:last-child th { top: 32px; border-bottom: 1px solid var(--ink); }
table.a3 thead th button { border: 0; background: none; padding: 0; font: inherit; color: inherit; }
table.a3 thead th[aria-sort] button { color: var(--ink); }
table.a3 thead th[aria-sort="descending"] button::after { content: " ↓"; }
table.a3 thead th[aria-sort="ascending"] button::after { content: " ↑"; }
table.a3 .grp { text-align: center; color: var(--ink); }
table.a3 td { border-bottom: 1px solid var(--line); color: var(--ink-2); font-weight: 400; }
table.a3 td.ers { color: var(--accent); font-weight: 600; }
table.a3 td:first-child { color: var(--ink); font-weight: 400; white-space: normal; min-width: 150px; }
table.a3 td.tot { color: var(--ink); font-weight: 600; }
table.a3 td .nd { color: var(--line-2); }
table.a3 tbody tr { cursor: pointer; }
table.a3 tbody tr:hover td { background: var(--bg); }
table.a3 tbody tr.sel td { background: var(--pale); }
table.a3 td small { color: var(--faint); font-size: 11px; margin-left: 6px; }

/* ---- Confronto ---- */
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 48px; max-width: 860px; }
.who { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.who i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 40px 72px; max-width: 1080px; }
.cmp-row .cmp-h { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.cmp-bars { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.cmp-bar { height: 10px; position: relative; background: var(--white); border-radius: 999px; overflow: hidden; }
.cmp-bar i { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.cmp-bar.a i { right: 0; background: var(--cmp-a); }
.cmp-bar.b i { left: 0; background: var(--cmp-b); }
.cmp-vals { display: grid; grid-template-columns: 1fr 1fr; margin-top: 10px; font: 600 20px/1.2 var(--ff); font-variant-numeric: tabular-nums; color: var(--muted); }
.cmp-vals span:last-child { text-align: right; }
.cmp-vals .win { color: var(--ink); }

/* ---- Metodo ---- */
.method { margin: 0; max-width: 900px; }
.method > div { display: grid; grid-template-columns: 180px 1fr; gap: 24px; padding: 26px 0; border-top: 1px solid var(--line-2); }
.method dt { font-size: 13px; color: var(--muted); }
.method dd { margin: 0; font-size: 16px; line-height: 1.75; color: var(--ink-2); max-width: 58ch; }
.method b { color: var(--ink); font-weight: 500; }

/* ---- Footer ---- */
.foot { padding: 56px var(--gut) 64px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.foot .wordmark { color: var(--ink); }

/* ------------------------------------------------------------------ *
 * Movimento
 * ------------------------------------------------------------------ */
:root { --ease: cubic-bezier(.2, .7, .2, 1); }
.stat .v small, .gstat .v small { font-weight: 400; }
.num { font-variant-numeric: tabular-nums; }

/* intro all'apertura */
.hero h1, .hero-lead { animation: rise 1s var(--ease) both; }
.hero-lead { animation-delay: .15s; }
@keyframes rise { from { opacity: 0; transform: translateY(28px); } }

/* comparsa allo scorrimento (classe .rv messa da JS) */
.rv { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.rv.in { opacity: 1; transform: none; }

/* barre che crescono */
.bar i, .stripe i, .pair-row .bar i { transition: width 1.2s var(--ease) .25s; }
.rv:not(.in) .bar i, .rv:not(.in) .stripe i { width: 0 !important; }
.split i, .cmp-bar i { animation: grow 1s var(--ease) both; }
@keyframes grow { from { width: 0; } }

/* anelli che si disegnano */
.ring-arc { transition: stroke-dasharray 1.5s var(--ease) .2s; }
.rv:not(.in) .ring-arc { stroke-dasharray: 0 999 !important; }

/* raggi che escono dal centro */
.radial .tick { transform-box: view-box; transform-origin: 50% 50%; transition: transform .9s var(--ease) calc(var(--i) * 5ms), opacity .25s; }
.radial.rv:not(.in) .tick { transform: scale(.34); opacity: 0; }
.radial .cone { pointer-events: none; }
.radial .ring0 { stroke-dasharray: 1; transition: stroke-dashoffset 1.4s var(--ease); }
.radial.rv:not(.in) .ring0 { stroke-dashoffset: 1; }
.radial svg { cursor: pointer; touch-action: manipulation; }
.radial svg, .radial svg:focus, .radial svg:focus-visible { outline: none; }  /* il fuoco si vede dal cono acceso */
.radial svg.hot .tick { opacity: .28; }
.radial svg .tick.on { opacity: 0; }
.fog::before { animation: breathe 9s ease-in-out infinite alternate; }
@keyframes breathe { to { transform: scale(1.08) translateX(4%); opacity: .85; } }
.fog, .radial-cap { pointer-events: none; }
.gstat .wire { transform-origin: left; transition: transform 1s var(--ease) .35s; }
.rv:not(.in) .wire { transform: scaleX(0); }

/* punti che compaiono a cascata */
.dots i, .mx-c i { transition: transform .45s var(--ease) calc(var(--i) * 6ms + .2s); }
.rv:not(.in) .dots i { transform: scale(0); }
.rv:not(.in) .mx-c i { transform: translate(-50%, -50%) scale(0); }
.dots i[data-id] { cursor: pointer; }
.dots i[data-id]:hover { transform: scale(1.6); }
.mx-c i:hover { transform: translate(-50%, -50%) scale(1.5); }
.mx-h[data-id] { cursor: pointer; }
.mx-h[data-id]:hover .val { color: var(--accent); border-color: var(--accent); }

/* schede: leggero sollevamento */
.card, .stat, .scheda-card, .fog-pill { transition: opacity .9s var(--ease), transform .9s var(--ease), box-shadow .5s var(--ease); }
.card.in:hover, .stat.in:hover { transform: translateY(-4px); box-shadow: 0 26px 50px -22px rgba(20, 20, 20, .18); }
.rank li .bar i { transition: width 1.2s var(--ease) calc(.25s + var(--i, 0) * 60ms); }
.rank li .nm { transition: color .2s; }
.chip, .seg button, .cta, .linkbtn { transition: background-color .25s, color .25s, text-decoration-color .25s; }
.scheda-card { animation: rise .6s var(--ease) both; }
.scheda-card + .scheda-card { animation-delay: .08s; }

/* finita la comparsa, niente più ritardi a cascata (hover immediati) */
.done .tick, .done .dots i, .done .mx-c i, .done .bar i, .done .ring-arc { transition-delay: 0s !important; }

/* etichetta al passaggio */
.ftip {
  position: fixed; z-index: 90; pointer-events: none; left: 0; top: 0;
  transform: translate(-50%, calc(-100% - 10px)) scale(.94); opacity: 0;
  transition: opacity .15s, transform .2s var(--ease);
  background: var(--ink); color: #fff; border-radius: 999px; padding: 7px 14px;
  font-size: 12.5px; line-height: 1.2; white-space: nowrap; display: flex; gap: 8px;
}
.ftip.on { opacity: 1; transform: translate(-50%, calc(-100% - 10px)); }
.ftip b { font-weight: 600; }
.ftip span { color: #cfcfcf; font-variant-numeric: tabular-nums; }

/* scheda a comparsa */
.fpop {
  position: absolute; z-index: 95; width: min(300px, calc(100vw - 24px));
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-radius: var(--r-l); padding: 22px 22px 18px; box-shadow: 0 30px 60px -20px rgba(20, 20, 20, .28);
  display: flex; flex-direction: column; gap: 12px;
  opacity: 0; transform: translateY(8px) scale(.97); transform-origin: top center;
  transition: opacity .25s var(--ease), transform .35s var(--ease);
}
.fpop.on { opacity: 1; transform: none; }
.fpop:focus { outline: none; }
.fpop h4 { margin: 0; font: 500 21px/1.15 var(--ff); letter-spacing: -.02em; padding-right: 24px; }
.fpop-k { font-size: 12px; color: var(--muted); }
.fpop-t { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.fpop-row { display: flex; gap: 22px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.fpop-row b { display: block; font: 600 22px/1.2 var(--ff); color: var(--ink); font-variant-numeric: tabular-nums; }
.fpop-row b.acc { color: var(--accent); }
.fpop .acts { gap: 18px; margin-top: 4px; }
.fpop-x { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; font-size: 19px; color: var(--muted); }
.fpop-x:hover { background: var(--bg); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .rv { opacity: 1; transform: none; }
  .fog::before { animation: none; }
}

/* ------------------------------------------------------------------ *
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  :root { --rail-w: 0px; }
  .rail { display: none; }
}
@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
  .stat.white { margin-top: 0; grid-column: 1 / -1; }
  .stat.glow { min-height: 340px; }
  .geo { grid-template-columns: 1fr; gap: 48px; }
  .gstat .wire { display: none; }
  .cards { grid-template-columns: 1fr; }
  .comuni-layout { grid-template-columns: 1fr; }
  .scheda { position: static; }
  .cmp { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  :root { --nav-h: 60px; }
  .nav nav { overflow-x: auto; scrollbar-width: none; gap: 18px; }
  .nav nav::-webkit-scrollbar { display: none; }
  .stats { grid-template-columns: 1fr; }
  .stat.glow { min-height: 300px; }
  .vs { grid-template-columns: 1fr; }
  .method > div { grid-template-columns: 1fr; gap: 6px; }
  .ctl.grow { max-width: none; flex-basis: 100%; }
  .rank li { grid-template-columns: 18px minmax(80px, 120px) 1fr auto; gap: 10px; }
  .dotrow { grid-template-columns: 96px 1fr 28px; }
  .fog-pills { width: 52%; }
  .matrix { grid-template-columns: 104px repeat(5, minmax(46px, 1fr)); min-width: 0; }
  .mx-h .val { writing-mode: vertical-rl; transform: rotate(180deg); border-bottom: 0; border-left: 1px solid var(--ink); padding: 0 0 0 2px; }
  .mx-l { padding-right: 8px; font-size: 12px; }
  .fog-pill { padding: 14px 16px; }
  .fog-pill b { font-size: 22px; }
}
@media (max-width: 520px) {
  :root { --nav-h: 96px; }
  .nav { flex-direction: column; align-items: stretch; justify-content: center; gap: 6px; }
}
