/* Lorenzo Maero – Consulenza informatica */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("../fonts/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #0E1726;
  --body: #344054;
  --muted: #475467;
  --gray: #98A2B3;
  --light: #D0D5DD;
  --line: #E4E7EC;
  --soft: #F4F6F8;
  --dark-line: #253043;
  --accent: #1D4ED8;
  --accent-soft: #E0E7FF;
  --wrap: 1160px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: "Inter", system-ui, sans-serif; color: var(--ink); background: #FFFFFF; line-height: 1.5; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: "Space Grotesk", "Inter", system-ui, sans-serif; margin: 0; }
p { margin: 0; }
a { color: var(--ink); transition: color 150ms ease; }
a:hover { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { padding-top: 16px; padding-bottom: 16px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; background: var(--ink); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 16px; }
.brand-name { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 18px; }
.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.nav a { text-decoration: none; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; padding: 16px 24px; border-radius: 12px; transition: transform 160ms var(--ease-out), box-shadow 200ms ease; }
.btn:active { transform: scale(0.97); }
.btn-sm { font-size: 15px; padding: 12px 20px; border-radius: 10px; }
.btn-solid, .btn-solid:hover { background: var(--accent); color: #FFFFFF; }
.btn-ghost, .btn-ghost:hover { background: #FFFFFF; color: var(--ink); border: 1px solid var(--light); padding: 15px 23px; }
.btn-white, .btn-white:hover { background: #FFFFFF; color: var(--ink); }
.btn-light, .btn-light:hover { color: #FFFFFF; border: 1px solid #FFFFFF; padding: 15px 23px; }
.arr { transition: transform 200ms var(--ease-out); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; }
.hero-dots { position: absolute; inset: 0; background-image: radial-gradient(var(--light) 1px, transparent 1px); background-size: 24px 24px; -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%); mask-image: radial-gradient(ellipse at 70% 40%, #000 0%, transparent 65%); opacity: 0.7; }
.hero-inner { position: relative; padding-top: 96px; padding-bottom: 104px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-copy { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.eyebrow { font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.hero h1 { font-size: clamp(40px, 5.4vw, 72px); line-height: 1.05; font-weight: 700; letter-spacing: -0.025em; }
.lead { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 600px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 8px; }

.words { display: inline-grid; vertical-align: bottom; color: var(--accent); }
.word, .detail { grid-area: 1 / 1; opacity: 0; translate: 0 .35em; filter: blur(6px); transition: opacity 500ms var(--ease-out), translate 500ms var(--ease-out), filter 500ms var(--ease-out); }
.word.out, .detail.out { translate: 0 -.35em; }
.word.on, .detail.on { opacity: 1; translate: 0 0; filter: blur(0); }

.offer { flex: 1 1 360px; min-width: 0; background: var(--ink); color: #FFFFFF; border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 30px 60px -30px rgba(14, 23, 38, 0.5); }
.offer-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gray); }
.rows { position: relative; display: flex; flex-direction: column; }
.pill { position: absolute; left: 0; right: 0; top: 0; height: 52px; border-radius: 12px; background: #1B2638; box-shadow: inset 0 0 0 1px #2C3A52; transition: transform 450ms var(--ease-in-out); }
.row { all: unset; box-sizing: border-box; position: relative; cursor: pointer; height: 52px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-radius: 12px; color: var(--gray); font-weight: 600; transition: color 200ms ease; }
.row .sub { font-weight: 400; font-size: 14px; color: var(--gray); }
.row.on { color: #FFFFFF; }
.row.on .sub { color: #C7D2FE; }
.row:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }
.details { display: grid; min-height: 48px; padding: 0 16px; font-size: 15px; line-height: 1.55; color: var(--light); }

/* ---------- Marquee ---------- */
.band { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.track { display: flex; width: max-content; animation: marquee 40s linear infinite; font-family: "Space Grotesk", sans-serif; font-size: 22px; font-weight: 500; }
.marquee:hover .track { animation-play-state: paused; }
.track span { display: inline-flex; align-items: center; gap: 28px; padding-right: 28px; white-space: nowrap; }
.track span::after { content: ""; width: 6px; height: 6px; border-radius: 2px; background: var(--accent); transform: rotate(45deg); }

/* ---------- Sections ---------- */
.section { padding-top: 104px; padding-bottom: 104px; }
.section-soft { background: var(--soft); }
.section-dark { background: var(--ink); color: #FFFFFF; }
.stack { display: flex; flex-direction: column; gap: 48px; }
.head { display: flex; flex-direction: column; gap: 12px; max-width: 640px; }
.head h2, .about h2, .cta h2 { font-size: 44px; line-height: 1.1; letter-spacing: -0.015em; }
.head p { font-size: 18px; line-height: 1.6; color: var(--muted); }
.section-dark .head p { color: var(--light); }
.grid { display: flex; flex-wrap: wrap; gap: 20px; }

.card { position: relative; isolation: isolate; flex: 1 1 200px; background: #FFFFFF; border: 1px solid var(--line); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 14px; transition: transform 300ms var(--ease-out), box-shadow 300ms ease; }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; opacity: 0; transition: opacity 250ms ease; background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(29, 78, 216, 0.13), transparent 70%); }
.card h3 { font-size: 21px; }
.card p { font-size: 15px; line-height: 1.6; color: var(--muted); }
.card-wide { flex-basis: 320px; padding: 32px; gap: 12px; }
.card-wide h3 { font-size: 22px; }
.num { font-family: "Space Grotesk", sans-serif; font-size: 15px; font-weight: 600; color: var(--accent); }
.ico { width: 28px; height: 28px; stroke: var(--accent); transition: transform 300ms var(--ease-out); }

.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 32px; }
.step { position: relative; flex: 1 1 220px; display: flex; flex-direction: column; gap: 10px; padding-top: 24px; }
.step .num { color: var(--gray); font-weight: 400; }
.step h3 { font-size: 21px; }
.step p { font-size: 15px; line-height: 1.6; color: var(--light); }
.track-line { position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--dark-line); }
.fill { position: absolute; inset: 0; background: var(--accent); transform-origin: left; }

.about { display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.photo { flex: 1 1 280px; max-width: 380px; aspect-ratio: 4 / 5; border-radius: 20px; overflow: hidden; background: var(--soft); box-shadow: 0 30px 60px -30px rgba(14, 23, 38, 0.45); }
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.about-copy { flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.about-copy p { font-size: 18px; line-height: 1.65; color: var(--body); }
.about-copy .place { font-size: 15px; line-height: 1.5; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.cta-wrap { padding-bottom: 104px; }
.cta { position: relative; overflow: hidden; background: var(--accent); color: #FFFFFF; border-radius: 24px; padding: 72px 56px; display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: space-between; }
.cta-dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(255, 255, 255, 0.22) 1px, transparent 1px); background-size: 22px 22px; -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 0%, transparent 60%); mask-image: radial-gradient(ellipse at 100% 0%, #000 0%, transparent 60%); }
.cta-copy { position: relative; flex: 999 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.cta-copy p { font-size: 18px; line-height: 1.6; color: var(--accent-soft); }
.cta-actions { position: relative; flex: 1 1 280px; display: flex; flex-direction: column; gap: 12px; }
.cta-actions .contacts { margin-top: 4px; font-size: 15px; line-height: 1.6; text-align: center; color: var(--accent-soft); }
.cta-actions .contacts a { color: #FFFFFF; white-space: nowrap; }
@media (max-width: 600px) {
  .cta { padding: 48px 24px; }
  .head h2, .about h2, .cta h2 { font-size: 34px; }
  .section { padding-top: 80px; padding-bottom: 80px; }
}

.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); }
.site-footer a { color: var(--muted); }

/* ---------- Pagine di testo (privacy, 404) ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 72px 24px 96px; display: flex; flex-direction: column; gap: 36px; font-size: 16px; line-height: 1.7; color: var(--body); }
.legal h1 { font-size: 44px; line-height: 1.1; letter-spacing: -0.015em; color: var(--ink); }
.legal h2 { font-size: 24px; color: var(--ink); }
.legal section { display: flex; flex-direction: column; gap: 10px; }
.legal a { color: var(--accent); }
.legal .meta { color: var(--muted); }

/* ---------- Hover (solo mouse) ---------- */
@media (hover: hover) and (pointer: fine) {
  .btn-solid:hover { box-shadow: inset 0 0 0 999px rgba(14, 23, 38, 0.14); }
  .btn-ghost:hover, .btn-white:hover { box-shadow: inset 0 0 0 999px rgba(14, 23, 38, 0.05); }
  .btn-light:hover { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.14); }
  .btn:hover .arr { transform: translateX(3px); }
  .row:hover { color: var(--light); }
  .card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(14, 23, 38, 0.28); }
  .card:hover::before { opacity: 1; }
  .card:hover .ico { transform: scale(1.1) rotate(-6deg); }
}

/* ---------- Animazioni ---------- */
@keyframes rise { from { opacity: 0; translate: 0 12px; } }
@keyframes up { from { opacity: 0; translate: 0 48px; filter: blur(6px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes heroOut { to { opacity: 0; translate: 0 -90px; scale: .97; } }
@keyframes drift { to { translate: 0 160px; } }
@keyframes para { from { translate: 0 60px; } to { translate: 0 -60px; } }
@keyframes zoom { from { opacity: .4; scale: .9; } }
@keyframes shadow { to { box-shadow: 0 10px 30px -12px rgba(14, 23, 38, 0.18); } }

.rise { animation: rise 700ms var(--ease-out) both; }
.d1 { animation-delay: 70ms; } .d2 { animation-delay: 140ms; } .d3 { animation-delay: 210ms; } .d4 { animation-delay: 280ms; }

/* Animazioni legate allo scorrimento: solo nei browser che le supportano */
@supports (animation-timeline: view()) {
  .reveal { animation: up linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  .stagger > :nth-child(2) { animation-range: entry 8% entry 63%; }
  .stagger > :nth-child(3) { animation-range: entry 16% entry 71%; }
  .stagger > :nth-child(4) { animation-range: entry 24% entry 79%; }
  .stagger > :nth-child(5) { animation-range: entry 32% entry 87%; }
  .hero-out { animation: heroOut linear both; animation-timeline: scroll(); animation-range: 0px 640px; }
  .hero-dots { animation: drift linear both; animation-timeline: scroll(); animation-range: 0px 800px; }
  .parallax { animation: para linear both; animation-timeline: view(); }
  .zoom { animation: zoom linear both; animation-timeline: view(); animation-range: entry 0% cover 45%; }
  .site-header { animation: shadow linear both; animation-timeline: scroll(); animation-range: 0px 120px; }
  .progress { animation: grow linear both; animation-timeline: scroll(); }
  .steps { view-timeline: --steps block; }
  .fill { animation: grow linear both; animation-timeline: --steps; }
  .step:nth-child(1) .fill { animation-range: cover 20% cover 32%; }
  .step:nth-child(2) .fill { animation-range: cover 32% cover 44%; }
  .step:nth-child(3) .fill { animation-range: cover 44% cover 56%; }
  .step:nth-child(4) .fill { animation-range: cover 56% cover 68%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rise, .reveal { animation-name: fade; }
  .hero-out, .hero-dots, .parallax, .zoom, .fill { animation: none; }
  .btn:active, .card:hover, .card:hover .ico { transform: none; }
  .word, .detail { translate: none; filter: none; }
  .pill { transition: none; }
  .track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .track span[aria-hidden="true"] { display: none; }
}
