/* =====================================================================
   ATRP — sistema di movimento e atmosfera di Los Angeles
   Caricato dopo styles.css. Anima solo transform, opacity e clip-path
   (più stroke-dashoffset su poche scie luminose). Tutto si spegne con
   prefers-reduced-motion.
   ===================================================================== */

:root {
  /* durate */
  --dur-xs: 120ms;
  --dur-s: 220ms;
  --dur-m: 420ms;
  --dur-l: 720ms;
  --dur-xl: 1100ms;
  /* easing */
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-in: cubic-bezier(.55, 0, 1, .45);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  /* distanze */
  --rise: 22px;
  /* header */
  --header-h: 78px;
  --header-h-s: 62px;
  --sea: #030915;
}

html { background: var(--navy); }

/* ---------------------------------------------------------------- transizioni tra pagine
   View Transitions tra documenti (Chrome/Edge 126+, Safari 18.2+). Altrove la navigazione
   resta istantanea. L'header è escluso: non si anima a ogni cambio pagina. */
@view-transition { navigation: auto; }
.site-header { view-transition-name: site-header; }
main { view-transition-name: page; }
::view-transition-group(site-header) { animation: none; }
::view-transition-old(site-header) { display: none; }
::view-transition-new(site-header) { animation: none; }
::view-transition-group(page) { animation: none; }
::view-transition-old(page) { animation: vt-out var(--dur-s) var(--ease-in) both; }
::view-transition-new(page) { animation: vt-in var(--dur-m) var(--ease-out) both; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: var(--dur-s); }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  transition: background var(--dur-m) var(--ease-out), border-color var(--dur-m), box-shadow var(--dur-m), backdrop-filter var(--dur-m);
}
.header-inner { transition: height var(--dur-m) var(--ease-out); }
.site-header.is-scrolled { background: rgba(6, 13, 26, .9); box-shadow: 0 12px 34px rgba(0, 0, 0, .35); }
.site-header.is-scrolled .header-inner { height: var(--header-h-s); }
.brand-logo { transition: transform var(--dur-m) var(--ease-out); }
.site-header.is-scrolled .brand-logo { transform: scale(.88); }
.page-home .site-header:not(.is-scrolled):not(:has(#nav-mobile:not([hidden]))) {
  background: linear-gradient(180deg, rgba(3, 9, 21, .55), rgba(3, 9, 21, 0));
  border-bottom-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
}
.devbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; }

/* sottolineatura animata */
.nav-link { position: relative; }
.nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 5px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--blue), #7fd0ff); transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur-m) var(--ease-out), opacity var(--dur-s);
  opacity: .7;
}
.has-menu > .nav-link::after { right: 34px; }
.nav-link:hover::after, .has-menu:hover > .nav-link::after, .has-menu.open > .nav-link::after { transform: scaleX(1); }
.nav-link.is-active { box-shadow: none; }
.nav-link.is-active::after { transform: scaleX(1); opacity: 1; }
.menu a { transition: background var(--dur-s), transform var(--dur-s) var(--ease-out); }
.menu a:hover { transform: translateX(3px); }
.has-menu:hover > .menu a, .has-menu.open > .menu a { animation: item-in var(--dur-m) var(--ease-out) both; }
.menu a:nth-child(2) { animation-delay: 25ms !important; } .menu a:nth-child(3) { animation-delay: 50ms !important; }
.menu a:nth-child(4) { animation-delay: 75ms !important; } .menu a:nth-child(5) { animation-delay: 100ms !important; }
.menu a:nth-child(6) { animation-delay: 125ms !important; } .menu a:nth-child(7) { animation-delay: 150ms !important; }
@keyframes item-in { from { opacity: 0; transform: translateY(-4px); } }

/* menu mobile: apertura e chiusura */
.nav-mobile:not([hidden]) { animation: menu-in var(--dur-m) var(--ease-out) both; }
.nav-mobile.is-closing { animation: menu-out 200ms var(--ease-in) both; }
.nav-mobile:not([hidden]):not(.is-closing) nav > * { animation: item-in var(--dur-m) var(--ease-out) both; }
.nav-mobile nav > :nth-child(2) { animation-delay: 30ms; } .nav-mobile nav > :nth-child(3) { animation-delay: 60ms; }
.nav-mobile nav > :nth-child(4) { animation-delay: 90ms; } .nav-mobile nav > :nth-child(5) { animation-delay: 120ms; }
.nav-mobile nav > :nth-child(6) { animation-delay: 150ms; } .nav-mobile nav > :nth-child(7) { animation-delay: 180ms; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes menu-out { to { opacity: 0; transform: translateY(-10px); } }
.nav-toggle { transition: background var(--dur-s), border-color var(--dur-s), transform var(--dur-xs); }
.nav-toggle:active { transform: scale(.94); }
.nav-toggle[aria-expanded="true"] { background: rgba(27, 151, 227, .16); border-color: var(--blue-300); }

/* avanzamento dello scroll (solo dove supportato nativamente, senza JS) */
.scroll-progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--blue), #7fd0ff); transform: scaleX(0); transform-origin: 0 50%; opacity: 0; pointer-events: none; }
@supports (animation-timeline: scroll()) {
  .scroll-progress { opacity: .9; animation: progress linear both; animation-timeline: scroll(root block); }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ---------------------------------------------------------------- pulsanti */
.btn:active { transform: translateY(0) scale(.97); transition-duration: 80ms; }
.btn-primary { position: relative; overflow: hidden; isolation: isolate; }
.btn-primary::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .28) 50%, transparent 70%);
  transform: translateX(-120%); transition: transform 700ms var(--ease-out);
}
.btn-primary:hover::after { transform: translateX(120%); }
.btn .icon { transition: transform var(--dur-s) var(--ease-out); }

/* ---------------------------------------------------------------- scene */
.scene { position: absolute; inset: 0; z-index: -1; overflow: hidden; background: var(--sea); pointer-events: none; }
.scene-stage { position: absolute; inset: -6% 0 0 0; will-change: transform; }
.scene-layer { position: absolute; inset: 0; will-change: transform; }
.scene-photo { width: 100%; height: 100%; object-fit: cover; animation: kenburns 38s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.12) translate(-1.5%, -1%); } }
.scene-shade { position: absolute; inset: 0; }
.scene-tag {
  position: absolute; right: max(20px, calc((100% - 1200px) / 2)); bottom: 18px; margin: 0;
  display: flex; gap: 12px; align-items: center; font: 600 .7rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: .14em; text-transform: uppercase; color: rgba(207, 234, 255, .72);
}
.scene-tag span:first-child::after { content: ""; display: inline-block; width: 28px; height: 1px; margin-left: 12px; vertical-align: middle; background: rgba(127, 208, 255, .6); }
.scene-credit { position: absolute; left: 12px; bottom: 8px; margin: 0; font-size: .68rem; color: rgba(255, 255, 255, .6); }

/* Tela della scena: rapporto 2:1, copre il contenitore ancorata in basso (come "cover"). */
.scene-stage { container-type: size; }
.scene-canvas { position: absolute; left: 50%; bottom: 0; width: max(100cqw, 200cqh); aspect-ratio: 2 / 1; transform: translateX(-50%); }
.scene-static { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }

/* Livelli animati: solo transform/opacity sull'elemento, nessun ridisegno della scena. */
.fx { position: absolute; display: block; max-width: none; pointer-events: none; overflow: visible; }
.fx-twinkle { animation: twinkle 8s ease-in-out infinite; }
.fx-t2 { animation-duration: 10s; animation-delay: -3s; }
.fx-t3 { animation-duration: 12s; animation-delay: -6s; }
@keyframes twinkle { 0%, 100% { opacity: .7; } 50% { opacity: .18; } }
.fx-water { animation: water 16s ease-in-out infinite alternate; }
@keyframes water { from { transform: translateX(-1.2%); } to { transform: translateX(1.2%); } }
.fx-wheel { transform-origin: 50% 50%; animation: wheel 80s linear infinite; }
@keyframes wheel { to { transform: rotate(360deg); } }
.fx-bob { animation: bob 6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5%); } }
.fx-beacon { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px 4px rgba(255, 255, 255, .3); animation: beacon 3.6s ease-in-out infinite; }
@keyframes beacon { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.fx-glow { border-radius: 50%; background: radial-gradient(closest-side, rgba(27, 151, 227, .4), rgba(27, 151, 227, 0)); animation: drift 26s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translateX(-8%) scale(1); } to { transform: translateX(8%) scale(1.08); } }
.fx-lane { left: 0; width: 100%; height: .4%; overflow: hidden; }
.fx-trail { position: absolute; inset: 0; animation: trail-r 12s linear infinite; }
.fx-trail i { position: absolute; left: 0; top: 0; height: 100%; width: var(--len); border-radius: 9px; background: linear-gradient(90deg, transparent, var(--c)); }
.fx-trail-l { animation-name: trail-l; }
.fx-trail-l i { background: linear-gradient(90deg, var(--c), transparent); }
@keyframes trail-r { from { transform: translateX(-16%); } to { transform: translateX(100%); } }
@keyframes trail-l { from { transform: translateX(100%); } to { transform: translateX(-16%); } }
.fx-path { height: .45%; transform-origin: 0 50%; overflow: hidden; }
.fx-flow { position: absolute; inset: 0; animation: flow 8s linear infinite; }
.fx-flow::before { content: ""; position: absolute; left: 0; top: 0; height: 100%; width: 6%; border-radius: 9px; background: linear-gradient(90deg, transparent, var(--c)); }
@keyframes flow { from { transform: translateX(-6%); } to { transform: translateX(100%); } }
.scene.is-paused .fx, .scene.is-paused .fx * { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- hero homepage */
.hero.hero-cine {
  min-height: clamp(620px, 94vh, 900px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 20px) 0 22px; background: var(--sea);
}
.hero-cine .scene-stage { inset: -4% 0 -2% 0; animation: scene-in 1.8s var(--ease-out) both; }
@keyframes scene-in { from { opacity: .25; transform: scale(1.04); } }
.hero-cine .scene-shade {
  background:
    linear-gradient(90deg, rgba(3, 9, 21, .94) 0%, rgba(3, 9, 21, .78) 30%, rgba(3, 9, 21, .28) 62%, rgba(3, 9, 21, .05) 100%),
    linear-gradient(0deg, var(--navy) 0%, rgba(10, 18, 32, 0) 13%),
    linear-gradient(180deg, rgba(3, 9, 21, .6) 0%, rgba(3, 9, 21, 0) 22%);
}
.hero-inner { position: relative; }
.hero-cine .hero-copy { max-width: 640px; }
.hero-cine h1 { font-size: clamp(2.6rem, 5.4vw, 4.6rem); letter-spacing: -.02em; text-shadow: 0 6px 40px rgba(0, 0, 0, .45); }
.hero-cine .hero-text { color: #c9d8e8; max-width: 54ch; }
.hero-cine .hero-headline { font-size: clamp(1.3rem, 2.2vw, 1.75rem); margin-bottom: 14px; }
.hero-cine .hero-actions { margin: 22px 0 22px; }
.hero-in { animation: rise var(--dur-l) var(--ease-out) both; animation-delay: calc(var(--d, 0) * 90ms + 60ms); }
@keyframes rise { from { opacity: 0; transform: translateY(var(--rise)); } }
.hero-cine .code-box { background: rgba(6, 22, 42, .62); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }

.hero-hud {
  position: relative; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
  margin-top: clamp(24px, 4vh, 44px); padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12);
}
.hud { margin: 0; display: flex; flex-wrap: wrap; gap: 14px 36px; }
.hud > div { display: grid; gap: 2px; }
.hud dt { font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.hud dd { margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--white); }
.hud-route { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.route-sign {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 34px; height: 36px;
  border: 2px solid var(--white); border-radius: 6px 6px 14px 14px; color: var(--white);
  font-size: .5rem; letter-spacing: .1em; line-height: 1;
}
.route-sign b { font-family: var(--font-display); font-size: 1.05rem; letter-spacing: 0; }
.hud-coords dd { font: 600 .9rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .06em; color: #cfeaff; }
.scroll-cue { display: inline-flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; }
.scroll-cue i { position: relative; width: 1px; height: 42px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.scroll-cue i::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--blue-300); animation: cue 2.2s var(--ease-in-out) infinite; }
.scroll-cue:hover { color: var(--white); }
@keyframes cue { to { top: 100%; } }

/* ---------------------------------------------------------------- intestazioni delle pagine interne */
.page-hero { padding-top: calc(var(--header-h) + clamp(28px, 4vw, 52px)); }
.page-hero.has-scene {
  overflow: hidden; isolation: isolate; background: var(--sea); border-bottom: 0;
  min-height: clamp(360px, 52vh, 500px); display: flex; flex-direction: column; justify-content: flex-end;
  padding-bottom: clamp(48px, 6vw, 76px);
}
.page-hero.has-scene > .container { position: relative; }
.page-hero .scene-shade {
  background:
    linear-gradient(90deg, rgba(3, 9, 21, .92) 0%, rgba(3, 9, 21, .66) 42%, rgba(3, 9, 21, .2) 100%),
    linear-gradient(0deg, var(--navy) 0%, rgba(10, 18, 32, 0) 38%),
    linear-gradient(180deg, rgba(3, 9, 21, .55) 0%, rgba(3, 9, 21, 0) 30%);
}
.page-hero .breadcrumb, .page-hero .eyebrow, .page-hero h1, .page-hero .lead, .page-hero-aside { animation: rise var(--dur-l) var(--ease-out) both; }
.page-hero .eyebrow { animation-delay: 60ms; }
.page-hero h1 { animation-delay: 120ms; }
.page-hero .lead { animation-delay: 200ms; }
.page-hero-aside { animation-delay: 260ms; }
.page-hero .scene-stage { animation: scene-in 1.4s var(--ease-out) both; }

/* sezione con scena ambientale (homepage: lungomare) */
.section-scenic { position: relative; isolation: isolate; overflow: hidden; background: var(--sea); }
.section-scenic .scene-stage { inset: 0; }
.section-scenic .scene-shade {
  background:
    linear-gradient(90deg, rgba(3, 9, 21, .94) 0%, rgba(3, 9, 21, .7) 50%, rgba(3, 9, 21, .35) 100%),
    linear-gradient(180deg, var(--navy) 0%, rgba(10, 18, 32, 0) 30%, rgba(10, 18, 32, 0) 70%, var(--navy) 100%);
}
.section-scenic .facts > div { background: rgba(14, 27, 46, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
@media (max-width: 900px) { .section-scenic .scene-shade { background: linear-gradient(180deg, var(--navy) 0%, rgba(3, 9, 21, .78) 25%, rgba(3, 9, 21, .78) 75%, var(--navy) 100%); } }

/* separatori tra sezioni: una linea d'orizzonte blu */
.section-alt { position: relative; }
.section-alt::before {
  content: ""; position: absolute; top: -1px; left: 50%; width: min(720px, 72%); height: 1px; transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, rgba(27, 151, 227, .85), transparent);
}

/* ---------------------------------------------------------------- comparsa allo scroll */
.reveal {
  opacity: 0; translate: 0 var(--rise);
  transition: opacity var(--dur-l) var(--ease-out), translate var(--dur-l) var(--ease-out);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.reveal.is-in { opacity: 1; translate: 0 0; }
.reveal-mask { clip-path: inset(0 0 100% 0 round 22px); transition: clip-path var(--dur-xl) var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal-mask.is-in { clip-path: inset(0 0 0 0 round 22px); }

/* ---------------------------------------------------------------- card */
.hub-card, .stat-card, .join-step, .rule-card, .found-chip, .check-list li, .competency-list li {
  transition: transform var(--dur-m) var(--ease-out), border-color var(--dur-m), box-shadow var(--dur-m), background var(--dur-m);
}
@media (hover: hover) {
  .hub-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
  .hub-card:hover .hub-icon { transform: rotate(-6deg) scale(1.06); }
  .rule-card:hover, .join-step:hover { border-color: rgba(27, 151, 227, .45); background: linear-gradient(180deg, rgba(27, 151, 227, .07), var(--panel)); }
  .found-chip:hover { transform: translateY(-3px); border-color: rgba(27, 151, 227, .5); }
  .stat-card:hover { border-color: rgba(27, 151, 227, .4); box-shadow: 0 16px 40px rgba(0, 0, 0, .3); }
  .competency-list li:hover, .check-list li:hover { border-color: rgba(27, 151, 227, .4); transform: translateX(3px); }
}
.hub-icon { transition: transform var(--dur-m) var(--ease-out); }
.hub-card:active, .dept-card:active, .product-card:active, .found-chip:active { transform: translateY(-1px) scale(.992); transition-duration: 90ms; }

.dept-card { transition: transform var(--dur-m) var(--ease-out), border-color var(--dur-m), box-shadow var(--dur-m); }
.dept-card-art .art-inner { display: block; width: 100%; height: 100%; transition: transform 900ms var(--ease-out); }
.dept-card-art svg { transition: none; }
.dept-card:hover .dept-card-art svg { transform: none; }
.dept-card:hover .dept-card-art .art-inner { transform: scale(1.06); }
.dept-card .dept-badge { transition: transform var(--dur-m) var(--ease-out), background var(--dur-m); }
.dept-card:hover .dept-badge { transform: translateY(-2px); background: rgba(27, 151, 227, .85); }

.step-card a { transition: transform var(--dur-m) var(--ease-out), border-color var(--dur-m), box-shadow var(--dur-m); }
.step-card a:active { transform: scale(.99); }

/* ---------------------------------------------------------------- dipartimenti: pagina editoriale */
.dept-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.dept-index { position: sticky; top: calc(var(--header-h-s) + 32px); }
.dept-index-label { margin: 0 0 12px; font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--blue-300); font-weight: 800; }
.dept-index ul { list-style: none; display: grid; gap: 2px; border-left: 1px solid var(--line-strong); }
.dept-index a {
  display: grid; gap: 1px; padding: 9px 14px; margin-left: -1px; border-left: 2px solid transparent; text-decoration: none; color: var(--muted);
  transition: color var(--dur-s), border-color var(--dur-m), background var(--dur-m);
}
.dept-index a strong { font-family: var(--font-display); font-size: 1.2rem; color: inherit; letter-spacing: .03em; }
.dept-index a span { font-size: .74rem; line-height: 1.3; }
.dept-index a:hover { color: var(--white); }
.dept-index a.is-current { color: var(--white); border-left-color: var(--blue); background: linear-gradient(90deg, rgba(27, 151, 227, .16), transparent); }
.dept-features .dept-feature { scroll-margin-top: calc(var(--header-h-s) + 24px); }
.dept-feature-art .art-inner, .dept-detail-art .art-inner { display: block; width: 100%; height: 100%; transform: scale(1.06); will-change: transform; }
.dept-feature-art { transition: box-shadow var(--dur-m), border-color var(--dur-m); }
.dept-feature:hover .dept-feature-art { border-color: rgba(127, 208, 255, .5); box-shadow: 0 30px 70px rgba(0, 0, 0, .45), 0 0 0 6px rgba(27, 151, 227, .08); }
.dept-feature .btn-primary .icon { transition: transform var(--dur-m) var(--ease-out); }
.dept-feature .btn-primary:hover .icon { transform: translateX(6px); }

/* ---------------------------------------------------------------- Fondazione */
.profile { transition: transform var(--dur-m) var(--ease-out), border-color var(--dur-m), box-shadow var(--dur-m); }
.profile-avatar { transition: transform var(--dur-l) var(--ease-out), box-shadow var(--dur-l) var(--ease-out); }
@media (hover: hover) {
  .profile:hover { box-shadow: 0 26px 60px rgba(0, 0, 0, .4); }
  .profile:hover .profile-avatar { transform: scale(1.05); box-shadow: 0 0 0 6px rgba(27, 151, 227, .22), 0 0 44px rgba(27, 151, 227, .45); }
}
.profile.is-big::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(120deg, transparent 35%, rgba(127, 208, 255, .22) 50%, transparent 65%) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  border: 1px solid transparent; background-size: 250% 100%; animation: sheen 7s ease-in-out infinite;
}
@keyframes sheen { 0%, 100% { background-position: 120% 0; } 50% { background-position: -20% 0; } }
.tier-connector { transform-origin: top; }
.tier-connector.reveal { translate: none; transform: scaleY(0); transition: transform var(--dur-l) var(--ease-out), opacity var(--dur-m); }
.tier-connector.reveal.is-in { transform: scaleY(1); }

/* ---------------------------------------------------------------- statistiche */
.stat-value [data-bind] { display: inline-block; font-variant-numeric: tabular-nums; }
.stat-value .is-bumped { animation: bump 1.1s var(--ease-out); }
@keyframes bump { 0% { color: #7fd0ff; text-shadow: 0 0 28px rgba(27, 151, 227, .7); } 100% { color: inherit; text-shadow: none; } }
.stat-card { transition: border-color var(--dur-l), box-shadow var(--dur-l), transform var(--dur-m); }
.stat-card[data-state="ok"]::before { background: linear-gradient(90deg, var(--blue), var(--ok)); }
.stat-card::before { transition: background var(--dur-l); }
.badge, .session-pill, .stats-bar { transition: background var(--dur-l), color var(--dur-l), border-color var(--dur-l); }
.stat-value { transition: opacity var(--dur-l), color var(--dur-l); }
.session-pill { align-items: center; gap: 7px; }
.session-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.session-pill[data-s="active"]::before { animation: pulse-dot 2s ease-out infinite; }
@keyframes pulse-dot { 0% { box-shadow: 0 0 0 0 rgba(61, 220, 151, .55); } 70% { box-shadow: 0 0 0 7px rgba(61, 220, 151, 0); } 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0); } }
.capacity { display: grid; gap: 6px; }
.capacity[hidden] { display: none; }
.capacity-label { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 800; }
.capacity-track { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.capacity-fill { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #7fd0ff); transform: scaleX(var(--fill, 0)); transform-origin: left center; transition: transform 1.1s var(--ease-out); }
.stat-msg { animation: rise var(--dur-m) var(--ease-out) both; }
.copy-btn .copy-done { animation: pop var(--dur-m) var(--ease-out); }
.copy-btn.is-copied { background: rgba(61, 220, 151, .12); }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: none; } }

/* ---------------------------------------------------------------- shop */
.product-card { transition: transform var(--dur-m) var(--ease-out), border-color var(--dur-m), box-shadow var(--dur-m), opacity var(--dur-s); }
.product-card.is-leaving, .product-card.is-entering { opacity: 0; transform: translateY(8px) scale(.98); }
.product-media { overflow: hidden; isolation: isolate; }
.product-media::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(240px 160px at 50% 60%, rgba(27, 151, 227, .35), transparent 70%);
  opacity: .6; transition: opacity var(--dur-l), transform var(--dur-l) var(--ease-out);
}
.product-media::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, .12) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform 900ms var(--ease-out);
}
.product-logo { transition: transform var(--dur-l) var(--ease-out), filter var(--dur-l); }
@media (hover: hover) {
  .product-card:hover { box-shadow: 0 24px 54px rgba(0, 0, 0, .4); }
  .product-card:hover .product-media::before { opacity: 1; transform: scale(1.15); }
  .product-card:hover .product-media::after { transform: translateX(120%); }
  .product-card:hover .product-logo { transform: translateY(-6px) scale(1.05); filter: drop-shadow(0 10px 26px rgba(27, 151, 227, .7)); }
}
.product-foot .btn:hover .icon { transform: translate(2px, -2px); }
.perk-list li { transition: transform var(--dur-s) var(--ease-out); }
.product-card:hover .perk-list li { transform: translateX(2px); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .dept-layout { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .dept-index {
    position: sticky; top: var(--header-h-s); z-index: 20; margin: 0 -20px; padding: 10px 20px;
    background: rgba(6, 13, 26, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line);
  }
  .dept-index-label { display: none; }
  .dept-index ul { display: flex; gap: 6px; overflow-x: auto; border-left: 0; scrollbar-width: none; }
  .dept-index ul::-webkit-scrollbar { display: none; }
  .dept-index a { border-left: 0; margin-left: 0; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line-strong); white-space: nowrap; }
  .dept-index a strong { font-size: 1rem; }
  .dept-index a span { display: none; }
  .dept-index a.is-current { background: rgba(27, 151, 227, .2); border-color: var(--blue); }
  .dept-features .dept-feature { scroll-margin-top: calc(var(--header-h-s) + 70px); }
}
@media (max-width: 900px) {
  /* su schermi stretti la scena diventa una fascia in alto e il testo scorre sotto */
  .hero.hero-cine { min-height: auto; padding-top: calc(var(--header-h) + min(34vh, 250px)); background: var(--navy); }
  .hero-cine .scene { bottom: auto; height: calc(var(--header-h) + min(52vh, 380px)); }
  .hero-cine .scene-shade {
    background: linear-gradient(0deg, var(--navy) 0%, rgba(10, 18, 32, .6) 30%, rgba(3, 9, 21, 0) 60%, rgba(3, 9, 21, .55) 100%);
  }
  .hero-hud { flex-direction: column; align-items: flex-start; }
  .scroll-cue { display: none; }
  .page-hero .scene-shade { background: linear-gradient(0deg, var(--navy) 0%, rgba(3, 9, 21, .82) 45%, rgba(3, 9, 21, .55) 100%); }
  .scene-tag { right: 20px; }
}
@media (max-width: 640px) {
  :root { --header-h: 66px; --header-h-s: 58px; }
  .hud { gap: 12px 24px; }
  .hud-coords { display: none; }
  .scene-tag span:first-child::after { width: 14px; }
  .page-hero.has-scene { min-height: 300px; }
  .dept-index { margin: 0 -16px; padding: 10px 16px; }
}

/* ---------------------------------------------------------------- movimento ridotto */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  .reveal, .reveal-mask { opacity: 1; translate: none; clip-path: none; }
  ::view-transition-old(page), ::view-transition-new(page), ::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }
  .scroll-progress { display: none; }
}
@media (max-width: 640px) {
  .scene-tag { left: 16px; right: 16px; justify-content: flex-end; white-space: nowrap; bottom: 12px; font-size: .62rem; }
  .scene-tag span:first-child { display: none; }
}
/* mobile: meno movimento decorativo, restano acqua, ruota e scie dei fari */
@media (max-width: 640px) {
  .fx-glow, .fx-bob, .fx-twinkle, .fx-beacon { animation: none; }
}
