/* ============================================================
   COMPASS — one-pager
   Palette e tipografia da Compass Brand Directions.pdf
   ============================================================ */

:root {
  --blu: #1D36DA;
  --blu-scuro: #172CC8;
  --blu-tint: #E4E7FB;
  --porpora: #7C2D8A;
  --porpora-tint: #F4E9F6;
  --grigio: #6A7180;
  --surface: #F6F8FB;
  --ink: #13161C;
  --bg: #FBFCFE;
  --line: rgba(19, 22, 28, 0.08);

  --font-sans: "Instrument Sans", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius-s: 12px;
  --radius-m: 18px;
  --radius-l: 28px;

  --container: 1180px;
  --nav-h: 72px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2.5px solid var(--blu);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection { background: var(--blu-tint); color: var(--ink); }

section { scroll-margin-top: calc(var(--nav-h) + 12px); }

/* ---------- Primitives ---------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blu);
  background: var(--blu-tint);
  width: fit-content;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.eyebrow-light {
  color: #8A96EC;
  background: rgba(138, 150, 236, 0.12);
}

.section { padding-block: clamp(84px, 11vw, 148px); }

.section-title {
  font-size: clamp(30px, 4.4vw, 52px);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 16ch;
}

.section-lead {
  font-size: clamp(17px, 1.6vw, 20px);
  color: var(--grigio);
  margin-top: 16px;
  max-width: 52ch;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-primary {
  background: var(--blu);
  color: #fff;
  box-shadow: 0 6px 18px rgba(42, 99, 246, 0.28);
}

.btn-primary:hover {
  background: var(--blu-scuro);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(42, 99, 246, 0.32);
}

.btn-primary:active { transform: translateY(0); }

.btn-nav { font-size: 15px; padding: 10px 22px; }

.btn-lg { font-size: 17px; padding: 16px 34px; }

.btn-block { width: 100%; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(251, 252, 254, 0.78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.navbar.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 4px 24px rgba(19, 22, 28, 0.05);
}

.navbar-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.brand-mark { height: 30px; width: auto; }

.brand-word {
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  gap: 30px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--grigio);
}

.nav-links a { transition: color 0.2s ease; }
.nav-links a:hover { color: var(--ink); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  padding-top: var(--nav-h);
  min-height: 100svh;
  display: flex;
  align-items: center;
  background:
    radial-gradient(85% 75% at 100% 0%, var(--blu-tint) 0%, transparent 55%),
    radial-gradient(55% 45% at 0% 100%, var(--porpora-tint) 0%, transparent 48%),
    var(--bg);
}

/* Hero centrato a colonna singola (richiesta 17 lug 2026):
   titolo grande su due righe — "Automatizziamo processi" sopra,
   parola che ruota sotto — poi sottotitolo e CTA.
   (Sfondo "background paths" provato DUE volte il 17 lug — prima come
   72 <path> SVG animati, poi come porting su <canvas> — e SCARTATO
   definitivamente su richiesta di Daniele: niente animazione in hero.) */
.hero-inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
  padding-block: clamp(40px, 6vh, 80px);
  width: 100%;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* alza il blocco rispetto al centro verticale (richiesta 17 lug 2026) */
  margin-top: calc(-1 * clamp(20px, 5vh, 56px));
}

.hero-title {
  font-size: clamp(40px, 6.6vw, 86px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.06;
}

.hero-title-line { display: block; }

.adj {
  font-weight: 700;
  color: var(--blu);
  letter-spacing: -0.01em;
}

/* Slot della parola che ruota (una sola visibile alla volta), su riga propria.
   Il sizer invisibile riserva l'altezza e la larghezza di RIPETITIVI: niente salti. */
.hero-rotate {
  position: relative;
  display: block;
  margin-top: 0.04em;
}

.adj-sizer { visibility: hidden; }

.adj-rotate {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  text-align: center;
  opacity: 0;
  will-change: opacity, transform;
  animation: word-cycle 9s cubic-bezier(0.22, 1, 0.36, 1) infinite both;
}

/* il sizer è il primo span dello slot: le parole rotanti sono la 2ª, 3ª e 4ª */
.adj-rotate:nth-of-type(2) { animation-delay: 0s; }
.adj-rotate:nth-of-type(3) { animation-delay: 3s; }
.adj-rotate:nth-of-type(4) { animation-delay: 6s; }

.hero-sub {
  font-size: clamp(17px, 1.7vw, 20px);
  color: var(--grigio);
  max-width: 54ch;
  margin-top: 26px;
}

.hero-actions { margin-top: 36px; }

/* ============================================================
   CHI SIAMO
   ============================================================ */
.manifesto {
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.45;
  letter-spacing: -0.012em;
  max-width: 34ch;
  margin-top: 22px;
  font-weight: 500;
}

.team-split {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

.team-photo {
  aspect-ratio: 4 / 3.2;
  border-radius: var(--radius-l);
  background:
    radial-gradient(115% 95% at 12% 8%, var(--blu-tint) 0%, transparent 60%),
    radial-gradient(110% 90% at 90% 92%, var(--porpora-tint) 0%, transparent 55%),
    #E7EEFD;
  position: relative;
  overflow: hidden;
}

/* la foto reale (vedi commento FOTO in index.html) riempie il contenitore */
.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.team-photo-initials {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 1.8vw, 24px);
}

.team-photo-initials span {
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 600;
  color: var(--blu);
  opacity: 0.5;
  letter-spacing: -0.02em;
}

.team-photo-initials span:last-child { color: var(--porpora); }

.photo-label {
  position: absolute;
  left: clamp(14px, 2vw, 22px);
  bottom: clamp(12px, 1.8vw, 20px);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blu);
  background: rgba(251, 252, 254, 0.75);
  border: 1px solid rgba(42, 99, 246, 0.18);
  padding: 8px 16px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.team-names {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--grigio);
  margin-top: 26px;
}

/* ============================================================
   CASI DI STUDIO — vetrina slide-deck
   Coverflow vanilla: la slide centrale è la protagonista, le altre
   arretrano in prospettiva. I transform li calcola script.js.
   ============================================================ */
.section-cases {
  background: linear-gradient(180deg, var(--bg) 0%, var(--surface) 100%);
  overflow: hidden; /* le slide laterali sbordano senza creare scroll orizzontale */
}

.cases-stage {
  --cases-h: clamp(430px, 44vw, 540px);
  position: relative;
  margin-top: clamp(44px, 5vw, 72px);
}

.cases-viewport {
  position: relative;
  height: var(--cases-h);
  perspective: 1600px;
  outline-offset: -2.5px;
  touch-action: pan-y; /* lo swipe orizzontale è nostro, lo scroll verticale resta al browser */
}

.cases-track {
  list-style: none;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.case-slide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(480px, 82vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-l);
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow: 0 34px 80px -34px rgba(19, 22, 28, 0.3);
  overflow: hidden;
  cursor: pointer;
  will-change: transform, opacity;
  transition:
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.65s ease,
    filter 0.65s ease;
}

.case-slide.is-active { box-shadow: 0 44px 100px -36px rgba(29, 54, 218, 0.35); }

/* --- Slide pubblicata --- */
.case-media {
  height: 52%;
  background:
    radial-gradient(120% 100% at 15% 0%, rgba(143, 176, 255, 0.22) 0%, transparent 60%),
    linear-gradient(160deg, #1A1E27 0%, var(--ink) 70%);
  position: relative;
  overflow: hidden;
  flex: none;
}

.case-media img,
.case-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.case-body {
  padding: clamp(20px, 2.4vw, 30px) clamp(22px, 2.6vw, 34px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-height: 0;
}

.case-sector {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--grigio);
}

.case-title {
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.case-metric {
  font-family: var(--font-mono);
  font-size: clamp(21px, 2.3vw, 28px);
  font-weight: 500;
  color: var(--blu);
  margin-top: auto;
}

.case-open {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--blu);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.case-open span { transition: transform 0.3s ease; }
.case-slide.is-active:hover .case-open span { transform: translateX(4px); }

/* --- Slide placeholder: "// caso di studio in arrivo" --- */
.case-slide.is-placeholder {
  cursor: default;
  border: 1.5px dashed rgba(29, 54, 218, 0.28);
  background:
    radial-gradient(115% 95% at 12% 8%, var(--blu-tint) 0%, transparent 60%),
    radial-gradient(110% 90% at 90% 92%, var(--porpora-tint) 0%, transparent 55%),
    var(--surface);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.case-ph {
  position: relative;
  z-index: 1;
  padding: 24px;
  display: grid;
  gap: 14px;
  justify-items: center;
}

.case-ph-num {
  font-family: var(--font-mono);
  font-size: clamp(64px, 8vw, 104px);
  font-weight: 500;
  line-height: 1;
  color: rgba(29, 54, 218, 0.14);
  user-select: none;
}

.case-ph-label {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--blu);
  background: rgba(251, 252, 254, 0.75);
  border: 1px solid rgba(42, 99, 246, 0.18);
  padding: 8px 16px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.case-ph-text {
  font-size: 15px;
  color: var(--grigio);
  max-width: 26ch;
}

/* --- Frecce --- */
.cases-arrow {
  position: absolute;
  top: calc(var(--cases-h) / 2);
  transform: translateY(-50%);
  z-index: 120;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 252, 254, 0.85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 30px rgba(19, 22, 28, 0.12);
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.cases-arrow:hover {
  background: var(--blu);
  color: #fff;
  transform: translateY(-50%) scale(1.05);
}

.cases-arrow svg { width: 22px; height: 22px; }

.cases-arrow-prev { left: clamp(8px, 3vw, 48px); }
.cases-arrow-next { right: clamp(8px, 3vw, 48px); }

/* --- Dots --- */
.cases-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.cases-dots button {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  background: rgba(19, 22, 28, 0.18);
  cursor: pointer;
  padding: 0;
  transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.3s ease;
}

.cases-dots button[aria-selected="true"] {
  width: 30px;
  background: var(--blu);
}

/* ============================================================
   MODAL CASO DI STUDIO
   ============================================================ */
body.modal-open { overflow: hidden; }

.case-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 44px);
}

.case-modal[hidden] { display: none; }

.case-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 22, 28, 0.66);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: modal-fade 0.3s ease both;
}

.case-modal-dialog {
  position: relative;
  width: min(780px, 100%);
  max-height: min(88vh, 920px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  border-radius: var(--radius-l);
  box-shadow: 0 50px 120px rgba(0, 0, 0, 0.45);
  animation: modal-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.case-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(251, 252, 254, 0.25);
  background: rgba(19, 22, 28, 0.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #F4F6FA;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background-color 0.25s ease, transform 0.25s ease;
}

.case-modal-close:hover {
  background: rgba(19, 22, 28, 0.8);
  transform: scale(1.06);
}

.case-modal-close svg { width: 20px; height: 20px; }

/* media in alto: contiene sia GIF orizzontali che video verticali 9:16 */
.case-modal-media:empty { display: none; } /* caso senza demo: niente box vuoto */

.case-modal-media {
  aspect-ratio: 16 / 9;
  max-height: 46vh;
  width: 100%;
  background: linear-gradient(160deg, #1A1E27 0%, var(--ink) 70%);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.case-modal-media img,
.case-modal-media video {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.case-modal-content {
  padding: clamp(26px, 3.4vw, 44px);
  display: grid;
  gap: 18px;
}

.case-modal-sector {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--grigio);
}

.case-modal-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.case-modal-metric {
  font-family: var(--font-mono);
  font-size: clamp(26px, 3.2vw, 38px);
  font-weight: 500;
  color: var(--blu);
}

.case-modal-blocks {
  display: grid;
  gap: 20px;
  margin-top: 8px;
}

.case-block h4 {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--blu);
  margin-bottom: 6px;
}

.case-block p {
  font-size: 16.5px;
  color: var(--ink);
  line-height: 1.65;
}

.case-modal-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.case-modal-tags li {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--blu);
  background: var(--blu-tint);
  padding: 6px 13px;
  border-radius: 999px;
}

.case-modal-cta {
  justify-self: start;
  margin-top: 10px;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   PER CHI / COSA FACCIAMO
   ============================================================ */
.section-processes {
  background: linear-gradient(175deg, var(--blu-tint) 0%, #F2F6FE 55%, var(--surface) 100%);
}

.process-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(14px, 1.6vw, 22px);
  margin-top: clamp(44px, 5vw, 64px);
}

.process-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: clamp(24px, 2.4vw, 32px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.process-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(19, 22, 28, 0.07);
}

.process-card h3 {
  font-size: 18.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-top: 18px;
}

.process-card p {
  font-size: 15.5px;
  color: var(--grigio);
  margin-top: 8px;
  line-height: 1.55;
}

.process-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: var(--blu-tint);
  color: var(--blu);
  display: grid;
  place-items: center;
}

.process-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* card CTA — unico accento porpora della sezione */
.process-card-cta {
  background: var(--porpora-tint);
  border-color: rgba(124, 45, 138, 0.16);
}

.process-card-cta .process-icon {
  background: rgba(124, 45, 138, 0.1);
  color: var(--porpora);
}

.process-card-cta h3 { color: var(--porpora); }

.process-card-cta:hover { box-shadow: 0 14px 34px rgba(124, 45, 138, 0.12); }

.positioning {
  font-size: clamp(24px, 3.2vw, 38px);
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.22;
  max-width: 26ch;
  margin-top: clamp(56px, 7vw, 96px);
}

.positioning em {
  font-style: normal;
  color: var(--blu);
}

/* ============================================================
   IL METODO
   ============================================================ */
.method-flow {
  margin-top: clamp(48px, 6vw, 80px);
  max-width: 940px;
}

/* contenitore prospettico: il reveal resta qui, il tilt sta sulla card interna */
.method-step {
  position: relative;
  perspective: 1200px;
}

.method-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: clamp(20px, 4vw, 48px);
  padding: clamp(32px, 4.5vw, 60px) clamp(24px, 4vw, 56px);
  border-radius: var(--radius-l);
  background: linear-gradient(150deg, var(--blu-tint) 0%, rgba(228, 231, 251, 0.35) 100%);
  overflow: hidden;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  will-change: transform;
  box-shadow: 0 14px 38px -28px rgba(19, 22, 28, 0.22);
  transition:
    transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.5s ease;
}

/* glow indaco discreto quando la card è viva */
.method-card:hover {
  box-shadow:
    0 30px 70px -30px rgba(29, 54, 218, 0.32),
    0 0 0 1px rgba(29, 54, 218, 0.07);
}

.method-num {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--blu);
  background: rgba(251, 252, 254, 0.85);
  padding: 8px 14px;
  border-radius: 9px;
  margin-top: 6px;
}

.method-body {
  position: relative;
  z-index: 1;
}

/* strati in parallasse: contenuto e numero fluttuano col mouse */
.method-num,
.method-body {
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.method-body h3 {
  font-size: clamp(26px, 3.4vw, 44px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.method-body p {
  font-size: clamp(16.5px, 1.7vw, 19px);
  color: var(--grigio);
  margin-top: 12px;
  line-height: 1.65;
  max-width: 52ch;
}

/* numero fantasma: presenza grafica dello step, in controfase col mouse */
.method-ghost {
  position: absolute;
  right: clamp(8px, 3vw, 40px);
  top: 50%;
  transform: translateY(-50%) translate3d(var(--gx, 0px), var(--gy, 0px), 0);
  font-family: var(--font-mono);
  font-size: clamp(96px, 14vw, 200px);
  font-weight: 500;
  line-height: 1;
  color: rgba(29, 54, 218, 0.1);
  pointer-events: none;
  user-select: none;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* connettore verticale tra gli step */
.method-link {
  width: 2px;
  height: clamp(28px, 4vw, 52px);
  margin-inline: auto;
  background: repeating-linear-gradient(180deg, var(--blu) 0 6px, transparent 6px 12px);
  opacity: 0.45;
}

.method-link:last-of-type {
  background: repeating-linear-gradient(180deg, var(--porpora) 0 6px, transparent 6px 12px);
}

/* il Development è il climax: accento porpora */
.method-step-final .method-card {
  background: linear-gradient(150deg, var(--porpora-tint) 0%, rgba(244, 233, 246, 0.4) 100%);
}

.method-step-final .method-card:hover {
  box-shadow:
    0 30px 70px -30px rgba(124, 45, 138, 0.32),
    0 0 0 1px rgba(124, 45, 138, 0.07);
}

.method-step-final .method-num { color: var(--porpora); }

.method-step-final .method-ghost { color: rgba(124, 45, 138, 0.1); }

/* ============================================================
   LA PROVA
   ============================================================ */
.section-demo {
  background: linear-gradient(180deg, var(--bg) 0%, var(--blu-tint) 100%);
}

.demo-split {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(36px, 6vw, 88px);
  align-items: center;
}

/* frame verticale 9:16, formato telefono */
.demo-frame {
  aspect-ratio: 9 / 16;
  width: min(100%, clamp(280px, 24vw, 360px));
  margin-inline: auto;
  border-radius: clamp(28px, 3vw, 44px);
  background: linear-gradient(165deg, #1A1E27 0%, var(--ink) 60%);
  border: 1px solid rgba(143, 176, 255, 0.14);
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(19, 22, 28, 0.22);
}

/* il video verticale (vedi commento VIDEO in index.html) riempie il frame */
.demo-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.demo-flow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.5;
}

.flow-lines path { stroke: #39415A; }

.flow-nodes rect {
  fill: rgba(42, 99, 246, 0.14);
  stroke: rgba(143, 176, 255, 0.35);
  stroke-width: 1.2;
}

.flow-dots circle { fill: var(--blu); }

.demo-label {
  position: absolute;
  z-index: 1;
  left: 50%;
  transform: translateX(-50%);
  bottom: clamp(16px, 2vw, 26px);
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #C4CBF5;
  background: rgba(19, 22, 28, 0.55);
  border: 1px solid rgba(143, 176, 255, 0.28);
  padding: 10px 18px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.demo-bullets {
  list-style: none;
  display: grid;
  gap: 16px;
  margin-top: clamp(28px, 3vw, 40px);
}

.demo-bullets li {
  font-size: 16px;
  font-weight: 500;
  padding-left: 26px;
  position: relative;
  color: var(--ink);
}

.demo-bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 13px;
  height: 13px;
  background: var(--blu);
  clip-path: polygon(100% 0, 40% 60%, 0 100%, 60% 40%);
}

/* ============================================================
   CONTATTO
   ============================================================ */
.section-contact {
  background: var(--ink);
  color: #F4F6FA;
}

.contact-inner {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

.section-contact .section-title { color: #F9FAFD; }

.contact-lead {
  font-size: clamp(17px, 1.7vw, 20px);
  color: #A9B1C0;
  margin-top: 18px;
  max-width: 38ch;
}

.contact-form {
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius-l);
  padding: clamp(28px, 3vw, 40px);
  display: grid;
  gap: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.field { display: grid; gap: 8px; }

.field label {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.field input,
.field textarea {
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid transparent;
  border-radius: var(--radius-s);
  padding: 13px 16px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder { color: #9AA1AE; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blu);
  background: var(--bg);
}

.form-error {
  font-size: 14.5px;
  color: #C4372C;
  text-align: center;
}

.form-success {
  background: var(--bg);
  color: var(--ink);
  border-radius: var(--radius-l);
  padding: clamp(40px, 4vw, 56px);
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.form-success svg {
  width: 52px;
  height: 52px;
  margin-inline: auto;
  color: var(--blu);
}

.form-success h3 {
  font-size: 24px;
  font-weight: 600;
  margin-top: 18px;
  letter-spacing: -0.015em;
}

.form-success p {
  color: var(--grigio);
  margin-top: 8px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--ink);
  border-top: 1px solid rgba(244, 246, 250, 0.08);
  padding-block: 36px;
}

.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.brand-light { color: #F4F6FA; }

/* il PNG del mark è nero: sul footer scuro si inverte via filtro */
.brand-light .brand-mark { filter: invert(0.94); }

.footer-tag {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #6E7788;
  margin-right: auto;
}

.footer-legal {
  font-size: 13.5px;
  color: #6E7788;
}

/* ============================================================
   MOTION
   Regole: sottile, max 24px di traslazione, 0.6–0.8s, una volta sola.
   Eccezioni vive (in loop): il ciclo parola della hero (word-cycle,
   richiesto il 14 lug 2026), l'autoplay del carosello casi di studio
   (gestito in script.js) e il tilt 3D delle card del metodo
   (solo su hover, mitigato).
   ============================================================ */

/* --- Reveal allo scroll (via IntersectionObserver in script.js) --- */
.reveal,
.reveal-scale { opacity: 0; }

.reveal.is-visible {
  opacity: 1;
  animation: reveal-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: var(--d, 0s);
}

.reveal-scale.is-visible {
  opacity: 1;
  animation: reveal-scale 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* --- Metodo: le card entrano flottando con lieve inclinazione 3D --- */
.method-step.reveal.is-visible {
  animation-name: reveal-tilt;
  animation-duration: 0.85s;
}

@keyframes reveal-tilt {
  from { opacity: 0; transform: perspective(1200px) translateY(36px) rotateX(6deg); }
  to   { opacity: 1; transform: perspective(1200px) translateY(0) rotateX(0deg); }
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-scale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Ciclo parola hero: entra dal basso, resta ~3s, esce verso l'alto
   (ritmo 3s a parola: ciclo 9s / 3 parole). L'uscita (33,3→38,3%) è
   speculare all'entrata della successiva (delay 3s + fade 0→5%): stesso
   istante, stessa easing — dissolvenza incrociata perfetta, la parola
   uscente "spinge su" quella che entra e la riga non resta mai vuota
   (prima c'era quasi 1s di buio tra una parola e l'altra). */
@keyframes word-cycle {
  0%      { opacity: 0; transform: translateY(0.4em); }
  5%      { opacity: 1; transform: translateY(0); }
  33.333% { opacity: 1; transform: translateY(0); }
  38.333% { opacity: 0; transform: translateY(-0.4em); }
  100%    { opacity: 0; transform: translateY(-0.4em); }
}

/* --- Hero: sequenza al caricamento --- */
.hero-title,
.hero-sub,
.hero-actions {
  opacity: 0;
  animation: reveal-up 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-title { animation-delay: 0.1s; }
.hero-sub { animation-delay: 0.35s; }
.hero-actions { animation-delay: 0.5s; }

/* --- Reduced motion: tutto fermo, tutto visibile --- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal-scale,
  .hero-title,
  .hero-sub,
  .hero-actions {
    opacity: 1;
    animation: none !important;
  }

  /* Niente ciclo: mostra ferma solo la prima parola (dopo il sizer) */
  .adj-rotate { animation: none !important; opacity: 0; }
  .adj-rotate:nth-of-type(2) { opacity: 1; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .team-split { grid-template-columns: 1fr; gap: 32px; }
  .process-grid { grid-template-columns: repeat(2, 1fr); }
  .demo-split { grid-template-columns: 1fr; gap: 40px; }
  .demo-frame { width: min(100%, 320px); }
  .contact-inner { grid-template-columns: 1fr; }

  .cases-stage { --cases-h: clamp(430px, 62vw, 520px); }
}

@media (max-width: 760px) {
  .nav-links { display: none; }

  .hero { min-height: auto; }

  .hero-inner { padding-block: clamp(64px, 10vh, 96px); }
}

@media (max-width: 560px) {
  .process-grid { grid-template-columns: 1fr; }

  .method-card { grid-template-columns: 1fr; gap: 16px; }
  .method-num { margin-top: 0; width: fit-content; }
  .method-ghost { font-size: 84px; right: 14px; top: auto; bottom: 10px; transform: none; }

  .case-slide { width: min(340px, 84vw); }
  .cases-stage { --cases-h: clamp(440px, 128vw, 500px); }
  .cases-arrow {
    width: 44px;
    height: 44px;
  }
  .cases-arrow svg { width: 19px; height: 19px; }
  .cases-arrow-prev { left: 6px; }
  .cases-arrow-next { right: 6px; }

  .case-modal { padding: 10px; }
  .case-modal-media { max-height: 40vh; }
  .case-modal-cta { justify-self: stretch; }
}
