/* =====================================================================
   Alessandro Chiri — digital résumé v4
   Design system ispirato alle Human Interface Guidelines:
   font di sistema (SF Pro sui dispositivi Apple, Inter altrove),
   un solo colore d'accento, chiaro/scuro automatico, vetro solo sul
   livello di navigazione, movimento legato allo scroll e disattivabile.
   ===================================================================== */

/* Inter (SIL OFL 1.1) — scaricato solo dove il font di sistema Apple non c'è */
@font-face {
  font-family: "InterVariable";
  src: url("../fonts/inter-latin-opsz.woff2") format("woff2-variations"),
       url("../fonts/inter-latin-opsz.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Token ---------- */
:root {
  color-scheme: light dark;
  --font: -apple-system, BlinkMacSystemFont, "InterVariable", "Inter", "Segoe UI Variable Text",
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* colori — chiaro */
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --tile: #f5f5f7;
  --tile-on-alt: #ffffff;
  --label: #1d1d1f;
  --label-2: #6e6e73;
  --label-3: #86868b;
  --sep: rgba(0, 0, 0, 0.12);
  --accent: #1e6ef4;            /* HIG Blue, variante accessibile */
  --accent-hover: #1760dd;
  --accent-text: #0a5bd1;
  --link: #0066cc;
  --focus: #1e6ef4;
  --ok: #248a3d;
  --grad-a: #1e6ef4;
  --grad-b: #6155f5;            /* HIG Indigo */
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(0, 0, 0, 0.1);
  --paddle: rgba(210, 210, 215, 0.64);
  --paddle-hover: rgba(223, 223, 227, 0.72);
  --fill: rgba(118, 118, 128, 0.12);

  /* forma e ritmo */
  --radius-tile: 28px;
  --radius-card: 20px;
  --gutter: max(22px, env(safe-area-inset-left), env(safe-area-inset-right));
  --maxw: 1200px;
  --textw: 980px;
  --nav-h: 48px;
  --section-pad: clamp(5rem, 3rem + 7vw, 10rem);
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* scala tipografica (rem: rispetta la dimensione testo scelta dall'utente) */
  --t-hero: clamp(3rem, 1.9rem + 5.4vw, 6rem);
  --t-h2: clamp(2.125rem, 1.45rem + 2.9vw, 3.5rem);
  --t-contact: clamp(2.5rem, 1.5rem + 4.3vw, 4.75rem);
  --t-statement: clamp(1.75rem, 1.05rem + 2.75vw, 3.5rem);
  --t-stat: clamp(3.5rem, 2.4rem + 4.2vw, 5.75rem);
  --t-year: clamp(4.5rem, 2.2rem + 7vw, 9rem);
  --t-h3: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
  --t-eyebrow: clamp(1.0625rem, 0.97rem + 0.42vw, 1.3125rem);
  --t-lead: clamp(1.1875rem, 0.98rem + 0.95vw, 1.75rem);
  --t-intro: clamp(1.0625rem, 0.98rem + 0.4vw, 1.3125rem);

  /* tracking: Inter (default) */
  --ls-hero: -0.022em;
  --ls-h2: -0.019em;
  --ls-h3: -0.015em;
  --ls-lead: -0.012em;
  --ls-eyebrow: -0.01em;
  --ls-body: -0.011em;
  --ls-small: -0.005em;
}
/* tracking: SF Pro (valori per dimensione ottica, come nel sistema) */
.sf {
  --ls-hero: -0.015em;
  --ls-h2: -0.009em;
  --ls-h3: 0.004em;
  --ls-lead: 0.007em;
  --ls-eyebrow: 0.011em;
  --ls-body: -0.022em;
  --ls-small: -0.016em;
}

/* colori — scuro (tema scelto o di sistema) e capitoli scuri */
:root[data-theme="dark"],
.section--dark,
.nav--dark {
  --bg: #000000;
  --bg-alt: #0c0c0d;
  --tile: #1c1c1e;
  --tile-on-alt: #1c1c1e;
  --label: #f5f5f7;
  --label-2: #a1a1a6;
  --label-3: #86868b;
  --sep: rgba(255, 255, 255, 0.16);
  --accent: #1e6ef4;
  --accent-hover: #3a82f7;
  --accent-text: #6cb6ff;
  --link: #2997ff;
  --focus: #2997ff;
  --ok: #30d158;
  --grad-a: #3ea2ff;
  --grad-b: #a7aaff;
  --glass: rgba(22, 22, 23, 0.72);
  --glass-line: rgba(255, 255, 255, 0.12);
  --paddle: rgba(66, 66, 69, 0.72);
  --paddle-hover: rgba(80, 80, 84, 0.8);
  --fill: rgba(118, 118, 128, 0.24);
}
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000;
    --bg-alt: #0c0c0d;
    --tile: #1c1c1e;
    --tile-on-alt: #1c1c1e;
    --label: #f5f5f7;
    --label-2: #a1a1a6;
    --label-3: #86868b;
    --sep: rgba(255, 255, 255, 0.16);
    --accent: #1e6ef4;
    --accent-hover: #3a82f7;
    --accent-text: #6cb6ff;
    --link: #2997ff;
    --focus: #2997ff;
    --ok: #30d158;
    --grad-a: #3ea2ff;
    --grad-b: #a7aaff;
    --glass: rgba(22, 22, 23, 0.72);
    --glass-line: rgba(255, 255, 255, 0.12);
    --paddle: rgba(66, 66, 69, 0.72);
    --paddle-hover: rgba(80, 80, 84, 0.8);
    --fill: rgba(118, 118, 128, 0.24);
  }
}
/* Aumenta contrasto */
@media (prefers-contrast: more) {
  :root { --label-2: #515154; --sep: rgba(0, 0, 0, 0.3); --glass: #ffffff; }
  :root[data-theme="dark"], .section--dark { --label-2: #d1d1d6; --sep: rgba(255, 255, 255, 0.36); --glass: #161617; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--nav-h);
  background: var(--bg);
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  font-family: var(--font);
  font-size: 1.0625rem;              /* 17 px: corpo del testo di sistema */
  line-height: 1.47059;
  font-weight: 400;
  letter-spacing: var(--ls-body);
  font-optical-sizing: auto;
  color: var(--label);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  overflow-x: clip;
}
img, svg, canvas, picture { display: block; max-width: 100%; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; letter-spacing: inherit; }
h1, h2, h3 { font-weight: 600; text-wrap: balance; }
p, dd, li { text-wrap: pretty; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 1000;
  background: var(--label); color: var(--bg);
  padding: 0.75rem 1.1rem; border-radius: 12px; font-size: 0.875rem; font-weight: 600;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: 0.75rem; }

/* ---------- Tipografia condivisa ---------- */
.eyebrow {
  font-size: var(--t-eyebrow);
  line-height: 1.19;
  font-weight: 600;
  letter-spacing: var(--ls-eyebrow);
  color: var(--label-2);
}
.section__title {
  font-size: var(--t-h2);
  line-height: 1.07;
  letter-spacing: var(--ls-h2);
  margin-top: 0.5rem;
  max-width: 18ch;
}
.section__intro {
  font-size: var(--t-intro);
  line-height: 1.38;
  letter-spacing: var(--ls-lead);
  color: var(--label-2);
  margin-top: 1.25rem;
  max-width: 44ch;
}

/* ---------- Bottoni e link ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.6875rem 1.375rem;
  border-radius: 980px;
  font-size: 1.0625rem; line-height: 1.17648; font-weight: 400;
  background: var(--accent); color: #fff;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--accent-hover); }
.btn:active { transform: scale(0.97); }
.btn--small {
  min-height: 28px; padding: 0.25rem 0.8125rem;
  font-size: 0.75rem; line-height: 1.33337; letter-spacing: var(--ls-small);
}
.btn--large { min-height: 52px; padding: 0.875rem 1.75rem; }
.link-more {
  display: inline-flex; align-items: center; gap: 0.3em;
  min-height: 44px;
  color: var(--link);
  font-size: 1.1875rem; letter-spacing: var(--ls-lead);
}
.link-more:hover > span, .link-more:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.chev {
  width: 0.62em; height: 0.62em; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.25s var(--ease);
}
.link-more:hover .chev { transform: translateX(3px); }

/* ---------- Navigazione (vetro) ---------- */
/* il vetro sta su ::before: un backdrop-filter sulla barra stessa
   farebbe da contenitore al menu mobile (position: fixed) */
.nav { position: sticky; top: 0; z-index: 100; color: var(--label); }
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.nav.is-stuck::before { border-bottom-color: var(--glass-line); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav::before { background: var(--bg); }
}
@media (prefers-reduced-transparency: reduce) { .nav::before { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }
.nav__bar {
  height: var(--nav-h);
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex; align-items: center; gap: 1rem;
}
.nav__brand {
  font-size: 1.1875rem; font-weight: 600; letter-spacing: var(--ls-lead);
  white-space: nowrap; margin-right: auto;
}
.nav__links { display: flex; gap: 1.6rem; }
.nav__links a {
  font-size: 0.8125rem; letter-spacing: var(--ls-small);
  color: var(--label); opacity: 0.8;
  padding-block: 0.75rem;
  transition: opacity 0.2s var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="true"] { opacity: 1; }
.nav__links a[aria-current="true"] { font-weight: 600; }
.nav__actions { display: flex; align-items: center; gap: 0.25rem; margin-left: 1rem; }
.nav__icon {
  position: relative; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; color: var(--label); opacity: 0.8;
  transition: opacity 0.2s var(--ease), background-color 0.2s var(--ease);
}
.nav__icon:hover { opacity: 1; background: var(--fill); }
.nav__icon::after { content: ""; position: absolute; inset: -4px; }
.nav__lang { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em; }
.nav__actions .btn--small { margin-left: 0.5rem; }
.nav__menu { display: none; position: relative; width: 44px; height: 44px; margin-right: -10px; }
.nav__menu span {
  position: absolute; left: 13px; width: 18px; height: 1.5px; border-radius: 1px;
  background: var(--label);
  transition: transform 0.35s var(--ease), top 0.35s var(--ease);
}
.nav__menu span:first-child { top: 18px; }
.nav__menu span:last-child { top: 25px; }
.nav__menu[aria-expanded="true"] span:first-child { top: 21.5px; transform: rotate(45deg); }
.nav__menu[aria-expanded="true"] span:last-child { top: 21.5px; transform: rotate(-45deg); }

.menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 99;
  background: var(--bg);
  padding: 1.25rem var(--gutter) calc(2rem + env(safe-area-inset-bottom));
  overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.menu[hidden] { display: none; }
.menu__links a {
  display: block; padding: 0.4rem 0;
  font-size: 1.75rem; line-height: 1.2; font-weight: 600; letter-spacing: var(--ls-h3);
}
.menu__foot { margin-top: auto; padding-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }
.pill-toggle {
  min-height: 44px; padding: 0 1.1rem; border-radius: 980px;
  background: var(--fill); font-size: 0.9375rem;
}
.menu.is-open .menu__links a, .menu.is-open .menu__foot {
  animation: menuIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i, 6) * 32ms);
}
@keyframes menuIn { from { opacity: 0; transform: translateY(-10px); } }

/* breakpoint della nav in em: segue la dimensione del testo scelta nel browser */
@media (max-width: 63.99em) {
  .nav__links, .nav__icon { display: none; }
  .nav__menu { display: block; }
  .nav__actions { margin-left: 0; gap: 0.5rem; }
}
@media (min-width: 64em) { .menu { display: none !important; } }
/* otto sezioni: link su una riga e spazi più stretti finché la barra è al limite */
.nav__links a { white-space: nowrap; }
@media (min-width: 64em) and (max-width: 74.99em) { .nav__links { gap: 1.1rem; } }

/* ---------- Hero ---------- */
.hero {
  padding: clamp(3rem, 1.5rem + 5vw, 6.25rem) var(--gutter) 0;
  text-align: center;
}
.hero__copy { max-width: 62rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.badge {
  display: inline-flex; align-items: center; gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.75rem; border-radius: 980px;
  background: var(--tile); color: var(--label-2);
  font-size: 0.875rem; line-height: 1.3; letter-spacing: var(--ls-small); font-weight: 500;
}
.badge__dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.badge__dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok);
  animation: ping 2.4s var(--ease-out) infinite;
}
@keyframes ping { 0% { transform: scale(1); opacity: 0.55; } 70%, 100% { transform: scale(2.8); opacity: 0; } }
.hero .eyebrow { margin-top: 1.5rem; color: var(--label); }
.hero__title {
  font-size: var(--t-hero); line-height: 1.04; letter-spacing: var(--ls-hero);
  margin-top: 0.3rem;
}
.hero__sub {
  font-size: var(--t-lead); line-height: 1.2; letter-spacing: var(--ls-lead);
  color: var(--label-2); max-width: 32ch; margin-top: 1.1rem;
}
.hero__ctas {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.75rem 1.75rem; margin-top: 2rem;
}
.js .hero__in { opacity: 0; transform: translateY(14px); animation: heroIn 1.1s var(--ease-out) forwards; animation-delay: calc(80ms + var(--d, 0) * 90ms); }
@keyframes heroIn { to { opacity: 1; transform: none; } }

/* --p (0 → 1) guida l'ingresso del ritratto: dallo scroll via JS, oppure
   dal browser con le animazioni guidate dallo scroll (vedi "Animazioni
   guidate dallo scroll"). Solo transform: niente ridisegni. */
.hero__media {
  --p: 1;
  position: relative;
  max-width: var(--maxw);
  margin: clamp(2.75rem, 2rem + 3vw, 4.5rem) auto 0;
}
.js:not(.sda) .hero__media { --p: 0; }
.portrait {
  position: relative; margin: 0 auto;
  width: min(100%, 560px); aspect-ratio: 4 / 5;
  border-radius: var(--radius-tile);
  overflow: hidden;
  background: linear-gradient(180deg, #e7e6ec 0%, #ececef 40%, #f0f0f1 100%);
  transform: scale(calc(0.9 + 0.1 * var(--p)));
  transform-origin: 50% 0;
  will-change: transform;
}
.portrait picture { position: absolute; inset: 0; }
.portrait__img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 16%;
  transform: scale(calc(1.1 - 0.1 * var(--p)));
  transform-origin: 50% 30%;
}
.portrait__cap {
  position: absolute; left: 1.4rem; bottom: 1.2rem;
  padding: 0.3rem 0.7rem; border-radius: 980px;
  background: rgba(255, 255, 255, 0.72); color: #1d1d1f;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  font-size: 0.75rem; letter-spacing: var(--ls-small);
}
.callouts { display: none; }
@media (min-width: 1068px) {
  .callouts { display: block; }
  .callout {
    position: absolute; top: var(--top);
    width: calc((100% - 560px) / 2 - 3.5rem);
    display: flex; flex-direction: column; gap: 0.2rem;
  }
  .callout strong { font-size: 1.3125rem; line-height: 1.19; font-weight: 600; letter-spacing: var(--ls-eyebrow); }
  .callout span { font-size: 0.875rem; line-height: 1.43; color: var(--label-2); letter-spacing: var(--ls-small); }
  .callout--l { left: 0; text-align: right; align-items: flex-end; }
  .callout--r { right: 0; text-align: left; align-items: flex-start; }
  .callout::after {
    content: ""; position: absolute; top: 0.8rem; width: 2.25rem; height: 1px; background: var(--sep);
  }
  .callout--l::after { right: -3rem; }
  .callout--r::after { left: -3rem; }
}

/* ---------- Profilo: testo che si accende ---------- */
.statement { padding-inline: var(--gutter); }
.statement__pin { --p: 1; }
.js .statement__pin { height: 230vh; }
.statement__sticky {
  max-width: var(--textw); margin: 0 auto;
  padding-block: var(--section-pad);
}
.js .statement__sticky {
  position: sticky; top: 0;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-block: calc(var(--nav-h) + 2rem) 2rem;
}
.statement__text {
  font-size: var(--t-statement); line-height: 1.12; letter-spacing: var(--ls-h2);
  font-weight: 600; margin-top: 1.25rem;
}
.statement__text .w {
  opacity: clamp(0.16, calc(var(--p) * (var(--n) + 7) - var(--i) - 1.5), 1);
}

/* ---------- Numeri ---------- */
.numbers { background: var(--bg-alt); padding: clamp(4rem, 2.5rem + 5vw, 7.5rem) var(--gutter); }
.numbers__grid {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2.5rem 2rem;
}
.stat__value {
  display: block;
  font-size: var(--t-stat); line-height: 1; font-weight: 600; letter-spacing: var(--ls-hero);
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, var(--grad-a) 10%, var(--grad-b) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  padding-bottom: 0.06em;
}
.stat__unit { margin-left: 0.02em; }
.stat__label { display: block; margin-top: 0.8rem; color: var(--label-2); max-width: 17ch; }
@media (max-width: 833px) { .numbers__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Sezioni ---------- */
.section { padding: var(--section-pad) var(--gutter); }
.section--alt { background: var(--bg-alt); }
.section--alt .tile { background: var(--tile-on-alt); }
.section--dark { background: var(--bg); color: var(--label); }
.section__head { max-width: var(--maxw); margin: 0 auto clamp(2.5rem, 1.75rem + 3vw, 4.5rem); }

/* ---------- Tile / bento ---------- */
.bento {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem;
}
.tile {
  position: relative; overflow: hidden;
  background: var(--tile); border-radius: var(--radius-tile);
  padding: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  display: flex; flex-direction: column;
}
.bento .tile { min-height: 23rem; justify-content: flex-end; }
.tile--wide {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center; gap: 2rem;
}
.bento .tile--wide { min-height: 25rem; }
.tile__icon { margin-bottom: auto; padding-bottom: 2rem; }
.tile__icon svg {
  width: 52px; height: 52px; fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.tile__eyebrow { font-size: 1.0625rem; font-weight: 600; color: var(--label-2); }
.tile__eyebrow--muted { font-weight: 400; margin-top: 0.3rem; }
.tile__title { font-size: var(--t-h3); line-height: 1.125; letter-spacing: var(--ls-h3); margin-top: 0.35rem; }
.tile__body { margin-top: 0.9rem; color: var(--label-2); max-width: 46ch; }
.tile__art { display: grid; place-items: center; }
.flow { width: 100%; max-width: 420px; overflow: visible; }
.flow__line {
  fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 420; stroke-dashoffset: 0;
}
.flow__node { fill: var(--tile); stroke: var(--accent); stroke-width: 3; }
.flow__node--end { fill: var(--accent); }
.flow__check { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.js .tile--wide.reveal .flow__line { stroke-dashoffset: 420; transition: stroke-dashoffset 1.8s var(--ease) 0.35s; }
.js .tile--wide.reveal .flow__node { opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0.4); transition: opacity 0.5s var(--ease), transform 0.6s var(--ease-out); }
.js .tile--wide.reveal .flow__node:nth-of-type(1) { transition-delay: 0.35s; }
.js .tile--wide.reveal .flow__node:nth-of-type(2) { transition-delay: 1.05s; }
.js .tile--wide.reveal .flow__node:nth-of-type(3) { transition-delay: 1.9s; }
.js .tile--wide.reveal .flow__check { opacity: 0; transition: opacity 0.4s var(--ease) 2.2s; }
.js .tile--wide.is-in .flow__line { stroke-dashoffset: 0; }
.js .tile--wide.is-in .flow__node { opacity: 1; transform: none; }
.js .tile--wide.is-in .flow__check { opacity: 1; }

@media (max-width: 733px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .tile--wide { grid-template-columns: minmax(0, 1fr); }
  .tile--wide .tile__art { order: -1; }
  .bento .tile { min-height: 0; }
  .bento .tile .tile__icon { padding-bottom: 1.5rem; }
}

/* ---------- Percorso ---------- */
.journey {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2rem, 1rem + 4vw, 6rem);
}
.journey__rail { position: sticky; top: calc(var(--nav-h) + 14vh); align-self: start; }
.journey__years {
  position: relative; height: 1.08em;
  font-size: var(--t-year); line-height: 1; font-weight: 600; letter-spacing: var(--ls-hero);
  font-variant-numeric: tabular-nums;
}
.journey__year {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--grad-a) 10%, var(--grad-b) 90%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  opacity: 0; transform: translateY(0.18em);
  transition: opacity 0.5s var(--ease), transform 0.7s var(--ease);
}
.journey__year.is-active { opacity: 1; transform: none; }
.journey__track { --p: 1; position: relative; }
.js:not(.sda) .journey__track { --p: 0; }
.journey__list { position: relative; padding-left: 2.25rem; }
.journey__track::before, .journey__line {
  content: ""; position: absolute; left: 5px; top: 0.6rem; bottom: 0.6rem; width: 2px; border-radius: 2px;
}
.journey__track::before { background: var(--sep); }
.journey__line {
  z-index: 0;
  background: linear-gradient(180deg, var(--grad-a), var(--grad-b));
  transform: scaleY(var(--p)); transform-origin: top;
  will-change: transform;
}
.role { position: relative; padding-block: 0 clamp(2.5rem, 1.5rem + 3vw, 4.5rem); }
.role:last-child { padding-bottom: 0; }
.role::before {
  content: ""; position: absolute; left: calc(-2.25rem - 0px); top: 0.35rem; z-index: 1;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-alt); border: 2px solid var(--label-3);
  transition: background-color 0.4s var(--ease), border-color 0.4s var(--ease), transform 0.4s var(--ease);
}
.role.is-current::before { background: var(--accent); border-color: var(--accent); transform: scale(1.15); }
.role__period {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  font-size: 0.875rem; line-height: 1.43; font-weight: 600; letter-spacing: var(--ls-small); color: var(--label-2);
}
.role__tag {
  padding: 0.2rem 0.65rem; border-radius: 980px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text);
  font-size: 0.75rem;
}
.role__tag--plain { background: none; padding: 0; color: var(--label-3); font-weight: 400; font-size: 0.875rem; }
.role__title { font-size: var(--t-h3); line-height: 1.125; letter-spacing: var(--ls-h3); margin-top: 0.6rem; }
.role__at { display: block; color: var(--label-2); }
.role__body { margin-top: 1rem; color: var(--label-2); max-width: 52ch; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1.25rem; }
.chips li {
  font-size: 0.875rem; line-height: 1.3; letter-spacing: var(--ls-small);
  padding: 0.4rem 0.85rem; border-radius: 980px; border: 1px solid var(--sep);
}
@media (max-width: 833px) {
  .journey { grid-template-columns: minmax(0, 1fr); }
  .journey__rail { display: none; }
}

/* ---------- Galleria progetti ---------- */
.gallery { margin-inline: calc(-1 * var(--gutter)); }
.gallery__track {
  --gpad: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  display: flex; gap: 1.25rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gpad);
  padding: 0.25rem var(--gpad) 1.25rem;
  scrollbar-width: none;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track:focus-visible { outline-offset: -2px; border-radius: 0; }
.gcard {
  --c: #0091ff; --c2: #6d7cff;
  position: relative; overflow: hidden; flex: 0 0 min(84%, 38.5rem);
  scroll-snap-align: start;
  min-height: 33rem;
  background: var(--tile); border-radius: var(--radius-tile);
  padding: clamp(1.75rem, 1.2rem + 2vw, 3rem);
  display: flex; flex-direction: column;
}
.gcard--mint { --c: #00dac3; --c2: #30d158; }
.gcard--orange { --c: #ff9230; --c2: #ff375f; }
.gcard__art {
  position: absolute; inset: 0 0 auto 0; height: 16rem; pointer-events: none;
  background:
    radial-gradient(55% 90% at 85% -10%, color-mix(in srgb, var(--c) 58%, transparent), transparent 70%),
    radial-gradient(45% 70% at 25% -20%, color-mix(in srgb, var(--c2) 38%, transparent), transparent 72%);
  opacity: 0.9;
}
.gcard > :not(.gcard__art) { position: relative; }
.gcard__tag {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  margin-top: 5.5rem;
  font-size: 1.0625rem; font-weight: 600; color: var(--c);
}
.gcard__num { color: var(--label-3); font-variant-numeric: tabular-nums; font-size: 0.875rem; }
.gcard__title {
  font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2.25rem); line-height: 1.1; letter-spacing: var(--ls-h3);
  margin-top: 0.5rem; max-width: 22ch;
}
.gcard__facts { margin-top: auto; padding-top: 2rem; display: grid; }
.gcard__facts > div {
  display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem;
  padding-block: 0.9rem; border-top: 1px solid var(--sep);
}
.gcard__facts dt { font-size: 0.875rem; font-weight: 600; color: var(--label-2); padding-top: 0.15rem; }
.gcard__facts dd { margin: 0; }
.gallery__controls {
  width: min(var(--maxw), 100% - 2 * var(--gutter)); margin: 0.75rem auto 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.gallery__dots { display: flex; gap: 8px; }
.gallery__dots span {
  width: 8px; height: 8px; border-radius: 980px; background: var(--label-3); opacity: 0.45;
  transition: width 0.4s var(--ease), opacity 0.4s var(--ease), background-color 0.4s var(--ease);
}
.gallery__dots span.is-active { width: 26px; opacity: 1; background: var(--label); }
.gallery__paddles { display: flex; gap: 0.75rem; }
.paddle {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paddle); color: var(--label);
  transition: background-color 0.2s var(--ease), opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.paddle:hover { background: var(--paddle-hover); }
.paddle:active { transform: scale(0.94); }
.paddle[disabled] { opacity: 0.36; cursor: default; }
.paddle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 733px) {
  .gcard { min-height: 0; }
  .gcard__facts > div { grid-template-columns: minmax(0, 1fr); gap: 0.25rem; }
}

/* ---------- Dove ho lavorato (globo) ---------- */
.where { position: relative; background: #000; }
.where__sticky { position: relative; padding: var(--section-pad) var(--gutter); }
.where__viz { display: none; }
.where__viz canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* impulso sulla città attiva: animazione CSS, eseguita dal compositore */
.where__pulse {
  position: absolute; left: 0; top: 0; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  pointer-events: none; opacity: 0; will-change: transform, opacity;
}
.where__pulse::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid #fff; opacity: 0;
  animation: cityPing 2.2s linear infinite;
}
@keyframes cityPing { from { transform: scale(0.25); opacity: 0.5; } to { transform: scale(1); opacity: 0; } }
.where__pulse::after { animation-play-state: paused; }
.where.is-vis .where__pulse::after, .where.is-vis .where__hint svg { animation-play-state: running; }
.where__head { max-width: var(--maxw); margin: 0 auto; }
.where__head .section__title { max-width: none; }
.where__ui { max-width: var(--maxw); margin: 2.5rem auto 0; }
.segmented {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 980px;
  background: rgba(118, 118, 128, 0.24);
}
.segmented button {
  min-height: 40px; padding: 0 1.15rem; border-radius: 980px;
  font-size: 0.875rem; font-weight: 600; letter-spacing: var(--ls-small); color: var(--label);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.segmented button:hover { background: rgba(255, 255, 255, 0.08); }
.segmented button[aria-pressed="true"] { background: #636366; }
.where__cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.city {
  background: rgba(28, 28, 30, 0.94); border-radius: var(--radius-card);
  padding: 1.35rem 1.5rem 1.1rem;
}
.city__name { font-size: 1.5rem; line-height: 1.17; letter-spacing: var(--ls-h3); }
.city__note { margin-top: 0.2rem; color: var(--label-2); font-size: 0.9375rem; }
.city__label { margin-top: 1rem; font-size: 0.75rem; font-weight: 600; color: var(--label-3); letter-spacing: 0.01em; }
.city__clients li { padding-block: 0.45rem; border-top: 1px solid var(--sep); }
.city__clients li:first-child { border-top: 0; }
.where__hint { display: none; }

/* stato "live": scena fissata e guidata dallo scroll */
.where.is-live .where__scroller { height: 460vh; }
.where.is-live .where__sticky {
  position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; padding: 0;
}
.where.is-live .where__viz, .where.is-static .where__viz { display: block; }
.where.is-live .where__viz { position: absolute; inset: 0; }
/* titolo, schede e suggerimento seguono lo scroll insieme al globo:
   il JS scrive le opacità solo quando cambiano, su livelli già pronti */
.where.is-live .where__head {
  position: absolute; left: 0; right: 0; top: calc(var(--nav-h) + clamp(1.5rem, 0.5rem + 5vh, 4.5rem));
  padding-inline: var(--gutter); text-align: center; pointer-events: none;
  opacity: var(--head-o, 1); transform: translateY(calc((1 - var(--head-o, 1)) * -28px));
  will-change: opacity, transform;
}
.where.is-live .where__head .section__intro { margin-inline: auto; }
.where.is-live .where__ui {
  position: absolute; margin: 0;
  right: max(var(--gutter), calc((100% - var(--maxw)) / 2));
  bottom: max(1.5rem, calc(1rem + 4vh));
  width: min(23.5rem, 100% - 2 * var(--gutter));
  opacity: var(--ui-o, 0); transform: translateY(calc((1 - var(--ui-o, 0)) * 24px));
  will-change: opacity, transform;
}
.where.is-live .where__cards { display: grid; grid-template-columns: minmax(0, 1fr); }
.where.is-live .city {
  grid-area: 1 / 1; align-self: end;
  opacity: 0; transform: translateY(14px) scale(0.98);
  transition: opacity 0.45s var(--ease), transform 0.55s var(--ease);
  pointer-events: none;
}
.where.is-live .city.is-active { opacity: 1; transform: none; pointer-events: auto; }
.where.is-live .where__hint {
  position: absolute; left: 50%; bottom: max(1.5rem, calc(0.75rem + 3vh)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.875rem; color: var(--label-2); opacity: var(--hint-o, 1);
  will-change: opacity;
}
.where__hint svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; animation: bob 1.8s var(--ease) infinite; animation-play-state: paused; }
@keyframes bob { 50% { transform: translateY(3px); } }
@media (max-width: 733px) {
  .where__cards { grid-template-columns: minmax(0, 1fr); }
  .where.is-live .where__ui { left: var(--gutter); right: var(--gutter); width: auto; bottom: max(1rem, env(safe-area-inset-bottom)); }
  .segmented { display: flex; }
  .segmented button { flex: 1; }
}
/* stato statico (Riduci movimento): mappa ferma + schede */
.where.is-static .where__sticky { display: flex; flex-direction: column; }
.where.is-static .where__viz {
  position: relative; order: 1; width: 100%; height: min(62vh, 560px); margin: 2rem auto 0; max-width: var(--maxw);
  border-radius: var(--radius-tile); overflow: hidden; background: #000;
}
.where.is-static .where__ui { order: 2; width: 100%; }
.where.is-live .where__ui { pointer-events: none; }
.where.is-live.ui-on .where__ui { pointer-events: auto; }

/* ---------- Pubblicazioni ---------- */
.pubs {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 1.25rem;
  align-items: start;
}
@media (min-width: 834px) {
  .pub--book { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
}
.pub { gap: 0; }
.pub__head { display: flex; align-items: center; gap: 0.75rem; }
.pub__icon {
  width: 40px; height: 40px; flex: none; border-radius: 12px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text);
}
.pub__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pub__type { font-size: 0.875rem; font-weight: 600; letter-spacing: var(--ls-small); color: var(--label-2); }
.pub__title {
  margin-top: 1.25rem;
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem); line-height: 1.18; letter-spacing: var(--ls-h3);
}
.pub__meta { margin-top: 0.6rem; font-size: 0.875rem; line-height: 1.43; color: var(--label-2); letter-spacing: var(--ls-small); }
.pub__meta cite { font-style: italic; }
.pub__authors { margin-top: 0.35rem; font-size: 0.875rem; line-height: 1.43; color: var(--label-2); letter-spacing: var(--ls-small); }
.pub__authors strong { color: var(--label); font-weight: 600; }
.pub__body { margin-top: 1rem; color: var(--label-2); }
.pub__label { margin-top: 1.5rem; font-size: 0.875rem; font-weight: 600; letter-spacing: var(--ls-small); }
.pub__parts { margin-top: 0.5rem; }
.pub__parts > div {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.9rem; align-items: start;
  padding-block: 0.85rem; border-top: 1px solid var(--sep);
}
.pub__parts dt {
  min-width: 2.75rem; text-align: center;
  padding: 0.15rem 0.5rem; border-radius: 980px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text);
  font-size: 0.8125rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.pub__parts dd { margin: 0; color: var(--label-2); }
.pub__parts dd strong { color: var(--label); font-weight: 600; }
.pub__specs { margin-top: 1.5rem; }
.pub__specs > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.8rem; border-top: 1px solid var(--sep);
}
.pub__specs dt { color: var(--label-2); }
.pub__specs dd { margin: 0; font-weight: 600; text-align: right; }
.pub__links {
  margin-top: auto; padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
}
.pub__doi { font-size: 0.875rem; color: var(--label-2); letter-spacing: var(--ls-small); }
.pub__doi:hover { color: var(--label); text-decoration: underline; text-underline-offset: 0.18em; }
@media (max-width: 833px) {
  .pubs { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Side project: app per i cittadini ----------
   Due schede prodotto: lo screenshot reale (chiaro o scuro, come il tema)
   in una cornice di telefono disegnata in CSS che sale dal bordo della
   scena, poi nome, problema risolto, funzioni, fonti e link. Sotto, una
   scheda larga con i principi comuni e i punteggi Lighthouse misurati
   (solo San Vito). In movimento solo transform e stroke-dashoffset. */
.apps {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem;
}
.app {
  --pad: clamp(1.75rem, 1.2rem + 2vw, 3rem);   /* = padding di .tile */
  --app-c: #132b4f;                             /* colore dell'intestazione dell'app */
  --app-glow: #4b8fe8;
  padding: 0 var(--pad) var(--pad);
}
.app--sanvito { --app-c: #132b4f; --app-glow: #4b8fe8; }
.app--mesagne { --app-c: #14523f; --app-glow: #3fb488; }

/* scena: il colore dell'app, con una luce che sale da sotto il telefono */
.app__stage {
  margin-inline: calc(-1 * var(--pad));
  padding-top: clamp(2.25rem, 1.75rem + 2vw, 3.25rem);
  display: flex; justify-content: center; align-items: flex-end;
  overflow: hidden;
  background:
    radial-gradient(62% 58% at 50% 108%, color-mix(in srgb, var(--app-glow) 62%, transparent), transparent 74%),
    radial-gradient(90% 70% at 50% -10%, rgba(255, 255, 255, 0.10), transparent 70%),
    var(--app-c);
}
.phone {
  position: relative; width: min(72%, 16.25rem);
  padding: 9px 9px 0;
  border-radius: 46px 46px 0 0;
  background: #0b0b0c;
  box-shadow:
    0 0 0 1.5px #6e6e73,                        /* profilo metallico */
    0 0 0 3px #2c2c2e,
    0 28px 70px -10px rgba(0, 0, 0, 0.55);
}
.phone__screen {
  position: relative; overflow: hidden;
  aspect-ratio: 10 / 17;                        /* stesso rapporto delle immagini */
  border-radius: 37px 37px 0 0;
  background: var(--app-c);
}
.shot, .shot img { display: block; width: 100%; height: 100%; }
.shot img { object-fit: cover; object-position: top; }
/* schermata chiara o scura secondo il tema (anche quello scelto a mano):
   l'immagine nascosta è lazy e display:none, quindi non viene scaricata */
.shot--dark { display: none; }
:root[data-theme="dark"] .shot--light { display: none; }
:root[data-theme="dark"] .shot--dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .shot--light { display: none; }
  :root:not([data-theme="light"]) .shot--dark { display: block; }
}
.phone__island {                                 /* margin in % = % della larghezza */
  position: absolute; left: 50%; top: 0;
  width: 31%; aspect-ratio: 126 / 37; margin-top: 2.9%;
  transform: translateX(-50%);
  border-radius: 980px; background: #000;
}
.js .app.reveal .phone { transform: translateY(14%); transition: transform 1.3s var(--ease-out) 0.12s; }
.js .app.is-in .phone { transform: none; }

/* testo */
.app__head { display: flex; align-items: center; gap: 0.9rem; margin-top: clamp(1.5rem, 1.25rem + 1vw, 2rem); }
.app__icon {
  width: 56px; height: 56px; flex: none; border-radius: 13px;
  box-shadow: 0 0 0 1px var(--sep);
}
.app__type { font-size: 0.875rem; line-height: 1.3; font-weight: 600; letter-spacing: var(--ls-small); color: var(--label-2); }
.app__name {
  margin-top: 0.15rem;
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem); line-height: 1.15; letter-spacing: var(--ls-h3);
}
.app__lede { margin-top: 1rem; color: var(--label-2); max-width: 46ch; }
.app__feats { margin-top: 1.5rem; }
.app__feats li {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 0.85rem; align-items: start;
  padding-block: 0.85rem; border-top: 1px solid var(--sep);
}
.app__feats svg {
  width: 24px; height: 24px; margin-top: 0.05rem;
  fill: none; stroke: var(--accent-text); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.app__feats p { color: var(--label-2); }
.app__feats strong { color: var(--label); font-weight: 600; }
.app__specs > div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding-block: 0.8rem; border-top: 1px solid var(--sep);
}
.app__specs dt { color: var(--label-2); }
.app__specs dd { margin: 0; font-weight: 600; text-align: right; }
.app__links {
  margin-top: auto; padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem;
}
.app__press { color: var(--link); }
.app__press:hover { text-decoration: underline; text-underline-offset: 0.18em; }

/* rassegna stampa: la testata sul verde di Differenziata Mesagne,
   accanto titolo originale, sintesi e link all'articolo */
.press {
  grid-column: 1 / -1;
  --pad: clamp(1.75rem, 1.2rem + 2vw, 3rem);   /* = padding di .tile */
  padding: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 834px) {
  .press { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
}
.press__source {
  padding: var(--pad);
  display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
  color: #fff;
  background:
    radial-gradient(70% 80% at 100% 115%, color-mix(in srgb, #3fb488 48%, transparent), transparent 72%),
    radial-gradient(90% 70% at 30% -10%, rgba(255, 255, 255, 0.10), transparent 70%),
    #14523f;
}
.press__kicker { font-size: 0.875rem; line-height: 1.3; font-weight: 600; letter-spacing: var(--ls-small); color: rgba(255, 255, 255, 0.8); }
.press__outlet { margin-top: 0.4rem; font-size: var(--t-h3); line-height: 1.125; font-weight: 600; letter-spacing: var(--ls-h3); }
.press__desc { margin-top: 0.35rem; font-size: 0.875rem; line-height: 1.43; letter-spacing: var(--ls-small); color: rgba(255, 255, 255, 0.8); }
.press__mark { align-self: flex-end; width: clamp(2.75rem, 2.25rem + 1.5vw, 3.5rem); height: auto; fill: rgba(255, 255, 255, 0.9); }
.press__body { padding: var(--pad); display: flex; flex-direction: column; }
.press__meta { font-size: 0.875rem; line-height: 1.3; font-weight: 600; letter-spacing: var(--ls-small); color: var(--label-2); }
.press__title {
  margin-top: 0.75rem; max-width: 34ch;
  font-size: clamp(1.375rem, 1.15rem + 0.7vw, 1.75rem); line-height: 1.18; letter-spacing: var(--ls-h3);
}
.press__gloss { margin-top: 0.5rem; max-width: 60ch; font-size: 0.875rem; line-height: 1.43; letter-spacing: var(--ls-small); color: var(--label-2); }
.press__gloss:empty { display: none; }
.press__text { margin-top: 1rem; max-width: 58ch; color: var(--label-2); }
.press__links {
  margin-top: auto; padding-top: 1.5rem;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.5rem;
}

/* principi comuni + Lighthouse */
.craft {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 1rem + 3vw, 4.5rem); align-items: center;
}
@media (min-width: 1068px) {
  .craft { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
}
.craft__list { margin-top: 1.5rem; max-width: 62ch; }
.craft__list li { padding-block: 0.85rem; border-top: 1px solid var(--sep); color: var(--label-2); }
.craft__list strong { color: var(--label); font-weight: 600; }
.lh { display: flex; flex-direction: column; align-items: center; text-align: center; }
.lh__label { margin-bottom: 1.5rem; font-size: 0.875rem; line-height: 1.43; font-weight: 600; letter-spacing: var(--ls-small); }
.lh__app { display: block; font-weight: 400; color: var(--label-2); }
.lh__scores {
  width: 100%; max-width: 30rem;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem;
}
.lh__scores > div { display: flex; flex-direction: column-reverse; align-items: center; gap: 0.65rem; }
.lh__scores dt { font-size: 0.8125rem; line-height: 1.3; letter-spacing: var(--ls-small); color: var(--label-2); }
.lh__scores dd {
  position: relative; margin: 0;
  width: clamp(3.75rem, 3rem + 2vw, 5rem); aspect-ratio: 1;
  display: grid; place-items: center;
}
.lh__ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.lh__track { fill: color-mix(in srgb, var(--ok) 9%, transparent); stroke: color-mix(in srgb, var(--ok) 20%, transparent); stroke-width: 3.5; }
.lh__arc { fill: none; stroke: var(--ok); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 132 132; stroke-dashoffset: 0; }
.lh__scores dd span {                            /* 700 e ≥ 19 px: testo grande, contrasto ≥ 3:1 */
  position: relative;
  font-size: clamp(1.1875rem, 1.05rem + 0.4vw, 1.375rem); font-weight: 700; letter-spacing: var(--ls-h3);
  font-variant-numeric: tabular-nums; color: var(--ok);
}
.js .craft.reveal .lh__arc { stroke-dashoffset: 132; transition: stroke-dashoffset 1.4s var(--ease) 0.3s; }
.js .craft.reveal .lh__scores > div:nth-child(2) .lh__arc { transition-delay: 0.45s; }
.js .craft.reveal .lh__scores > div:nth-child(3) .lh__arc { transition-delay: 0.6s; }
.js .craft.reveal .lh__scores > div:nth-child(4) .lh__arc { transition-delay: 0.75s; }
.js .craft.is-in .lh__arc { stroke-dashoffset: 0; }
.lh__cap {
  margin-top: 1.5rem; max-width: 40ch;
  font-size: 0.8125rem; line-height: 1.43; letter-spacing: var(--ls-small); color: var(--label-2);
}
.lh__vitals { display: block; margin-top: 0.35rem; font-weight: 600; color: var(--label); font-variant-numeric: tabular-nums; }
.apps__note {
  max-width: var(--maxw); margin: 1.5rem auto 0;
  font-size: 0.8125rem; line-height: 1.43; letter-spacing: var(--ls-small); color: var(--label-2);
}
@media (max-width: 833px) {
  .apps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 559px) {
  .lh__scores { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 18rem; gap: 1.5rem 1rem; }
}

/* ---------- Competenze & formazione ---------- */
.duo {
  max-width: var(--maxw); margin: 0 auto;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem;
}
.specs { margin-top: 1.75rem; }
.specs > div {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1rem;
  padding-block: 0.95rem; border-top: 1px solid var(--sep);
}
.specs dt { font-weight: 600; }
.specs dd { margin: 0; color: var(--label-2); }
.langs {
  max-width: var(--maxw); margin: 1.25rem auto 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem;
}
.langs li {
  display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  background: var(--tile); border-radius: var(--radius-card); padding: 1.25rem 1.5rem;
}
.langs__k { font-weight: 600; }
.langs__v { color: var(--label-2); }
.degrees { margin-top: 1rem; }
.degrees li { padding-block: 1.25rem; border-top: 1px solid var(--sep); }
.degrees li:first-child { border-top: 0; }
.degrees__t { font-size: 1.3125rem; line-height: 1.19; letter-spacing: var(--ls-eyebrow); }
.degrees__s { margin-top: 0.3rem; color: var(--label-2); }
.certs { margin-top: 1rem; }
.certs li {
  display: flex; align-items: center; gap: 0.8rem;
  padding-block: 0.85rem; border-top: 1px solid var(--sep); font-weight: 600;
}
.certs li:first-child { border-top: 0; }
.certs svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--ok); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tile__foot { margin-top: auto; padding-top: 1.25rem; color: var(--label-2); font-size: 0.875rem; line-height: 1.43; }
@media (max-width: 833px) {
  .duo, .langs { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .specs > div { grid-template-columns: minmax(0, 1fr); gap: 0.15rem; }
}

/* ---------- Contatti ---------- */
.contact { padding: clamp(6rem, 4rem + 8vw, 11rem) var(--gutter) var(--section-pad); text-align: center; }
.contact__inner { max-width: 62rem; margin: 0 auto; }
.contact__title {
  font-size: var(--t-contact); line-height: 1.05; letter-spacing: var(--ls-hero);
  margin: 0.6rem auto 0; max-width: 21ch;
}
.contact__text {
  font-size: var(--t-intro); line-height: 1.38; letter-spacing: var(--ls-lead);
  color: var(--label-2); max-width: 42ch; margin: 1.5rem auto 0;
}
.contact__ctas { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1.75rem; margin-top: 2.25rem; }
.contact__mail { margin-top: 1rem; font-size: 0.875rem; }
.contact__mail a { color: var(--label-2); }
.contact__mail a:hover { color: var(--label); text-decoration: underline; }
.wants {
  max-width: var(--maxw); margin: clamp(4rem, 3rem + 4vw, 6.5rem) auto 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; text-align: left;
}
.wants > div { background: var(--tile); border-radius: var(--radius-card); padding: 1.5rem 1.6rem; }
.wants dt { font-size: 0.875rem; font-weight: 600; color: var(--label-2); }
.wants dd { margin-top: 0.5rem; line-height: 1.42; }
@media (max-width: 833px) { .wants { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-alt); color: var(--label-2);
  font-size: 0.75rem; line-height: 1.33337; letter-spacing: var(--ls-small);
  padding: 1.1rem var(--gutter) calc(1.4rem + env(safe-area-inset-bottom));
}
.footer__inner { max-width: var(--maxw); margin: 0 auto; }
.footer__crumbs { display: flex; align-items: center; gap: 0.55rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--sep); }
.footer__crumbs a { color: var(--label); }
.footer__crumbs a:hover { text-decoration: underline; }
.footer__crumbs .chev { width: 8px; height: 8px; color: var(--label-3); }
.footer__cols {
  display: grid; grid-template-columns: repeat(4, minmax(0, 13rem)); gap: 1.25rem 3rem;
  padding-block: 1.25rem 1.5rem;
}
.footer__h { font-size: 0.75rem; font-weight: 600; color: var(--label); margin-bottom: 0.65rem; }
.footer__cols li { margin-bottom: 0.55rem; }
.footer__cols a:hover { color: var(--label); text-decoration: underline; }
.footer__legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem;
  padding-top: 1rem; border-top: 1px solid var(--sep);
}
.footer__right { display: flex; gap: 1.5rem; }
.footer__right a { color: var(--label); }
.footer__right a:hover { text-decoration: underline; }
@media (max-width: 733px) { .footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Comparsa allo scroll ---------- */
.js .reveal {
  opacity: 0; transform: translateY(32px);
  transition: opacity 0.9s var(--ease-out), transform 1.1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Animazioni guidate dallo scroll ----------
   Dove il browser le supporta (classe "sda", impostata nell'<head>),
   ritratto, testo del profilo e linea del percorso sono calcolati dal
   browser stesso, sul compositore: restano fluidi a 60 o 120 Hz anche
   se la pagina è impegnata. Altrimenti li muove site.js tramite --p. */
@media (prefers-reduced-motion: no-preference) {
  .sda .hero__media { view-timeline: --hero block; view-timeline-inset: 0px; }
  .sda .portrait, .sda .portrait__img {
    animation: portraitIn linear both;
    animation-timeline: --hero;
    animation-range: cover 0% cover 85vh;
  }
  .sda .portrait__img { animation-name: portraitImg; }

  .sda .statement__pin { view-timeline: --statement block; view-timeline-inset: 0px; }
  /* ogni parola ha il suo intervallo (animation-range scritto da site.js) */
  .sda .statement__text .w { animation: wordOn linear both; animation-timeline: --statement; }

  .sda .journey__track { view-timeline: --journey block; view-timeline-inset: 0px; }
  .sda .journey__line {
    animation: journeyLine linear both;
    animation-timeline: --journey;
    animation-range: cover 45vh cover calc(100% - 55vh);
  }
}
@keyframes portraitIn { from { transform: scale(0.9); } to { transform: none; } }
@keyframes portraitImg { from { transform: scale(1.1); } to { transform: none; } }
@keyframes wordOn { from { opacity: 0.16; } to { opacity: 1; } }
@keyframes journeyLine { from { transform: scaleY(0); } to { transform: none; } }

/* ---------- Riduci movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; transition-delay: 0s !important;
  }
  .js .hero__in, .js .reveal { opacity: 1; transform: none; animation: none; }
  .js .statement__pin { height: auto; }
  .js .statement__sticky { position: static; min-height: 0; padding-block: var(--section-pad); }
  .statement__pin { --p: 1 !important; }
  .hero__media { --p: 1 !important; }
  .journey__track { --p: 1 !important; }
  .badge__dot::after, .where__hint svg { animation: none; }
}

/* ---------- Colori forzati (Windows) ---------- */
@media (forced-colors: active) {
  .stat__value, .journey__year { background: none; -webkit-text-fill-color: CanvasText; color: CanvasText; }
  .btn, .paddle, .segmented button { border: 1px solid ButtonText; }
}

/* ---------- Stampa ---------- */
@media print {
  .nav, .menu, .skip, .where__viz, .where__hint, .gallery__controls, .hero__media { display: none !important; }
  .js .reveal, .js .hero__in { opacity: 1 !important; transform: none !important; }
  .js .statement__pin, .where.is-live .where__scroller { height: auto !important; }
  .js .statement__sticky, .where.is-live .where__sticky { position: static !important; height: auto !important; }
  .statement__text .w { opacity: 1 !important; }
  .section--dark, .where { background: #fff !important; color: #000 !important; }
  .gallery__track { display: block; overflow: visible; }
  .gcard { break-inside: avoid; margin-bottom: 1rem; }
  .app__stage { display: none !important; }
  .apps { display: block; }
  .app, .press, .craft { break-inside: avoid; margin-bottom: 1rem; }
  .press__source { background: none !important; color: #000 !important; padding-bottom: 0; }
  .press__kicker, .press__desc { color: #555 !important; }
  .press__mark { display: none; }
}

/* ---------- Senza JavaScript: niente controlli inerti ---------- */
.no-js .segmented, .no-js .gallery__controls, .no-js .nav__menu,
.no-js [data-action] { display: none; }
