:root {
  --bg: #ffffff;
  --ink: #0a0a0a;
  --accent: #c6f135;
  --muted: rgba(10, 10, 10, 0.72);
  --line: rgba(0, 0, 0, 0.12);
  --glass: rgba(0, 0, 0, 0.025);
  --purple: #737373;
  --pink: #d4d4d4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Open Sauce Sans', -apple-system, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.page { position: relative; min-height: 100vh; }

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0;
}

.bg-fade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 30% 45%, rgba(7, 5, 13, 0.55) 0%, rgba(7, 5, 13, 0) 65%),
    linear-gradient(180deg, rgba(7, 5, 13, 0.7) 0%, rgba(7, 5, 13, 0.15) 40%, rgba(7, 5, 13, 0.75) 100%);
}

.nav, main, .footer { position: relative; z-index: 1; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 16px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
}

.nav nav { display: flex; align-items: center; gap: 26px; font-size: 14px; color: var(--muted); }
.nav nav a:hover { color: var(--ink); }

.pill {
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
}

.hero {
  min-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 clamp(20px, 5vw, 64px) 8vh;
  max-width: 1100px;
}

.eyebrow {
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 20px;
}

h1 {
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 600;
}

h2 {
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 600;
  max-width: 820px;
}

h3 { font-size: 20px; letter-spacing: -0.015em; font-weight: 600; margin-bottom: 8px; }

.lead {
  margin-top: 24px;
  max-width: 620px;
  font-size: 18px;
  line-height: 1.55;
  color: var(--muted);
}

.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }

.btn {
  position: relative;
  display: inline-block;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn.primary {
  border-color: rgba(255, 255, 255, 0.35);
  background: linear-gradient(135deg, var(--purple), var(--pink));
  box-shadow: 0 10px 30px rgba(255, 255, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn.primary::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.btn.ghost {
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.folder-section {
  min-height: 80vh;
  background: var(--bg);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  padding: 40px clamp(20px, 5vw, 64px) 100px;
}

#folder-root {
  display: grid;
  place-items: center;
}

.folder-title {
  font-size: clamp(28px, 3.6vw, 52px);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.servizi__list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; margin-top: 40px; }
.servizi__list li { padding-top: 16px; border-top: 1px solid var(--line); }
.servizi__list h3 { font-size: 18px; margin-bottom: 6px; }
.servizi__list p { color: var(--muted); font-size: 16px; line-height: 1.5; }

@media (max-width: 900px) {
  .folder-section { grid-template-columns: minmax(0, 1fr); gap: 48px; }
}

.section {
  padding: clamp(72px, 12vh, 140px) clamp(20px, 5vw, 64px) 0;
  max-width: 1200px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.card {
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.card p, .steps p { color: var(--muted); line-height: 1.55; font-size: 15px; }

.num {
  display: inline-block;
  margin-bottom: 22px;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  color: #525252;
}

.steps { list-style: none; margin-top: 48px; display: grid; gap: 16px; }

.steps li {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  padding: 24px 26px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.steps .num { margin: 3px 0 0; }

.final { padding-bottom: 120px; }

.form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  max-width: 760px;
}

.form input {
  flex: 1 1 220px;
  padding: 15px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  outline: none;
}

.form input::placeholder { color: rgba(246, 242, 255, 0.45); }
.form input:focus { border-color: rgba(255, 255, 255, 0.6); }

.footer {
  padding: 48px clamp(20px, 5vw, 64px) 28px;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg);
  /* A second, smaller sheet: rounded and ringed like main, but it just scrolls with the page. */
  margin-block: 16px;
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line), 0 0 40px -12px rgba(10, 10, 10, 0.16);
}

/* Its own max width: padding in % would follow the page width, not this narrower sheet. */
.footer__grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; max-width: 1240px; margin-inline: auto; }
.footer__title { margin-bottom: 14px; font: 500 12px/1 'Geist Mono', monospace; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink); }
.footer ul { display: grid; gap: 10px; list-style: none; }
.footer a:hover { color: var(--ink); }
.footer__copy { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; }
@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1 / -1; } }

@media (max-width: 640px) {
  .nav nav a:not(.pill) { display: none; }
  .steps li { grid-template-columns: 1fr; gap: 12px; }
  .servizi__list { grid-template-columns: minmax(0, 1fr); }
}

#landing {
  position: relative;
  z-index: 2;
}

#landing .scroll-expand__overlay {
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 clamp(20px, 5vw, 64px);
}

.landing-hero {
  width: 100%;
  max-width: 1100px;
}

.hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 64px);
}

.landing-hero .lead { margin-left: auto; margin-right: auto; }
.landing-hero .cta-row { justify-content: center; }

.btn.glass {
  padding: 17px 32px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.38);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.05) 48%, rgba(255, 255, 255, 0.14) 100%);
  -webkit-backdrop-filter: blur(18px) saturate(1.7);
  backdrop-filter: blur(18px) saturate(1.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.55),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1),
    0 10px 30px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.3);
}

.btn.glass::after {
  content: '';
  position: absolute;
  inset: 1px 1px 50% 1px;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
  pointer-events: none;
}

.btn.glass:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.08) 48%, rgba(255, 255, 255, 0.2) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(255, 255, 255, 0.14),
    0 14px 36px rgba(0, 0, 0, 0.3);
}

/* The sections are a sheet: pulled up one screen, they slide over the hero while it stays stuck in place. */
main {
  position: relative;
  /* Above the footer too, or the footer's white would cover the shadow under the sheet. */
  z-index: 4;
  margin-top: -100svh;
  border-radius: 24px;
  background: var(--bg);
  box-shadow: 0 0 0 1px var(--line), 0 0 40px -12px rgba(10, 10, 10, 0.16);
}
/* Sheet motion, driven by the page scroll on the compositor so it never trails it.
   Over the first 3.7 screens of scroll (scrollDistance 1.1 + SHEET_PAUSE 1 + SHEET_RISE 1.6 in main.js) it peeks
   28px (SHEET_PEEK) from the bottom until 56.76% (= 2.1 / 3.7), then rises over the last 1.6 screens.
   shortcut: these numbers are copied from main.js, change them together. */
@supports (animation-timeline: scroll()) {
  main { animation: sheet linear both; animation-timeline: scroll(root); animation-range: 0 370vh; }
}
@keyframes sheet {
  0% { transform: translateY(calc(100vh - 28px - 370vh)); }
  56.76% { transform: translateY(calc(100vh - 28px - 160vh)); }
  100% { transform: none; }
}

/* Hidden on the first screen; it appears in the mist together with the hero copy (Landing, mistIn). */
main:not(.is-shown) { visibility: hidden; }
#servizi { border-radius: 24px 24px 0 0; }
main > section:last-of-type { border-radius: 0 0 24px 24px; }

/* Desktop: the sheet is only as wide as the sections need, and the hero stays fixed behind it at the sides. */
@media (min-width: 1024px) {
  /* shortcut: 370svh = scrollDistance 1.1 + SHEET_PAUSE 1 + SHEET_RISE 1.6 screens of the hero in main.js; change them together. */
  #landing { position: sticky; top: -370svh; }
  main, .footer { width: min(100% - 48px, 1368px); margin-inline: auto; }
  .footer { z-index: 3; background: var(--bg); }
}

/* Tab on top of the sheet, peeking at the bottom of the hero. */
.sheet-tab {
  position: absolute;
  bottom: calc(100% - 2px);
  left: 50%;
  display: grid;
  place-items: center;
  width: 64px;
  height: 32px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 -8px 16px -8px rgba(10, 10, 10, 0.16);
  transform: translateX(-50%);
  pointer-events: auto;
}
.sheet-tab:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* main scrolls over the hero: only its sections may catch the pointer, or the hero button stops responding. */
main { pointer-events: none; }
main > section { pointer-events: auto; }

#site-nav {
  position: fixed;
  top: 18px;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.tag--eyebrow { margin-bottom: 20px; }
.tag.tag--logo { padding: 4px 10px; color: var(--ink); font-size: 16px; }
.footer__brand .tag--logo { padding: 6px 13px; font-size: 20px; }
.steps .tag { justify-self: start; }

.nav-badge {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 48px -24px rgba(10, 10, 10, 0.3), 0 6px 16px -10px rgba(10, 10, 10, 0.16);
  pointer-events: auto;
}
.nav-badge:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
#servizi, #numeri, #metodo, #domande, #contatti { scroll-margin-top: 90px; }
/* The case study button: back from caso-studio.html it sits mid-screen, with the steps above it. */
#caso-studio { scroll-margin-top: 45vh; }

#landing .scroll-expand__title { color: var(--ink); text-shadow: none; }

.scramble { display: inline-grid; text-align: left; }
.scramble > span { grid-area: 1 / 1; white-space: nowrap; }
.scramble__sizer { visibility: hidden; font-weight: 800; }
.scramble__live { font-weight: 800; }
.scramble__live { width: 0; }
.scramble__cell { display: inline-block; position: relative; }
.scramble__cell > span { display: inline-block; }
.scramble__glyph {
  position: absolute;
  inset: 0;
  text-align: center;
  color: var(--accent);
  font-weight: 400;
  opacity: 0;
}

/* Buttons, after the "smooth button" pattern: 40px tall, rounded 6px, a short press-in on click. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease-out, background-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.btn--primary { background: var(--ink); color: var(--bg); box-shadow: 0 1px 2px rgba(10, 10, 10, .12); }
.btn--primary:hover { background: var(--accent); color: var(--ink); }
.btn--sm { height: 36px; }
.btn--lg { height: 44px; padding: 0 32px; font-size: 15px; }

/* Brand mark: a corner top right and one bottom left. */
.corners { position: relative; }
.corners::before,
.corners::after {
  content: '';
  position: absolute;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border: 0 solid var(--ink);
  pointer-events: none;
  transition: width .35s cubic-bezier(.65, 0, .35, 1), height .35s cubic-bezier(.65, 0, .35, 1);
}
.corners::before { top: 0; right: 0; border-width: 2px 2px 0 0; }
.corners::after { bottom: 0; left: 0; border-width: 0 0 2px 2px; }

.highlight { padding: 0 .15em; background: var(--accent); color: var(--ink); }

::selection { background: var(--accent); color: #0a0a0a; }

@media (prefers-reduced-motion: reduce) {
  .btn, .corners::before, .corners::after { transition: none; }
  .btn:active { transform: none; }
}

.metodo {
  padding: clamp(72px, 12vh, 140px) clamp(20px, 5vw, 64px) 120px;
  background: var(--bg);
}

/* Every section shares the same content width and left and right edges. */
.metodo__inner { max-width: 1240px; margin: 0 auto; }
#servizi { padding-inline: max(clamp(20px, 5vw, 64px), calc((100% - 1240px) / 2)); }

#servizi { min-height: 60vh; padding-bottom: 24px; }
#metodo { padding-top: 42px; padding-bottom: 96px; overflow-x: clip; }

#servizi { overflow-x: clip; }

@media (min-width: 901px) {
  #folder-root { place-items: center end; }
  /* Aligned to the right edge, the open cards fan past the screen: the folder slides left to keep them all visible. */
  #folder-root .folder-root { transition: transform .6s cubic-bezier(.22, 1, .36, 1); }
  #folder-root .folder-root[data-open] { transform: translateX(calc(var(--folder-w) * -.62)); }
}

.metodo__end { margin-top: 40px; }
.metodo__end .metodo__close { margin-top: 0; }

/* Coverflow of the five steps: the active card faces you, the others turn away to the sides. */
.coverflow { margin-top: 40px; outline: none; }
.coverflow:focus-visible { outline: 2px solid var(--ink); outline-offset: 8px; border-radius: 12px; }
.coverflow__stage {
  position: relative;
  display: flex;
  justify-content: center;
  height: 300px;
  perspective: 1200px;
  transform-style: preserve-3d;
  touch-action: pan-y;
  user-select: none;
}
.coverflow__card {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(320px, 78vw);
  height: 100%;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f7f7f7;
  box-shadow: 0 24px 48px -28px rgba(10, 10, 10, 0.35);
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform .45s cubic-bezier(.34, 1.1, .64, 1), opacity .3s ease, filter .3s ease;
}
.coverflow__card[data-active] { cursor: default; }
.coverflow__card .tag { align-self: flex-start; }
.coverflow__card h3 { font-size: 20px; margin: 0; }
.coverflow__card p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.coverflow__controls { display: flex; justify-content: center; align-items: center; gap: 24px; margin-top: 28px; font-family: 'Geist Mono', monospace; font-size: 14px; }
.coverflow__controls button {
  padding: 8px 6px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  text-decoration: underline 1px transparent;
  text-underline-offset: 4px;
  transition: text-decoration-color .2s ease;
}
.coverflow__controls button:is(:hover, :focus-visible):not(:disabled) { text-decoration-color: currentColor; }
.coverflow__controls button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.coverflow__controls button:disabled { color: #8c8c8c; cursor: default; }
.coverflow__count { color: #404040; }

@media (prefers-reduced-motion: reduce) {
  .coverflow__card { transition: none; }
}

@media (min-width: 900px) {
  .metodo__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; column-gap: 40px; }
  .metodo__head .lead { margin-top: 0; justify-self: end; }
}

.folder-doc-title { color: var(--ink); }

.numeri {
  padding: 64px clamp(20px, 5vw, 64px) 64px;
  background: var(--bg);
}

/* Bento: the lead stat takes two columns by two rows, the other two sit stacked beside it. */
.numeri__list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: minmax(200px, auto);
  gap: 16px;
  margin-top: 40px;
}
.numeri__list li {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
}
.numeri__list li.is-lead { grid-row: span 2; background: #f7f7f7; }
.numeri__list li.is-lead .numeri__source { margin-top: 0; }
.numeri__dots { display: grid; grid-template-columns: repeat(20, 1fr); gap: 6px; margin-bottom: auto; padding-bottom: 20px; }
.numeri__dots span { aspect-ratio: 1; border-radius: 50%; background: rgba(10, 10, 10, 0.12); }
.numeri__dots[data-seen] span.is-on { background: var(--accent); transition: background-color .3s ease calc(var(--i) * 12ms); }
.numeri__list p { color: var(--muted); line-height: 1.55; font-size: 15px; }

.stats-counter { font-variant-numeric: tabular-nums; }
.numeri__value { font-size: clamp(56px, 7vw, 96px); font-weight: 700; line-height: 1; letter-spacing: -0.03em; }

.numeri__source { margin-top: auto; font-family: 'Geist Mono', monospace; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.numeri__note { margin-top: 32px; font-size: 13px; color: var(--muted); }

@media (max-width: 760px) {
  .numeri__list { grid-template-columns: minmax(0, 1fr); grid-auto-rows: auto; gap: 12px; }
  .numeri__list li, .numeri__list li.is-lead { grid-column: auto; grid-row: auto; }
  .numeri__dots { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  .numeri__dots[data-seen] span.is-on { transition: none; }
}

.domande { padding: clamp(72px, 12vh, 140px) clamp(20px, 5vw, 64px) 96px; background: var(--bg); }
.domande__inner { max-width: 860px; margin: 0 auto; }

/* FAQ accordion on native <details>: works without JS; the open/close height animates where the browser supports ::details-content. */
.faq { display: grid; gap: 16px; margin-top: 48px; interpolate-size: allow-keywords; }
.faq details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.faq details:hover { border-color: var(--accent); box-shadow: 0 16px 32px -20px rgba(10, 10, 10, 0.25); transform: scale(1.01); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 24px;
  font-size: 18px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-family: 'Geist Mono', monospace; font-size: 22px; font-weight: 400; transition: transform .3s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; border-radius: 16px; }
.faq details p { padding: 0 24px 24px; color: var(--muted); font-size: 16px; line-height: 1.6; }
.faq details::details-content { height: 0; overflow: clip; transition: height .3s ease, content-visibility .3s allow-discrete; }
.faq details[open]::details-content { height: auto; }
@media (prefers-reduced-motion: reduce) {
  .faq details, .faq summary::after, .faq details::details-content { transition: none; }
  .faq details:hover { transform: none; }
}

.contatti {
  position: relative;
  padding: clamp(72px, 12vh, 140px) clamp(20px, 5vw, 64px) 120px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.contatti__head { text-align: center; }
.contatti__head h2, .contatti__head .lead { margin-inline: auto; }

.contact-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding: 32px;
}

/* The form sits inside the brand corners, a little larger here than on the logo. */
.contact-frame { max-width: 826px; margin: 40px auto 0; }
.contact-frame::before, .contact-frame::after { width: 14px; height: 14px; }
.contact-form__field:has(textarea), .contact-form__consent, .contact-form__end { grid-column: 1 / -1; }
.contact-form__field { position: relative; display: block; font-size: 16px; color: var(--ink); }
/* Floating label: sits inside the empty field, rises onto its border on focus or once filled. */
.contact-form__field > span {
  position: absolute;
  top: 24px;
  left: 10px;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--bg);
  color: #6b7280;
  line-height: 1.2;
  pointer-events: none;
  transform: translateY(-50%);
  transform-origin: left center;
  transition: transform .28s cubic-bezier(.4, 0, .2, 1), color .28s cubic-bezier(.4, 0, .2, 1), border-color .28s cubic-bezier(.4, 0, .2, 1);
}
.contact-form__field :is(input, textarea):is(:focus, :not(:placeholder-shown)) + span {
  border-color: var(--accent);
  color: var(--ink);
  transform: translateY(calc(-50% - 24px)) scale(.85);
}
@media (prefers-reduced-motion: reduce) {
  .contact-form__field > span { transition: none; }
}
.contact-form__field small { font-size: inherit; font-weight: 400; color: var(--muted); }
/* 16px stops iOS zooming into the field on focus. */
.contact-form__field input, .contact-form__field textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #8c8c8c;
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  resize: vertical;
}
.contact-form__field input:focus, .contact-form__field textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; }
.contact-form__consent { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.contact-form__consent input { width: 20px; height: 20px; accent-color: var(--ink); }
.contact-form__link { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.contact-form__end { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 24px; margin-top: 8px; }
.contact-form__status { font-size: 15px; color: var(--ink); }

@media (max-width: 640px) {
  .contact-form { grid-template-columns: minmax(0, 1fr); padding: 20px; }
}

/* Small mono label. `.da-inserire` = data still to replace, dashed so it stands out until then. */
.tag,
.da-inserire {
  display: inline-block;
  color: #404040;
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
}
.da-inserire { padding: 2px 8px; border: 1px dashed #737373; border-radius: 6px; }

.metodo__close {
  margin-top: 48px;
  font-size: clamp(22px, 2.6vw, 32px);
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 600;
}

/* Bottom right of the sheet; main.js sends it back to the open hero. */
.back-top {
  position: absolute;
  right: clamp(20px, 5vw, 64px);
  bottom: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 4px;
  color: var(--muted);
  font-family: 'Geist Mono', ui-monospace, monospace;
  font-size: 13px;
  transition: color .2s ease;
}
.back-top:hover { color: var(--ink); }
.back-top:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* App-like popup (main.js, Popup): a rounded window over the site, which shows blurred and slightly darkened behind. */
.metodo__end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.popup {
  width: min(100% - 32px, 960px);
  max-height: min(100% - 32px, 860px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 24px 80px -20px rgba(10, 10, 10, .35);
  overscroll-behavior: contain;
}
#analisi-popup { width: min(100% - 32px, 720px); }
.popup::backdrop { background: rgba(10, 10, 10, .18); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.popup[open] { animation: popup-in .35s cubic-bezier(.22, 1, .36, 1); }
.popup[open]::backdrop { animation: popup-fade .35s ease; }
@keyframes popup-in { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes popup-fade { from { opacity: 0; } }
/* The dialog stays put and only the body scrolls, so the X (outside the body) never moves. */
.popup[open] { display: flex; flex-direction: column; overflow: hidden; }
.popup__body { position: relative; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: clamp(28px, 5vw, 56px); }
.popup__body > .btn { margin-top: 32px; }
/* Room under the last line so the fade never covers it once scrolled to the end. */
.popup__body:has(+ .popup__footer) { padding-bottom: 72px; }
.popup__footer { position: relative; padding: 4px clamp(28px, 5vw, 56px) clamp(20px, 3vw, 32px); background: var(--bg); }
/* Fade above the footer: the content dissolves into it instead of being cut by an edge. */
.popup__footer::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 64px; background: linear-gradient(rgba(255, 255, 255, 0), var(--bg)); pointer-events: none; }

/* Screenshot of a client's site in a browser-window frame. */
.site-preview { display: block; margin-top: 32px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #f7f7f7; box-shadow: 0 24px 48px -28px rgba(10, 10, 10, 0.35); transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1); }
/* Lifts only where it is a link (the case study page); in the popup it is just a picture. */
a.site-preview:hover { transform: translateY(-3px); }
.site-preview:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.site-preview__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 500 12px 'Geist Mono', monospace; color: var(--muted); }
.site-preview__bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(0, 0, 0, 0.14); }
.site-preview__bar span { margin-left: 10px; }
.site-preview img { display: block; width: 100%; height: auto; }
.caso__summary { margin-top: 24px; max-width: 620px; color: var(--muted); font-size: 16px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .site-preview { transition: none; } }
.popup__body .contact-form { margin-top: 32px; }
.popup__close {
  position: absolute; top: 16px; right: 16px; z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 50%;
  /* Solid, so the text scrolling underneath never shows through. */
  background: var(--bg); color: var(--ink); cursor: pointer;
  transition: background .2s ease;
}
.popup__close:hover { background: #f0f0f0; }
.popup__close:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.popup__title { font-size: clamp(26px, 3.4vw, 40px); padding-right: 40px; }
.popup__lead { margin-top: 12px; }
.caso__steps { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; margin-top: 40px; }
.caso__steps li { padding-top: 16px; border-top: 1px solid var(--line); }
.caso__steps .tag { margin-bottom: 12px; }
.caso__steps p { color: var(--muted); line-height: 1.55; }
@media (prefers-reduced-motion: reduce) { .popup[open], .popup[open]::backdrop { animation: none; } }

/* Letters rising one at a time (main.js, Letters). Opacity and transform only, so it stays smooth on phones. */
.letters__word { display: inline-block; white-space: nowrap; }
.letters__word > span {
  display: inline-block;
  opacity: 0;
  transform: translateY(46px);
  transition: opacity 0.4s cubic-bezier(0.18, 1, 0.32, 1), transform 0.4s cubic-bezier(0.18, 1, 0.32, 1);
}
/* What follows the letters in the same heading (the hero's rotating word) rises right after them: they last about 0.9s. */
.letters + .scramble { opacity: 0; transform: translateY(46px); transition: opacity 0.4s cubic-bezier(0.18, 1, 0.32, 1) 0.9s, transform 0.4s cubic-bezier(0.18, 1, 0.32, 1) 0.9s; }
.letters.is-in .letters__word > span, .letters.is-in + .scramble { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .letters__word > span, .letters + .scramble { opacity: 1; transform: none; transition: none; } }

/* Privacy and cookie page (privacy.html): one still sheet, no hero behind it. */
.legal-page { background: #f4f4f4; }
.legal__top { display: flex; align-items: center; justify-content: space-between; width: min(100% - 32px, 1368px); margin: 0 auto; padding: 24px 8px; font-size: 14px; color: var(--muted); }
.legal__back:hover { color: var(--ink); }
main.legal { margin: 0 auto; width: min(100% - 32px, 1368px); padding: clamp(40px, 7vw, 96px) clamp(20px, 5vw, 64px); animation: none; transform: none; }
.legal > * { max-width: 720px; margin-inline: auto; }
.legal h1 { font-size: clamp(36px, 5vw, 60px); }
.legal__index { display: flex; gap: 20px; margin-top: 32px; font: 500 13px 'Geist Mono', monospace; }
.legal__index a { text-decoration: underline; text-underline-offset: 4px; }
.legal section { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); scroll-margin-top: 24px; }
.legal h2 { font-size: clamp(26px, 3vw, 36px); }
.legal h3 { margin: 32px 0 8px; font-size: 18px; }
.legal p, .legal li { color: var(--muted); font-size: 16px; line-height: 1.65; }
.legal p + p { margin-top: 12px; }
.legal ul { display: grid; gap: 8px; padding-left: 20px; }
.legal strong { color: var(--ink); font-weight: 600; }
.legal p a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.footer--legal { width: min(100% - 32px, 1368px); margin-inline: auto; font-size: 13px; }
.footer--legal a:hover { color: var(--ink); }

/* Case study page (caso-studio.html): same still sheet as the privacy page. */
.caso__facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px 24px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.caso__facts dt { font: 500 12px 'Geist Mono', monospace; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink); }
.caso__facts dd { margin-top: 6px; color: var(--muted); }
.caso__facts a { text-decoration: underline; text-underline-offset: 3px; }
.legal > .caso__preview { max-width: 960px; margin-top: 48px; }
.caso .caso__steps { grid-template-columns: 1fr; gap: 0; margin-top: 24px; }
.caso .caso__steps li { display: grid; grid-template-columns: 56px 1fr; padding: 20px 0; }
.caso .caso__steps .tag { grid-row: span 2; align-self: start; justify-self: start; }
.caso .caso__steps h3 { margin: 0 0 6px; }
.caso__end { text-align: center; }
.caso__end h2, .caso__end p { margin-inline: auto; }
.caso__end .btn { margin-top: 24px; }
