/* ==========================================================================
   antonioceccatelli.it — foglio di stile
   Mobile-first, nessuna dipendenza esterna.
   ========================================================================== */

/* ---------- Font (ospitati sul sito, niente Google Fonts) ---------- */
@font-face { font-family: "Space Grotesk"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/space-grotesk-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Variabili ---------- */
:root {
  --bg: #070a12;
  --bg-2: #0a0f1c;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text: #e7edf7;
  --muted: #94a3b8;
  --faint: #64748b;
  --cyan: #38e1ff;
  --violet: #8b5cf6;
  --green: #4ade80;
  --grad: linear-gradient(120deg, var(--cyan), var(--violet));
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --nav-h: 64px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 1.0625rem; line-height: 1.65;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 6vw, 3.25rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
strong { color: #fff; font-weight: 600; }
::selection { background: rgba(56, 225, 255, .3); color: #fff; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 6px; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--pad); position: relative; }
.mono { font-family: var(--mono); }
.accent { color: var(--cyan); }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--cyan); color: #000; padding: .6rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 46px; padding: .7em 1.4em; border-radius: 999px;
  font: 500 .98rem/1 var(--font); cursor: pointer; border: 1px solid transparent;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, color .2s;
  text-decoration: none !important;
}
.btn--primary { background: var(--grad); color: #04111a; box-shadow: 0 8px 30px -8px rgba(56, 225, 255, .55); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 36px -8px rgba(139, 92, 246, .6); }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--cyan); color: #fff; background: rgba(56, 225, 255, .08); }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }

/* ---------- Card ---------- */
.card {
  position: relative; background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ---------- Navigazione ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--nav-h);
  transition: background .3s ease, border-color .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled, .nav.is-open {
  background: rgba(7, 10, 18, .82); border-bottom-color: var(--border);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
}
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.nav__brand { display: flex; align-items: center; gap: .7rem; color: var(--text); text-decoration: none !important; }
.nav__logo {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  font: 500 .9rem var(--mono); color: #04111a; background: var(--grad);
}
.nav__name { font-family: var(--mono); font-size: .92rem; display: none; }

.nav__toggle {
  width: 44px; height: 44px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--surface); display: grid; place-content: center; gap: 5px; cursor: pointer;
}
.nav__toggle span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav__menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; height: calc(100dvh - var(--nav-h));
  background: rgba(7, 10, 18, .97); padding: 2rem var(--pad);
  display: flex; flex-direction: column; gap: 2rem;
  transform: translateY(-8px); opacity: 0; visibility: hidden;
  transition: opacity .25s ease, transform .25s ease, visibility .25s;
}
.nav.is-open .nav__menu { opacity: 1; transform: none; visibility: visible; }
.nav__links { display: flex; flex-direction: column; gap: .25rem; }
.nav__links a {
  display: flex; align-items: baseline; gap: .8rem; padding: .7rem 0; color: var(--text);
  font-size: 1.6rem; font-weight: 500; text-decoration: none !important; border-bottom: 1px solid var(--border);
}
.nav__num { font: .8rem var(--mono); color: var(--cyan); }
.nav__links a.is-active { color: var(--cyan); }

.lang { display: inline-flex; gap: .25rem; padding: .25rem; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); }
.lang a { padding: .35rem .8rem; border-radius: 999px; font: 500 .8rem var(--mono); color: var(--muted); text-decoration: none !important; }
.lang a[aria-current="true"] { background: var(--grad); color: #04111a; }
.lang a:not([aria-current]):hover { color: #fff; }
.nav__menu .lang { align-self: flex-start; }

body.menu-open { overflow: hidden; }
.nav.is-open { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.nav__menu { background: var(--bg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center;
  padding: calc(var(--nav-h) + 2rem) 0 5rem; overflow: hidden; isolation: isolate;
}
.hero__layers { position: absolute; inset: 0; z-index: -1; }
.layer { position: absolute; inset: -10% 0; will-change: transform; }
.orb { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.orb--1 { width: 55vmax; height: 55vmax; left: -20vmax; top: -10vmax; background: radial-gradient(circle, rgba(56,225,255,.55), transparent 65%); animation: float 18s ease-in-out infinite; }
.orb--2 { width: 45vmax; height: 45vmax; right: -18vmax; top: 10%; background: radial-gradient(circle, rgba(139,92,246,.6), transparent 65%); animation: float 22s ease-in-out infinite reverse; }
.orb--3 { width: 30vmax; height: 30vmax; left: 35%; bottom: -12vmax; background: radial-gradient(circle, rgba(74,222,128,.25), transparent 65%); animation: float 26s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(4vmax, 3vmax) scale(1.08); } }

.layer--code span {
  position: absolute; font: .78rem var(--mono); color: rgba(148, 163, 184, .22); white-space: nowrap;
}
.layer--code span:nth-child(n+5) { display: none; }

.layer--grid { inset: auto 0 -10% 0; height: 60%; perspective: 500px; overflow: hidden; }
.grid-floor {
  position: absolute; inset: 0 -50% -40%;
  background-image:
    linear-gradient(rgba(56,225,255,.22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,225,255,.22) 1px, transparent 1px);
  background-size: 56px 56px;
  transform: rotateX(62deg); transform-origin: center top;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 35%, #000 70%, transparent);
  animation: grid-move 6s linear infinite;
}
@keyframes grid-move { to { background-position: 0 56px, 0 0; } }
.hero__fade { position: absolute; inset: auto 0 0 0; height: 30%; background: linear-gradient(transparent, var(--bg)); }

.hero__content { max-width: 980px; }
.hero__kicker { display: inline-flex; max-width: 100%; align-items: center; gap: .6rem; font-size: .8rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  padding: .4rem .9rem; border: 1px solid var(--border-strong); border-radius: 999px; background: rgba(7,10,18,.5); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(74,222,128,0); } 100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); } }

.hero__title { font-size: clamp(3rem, 13vw, 7.5rem); line-height: .95; letter-spacing: -0.045em; margin: 1.5rem 0 1.25rem; }
.hero__terminal {
  display: inline-block; font-size: clamp(.95rem, 3.4vw, 1.25rem); line-height: 1.7; color: var(--text);
  padding: .9rem 1.2rem; border-radius: var(--radius-sm); background: rgba(10, 15, 28, .75);
  border: 1px solid var(--border); margin-bottom: 2rem; min-width: min(100%, 26rem);
}
.prompt { color: var(--green); }
.arrow { color: var(--violet); }
.typed { color: var(--cyan); }
.caret { display: inline-block; width: .6em; height: 1.1em; vertical-align: -.18em; background: var(--cyan); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero__quote { margin: 0 0 2.25rem; padding-left: 1.2rem; border-left: 2px solid; border-image: var(--grad) 1; max-width: 46rem; }
.hero__quote p { margin: 0 0 .4rem; font-size: clamp(1rem, 2.6vw, 1.2rem); font-style: italic; color: #cfd8e6; }
.hero__quote .hero__quote-tr { font-size: .95rem; color: var(--muted); }
.hero__quote footer { font-size: .9rem; color: var(--muted); }
.hero__quote footer span { color: var(--faint); }
.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero__scroll { position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%); display: none; flex-direction: column; align-items: center; gap: .5rem;
  font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; color: var(--muted); text-decoration: none !important; }
.hero__scroll i { width: 22px; height: 36px; border: 1.5px solid var(--border-strong); border-radius: 12px; position: relative; }
.hero__scroll i::after { content: ""; position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); animation: wheel 1.8s infinite; }
@keyframes wheel { to { transform: translateY(12px); opacity: 0; } }

/* ---------- Sezioni ---------- */
.section { position: relative; padding: clamp(4.5rem, 11vw, 8rem) 0; overflow: hidden; isolation: isolate; }
.section--alt { background: var(--bg-2); }
.section__bg { position: absolute; inset: -15% 0; z-index: -1; will-change: transform; pointer-events: none; }
.bg-dots {
  background-image: radial-gradient(rgba(148,163,184,.16) 1px, transparent 1px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse at 80% 20%, #000 0%, transparent 60%); mask-image: radial-gradient(ellipse at 80% 20%, #000 0%, transparent 60%);
}
.bg-lines {
  background:
    radial-gradient(600px 400px at 10% 20%, rgba(139,92,246,.12), transparent 70%),
    radial-gradient(500px 400px at 90% 80%, rgba(56,225,255,.10), transparent 70%),
    repeating-linear-gradient(135deg, rgba(148,163,184,.05) 0 1px, transparent 1px 22px);
}
.bg-glow { background: radial-gradient(700px 400px at 50% 50%, rgba(56,225,255,.14), transparent 70%), radial-gradient(500px 300px at 30% 70%, rgba(139,92,246,.18), transparent 70%); }

.section__head { margin-bottom: clamp(2rem, 5vw, 3.5rem); }
.kicker { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--cyan); margin-bottom: .8rem; }
.kicker span { color: var(--faint); }
.subhead { font-size: 1rem; font-family: var(--mono); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 3rem 0 1.25rem; display: flex; align-items: center; gap: 1rem; }
.subhead::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-strong), transparent); }
.resume__main > .subhead:first-child, .resume__side .subhead:first-child { margin-top: 0; }

/* ---------- Chi sono ---------- */
.about { display: grid; gap: 2rem; }
.about__text p { color: #c7d1e0; }
.about__text p:first-child::first-letter { font-size: 3.2em; float: left; line-height: .9; margin: .08em .1em 0 0; font-weight: 700; color: var(--cyan); }
.testim { align-self: start; }
.testim__mark { width: 40px; fill: var(--violet); opacity: .7; margin-bottom: .8rem; }
.testim__text { font-style: italic; color: #d4dceb; }
.testim__author { margin: 0; font-size: .95rem; }
.testim__author span { color: var(--muted); font-size: .88rem; }

.what { display: grid; gap: 1rem; }
.what__item { transition: transform .3s ease, border-color .3s ease; }
.what__item:hover { transform: translateY(-4px); border-color: rgba(56,225,255,.45); }
.what__icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 1rem;
  background: linear-gradient(135deg, rgba(56,225,255,.16), rgba(139,92,246,.16)); border: 1px solid var(--border-strong); flex: none; }
.what__icon svg { width: 24px; height: 24px; stroke: var(--cyan); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.what__item p { color: var(--muted); font-size: .98rem; }
.what__tools { font-size: .75rem !important; color: var(--faint) !important; margin: 0; }

/* ---------- Curriculum ---------- */
.resume { display: grid; gap: 3rem; }
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(var(--cyan), var(--violet) 60%, transparent); opacity: .6; }
.timeline__item { position: relative; margin-bottom: 1.25rem; }
.timeline__item::before { content: ""; position: absolute; left: calc(-1.5rem + 0px); top: 1.6rem; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--cyan); box-shadow: 0 0 12px rgba(56,225,255,.6); }
.timeline__card { padding: 1.3rem 1.4rem; transition: border-color .3s ease; }
.timeline__card:hover { border-color: rgba(56,225,255,.4); }
.timeline__company { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--cyan); margin-bottom: .35rem; }
.timeline__card h4 { margin-bottom: .6rem; }
.timeline__card p, .bullets li { color: #bcc7d8; font-size: .97rem; }
.bullets { margin: 0 0 1rem; display: grid; gap: .5rem; }
.bullets li { position: relative; padding-left: 1.2rem; }
.bullets li::before { content: "▹"; position: absolute; left: 0; color: var(--violet); }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; }
.tags li { font: .72rem var(--mono); padding: .25rem .6rem; border-radius: 6px; color: var(--muted); background: rgba(148,163,184,.08); border: 1px solid var(--border); }

.edu { display: flex; gap: 1rem; align-items: flex-start; }
.edu .what__icon { margin: 0; }
.edu h4 { margin-bottom: .25rem; }
.edu p { margin: 0; color: var(--muted); }

.legend { font-size: .78rem; color: var(--muted); margin-bottom: 1.25rem; }
.legend .chip { padding: .1rem .45rem; font-size: .7rem; margin-right: .3rem; }
.skillgroup { margin-bottom: 1.4rem; }
.skillgroup__title { font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { font-size: .88rem; padding: .4rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: #c7d1e0; }
.chip--core { border-color: rgba(56,225,255,.45); background: rgba(56,225,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(56,225,255,.08); }
.legend .chip--core { color: var(--cyan); }

/* ---------- Clienti ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 2rem; }
.filter { font: 500 .88rem var(--font); padding: .55rem 1.1rem; min-height: 40px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--border-strong); transition: all .2s; }
.filter:hover { color: #fff; border-color: var(--cyan); }
.filter.is-active { background: var(--grad); color: #04111a; border-color: transparent; }

.clients { display: grid; grid-template-columns: repeat(2, 1fr); gap: .9rem; }
.client { border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  display: flex; flex-direction: column; transition: transform .35s ease, opacity .35s ease, border-color .3s; }
.client:hover { border-color: rgba(56,225,255,.45); transform: translateY(-3px); }
.client.is-hidden { display: none; }
.client__logo { background: #fff; aspect-ratio: 235 / 170; display: grid; place-items: center; padding: .75rem; }
.client__logo img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; filter: grayscale(.25); transition: filter .3s, transform .3s; }
.client:hover .client__logo img { filter: none; transform: scale(1.04); }
.client__info { padding: .85rem 1rem 1rem; display: flex; flex-direction: column; gap: .2rem; flex: 1; }
.client__name { font-weight: 600; font-size: .95rem; margin: 0; line-height: 1.3; }
.client__domain { font-size: .72rem; color: var(--faint); margin: 0; word-break: break-all; }
.client__link { margin-top: auto; padding-top: .5rem; font-size: .85rem; }

/* ---------- Servizi ---------- */
.section__intro { color: var(--muted); font-size: 1.15rem; max-width: 46rem; margin-top: 1rem; }
.services { display: grid; gap: 1rem; }
.service { transition: transform .3s ease, border-color .3s ease; overflow: hidden; }
.service::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--grad); opacity: .0; transition: opacity .3s; }
.service:hover { transform: translateY(-4px); border-color: rgba(56,225,255,.45); }
.service:hover::before { opacity: 1; }
.service h3 { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
.service p { color: var(--muted); font-size: .98rem; margin: 0; }
.process { display: grid; gap: 1rem; counter-reset: step; }
.process__step { position: relative; padding: 1.1rem 1.2rem 1.1rem 4.2rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.process__num { position: absolute; left: 1.1rem; top: 1.05rem; font-size: 1.3rem; font-weight: 500; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.process__title { font-weight: 600; margin: 0 0 .2rem; }
.process__text { color: var(--muted); font-size: .92rem; margin: 0; }
.services__cta { margin-top: 2.5rem; display: flex; justify-content: center; }
.btn--lg { min-height: 56px; padding: .9em 2.2em; font-size: 1.1rem; }

/* ---------- Contatti ---------- */
.contact { max-width: 860px; }
.contact__intro { color: var(--muted); font-size: 1.1rem; }
.form { padding: clamp(1.25rem, 4vw, 2.25rem); }
.form__grid { display: grid; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > span { font-size: .88rem; color: var(--muted); }
.field em { font-style: normal; color: var(--faint); }
.field select {
  width: 100%; font: 1rem var(--font); color: var(--text); background-color: rgba(7,10,18,.7);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .8rem 2.5rem .8rem 1rem; min-height: 48px;
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #38e1ff 50%), linear-gradient(135deg, #38e1ff 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
.field select:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,255,.15); }
.field select option { background: #0a0f1c; color: #e7edf7; }
.field input, .field textarea {
  width: 100%; font: 1rem var(--font); color: var(--text); background: rgba(7,10,18,.7);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .8rem 1rem; min-height: 48px;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 150px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(56,225,255,.15); }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: #f87171; }
.altcha-box { margin-top: 1.25rem; }
altcha-widget {
  --altcha-max-width: 100%;
  --altcha-border-radius: 10px;
  --altcha-border-color: rgba(148, 163, 184, 0.28);
  --altcha-color-base: rgba(7, 10, 18, .7);
  --altcha-color-base-content: #e7edf7;
  --altcha-color-neutral: #94a3b8;
  --altcha-color-primary: #38e1ff;
  --altcha-color-primary-content: #04111a;
  --altcha-color-success: #4ade80;
  --altcha-color-success-content: #04111a;
  --altcha-color-error: #f87171;
  --altcha-checkbox-border-color: rgba(148, 163, 184, 0.5);
  --altcha-spinner-color: #38e1ff;
  font-family: var(--font);
}
.check { display: flex; gap: .7rem; align-items: flex-start; margin: 1.25rem 0 .5rem; font-size: .92rem; color: #c7d1e0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--cyan); flex: none; }
.privacy { font-size: .85rem; color: var(--muted); margin-bottom: 1.25rem; }
.privacy summary { cursor: pointer; color: var(--cyan); width: fit-content; }
.privacy p { margin: .5rem 0 0; }
.form__actions { display: flex; flex-wrap: wrap; gap: .8rem; }
.form__status { margin: 1rem 0 0; min-height: 1.5em; font-size: .95rem; }
.form__status.is-ok { color: var(--green); }
.form__status.is-error { color: #fca5a5; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Mappa ---------- */
.map { padding: 0; overflow: hidden; min-height: 380px; display: grid; }
.map iframe { width: 100%; height: 100%; min-height: 420px; border: 0; filter: invert(.9) hue-rotate(180deg) saturate(.7) contrast(.9); }
.map__placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2.5rem 1.5rem; gap: .5rem;
  background: radial-gradient(circle at 50% 40%, rgba(56,225,255,.12), transparent 60%),
    linear-gradient(rgba(148,163,184,.07) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, rgba(148,163,184,.07) 1px, transparent 1px) 0 0 / 40px 40px; }
.map__radar { position: relative; width: 120px; height: 120px; margin-bottom: 1rem; }
.map__radar span { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(56,225,255,.5); animation: radar 3s ease-out infinite; }
.map__radar span:nth-child(2) { animation-delay: 1s; } .map__radar span:nth-child(3) { animation-delay: 2s; }
.map__radar i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 20px var(--cyan); }
@keyframes radar { from { transform: scale(.2); opacity: 1; } to { transform: scale(1); opacity: 0; } }
.map__place { font-size: 1.4rem; font-weight: 600; margin: 0; }
.map__note { font-size: .85rem; color: var(--muted); max-width: 32rem; }
.map__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: .5rem; }

/* ---------- Condividi ---------- */
.section--share { text-align: center; }
.share { max-width: 820px; }
.share p { color: var(--muted); }
.share__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.5rem; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 3rem 0 2rem; position: relative; }
.footer__inner { display: grid; gap: 2rem; }
.footer__social p { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: .8rem; }
.footer__social ul { display: flex; flex-wrap: wrap; gap: .5rem; }
.footer__social a { display: inline-flex; gap: .4rem; padding: .5rem 1rem; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--text); font-size: .9rem; text-decoration: none !important; transition: border-color .2s, color .2s; }
.footer__social a:hover { border-color: var(--cyan); color: var(--cyan); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: .9rem; color: var(--muted); }
.footer__bottom p { margin: 0; }
.footer__bottom:first-child { border-top: 0; padding-top: 0; }
.footer__credit { font-size: .72rem; color: var(--faint); margin-top: .35rem !important; letter-spacing: .03em; }
.back-top { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--grad); box-shadow: 0 10px 30px -8px rgba(56,225,255,.6); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .3s, transform .3s; }
.back-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }
.back-top svg { width: 20px; height: 20px; stroke: #04111a; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Animazioni di comparsa ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 80ms); }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ==========================================================================
   Tablet (≥ 640px)
   ========================================================================== */
@media (min-width: 640px) {
  .nav__name { display: inline; }
  .clients { grid-template-columns: repeat(3, 1fr); }
  .what { grid-template-columns: repeat(2, 1fr); }
  .services { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); }
  .form__grid { grid-template-columns: repeat(3, 1fr); }
  .field--full { grid-column: 1 / -1; }
  .layer--code span:nth-child(n+5) { display: block; }
  .timeline { padding-left: 2rem; }
  .timeline__item::before { left: -2rem; }
}

/* ==========================================================================
   Desktop (≥ 1024px)
   ========================================================================== */
@media (min-width: 1024px) {
  :root { --nav-h: 76px; }
  .nav__toggle { display: none; }
  .nav__menu { position: static; height: auto; padding: 0; background: none; flex-direction: row; align-items: center; gap: 1.5rem;
    opacity: 1; transform: none; visibility: visible; }
  .nav__links { flex-direction: row; gap: .25rem; }
  .nav__links a { font-size: .95rem; padding: .5rem .8rem; border: 0; border-radius: 999px; gap: .4rem; position: relative; color: var(--muted); }
  .nav__links a:hover { color: #fff; }
  .nav__links a.is-active { color: #fff; background: var(--surface-2); }
  .nav__num { font-size: .7rem; }
  .hero__scroll { display: flex; }
  .about { grid-template-columns: 1.6fr 1fr; gap: 3rem; }
  .what { grid-template-columns: repeat(4, 1fr); }
  .services { grid-template-columns: repeat(4, 1fr); }
  .process { grid-template-columns: repeat(4, 1fr); }
  .process__step { padding: 1.3rem 1.2rem; }
  .process__num { position: static; display: block; font-size: 1.8rem; margin-bottom: .4rem; }
  .process__step:not(:last-child)::after { content: ""; position: absolute; top: 2.15rem; right: -1rem; width: 1rem; height: 1px; background: var(--border-strong); }
  .nav__links a { padding: .5rem .65rem; }
  .resume { grid-template-columns: 1.55fr 1fr; gap: 3.5rem; }
  .sticky-side { position: sticky; top: calc(var(--nav-h) + 1.5rem); }
  .clients { grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
  .footer__inner { gap: 2.5rem; }
  .back-top { right: 1.5rem; bottom: 1.5rem; }
}

@media (min-width: 1024px) { .nav__links a { white-space: nowrap; } }
@media (min-width: 1024px) and (max-width: 1239px) {
  .nav__name, .nav__num { display: none; }
  .nav__menu { gap: 1rem; }
}

/* ---------- Telefono: effetti più leggeri ---------- */
@media (max-width: 639px) {
  .layer--grid { height: 45%; perspective: none; }
  .grid-floor { inset: 0; transform: none; background-size: 36px 36px; animation: none;
    -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.6) 50%, transparent);
    mask-image: linear-gradient(to bottom, transparent, rgba(0,0,0,.6) 50%, transparent); }
  .layer--code span { color: rgba(148, 163, 184, .12); }
  .hero__kicker { font-size: .68rem; letter-spacing: .1em; }
  .layer--code span:nth-child(n+3) { display: none; }
}
@media (max-width: 639px), (pointer: coarse) {
  .orb { filter: blur(50px); opacity: .45; }
  .card { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* ---------- Chi preferisce meno movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
  [data-parallax] { transform: none !important; }
}
