/* =========================================================
   Alfa.it — tema ProcessWire
   Palette ereditata dal sito attuale: arancio #FF5B2E, blu #002C47
   ========================================================= */
/* Plus Jakarta Sans, ospitato in locale (variabile 400-800) */
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --navy: #002c47;
  --navy-900: #00192a;
  --ink: #0d2233;
  --text: #4b5b69;
  --muted: #5b6977;
  --orange: #f15d22;           /* arancio del logo (rgb 241,93,34) */
  --accent: #f15d22;           /* come il logo: bottoni e testi in evidenza */
  --accent-700: #d94a12;       /* hover */
  --orange-600: #d94a12;
  --orange-100: #ffe9e2;
  --sky: #1eb7f0;
  --cream: #f7f4ef;
  --white: #ffffff;
  --line: #e6e1d8;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow: 0 1px 2px rgba(0,25,42,.05), 0 12px 32px -12px rgba(0,25,42,.18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wrap: 1240px;
  --header-h: 76px;
  --ease-spring: cubic-bezier(.34, 1.4, .5, 1);
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  /* scala z-index */
  /* Raggi: pillola = elementi interattivi; 20px = card; 28px = contenitori grandi; 14px = campi */
  --z-float: 90; --z-header: 100; --z-skip: 200;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { color: var(--navy); margin: 0; line-height: 1.1; letter-spacing: -.02em; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
ul { list-style: none; margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; border-radius: 6px; }

.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: var(--z-skip); }
.skip:focus { top: 12px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 15px/1 var(--font); letter-spacing: .01em;
  padding: 17px 26px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: transform .35s var(--ease-spring), background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:active, .mailmax:active, .call:active { transform: scale(.97) translateY(1px); transition-duration: .08s; }
.btn svg { width: 18px; height: 18px; transition: transform .2s ease; }
.btn:hover svg.arrow { transform: translateX(4px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px -12px rgba(241,93,34,.55); }
.btn-primary:hover { background: var(--accent-700); transform: translateY(-2px); }
.btn-ghost { border-color: var(--navy); color: var(--navy); }
.btn-ghost:hover { background: var(--navy); color: #fff; }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--accent); color: #fff; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: var(--z-header); height: var(--header-h);
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(0,44,71,.08);
}
.header .wrap { height: 100%; display: flex; align-items: center; gap: 28px; }
.logo img { height: 40px; width: auto; }
.nav { margin-left: auto; }
.nav > ul { display: flex; align-items: center; gap: 4px; }
.nav a.nl, .nav button.nl {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 16px; border-radius: 999px; background: none; border: 0; cursor: pointer;
  font: 600 15px/1 var(--font); color: var(--navy); white-space: nowrap; transition: background .2s, color .2s;
}
.nav a.nl:hover, .nav button.nl:hover, .nav li:focus-within > .nl { background: var(--cream); }
.nav a.nl[aria-current="page"] { color: var(--accent); }
.nav .chev { width: 12px; height: 12px; transition: transform .2s; }
.has-sub { position: relative; }
.sub {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 260px;
  background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 8px;
  box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s ease;
}
.has-sub:hover .sub, .has-sub:focus-within .sub { opacity: 1; visibility: visible; transform: none; }
.has-sub:hover .chev, .has-sub:focus-within .chev { transform: rotate(180deg); }
.sub a { display: block; padding: 11px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; color: var(--navy); }
.sub a:hover { background: var(--cream); color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }
/* Posta MAX: SEMPRE visibile (anche su mobile, fuori dal menu) */
.mailmax {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 11px 18px; border-radius: 999px;
  background: var(--navy); color: #fff; font: 700 14px/1 var(--font); white-space: nowrap;
  transition: background .2s, transform .2s;
}
.mailmax:hover { background: var(--accent); transform: translateY(-1px); }
.mailmax svg { width: 18px; height: 18px; flex: none; }
.mailmax small { font-weight: 500; opacity: .75; }
.call {
  display: inline-flex; align-items: center; gap: 10px; padding: 11px 20px; border-radius: 999px;
  background: var(--accent); color: #fff; font: 700 15px/1 var(--font); white-space: nowrap;
  transition: background .2s, transform .2s;
}
.call:hover { background: var(--accent-700); transform: translateY(-1px); }
.call svg { width: 17px; height: 17px; }
.burger { display: none; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--navy); place-items: center; }
.burger svg { width: 22px; height: 22px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--cream); }
.hero::before {
  content: ""; position: absolute; inset: auto -10% -45% 38%; height: 120%;
  background: radial-gradient(closest-side, rgba(241,93,34,.16), transparent 70%); pointer-events: none;
}
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding-block: clamp(40px, 4.5vw, 64px) clamp(48px, 5.5vw, 80px); }
.eyebrow { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; color: var(--navy); }
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); border-radius: 2px; }
.hero h1 { font-size: clamp(2.5rem, 4.7vw, 4.3rem); font-weight: 800; margin-top: 20px; letter-spacing: -.045em; line-height: 1.04; }
.hero h1 em { display: block; font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(1.1rem, 1.5vw, 1.3rem); max-width: 34ch; margin-top: 24px; color: var(--text); }
.hero .cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 38px; }

.hero-visual { position: relative; }
.hero-card {
  position: relative; aspect-ratio: 5/4.4; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #fff 0%, #fff 55%, var(--orange-100) 100%);
  border: 1px solid var(--line); box-shadow: 0 2px 4px rgba(0,44,71,.04), 0 30px 60px -28px rgba(0,44,71,.35); overflow: hidden; display: grid; place-items: center;
}
.hero-card img { width: 92%; }

/* ---------- Sezioni ---------- */
section { padding-block: clamp(72px, 9vw, 128px); }
.kicker { display: inline-flex; align-items: center; gap: 12px; font-weight: 700; font-size: 15px; letter-spacing: 0; color: var(--accent); }
.kicker::before { content: ""; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; margin-bottom: 52px; flex-wrap: wrap; }
.sec-head h2 { font-size: clamp(2rem, 4.2vw, 3.6rem); font-weight: 800; margin-top: 16px; max-width: 18ch; letter-spacing: -.035em; }
.sec-head p { max-width: 38ch; }

/* Portali turistici: fascia chiara (meno salti scuro/chiaro) */
.portals { padding-block: 44px; background: #fff; border-block: 1px solid var(--line); }
.portals .wrap { display: grid; grid-template-columns: auto 1fr; gap: 56px; align-items: center; }
.portals h2 { color: var(--navy); font-size: 1.15rem; font-weight: 800; letter-spacing: -.01em; }
.portals h2 span { display: block; color: var(--muted); font-weight: 500; font-size: 1rem; margin-top: 6px; }
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; align-items: center; }
.logos a { display: grid; place-items: center; height: 84px; padding: 12px 18px; border-radius: 16px; filter: grayscale(1); opacity: .78; transition: filter .3s, opacity .3s, background .3s, transform .35s var(--ease-spring); }
.logos a:hover, .logos a:focus-visible { filter: none; opacity: 1; background: var(--cream); transform: translateY(-3px); }
.logos img { max-height: 48px; width: auto; object-fit: contain; }

/* Servizi */
.services { background: #fff; }
.svc-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.svc-grid.bento .svc:nth-child(1) { grid-column: span 7; }
.svc-grid.bento .svc:nth-child(2) { grid-column: span 5; }
.svc-grid.bento .svc:nth-child(3) { grid-column: span 5; }
.svc-grid.bento .svc:nth-child(4) { grid-column: span 7; }
.svc-grid.bento .svc:nth-child(5) { grid-column: span 6; }
.svc-grid.bento .svc:nth-child(6) { grid-column: span 6; }
.svc {
  grid-column: span 4; position: relative; display: flex; flex-direction: column; gap: 14px; padding: 36px 36px 32px; min-height: 290px;
  border-radius: var(--radius); background: var(--cream); isolation: isolate; overflow: hidden;
  transition: transform .45s var(--ease-spring), background .3s, box-shadow .3s;
}
.svc:hover { transform: translateY(-5px); background: #fff; box-shadow: 0 2px 4px rgba(0,44,71,.04), 0 24px 44px -24px rgba(0,44,71,.35); }
.svc:active { transform: translateY(-2px) scale(.99); transition-duration: .1s; }
.svc .num { position: absolute; top: 30px; right: 34px; font-weight: 700; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.svc .ico { width: 56px; height: 56px; border-radius: 16px; background: #fff; display: grid; place-items: center; color: var(--accent); transition: background .3s, color .3s; }
.svc:hover .ico { background: var(--accent); color: #fff; }
.svc .ico svg { width: 28px; height: 28px; }
.svc h3 { font-size: 1.5rem; font-weight: 800; margin-top: 22px; letter-spacing: -.025em; }
.svc p { color: var(--text); max-width: 34ch; }
.svc .more { margin-top: auto; padding-top: 14px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--navy); font-size: 15px; }
.svc .more svg { width: 18px; height: 18px; transition: transform .3s var(--ease-spring); }
.svc:hover .more svg { transform: translateX(5px); color: var(--accent); }
/* primo servizio in evidenza */
.svc-grid.bento .svc:nth-child(1) { background: var(--navy); }
.svc-grid.bento .svc:nth-child(1) h3, .svc-grid.bento .svc:nth-child(1) .more { color: #fff; }
.svc-grid.bento .svc:nth-child(1) p { color: rgba(255,255,255,.78); }
.svc-grid.bento .svc:nth-child(1) .num { color: rgba(255,255,255,.5); }
.svc-grid.bento .svc:nth-child(1) .ico { background: var(--orange); color: #fff; }
.svc-grid.bento .svc:nth-child(1):hover { background: var(--navy-900); }
.svc-grid.bento .svc:nth-child(1)::after { content: ""; position: absolute; z-index: -1; right: -12%; bottom: -40%; width: 70%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(241,93,34,.38), transparent 70%); }

/* varianti di superficie nel bento: tinta di marca, trama a punti, bianco con filo */
.svc-grid.bento .svc:nth-child(3) { background: var(--orange-100); }
.svc-grid.bento .svc:nth-child(3) .ico { background: #fff; }
.svc-grid.bento .svc:nth-child(5) { background-color: var(--cream); background-image: radial-gradient(rgba(0,44,71,.16) 1px, transparent 1.4px); background-size: 18px 18px; }
.svc-grid.bento .svc:nth-child(6) { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.svc-grid.bento .svc:nth-child(6):hover { box-shadow: inset 0 0 0 1.5px var(--line), 0 24px 44px -24px rgba(0,44,71,.35); }
.svc-grid.bento .svc:nth-child(5):hover { background-color: #fff; }

/* elenco compatto (altri servizi) */
.svc-list { border-top: 1px solid var(--line); }
.svc-row { display: grid; grid-template-columns: 56px 1fr auto; gap: 8px 24px; align-items: center; padding: 26px 8px; border-bottom: 1px solid var(--line); transition: padding .35s var(--ease-spring), background .25s; }
.svc-row:hover { padding-inline: 20px; background: var(--cream); }
.svc-row .ico { width: 56px; height: 56px; border-radius: 16px; background: var(--orange-100); color: var(--accent); display: grid; place-items: center; }
.svc-row .ico svg { width: 26px; height: 26px; }
.svc-row h3 { font-size: 1.35rem; font-weight: 800; }
.svc-row p { color: var(--text); font-size: 15.5px; }
.svc-row .go { width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; color: var(--navy); transition: .3s var(--ease-spring); }
.svc-row:hover .go { background: var(--accent); border-color: var(--accent); color: #fff; transform: rotate(-45deg); }
.svc-row .go svg { width: 20px; height: 20px; }

/* Webcam */
.webcam { background: var(--navy-900); color: #fff; padding-block: 0; overflow: hidden; }
.webcam .wrap { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
.webcam .txt { padding-block: clamp(64px, 8vw, 112px); padding-right: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.webcam .live { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 13px; letter-spacing: .14em; color: #fff; }
.webcam .live i { width: 10px; height: 10px; border-radius: 50%; background: #ff3b3b; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,59,59,.7); } 70% { box-shadow: 0 0 0 12px rgba(255,59,59,0); } 100% { box-shadow: 0 0 0 0 rgba(255,59,59,0); } }
.webcam h2 { color: #fff; font-size: clamp(2rem, 3.8vw, 3.2rem); font-weight: 800; margin: 20px 0 22px; max-width: 14ch; }
.webcam p { color: rgba(255,255,255,.78); max-width: 42ch; }
.webcam p a { color: #fff; font-weight: 700; border-bottom: 2px solid var(--orange); }
.webcam p a:hover { color: var(--orange); }
.webcam .ask { margin-top: 28px; font-weight: 700; color: #fff; }
.webcam .btn { margin-top: 18px; }
.webcam .pic { position: relative; min-height: 380px; margin-right: calc((min(100vw - 48px, var(--wrap)) - 100vw) / 2); }
.webcam .pic a { position: absolute; inset: 0; display: block; }
.webcam .pic img { width: 100%; height: 100%; object-fit: cover; }
.webcam .pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--navy-900) 0%, transparent 38%); pointer-events: none; }
.play {
  position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%; width: 84px; height: 84px; border-radius: 50%;
  background: var(--orange); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 12px rgba(241,93,34,.25);
  transition: transform .25s;
}
.pic a:hover .play { transform: scale(1.08); }
.play svg { width: 30px; height: 30px; margin-left: 4px; }

/* Portfolio */
.work { background: var(--cream); }
.work-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 20px; }
.card {
  position: relative; display: block; overflow: hidden; border-radius: var(--radius); background: var(--navy);
  min-height: 300px; grid-column: span 4; isolation: isolate;
}
.card:nth-child(1) { grid-column: span 7; min-height: 440px; }
.card:nth-child(2) { grid-column: span 5; min-height: 440px; }
.card:nth-child(6) { grid-column: span 5; }
.card:nth-child(7) { grid-column: span 7; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,25,42,0) 35%, rgba(0,25,42,.86) 100%); }
.card:hover img { transform: scale(1.06); }
.card .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px; color: #fff; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.card h3 { color: #fff; font-size: 1.5rem; font-weight: 800; }
.card p { font-size: 15px; line-height: 1.45; color: rgba(255,255,255,.82); margin-top: 8px; max-width: 40ch; }
.card .go { flex: none; width: 48px; height: 48px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; transition: background .25s, color .25s, transform .25s; }
.card:hover .go { background: var(--accent); color: #fff; transform: rotate(-45deg); }
.card .go svg { width: 22px; height: 22px; }
.work-foot { margin-top: 44px; text-align: center; }

/* Contatti */
.contact .wrap { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 6vw, 96px); align-items: start; }
.contact h2 { font-size: clamp(2rem, 4vw, 3.4rem); font-weight: 800; margin-top: 14px; }
.contact .intro { margin-top: 20px; max-width: 34ch; }
.contact-list { margin-top: 36px; display: grid; gap: 14px; }
.contact-list a, .contact-list div { display: flex; align-items: center; gap: 16px; font-weight: 700; color: var(--navy); font-size: 1.15rem; }
.contact-list .ci { width: 48px; height: 48px; border-radius: 14px; background: var(--orange-100); color: var(--accent); display: grid; place-items: center; flex: none; }
.contact-list .ci svg { width: 22px; height: 22px; }
.contact-list a:hover { color: var(--accent); }
.form { background: var(--cream); border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 44px); display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 14px; color: var(--navy); }
.field input[type=text], .field input[type=email], .field input[type=tel], .field textarea {
  width: 100%; font: 500 16px var(--font); color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 15px 16px; transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--orange-100); }
.check { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.check a { color: var(--navy); font-weight: 700; border-bottom: 1.5px solid var(--orange); }
.form .btn { grid-column: 1 / -1; justify-content: center; }

/* ---------- Footer ---------- */
.footer { background: var(--navy-900); color: rgba(255,255,255,.72); padding: 80px 0 0; font-size: 15px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 56px; padding-bottom: 56px; }
.footer h4 { color: #fff; font-size: 1.05rem; letter-spacing: -.01em; margin-bottom: 18px; font-weight: 800; }
.footer li + li { margin-top: 10px; }
.footer a:hover { color: var(--orange); }
.foot-brand img { height: 42px; width: auto; filter: brightness(0) invert(1); }
.foot-brand p { margin-top: 20px; max-width: 30ch; }
.foot-brand .tel { display: block; margin-top: 22px; color: #fff; font-weight: 800; font-size: 1.5rem; letter-spacing: -.01em; }
.foot-brand .mail { color: #fff; font-weight: 600; }
.foot-brand .mailmax { margin-top: 22px; background: rgba(255,255,255,.1); }
.foot-brand .mailmax:hover { background: var(--orange); }
.legal { border-top: 1px solid rgba(255,255,255,.12); padding-block: 26px; font-size: 13px; line-height: 1.7; display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.legal nav { display: flex; gap: 22px; }
.fb { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.1); margin-top: 22px; transition: background .2s; }
.fb:hover { background: var(--orange); color: #fff !important; }
.fb svg { width: 18px; height: 18px; }

/* WhatsApp flottante */
.wa {
  position: fixed; right: 20px; bottom: 20px; z-index: var(--z-float); display: flex; align-items: center; gap: 10px;
  background: #157a43; color: #fff; padding: 14px 20px 14px 16px; border-radius: 999px; font-weight: 700; font-size: 15px;
  box-shadow: 0 12px 28px -10px rgba(21,122,67,.7); transition: transform .2s;
}
.wa:hover { transform: translateY(-3px); }
.wa svg { width: 24px; height: 24px; }

/* Reveal */
.rv { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
.rv.in { opacity: 1; transform: none; }
.d1 { transition-delay: .08s; } .d2 { transition-delay: .16s; } .d3 { transition-delay: .24s; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .call span.lbl { display: none; }
  .nav a.nl, .nav button.nl { padding: 10px 11px; }
  .logos { grid-template-columns: repeat(3, 1fr); }
  .portals .wrap { grid-template-columns: 1fr; gap: 28px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .svc-grid.bento .svc:nth-child(n) { grid-column: span 6; }
  .svc-grid.bento .svc:nth-child(1) { grid-column: span 12; }
}
@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .header .wrap { gap: 12px; }
  .logo img { height: 34px; }
  .burger { display: grid; margin-left: 0; }
  .header-actions { margin-left: auto; }
  .call { display: none; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; background: #fff; margin: 0; padding: 12px 24px 28px;
    border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -20px rgba(0,25,42,.3);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s ease; max-height: calc(100dvh - var(--header-h)); overflow: auto;
  }
  .nav.open { transform: none; opacity: 1; visibility: visible; }
  .nav > ul { flex-direction: column; align-items: stretch; gap: 0; }
  .nav a.nl, .nav button.nl { width: 100%; justify-content: space-between; padding: 16px 4px; border-radius: 0; font-size: 18px; border-bottom: 1px solid var(--line); }
  .nav a.nl:hover, .nav button.nl:hover { background: none; }
  .sub { position: static; opacity: 1; visibility: visible; transform: none; border: 0; box-shadow: none; padding: 4px 0 8px 12px; min-width: 0; }
  .has-sub .chev { display: none; }
  .nav .m-call { display: flex; margin-top: 20px; }
  .nav .m-call .call { display: inline-flex; width: 100%; justify-content: center; padding: 16px; font-size: 17px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .webcam .wrap { grid-template-columns: 1fr; }
  .webcam .txt { padding-right: 0; }
  .webcam .pic { min-height: 300px; margin-inline: -24px; }
  .webcam .pic::after { background: linear-gradient(180deg, var(--navy-900) 0%, transparent 30%); }
  .card, .card:nth-child(n) { grid-column: span 12; min-height: 300px; }
  .card:nth-child(1), .card:nth-child(2) { min-height: 360px; }
  .contact .wrap { grid-template-columns: 1fr; }
}
@media (min-width: 901px) { .nav .m-call { display: none; } }
@media (max-width: 620px) {
  body { font-size: 16px; }
  .wrap { width: min(100% - 32px, var(--wrap)); }
  .mailmax { padding: 10px 14px; }
  .mailmax small { display: none; }
  .logos { grid-template-columns: repeat(2, 1fr); }
  .logos a:last-child { grid-column: 1 / -1; }
  .form { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 36px; }
  .svc-row { grid-template-columns: 48px 1fr; }
  .svc-row .go { display: none; }
  .wa span { display: none; }
  .wa { padding: 15px; }
  .hero .cta .btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .rv { opacity: 1; transform: none; }
}

/* =========================================================
   Pagine interne
   ========================================================= */
.page-hero { background: var(--cream); padding-block: clamp(48px, 6vw, 88px) clamp(40px, 5vw, 72px); position: relative; overflow: hidden; }
.page-hero::before { content: ""; position: absolute; right: -8%; top: -60%; width: 46%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(241,93,34,.15), transparent 70%); pointer-events: none; }
.page-hero .wrap { position: relative; }
.crumbs { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 14px; font-weight: 600; color: var(--muted); margin-bottom: 22px; }
.crumbs a { color: var(--navy); }
.crumbs a:hover { color: var(--accent); }
.page-hero h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-weight: 800; letter-spacing: -.035em; max-width: 20ch; }
.page-hero .lede { margin-top: 18px; font-size: clamp(1.05rem, 1.4vw, 1.25rem); max-width: 52ch; }

.section { padding-block: clamp(56px, 7vw, 104px); }
.section.alt { background: var(--cream); }
.split { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(32px, 6vw, 88px); align-items: start; }
.split-img { display: grid; gap: 20px; position: sticky; top: calc(var(--header-h) + 24px); }
.split-img img { width: 100%; height: auto; border-radius: var(--radius-lg); background: var(--cream); }

.prose h2 { font-size: clamp(1.8rem, 3.2vw, 2.8rem); font-weight: 800; margin: 14px 0 22px; }
.prose h3 { font-size: 1.35rem; font-weight: 800; margin: 36px 0 12px; }
.prose p { margin: 0 0 16px; }
.prose ul { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.prose li { position: relative; padding-left: 30px; }
.prose li::before { content: ""; position: absolute; left: 0; top: .5em; width: 14px; height: 14px; border-radius: 50%; background: var(--orange-100); box-shadow: inset 0 0 0 4px var(--orange); }
.prose a { color: var(--navy); font-weight: 700; border-bottom: 2px solid var(--orange); }
.prose a:hover { color: var(--accent); }
.prose strong { color: var(--navy); }
.prose.narrow { max-width: 64ch; }
.prose .btn { border-bottom: 0; color: #fff; }

.feat-list { counter-reset: f; border-top: 1px solid var(--line); }
.feat { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1.2fr); gap: 8px 40px; align-items: baseline; padding: 36px 0; border-bottom: 1px solid var(--line); counter-increment: f; }
.feat::before { content: counter(f, decimal-leading-zero); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.feat-label { grid-column: 2; font-weight: 700; font-size: 15px; color: var(--accent); }
.feat h3 { grid-column: 2; font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -.03em; margin: 4px 0 0; }
.feat p { grid-column: 3; grid-row: 1 / span 2; align-self: center; max-width: 40ch; font-size: 1.1rem; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); }
.stat { padding: 8px 40px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat b { display: block; font-size: clamp(3rem, 6.5vw, 5.4rem); font-weight: 800; color: var(--accent); letter-spacing: -.05em; line-height: .95; font-variant-numeric: tabular-nums; }
.stat h3 { font-size: 1.2rem; font-weight: 800; margin: 18px 0 6px; }

/* fasi di lavoro: linea del tempo */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; position: relative; }
.step { position: relative; padding-top: 44px; border-top: 2px solid var(--line); }
.step .n { position: absolute; top: -22px; left: 0; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; box-shadow: 0 0 0 8px var(--cream); font-variant-numeric: tabular-nums; }
.step h3 { font-size: 1.5rem; font-weight: 800; margin: 0 0 8px; letter-spacing: -.025em; }
.step p { max-width: 32ch; }

.filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 40px; padding: 0; list-style: none; }
.filters a { display: inline-block; padding: 11px 20px; border-radius: 999px; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px; color: var(--navy); transition: .2s; }
.filters a:hover { border-color: var(--navy); }
.filters a[aria-current] { background: var(--navy); color: #fff; border-color: var(--navy); }

.work-grid.list .card, .work-grid.list .card:nth-child(n) { grid-column: span 4; min-height: 320px; }

.project-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 28px 48px; align-items: start; }
.project-cover { margin: 0; grid-row: 1 / span 2; }
.project-cover img { width: 100%; height: auto; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.project-meta { background: var(--cream); border-radius: var(--radius-lg); padding: 32px; position: sticky; top: calc(var(--header-h) + 24px); }
.project-meta dl { margin: 0 0 24px; display: grid; gap: 18px; }
.project-meta dt { font-size: 14px; font-weight: 700; color: var(--muted); }
.project-meta dd { margin: 4px 0 0; font-weight: 700; color: var(--navy); font-size: 1.1rem; overflow-wrap: anywhere; }
.project-meta dd a { border-bottom: 2px solid var(--orange); }
.project-body { grid-column: 1 / -1; max-width: 70ch; }

.cta-band { background: var(--cream); padding-block: clamp(56px, 7vw, 96px); position: relative; overflow: hidden; border-top: 1px solid var(--line); }
.cta-band::before { content: ""; position: absolute; right: -8%; top: -90%; width: 46%; aspect-ratio: 1; background: radial-gradient(closest-side, rgba(241,93,34,.18), transparent 70%); pointer-events: none; }
.cta-band .wrap { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(1.9rem, 3.8vw, 3.2rem); font-weight: 800; max-width: 20ch; letter-spacing: -.035em; }
.cta-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.btn-outline-light { border-color: rgba(255,255,255,.5); color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--navy); }

.notice { grid-column: 1 / -1; display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; }
.notice svg { width: 22px; height: 22px; flex: none; }
.notice.ok { background: #e6f7ec; color: #0e6b32; }
.notice.err { background: #fde8e4; color: #a12a12; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact .hours { margin-top: 28px; }
.contact .hours strong { color: var(--navy); }

@media (max-width: 1100px) {
  .work-grid.list .card, .work-grid.list .card:nth-child(n) { grid-column: span 6; }
  .project-wrap { grid-template-columns: 1fr; }
  .project-cover { grid-row: auto; }
  .project-meta { position: static; }
}
@media (max-width: 900px) {
  .stats, .steps { grid-template-columns: 1fr; }
  .stat, .stat:first-child { border-left: 0; border-top: 1px solid var(--line); padding: 28px 0; }
  .stat:first-child { border-top: 0; }
  .feat { grid-template-columns: 44px 1fr; }
  .feat p { grid-column: 2; grid-row: auto; }
  .svc-grid .svc, .svc-grid.bento .svc:nth-child(n) { grid-column: span 12; min-height: 0; }
  .split { grid-template-columns: 1fr; }
  .split-img { position: static; }
  .work-grid.list .card, .work-grid.list .card:nth-child(n) { grid-column: span 12; }
}

/* Captcha (proof-of-work) */
.captcha { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.captcha-check { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 700; color: var(--navy); }
.captcha-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.captcha-box { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: transparent; transition: .2s; flex: none; }
.captcha-box svg { width: 16px; height: 16px; }
.captcha-check input:focus-visible + .captcha-box { outline: 3px solid var(--sky); outline-offset: 2px; }
.captcha.busy .captcha-box { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.captcha.ok .captcha-box { background: #1f9d55; border-color: #1f9d55; color: #fff; }
.captcha.error .captcha-box { border-color: #d6452a; }
.captcha-status { font-size: 14px; color: var(--muted); }
.captcha.ok .captcha-status { color: #0e6b32; font-weight: 600; }
.captcha.error .captcha-status { color: #a12a12; font-weight: 600; }
.captcha-noscript { font-size: 14px; margin: 0; }
@keyframes spin { to { transform: rotate(360deg); } }


/* =========================================================
   Superfici: grana leggera sulle sezioni crema
   ========================================================= */
.hero, .page-hero, .section.alt, .work { position: relative; isolation: isolate; }
.hero::after, .page-hero::after, .section.alt::after, .work::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .1 0 0 0 0 .1 0 0 0 0 .1 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

/* Stati del form: errore inline e campo non valido (dopo l'interazione) */
.field input:user-invalid, .field textarea:user-invalid { border-color: #d6452a; box-shadow: 0 0 0 4px rgba(214,69,42,.12); }
.check input:user-invalid + span { color: #a12a12; }

@media (hover: none) { .svc:hover, .card:hover img { transform: none; } }

/* intestazione di sezione impilata (titolo sopra, testo sotto) */
.sec-head.stack { display: block; }
.sec-head.stack .lead-body { margin-top: 20px; }
