/* antoniocivita.it — chiaro minimal: bianco, tipografia Geist, colore solo nei dettagli */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --ink: #0e0e0c;
  --ink-2: #63635e;
  --ink-3: #9a9a94;
  --line: #e7e7e3;
  --signal: #e0341b;
  --ok: #2e7d32;
  --sans: "Geist", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
  --max: 1120px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.6 var(--sans); letter-spacing: -.005em;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; }
::selection { background: var(--ink); color: #fff; }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: 32px; padding-right: 32px; }

/* ---------- barra di avanzamento ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  background: var(--signal); transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* ---------- testata (diventa vetro allo scroll) ---------- */
.top {
  position: sticky; top: 0; z-index: 50;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.top.scrolled {
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
}
.top-in {
  max-width: var(--max); margin: 0 auto; padding: 16px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.brand img { border-radius: 8px; display: block; }
.langs { display: flex; gap: 2px; padding: 3px; background: var(--bg-soft); border-radius: 999px; }
.langs a {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px;
  font: 500 12px var(--mono); letter-spacing: .04em; text-decoration: none; color: var(--ink-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.langs a:hover { color: var(--ink); }
.langs a[aria-current] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.langs svg { width: 18px; height: 12px; border-radius: 2px; display: block; box-shadow: 0 0 0 .5px rgba(0,0,0,.2); }

/* ---------- apertura ---------- */
.hero { padding-top: 16vh; padding-bottom: 14vh; }
.kicker {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 32px;
  font: 500 13px var(--mono); color: var(--ink-2); letter-spacing: .02em;
}
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); box-shadow: 0 0 0 4px rgba(224,52,27,.12); }
h1 {
  margin: 0; max-width: 13ch;
  font: 600 clamp(46px, 8.2vw, 112px)/.96 var(--sans); letter-spacing: -.045em;
}
h1 em { font-style: normal; color: var(--ink-3); }
.lead { max-width: 52ch; margin: 36px 0 0; font-size: clamp(17px, 1.5vw, 20px); color: var(--ink-2); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 500; font-size: 16px; text-decoration: none; transition: transform .3s var(--ease), background .2s, box-shadow .3s;
}
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(0,0,0,.45); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-ghost span { transition: transform .3s var(--ease); }
.btn-ghost:hover span { transform: translateX(4px); }

/* titolo: le parole salgono una alla volta (le spezza site.js) */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1s var(--ease); transition-delay: calc(var(--k) * 70ms + 100ms); }
.split.in .w > span { transform: none; }

/* ---------- sezioni ---------- */
.block { padding-top: 0; padding-bottom: 120px; position: relative; }
.rule { height: 1px; background: var(--line); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1.4s var(--ease); margin-bottom: 56px; }
.rule.in { transform: none; }
.label { margin: 0 0 48px; font: 500 13px var(--mono); color: var(--ink-3); letter-spacing: .02em; }

.work { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.num { font: 500 13px var(--mono); color: var(--signal); }
.work h3 { margin: 14px 0 10px; font: 600 26px/1.15 var(--sans); letter-spacing: -.03em; }
.work p { margin: 0; color: var(--ink-2); }

/* ---------- app ---------- */
.app { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.app-head { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; }
.app-icon svg { width: 64px; height: 64px; display: block; filter: drop-shadow(0 8px 16px rgba(198,40,40,.28)); }
.app-tag { margin: 0 0 2px; font: 500 12px var(--mono); color: var(--ink-3); letter-spacing: .03em; }
.app h3 { margin: 0; font: 600 clamp(30px, 3.6vw, 44px)/1.05 var(--sans); letter-spacing: -.035em; }
.app-text > p { margin: 0; max-width: 46ch; font-size: 18px; color: var(--ink-2); }
.app-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; margin-top: 28px !important; font-size: 15px !important; font-weight: 500; }
.app-meta a { text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--ink-3); transition: border-color .2s; }
.app-meta a:hover { border-color: var(--ink); }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(46,125,50,.5); animation: ping 2.2s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px rgba(46,125,50,0); } 100% { box-shadow: 0 0 0 0 rgba(46,125,50,0); } }

/* telefono illustrativo */
.phone-stage { display: flex; justify-content: center; perspective: 1400px; padding: 20px 0; }
.phone {
  --r: 1; width: 280px; aspect-ratio: 9 / 19; padding: 10px; border-radius: 44px;
  background: linear-gradient(145deg, #2a2a28, #0e0e0c);
  box-shadow: 0 50px 80px -30px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.6), inset 0 0 0 2px #3a3a37;
  transform: translateY(calc(var(--r) * 60px)) rotateX(calc(var(--r) * 18deg)) rotateZ(calc(var(--r) * -6deg));
  will-change: transform;
}
.phone-screen {
  height: 100%; border-radius: 35px; background: #fdf8f6; overflow: hidden;
  padding: 44px 16px 16px; display: flex; flex-direction: column; gap: 12px;
  font-family: Roboto, var(--sans); color: #1d1b1a;
}
.ph-title { font-weight: 700; font-size: 19px; letter-spacing: -.02em; }
.ph-card { background: #e6f2e5; border-radius: 22px; padding: 18px 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ph-card b { font-size: 15px; }
.ph-card small { font-size: 10.5px; color: #4a4744; }
.ph-dot { width: 42px; height: 42px; border-radius: 50%; background: #2e7d32; display: grid; place-items: center; }
.ph-dot svg { width: 24px; height: 24px; }
.ph-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ph-stats div { border: 1px solid #e3d9d5; border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; }
.ph-stats b { font-size: 24px; color: #b3261e; line-height: 1.1; }
.ph-stats div + div b { color: #3d3a38; }
.ph-stats small { font-size: 10px; color: #4a4744; }
.ph-sw { border: 1px solid #e3d9d5; border-radius: 16px; padding: 4px 12px; display: flex; flex-direction: column; font-size: 11px; }
.ph-sw span { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; }
.ph-sw span + span { border-top: 1px solid #efe6e2; }
.ph-sw i { width: 30px; height: 17px; border-radius: 999px; background: #e7e0ec; border: 1.5px solid #79747e; position: relative; flex: none; }
.ph-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: #79747e; }
.ph-sw i.on { background: #b3261e; border-color: #b3261e; }
.ph-sw i.on::after { left: auto; right: 2px; background: #fff; width: 11px; height: 11px; top: 1.5px; }
.ph-list { border: 1px solid #e3d9d5; border-radius: 16px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; font-size: 11px; }

/* ---------- contatti ---------- */
.contact h2 { margin: 0; max-width: 16ch; font: 600 clamp(36px, 5.6vw, 72px)/1 var(--sans); letter-spacing: -.045em; }
.contact p { margin: 22px 0 32px; color: var(--ink-2); font-size: 18px; }
.mail {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 clamp(22px, 3vw, 34px) var(--sans); letter-spacing: -.03em; text-decoration: none;
  padding-bottom: 6px; background: linear-gradient(var(--signal), var(--signal)) 0 100% / 0 2px no-repeat;
  transition: background-size .5s var(--ease);
}
.mail:hover { background-size: 100% 2px; }
.mail span { color: var(--signal); transition: transform .3s var(--ease); }
.mail:hover span { transform: translate(3px, -3px); }

/* ---------- privacy ---------- */
.doc { max-width: 760px; padding-top: 8vh; padding-bottom: 100px; }
.doc h1 { font-size: clamp(34px, 5vw, 56px); max-width: none; line-height: 1.04; }
.doc h2 { margin: 44px 0 10px; font: 600 20px var(--sans); letter-spacing: -.02em; }
.doc p, .doc li { color: var(--ink-2); }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a { color: var(--ink); }
.updated { font: 500 13px var(--mono); color: var(--ink-3) !important; margin-top: 16px; }
.back { display: inline-block; margin-bottom: 36px; font-size: 15px; text-decoration: none; color: var(--ink-2) !important; }

/* ---------- piede ---------- */
.foot { border-top: 1px solid var(--line); }
.foot-in {
  max-width: var(--max); margin: 0 auto; padding: 32px 32px 40px;
  display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px;
  font-size: 14px; color: var(--ink-2);
}
.foot-id { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-id strong { color: var(--ink); font-weight: 600; }
.foot-links { display: flex; gap: 20px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); }

/* ---------- comparsa allo scroll ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); transition-delay: calc(var(--i, 0) * 90ms); }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .split .w > span, .rule { opacity: 1 !important; transform: none !important; transition: none !important; }
  .phone { transform: none !important; }
  .status i { animation: none; }
}

/* ---------- telefono e tablet ---------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; gap: 24px; }
  .work { grid-template-columns: 1fr; gap: 36px; }
}
@media (max-width: 640px) {
  .wrap, .top-in, .foot-in { padding-left: 16px; padding-right: 16px; }
  .brand span { display: none; }
  .langs a { padding: 5px 8px; }
  .hero { padding-top: 10vh; padding-bottom: 10vh; }
  .block { padding-bottom: 88px; }
  .rule { margin-bottom: 40px; }
  .label { margin-bottom: 32px; }
  .phone { width: 240px; }
}
