#film {
  position: relative;
  height: 100svh;
  min-height: 420px;
  overflow: hidden;
  background: var(--ink);
  isolation: isolate;
}
.film-bg {
  position: absolute; inset: 0; z-index: -2;
  --aura: .6;
  background: radial-gradient(56% 62% at 50% 44%, #2f0b0a, #18101a 54%, var(--ink) 100%);
}
.film-bg::after {
  content: ""; position: absolute; inset: 0;
  opacity: var(--aura);
  background:
    radial-gradient(40% 44% at 50% 46%, rgba(255, 42, 26, .24), transparent 72%),
    radial-gradient(60% 50% at 10% 100%, rgba(40, 54, 110, .4), transparent 72%);
}
#film-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.thread-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.thread-svg path { fill: none; stroke: var(--red); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 7px rgba(255, 42, 26, .9)); }

.film-wipe {
  position: absolute; top: -10%; bottom: -10%; left: 0; width: 70%; z-index: 6;
  background: linear-gradient(100deg, #6e0d07 0%, #e8180c 34%, #ff5c44 50%, #d9140a 66%, #5b0a05 100%);
  transform: translateX(-140%) skewX(-18deg);
  visibility: hidden;
  pointer-events: none;
}

.beat {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 84px var(--gutter) 56px;
  opacity: 0;
  visibility: hidden;
}
.beat-inner { width: 100%; will-change: transform; }
.beat .display, .beat .title, .beat .sub { text-shadow: 0 2px 28px rgba(8, 8, 14, .6); }
.beat em { text-shadow: var(--glow-red); }

/* Problema */
.b-problem { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .6fr); gap: clamp(20px, 5vw, 80px); align-items: center; max-width: 1240px; margin: auto; }
.b-problem .title { margin-top: .32em; }
.counter { margin-top: .7em; display: flex; align-items: baseline; gap: .4em; }
.counter b { font-size: clamp(2.6rem, 5.4vw, 5.2rem); font-weight: 560; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.counter b.is-late { color: var(--red); text-shadow: var(--glow-red); }
.counter span { color: var(--grey); }
.stat { margin-top: 1.1em; max-width: 34em; opacity: 0; font-size: clamp(1rem, 1.35vw, 1.25rem); line-height: 1.3; }
.stat b { color: var(--red); font-weight: 650; font-size: 1.3em; }
.stat small { display: block; margin-top: .45em; font-size: .74em; color: var(--grey); }
.b-problem-device { width: min(100%, 250px); justify-self: center; }

/* Prima / Dopo */
.b-compare { display: flex; flex-direction: column; align-items: center; gap: clamp(10px, 2vh, 20px); }
.b-compare-head { text-align: center; }
.b-compare-head .title { font-size: clamp(1.8rem, 3.6vw, 3.4rem); margin-top: .25em; }
.compare {
  position: relative; --split: 25%;
  width: min(56vw, 760px, calc((100svh - 372px) * 1.6));
  min-width: min(100%, 280px);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  touch-action: pan-y;
}
.compare-pane { position: absolute; inset: 0; border-radius: 12px; overflow: hidden; }
.compare-pane .mk, .compare-pane .mk-flat, .compare-pane > div { height: 100%; }
.is-after { clip-path: inset(0 0 0 var(--split)); }
.compare-label {
  position: absolute; bottom: 10px; padding: .32em .7em; font-size: .68rem; font-weight: 700; letter-spacing: .14em;
  background: rgba(10, 10, 16, .82); border: 1px solid rgba(255, 255, 255, .24); border-radius: 5px; pointer-events: none;
}
.is-before-label { left: 10px; }
.is-after-label { right: 10px; border-color: rgba(255, 42, 26, .9); box-shadow: 0 0 14px rgba(255, 42, 26, .4); }
.compare-handle {
  position: absolute; top: -8px; bottom: -8px; left: var(--split);
  width: 44px; margin-left: -22px;
  display: flex; justify-content: center; cursor: ew-resize;
  touch-action: none;
}
.compare-handle::before {
  content: ""; width: 3px; background: linear-gradient(#ffb5a4, var(--red), #ffb5a4);
  box-shadow: 0 0 16px 2px rgba(255, 42, 26, .95), 0 0 44px rgba(255, 42, 26, .5);
  border-radius: 3px;
}
.compare-handle i {
  position: absolute; top: 50%; width: 34px; height: 34px; margin-top: -17px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 22px rgba(255, 42, 26, .9), inset 0 0 8px rgba(255, 255, 255, .4);
  transition: transform .2s var(--ease-out);
}
.compare-handle i::before {
  content: "‹ ›"; position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 15px; font-style: normal; font-weight: 700; color: #fff;
}
.compare-handle:hover i, .is-dragging .compare-handle i { transform: scale(1.14); }
.compare-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.compare-play i { display: inline-block; width: .62em; height: .72em; margin-right: .5em; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); }
.compare-play[aria-pressed="true"] i { clip-path: none; height: .62em; }
.compare-tabs button {
  padding: .5em 1em; font-size: .82rem; font-weight: 560;
  border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; color: var(--grey);
  min-height: 38px; transition: color .2s, border-color .2s, background .2s;
}
.compare-tabs button:hover { color: var(--white); }
.compare-tabs [aria-pressed="true"] { color: #fff; border-color: rgba(255, 42, 26, .85); background: rgba(255, 42, 26, .14); }

/* Per chi */
.b-audience { text-align: center; display: flex; flex-direction: column; align-items: center; }
.a-final { margin-top: .08em; opacity: 0; }
.a-choose { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: clamp(18px, 4vh, 42px); opacity: 0; }
.a-choose button {
  min-height: 46px; padding: .7em 1.4em; font-size: clamp(.92rem, 1.2vw, 1.05rem); font-weight: 580;
  border: 1px solid rgba(255, 255, 255, .24); border-radius: 10px; background: rgba(12, 12, 20, .55);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.a-choose button:hover { border-color: var(--red-soft); }
.a-choose [aria-pressed="true"] { border-color: var(--red); background: rgba(255, 42, 26, .2); box-shadow: 0 0 26px rgba(255, 42, 26, .42); }

/* Processo */
.b-process-tag { position: absolute; left: var(--gutter); top: 88px; }
.b-process { position: absolute; inset: 0; pointer-events: none; }
.node { position: absolute; left: 0; top: 0; width: min(440px, 84vw); visibility: hidden; opacity: 0; will-change: transform; }
.node h3 { font-size: clamp(3rem, 6.4vw, 6.6rem); font-weight: 560; letter-spacing: -.035em; line-height: 1; color: var(--red); text-shadow: var(--glow-red); }
.node p { margin-top: .5em; font-size: clamp(1.02rem, 1.5vw, 1.34rem); color: var(--white); opacity: .9; text-shadow: 0 1px 18px rgba(8, 8, 14, .85); }
.node-mock { margin-top: 1em; width: min(100%, 360px); }

/* Prezzi */
.b-pricing { text-align: center; display: flex; flex-direction: column; align-items: center; }
.b-pricing .title { margin-top: .32em; max-width: 15em; }
.ruler {
  position: relative; width: min(760px, 86vw); height: 22px; margin: clamp(18px, 4vh, 42px) 0;
  background: var(--ruler-ticks);
}
.ruler i { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--red); box-shadow: 0 0 12px rgba(255, 42, 26, .9); transform: scaleX(0); transform-origin: left; }
.b-pricing-sub { font-size: clamp(1.9rem, 4.6vw, 4.6rem); opacity: 0; }

/* Qualità */
.b-quality { max-width: 1240px; margin: auto; }
.b-quality .display { opacity: 0; }
.b-quality .sub { margin-top: 1em; opacity: 0; }

/* Chi siamo */
.b-team-tag { position: absolute; left: 0; right: 0; top: 92px; text-align: center; }
.b-team { display: flex; justify-content: space-between; gap: 20px; max-width: 1240px; margin: auto; }
.person { opacity: 0; }
.person[data-person="m"] { text-align: right; }
.person h3 { font-size: clamp(1.7rem, 3.5vw, 3.5rem); font-weight: 560; letter-spacing: -.025em; line-height: 1.05; text-shadow: 0 2px 26px rgba(8, 8, 14, .8); max-width: 7em; }
.person p { margin-top: .5em; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--red-soft); font-weight: 600; }

/* Incrocio finale */
.b-cross { position: relative; text-align: center; opacity: 0; }
[data-beat="cross"] { padding: 0; }
#film .wordmark { font-size: min(15.5vw, 26vh); }
/* Argento semplice per chi non ha la grafica 3D; con la grafica il metallo vero sta nella tela. */
#film .wm-part, #contatto .wm-part {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, #cdd2dc 42%, #5f6571 52%, #eceef3 62%, #a4aab6 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
#film .is-chrome .wm-part, #contatto .is-chrome .wm-part { background: none; }
.film-chrome { position: absolute; display: block; pointer-events: none; }
/* Allo scontro le lettere vengono sbalzate dentro dai lati e la scritta trema. */
.is-struck .wordmark { animation: wm-shake .55s linear both; }
.is-struck .wm-part:first-child { animation: wm-slam-left .68s cubic-bezier(.12, .9, .2, 1) both; }
.is-struck .wm-part:last-child { animation: wm-slam-right .68s cubic-bezier(.12, .9, .2, 1) both; }
.is-struck .hero-agency { animation: agency-in 1.2s var(--ease-out) .32s both; }
@keyframes wm-slam-left {
  0% { opacity: 0; transform: translateX(-.62em) scale(1.3); filter: blur(12px); text-shadow: 0 0 60px #fff; }
  34% { opacity: 1; transform: translateX(.05em) scale(.97); filter: blur(0); text-shadow: 0 0 34px #fff, 0 0 90px var(--red); }
  100% { opacity: 1; transform: none; filter: blur(0); text-shadow: 0 0 0 transparent; }
}
@keyframes wm-slam-right {
  0% { opacity: 0; transform: translateX(.62em) scale(1.3); filter: blur(12px); text-shadow: 0 0 60px #fff; }
  34% { opacity: 1; transform: translateX(-.05em) scale(.97); filter: blur(0); text-shadow: 0 0 34px #fff, 0 0 90px var(--red); }
  100% { opacity: 1; transform: none; filter: blur(0); text-shadow: 0 0 0 transparent; }
}
@keyframes wm-shake {
  0%, 100% { transform: none; }
  12% { transform: translate(.012em, -.016em); }
  26% { transform: translate(-.014em, .01em); }
  42% { transform: translate(.009em, .008em); }
  60% { transform: translate(-.005em, -.005em); }
  80% { transform: translate(.002em, .002em); }
}

@media (max-width: 860px) {
  .b-problem { grid-template-columns: 1fr; gap: 14px; text-align: left; }
  .b-problem-device { width: min(34vw, 150px, 20svh); justify-self: start; order: -1; }
  .counter b { font-size: 2.4rem; }
  .compare { width: min(100%, calc((100svh - 350px) * 1.6)); }
  .b-team { flex-direction: column; gap: 40svh; align-items: stretch; }
  .person, .person[data-person="m"] { text-align: center; }
  .person h3 { max-width: none; }
  .b-process-tag { top: 76px; }
  #film .wordmark { font-size: min(25vw, 26vh); }
}

/* Con reduced motion o senza JS il film diventa una pagina che si legge dall'alto in basso */
.rm #film, html:not(.js) #film { height: auto; overflow: visible; }
.rm #film-canvas, .rm .film-wipe, html:not(.js) #film-canvas, html:not(.js) .film-wipe { display: none; }
.rm .beat, html:not(.js) .beat { position: relative; inset: auto; opacity: 1; visibility: visible; min-height: 80vh; }
.rm .a-final, .rm .a-choose, .rm .stat, .rm .b-pricing-sub, .rm .b-quality .display, .rm .b-quality .sub, .rm .person, .rm .b-cross,
html:not(.js) .a-final, html:not(.js) .stat, html:not(.js) .b-pricing-sub, html:not(.js) .b-quality .display, html:not(.js) .b-quality .sub, html:not(.js) .person, html:not(.js) .b-cross { opacity: 1; }
.rm .b-process, html:not(.js) .b-process { position: relative; display: grid; gap: 32px; }
.rm .node, html:not(.js) .node { position: relative; visibility: visible; opacity: 1; width: auto; }
.rm .b-process-tag, html:not(.js) .b-process-tag, .rm .b-team-tag, html:not(.js) .b-team-tag { position: static; }
.rm .ruler i, html:not(.js) .ruler i { transform: none; }
