/* Equal Group, pagina unica.
   Senza JavaScript (o con "riduci movimento") tutto è visibile e statico:
   le scene animate esistono solo sotto html.motion, che main.js aggiunge. */

:root {
  --bg: #000;
  --bg-2: #0b0b0d;
  --card: #141417;
  --line: rgba(255, 255, 255, .12);
  --text: #f5f5f7;
  --muted: #a1a1a6;
  --dim: #6e6e73;
  --accent: #ddbfa7;   /* Sabbia, colore di Equal Group */
  --green: #2e6b4a;    /* Verde Equal su fondo nero */
  --radius: 28px;
  --wrap: min(1180px, 100% - 48px);
  /* Identità visiva: Montserrat, con ripiego su Arial/Helvetica. */
  --font: Montserrat, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: var(--wrap); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: fixed; left: 16px; top: -60px; z-index: 100;
  background: var(--text); color: #000; padding: 10px 16px; border-radius: 10px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 16px; }

.eyebrow {
  font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 16px;
}
.section-title {
  font-size: clamp(36px, 6vw, 72px); line-height: 1.06;
  font-weight: 700; letter-spacing: -.03em;
}

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  transition: transform .3s var(--ease), background .3s, border-color .3s;
}
.btn:hover { transform: translateY(-2px); }
.btn--light { background: var(--text); color: #000; }
.btn--ghost { background: transparent; color: var(--text); border-color: rgba(255,255,255,.3); }
.btn--ghost:hover { border-color: var(--text); }

/* Navigazione */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  height: 52px; padding: 0 max(24px, calc((100% - 1180px) / 2));
  background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: 13px;
}
.nav__logo { display: flex; align-items: center; text-decoration: none; padding: 6px 0; }
.nav__logo img { display: block; width: 124px; height: auto; }
.nav nav { margin-left: auto; }
.nav ul { display: flex; gap: 26px; }
.nav nav a { color: var(--muted); text-decoration: none; transition: color .2s; }
.nav nav a:hover { color: var(--text); }
.nav__cta {
  text-decoration: none; background: var(--text); color: #000;
  padding: 6px 14px; border-radius: 999px; font-weight: 600;
}
@media (max-width: 720px) {
  .nav nav { display: none; }
  .nav__cta { margin-left: auto; }
}

/* HERO */
.hero { position: relative; }
.hero__sticky {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: grid; place-items: center; overflow: hidden;
  padding: 120px 0 80px;
}
.hero__glow {
  position: absolute; inset: -20%;
  background:
    radial-gradient(40% 35% at 30% 40%, rgba(46,107,74,.45), transparent 70%),
    radial-gradient(35% 30% at 72% 35%, rgba(221,191,167,.22), transparent 70%),
    radial-gradient(45% 40% at 50% 80%, rgba(221,191,167,.26), transparent 70%);
  filter: blur(40px);
  opacity: .9;
}
.hero__inner { position: relative; width: var(--wrap); text-align: center; }
.hero__title {
  font-size: clamp(40px, min(7.6vw, 11.5vh), 100px); line-height: 1.05;
  font-weight: 700; letter-spacing: -.04em;
  max-width: 15ch; margin: 0 auto; padding-bottom: .08em;
  background: linear-gradient(180deg, #fff 30%, #c9c9cf 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead {
  max-width: 640px; margin: 28px auto 0;
  font-size: clamp(18px, 2.2vw, 23px); color: var(--muted); line-height: 1.45;
}
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-top: 36px; }
.hero__scroll {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  font-size: 12px; color: var(--dim); letter-spacing: .12em; text-transform: uppercase;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.hero__scroll span {
  width: 1px; height: 40px; background: linear-gradient(var(--dim), transparent);
  animation: drip 2s var(--ease) infinite;
}
@keyframes drip { from { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } to { transform: scaleY(0); transform-origin: bottom; } }

/* MANIFESTO */
.manifesto__sticky { min-height: 100vh; display: grid; place-items: center; padding: 120px 0; }
.manifesto__text {
  width: var(--wrap); max-width: 980px;
  font-size: clamp(30px, 4.6vw, 60px); line-height: 1.12;
  font-weight: 700; letter-spacing: -.03em;
}
.manifesto__text .w { transition: opacity .25s linear, color .25s linear; }

/* NUMERI */
.facts { padding: 40px 0 140px; }
.facts__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.fact {
  background: var(--card); border-radius: var(--radius);
  padding: 40px 32px; border: 1px solid rgba(255,255,255,.04);
}
.fact__num {
  font-size: clamp(64px, 9vw, 120px); font-weight: 700; letter-spacing: -.05em; line-height: 1; padding-bottom: .06em;
  background: linear-gradient(135deg, #fff, var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.fact__label { margin-top: 14px; color: var(--muted); font-size: 18px; max-width: 26ch; }
@media (max-width: 820px) { .facts__grid { grid-template-columns: 1fr; } }

/* RAMI */
.branches { padding: 40px 0 100px; }
.branches__head { margin-bottom: 48px; }
.branches__intro { margin-top: 14px; max-width: 640px; color: var(--muted); font-size: 18px; line-height: 1.5; }
.branches__progress {
  margin-top: 28px; height: 2px; width: 100%; max-width: 360px;
  background: var(--line); border-radius: 2px; overflow: hidden;
}
.branches__progress span { display: block; height: 100%; width: 0; background: var(--text); }
.branches__viewport { overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: none; }
.branches__viewport::-webkit-scrollbar { display: none; }
.branches__track {
  display: flex; gap: 20px; width: max-content;
  padding-inline: max(24px, calc((100vw - 1180px) / 2));
}
.branch {
  --c: var(--accent);
  position: relative; flex: none; scroll-snap-align: center;
  width: min(420px, 82vw); min-height: 460px;
  display: flex; flex-direction: column;
  padding: 32px 32px 32px; border-radius: var(--radius);
  background: var(--card);
  border: 1px solid rgba(255,255,255,.07);
  overflow: hidden;
}
/* Icona di marchio come da identità visiva: quadrato scuro, bagliore del colore in basso a destra, simbolo bianco. */
/* Icone e loghi dei marchi: i file del brand kit Equal, mai ridisegnati (bianco su scuro). */
.branch__icon {
  position: relative; display: block; flex: none;
  width: 56px; height: 56px; border-radius: 20%; overflow: hidden;
  border: 1px solid rgba(255,255,255,.08);
  margin-bottom: 22px;
}
.branch__icon img { display: block; width: 100%; height: 100%; }
.branch__logo { display: block; width: 160px; max-width: 70%; height: auto; }
.branch__tag { color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.branch__name { margin-top: 18px; line-height: 0; font-size: clamp(32px, 3.4vw, 44px); letter-spacing: -.03em; line-height: 1.05; font-weight: 700; }
.branch__desc { margin-top: 18px; color: #d2d2d7; font-size: 18px; line-height: 1.5; }
.branch__link {
  margin-top: auto; padding-top: 28px; align-self: flex-start;
  color: var(--text); font-weight: 600; text-decoration: none;
  display: inline-flex; gap: 8px; align-items: center;
}
.branch__link::after { content: "→"; transition: transform .3s var(--ease); }
.branch__link:hover::after { transform: translateX(4px); }

/* Studio e Cassa hanno un dominio proprio: stessa scheda, freccia da link esterno. */
.branch__link[rel~="noopener"]::after { content: "↗"; }
.branches + .method { margin-top: 80px; }

/* METODO */
.method { padding: 60px 0 140px; background: linear-gradient(#000, #0a0a0c 30%, #0a0a0c 70%, #000); }
.method__grid { display: grid; grid-template-columns: 1fr 1.1fr; gap: 60px; align-items: start; }
.method__counter { margin-top: 32px; color: var(--dim); font-variant-numeric: tabular-nums; font-size: 15px; }
.method__counter span { color: var(--text); font-weight: 600; }
.method__steps { display: grid; gap: 36px; }
.step h3 { font-size: clamp(30px, 3.6vw, 46px); letter-spacing: -.03em; line-height: 1.05; font-weight: 700; }
.step p { margin-top: 14px; font-size: clamp(18px, 1.8vw, 22px); color: var(--muted); max-width: 34ch; }
@media (max-width: 820px) { .method__grid { grid-template-columns: 1fr; gap: 40px; } }

/* CANTIERE */
.lab { padding: 40px 0 160px; }
.lab__card {
  position: relative; overflow: hidden;
  padding: clamp(36px, 6vw, 80px); border-radius: 36px;
  background: radial-gradient(80% 120% at 0% 0%, rgba(79,124,255,.22), transparent 60%), var(--bg-2);
  border: 1px solid var(--line);
}
.lab__card > p:not(.eyebrow) { margin-top: 22px; max-width: 62ch; color: #d2d2d7; font-size: 19px; }
.lab__card .section-title { max-width: 18ch; }
.lab__replay { margin-top: 32px; }

/* FAQ */
.faq { padding: 40px 0 160px; }
.faq__list { margin-top: 48px; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; gap: 24px; align-items: center;
  padding: 26px 0; font-size: clamp(19px, 2vw, 24px); font-weight: 600; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; font-size: 28px; font-weight: 300; color: var(--muted);
  transition: transform .3s var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 28px; color: var(--muted); max-width: 72ch; font-size: 18px; }
.faq details a { color: var(--text); }

/* CTA */
.cta { padding: 140px 0 180px; text-align: center; position: relative; overflow: hidden; }
.cta::before {
  content: ""; position: absolute; inset: 20% -10% -30%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(184,164,140,.28), transparent 70%);
  filter: blur(30px);
}
.cta__inner { position: relative; }
.cta__title { font-size: clamp(40px, 7vw, 96px); line-height: 1.05; font-weight: 700; letter-spacing: -.045em; max-width: 14ch; margin: 0 auto; }
.cta__lead { max-width: 620px; margin: 26px auto 0; color: var(--muted); font-size: clamp(18px, 2vw, 21px); }

/* FOOTER */
.footer { border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 14px; color: var(--muted); }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer__brand { color: var(--text); font-weight: 600; font-size: 16px; display: grid; gap: 16px; justify-items: start; }
.footer__brand img { display: block; width: 148px; height: auto; }
.footer__legal, .footer__note { margin-top: 8px; }
.footer__legal { font-style: normal; line-height: 1.7; }
.footer__legal a { text-decoration: none; }
.footer__legal a:hover { color: var(--text); }
.footer__head { color: var(--text); font-weight: 600; margin-bottom: 12px; }
.footer__links { display: grid; gap: 8px; }
.footer__links a { text-decoration: none; }
.footer__links a:hover { color: var(--text); }
.footer__copy { margin-top: 40px; color: var(--dim); font-size: 12px; }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > div { grid-column: 1 / -1; } }

/* =========================================================
   MOTION: solo con html.motion (JS attivo, movimento consentito)
   ========================================================= */

/* Hero: resta fermo mentre scorre via, si rimpicciolisce e sfuma */
.motion .hero { height: 170vh; }
.motion .hero__sticky { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; padding-block: 52px 0; }
.motion .hero__inner {
  transform: translateY(calc(var(--p, 0) * -60px)) scale(calc(1 - var(--p, 0) * .12));
  opacity: calc(1 - var(--p, 0) * 1.6);
  filter: blur(calc(var(--p, 0) * 8px));
}
.motion .hero__glow { transform: scale(calc(1 + var(--p, 0) * .6)) rotate(calc(var(--p, 0) * 40deg)); }
.motion .hero__scroll { opacity: calc(1 - var(--p, 0) * 5); }

/* Manifesto: le parole si accendono una alla volta */
.motion .manifesto { height: 260vh; }
.motion .manifesto__sticky { position: sticky; top: 0; height: 100vh; min-height: 0; padding: 0; }
.motion .manifesto__text .w { opacity: .14; }
.motion .manifesto__text .w.on { opacity: 1; }

/* Rami: scorrimento orizzontale guidato da quello verticale */
.motion .branches { padding: 0; height: var(--branches-h, 400vh); }
.motion .branches__sticky {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
}
.motion .branches__head { margin-bottom: 36px; }
.motion .branches__viewport { overflow: visible; scroll-snap-type: none; }
.motion .branches__track { transform: translate3d(var(--tx, 0px), 0, 0); will-change: transform; }
.motion .branch {
  transform: perspective(1200px) rotateY(var(--ry, 0deg)) scale(var(--s, 1));
  transition: transform .2s linear;
}
@media (max-height: 700px) { .motion .branch { min-height: 380px; } .motion .branches__head { margin-bottom: 20px; } }

/* Metodo: quattro regole, una per volta */
.motion .method { height: 420vh; padding: 0; }
.motion .method__sticky { position: sticky; top: 0; height: 100vh; display: flex; align-items: center; }
.motion .method__steps { position: relative; min-height: 340px; }
.motion .step {
  position: absolute; inset: 0 0 auto;
  opacity: 0; transform: translateY(40px); filter: blur(6px);
  transition: opacity .6s var(--ease), transform .6s var(--ease), filter .6s var(--ease);
}
.motion .step.on { opacity: 1; transform: none; filter: none; }
.motion .step.past { opacity: 0; transform: translateY(-40px); }

/* CTA: il titolo sale con lo scroll */
.motion .cta__title { transform: translateY(calc((1 - var(--p, 1)) * 60px)); }

/* Costruzione dal vivo: gli elementi aspettano il loro agente */
.motion [data-build]:not(.is-built) { opacity: 0; transform: translateY(18px) scale(.985); }
.motion [data-build] { transition: opacity .7s var(--ease), transform .8s var(--ease); }
.motion [data-build].is-typing { opacity: 1; transform: none; }
.motion .is-typing::after {
  content: ""; display: inline-block; width: .06em; height: .9em; margin-left: .04em;
  background: currentColor; vertical-align: -.08em; animation: blink .8s steps(1) infinite;
}
.motion .hero__title.is-typing::after { background: #fff; }

/* Scheletro: il riquadro c'è, i pezzi arrivano uno alla volta (icona, testo, link).
   Gli elementi annidati con data-build fanno il loro percorso da soli. */
.motion [data-build].is-frame { opacity: 1; transform: none; outline: 1.5px dashed rgba(255,255,255,.22); outline-offset: -1px; }
.motion [data-build].is-frame:not(.is-built) > :not(.part-on):not([data-build]) { opacity: 0; transform: translateY(8px); }
.motion [data-build] > * { transition: opacity .45s var(--ease), transform .5s var(--ease); }
.motion .part-on { opacity: 1; transform: none; }
@keyframes blink { 50% { opacity: 0; } }

/* Strato agenti */
.agents { position: fixed; inset: 0; pointer-events: none; z-index: 60; }
.agent {
  position: absolute; left: 0; top: 0;
  transform: translate3d(var(--x, -100px), var(--y, -100px), 0);
  transition: transform .9s cubic-bezier(.3, .8, .2, 1), opacity .4s;
  opacity: 0;
}
.agent.live { opacity: 1; }
.agent.fast { transition-duration: .12s; transition-timing-function: linear; }
.agent svg { width: 22px; height: 22px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.agent__label {
  position: absolute; left: 16px; top: 18px; white-space: nowrap;
  padding: 4px 9px; border-radius: 6px 12px 12px 12px;
  background: var(--ac); color: #000; font: 600 12px/1.2 var(--font);
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.agent__label small { font-weight: 500; opacity: .7; margin-left: 4px; }
.agent-box {
  position: absolute; left: 0; top: 0; border: 1.5px solid var(--ac);
  border-radius: 10px; opacity: 0; transition: opacity .3s;
  background: color-mix(in srgb, var(--ac) 7%, transparent);
}
.agent-box.on { opacity: 1; }
.agent-box__tag {
  position: absolute; left: -1.5px; top: -22px; white-space: nowrap;
  background: var(--ac); color: #000; font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  padding: 4px 6px; border-radius: 4px 4px 0 0;
}
.agentlog {
  position: fixed; left: 20px; bottom: 20px; z-index: 61; pointer-events: none;
  display: grid; gap: 6px; max-width: min(360px, calc(100vw - 40px));
  font: 500 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.agentlog p {
  padding: 7px 10px; border-radius: 10px; color: #e8e8ed;
  background: rgba(20,20,23,.82); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  animation: logIn .35s var(--ease) both;
}
.agentlog p b { color: var(--ac); font-weight: 600; }
.agentlog p.out { animation: logOut .4s var(--ease) both; }
@keyframes logIn { from { opacity: 0; transform: translateY(8px); } }
@keyframes logOut { to { opacity: 0; transform: translateY(-6px); } }
.agenthud {
  position: fixed; right: 20px; top: 64px; z-index: 61; pointer-events: none;
  padding: 7px 12px; border-radius: 999px; color: #e8e8ed;
  font: 500 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
  background: rgba(20,20,23,.82); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.agenthud:empty { display: none; }
.agenthud b { color: #9BD42E; font-weight: 600; margin-right: 6px; }
.motion:not(.js) .agenthud, html:not(.motion) .agenthud { display: none; }
@media (max-width: 600px) {
  .agentlog { display: none; }
  .agent__label small { display: none; }
  .agenthud { right: 12px; top: 60px; font-size: 11px; }
}

/* Modulo di contatto */
.contact { max-width: 760px; margin: 48px auto 0; text-align: left; padding: 32px; border-radius: 28px;
  background: #161618; border: 1px solid rgba(255,255,255,.08); }
.contact__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 8px; }
.field--wide { grid-column: 1 / -1; }
.field span { color: var(--muted); font-size: 14px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text); background: #0e0e0f;
  border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 12px 14px; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #DDBFA7; outline-offset: 1px; border-color: transparent; }
.field--trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact__hint { margin-top: 14px; color: var(--muted); font-size: 14px; }
.contact__privacy { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; color: #d2d2d7; font-size: 15px; line-height: 1.5; }
.contact__privacy input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: #DDBFA7; }
.contact__privacy a { color: var(--text); }
.contact__actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.contact__actions .btn { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.contact__actions .btn:disabled { opacity: .6; cursor: wait; }
.contact__status { color: var(--muted); font-size: 15px; flex: 1 1 240px; }
.contact__status[data-tipo=errore] { color: #ff8a80; }
.contact__status[data-tipo=avviso] { color: #DDBFA7; }
.contact__alt { margin-top: 24px; color: var(--muted); }
.contact__alt a { color: var(--text); }
@media (max-width: 640px) { .contact { padding: 22px; } .contact__grid { grid-template-columns: 1fr; } }

/* Pagine di testo (privacy) */
.doc .nav { position: sticky; }
.doc__body { padding: 120px 0 80px; max-width: 760px; }
.doc__body h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.1; letter-spacing: -.03em; margin-top: 12px; }
.doc__body h2 { font-size: 22px; margin-top: 44px; }
.doc__body p, .doc__body li { color: #d2d2d7; line-height: 1.65; margin-top: 12px; }
.doc__body ul { padding-left: 20px; list-style: disc; }
.doc__body a { color: var(--text); }
.doc__date { color: var(--muted) !important; font-size: 14px; }
.doc__lead { padding: 18px 20px; border-radius: 16px; background: #161618; border: 1px solid rgba(255,255,255,.08); }
.doc__table { overflow-x: auto; margin-top: 16px; }
.doc__table table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.doc__table th, .doc__table td { text-align: left; vertical-align: top; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.1); color: #d2d2d7; }
.doc__table th { color: var(--text); font-weight: 600; }
.doc__back { margin-top: 48px !important; }
