/* AgiBot by Mamify — site styles. Light theme only, feed world. */

@font-face { font-family: "Sofia Sans"; font-style: normal; font-weight: 1 1000; font-display: swap; src: url("../fonts/sofia-sans-normal-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; }
@font-face { font-family: "Sofia Sans"; font-style: normal; font-weight: 1 1000; font-display: swap; src: url("../fonts/sofia-sans-normal-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sofia Sans"; font-style: italic; font-weight: 1 1000; font-display: swap; src: url("../fonts/sofia-sans-italic-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; }
@font-face { font-family: "Sofia Sans Extra Condensed"; font-style: normal; font-weight: 1 1000; font-display: swap; src: url("../fonts/sofia-sans-extra-condensed-normal-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; }
@font-face { font-family: "Sofia Sans Extra Condensed"; font-style: normal; font-weight: 1 1000; font-display: swap; src: url("../fonts/sofia-sans-extra-condensed-normal-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: light;
  --paper: #ffffff;
  --mist: #f3f7fd;
  --haze: #e3ecfb;
  --ink: #050b2e;
  --ink-2: #2b3765;
  --ink-3: #4f5a86;
  --line: rgba(5, 11, 46, .12);
  --line-2: rgba(5, 11, 46, .24);
  --blue: #0033d6;
  --blue-press: #0029ad;
  --navy: #001881;
  --cyan: #00c3fb;
  --sky: #3eabfb;
  --tint: #d9f4ff;
  --error: #b3261e;
  --error-bg: #fdf0ef;
  --ok: #0b6e46;

  --font-sans: "Sofia Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Sofia Sans Extra Condensed", "Sofia Sans", system-ui, sans-serif;

  --gutter: clamp(16px, 4.4vw, 64px);
  --header-h: 72px;
  --measure: 31em; /* ~70 characters in Sofia Sans; ch runs wide in this face */
  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 26px;
  --glyph: 56px;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);

  --shadow-1: 0 1px 2px rgba(5, 11, 46, .06), 0 6px 18px rgba(5, 11, 46, .08);
  --shadow-2: 0 2px 6px rgba(5, 11, 46, .08), 0 22px 48px rgba(5, 11, 46, .14);

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  interpolate-size: allow-keywords;
}
@media (max-width: 760px) { :root { --header-h: 60px; --glyph: 52px; } }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scrollbar-color: #9fb6e6 var(--mist); background: var(--paper); }
body {
  min-height: 100svh;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
::selection { background: var(--tint); color: var(--ink); }
input, textarea { caret-color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { text-wrap: balance; }
p, li { text-wrap: pretty; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 18px; border-radius: var(--radius-s); background: var(--ink); color: #fff; font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }

.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon--fill { fill: currentColor; stroke: none; }

/* ---------- type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 820;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -.005em;
}
.t-xl { font-size: clamp(3.1rem, 1.6rem + 6.2vw, 6rem); }
.t-l { font-size: clamp(2.5rem, 1.5rem + 3.9vw, 4.75rem); }
.t-m { font-size: clamp(2.05rem, 1.45rem + 2.3vw, 3.25rem); }
.t-s { font-size: clamp(1.6rem, 1.3rem + 1.1vw, 2.1rem); }
.lead { font-size: clamp(1.15rem, 1.05rem + .4vw, 1.35rem); line-height: 1.5; color: var(--ink-2); }
.muted { color: var(--ink-3); }
.prose { max-width: var(--measure); color: var(--ink-2); }
.prose > * + * { margin-top: 1em; }
.prose h2 { margin-top: 2.2em; color: var(--ink); font-family: var(--font-display); font-weight: 800; text-transform: uppercase; font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.6rem); line-height: .95; }
.prose h3 { margin-top: 1.8em; color: var(--ink); font-size: 1.25rem; line-height: 1.3; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--blue); }
.prose strong { color: var(--ink); font-weight: 700; }
.prose a { color: var(--blue); }
.prose blockquote { margin: 1.6em 0; padding: 0 0 0 1em; border-left: 1px solid var(--blue); font-size: 1.2rem; line-height: 1.5; color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  --h: 52px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 24px;
  border: 1.5px solid transparent; border-radius: 999px;
  font-size: 1.0625rem; font-weight: 700; line-height: 1.15; letter-spacing: .005em;
  text-decoration: none; text-align: center; text-wrap: balance;
  transition: transform 160ms var(--ease-out), background-color 200ms ease, border-color 200ms ease, color 200ms ease;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.97); }
.btn .icon { width: 20px; height: 20px; }
.btn--primary { background: var(--blue); color: #fff; }
.btn--ghost { border-color: var(--ink); color: var(--ink); background: rgba(255, 255, 255, .55); }
.btn--quiet { padding: 0 6px; min-height: 44px; color: var(--blue); }
.btn--sm { --h: 44px; padding: 0 18px; font-size: 1rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--blue-press); }
  .btn--ghost:hover { background: var(--ink); color: #fff; }
  .btn--quiet:hover { color: var(--navy); }
}
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link-arrow { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: var(--blue); text-decoration: none; }
.link-arrow .icon { width: 18px; height: 18px; transition: transform 200ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .link-arrow:hover .icon { transform: translateX(4px); } .link-arrow:hover { text-decoration: underline; } }

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 40;
  height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 var(--gutter);
  padding-left: max(var(--gutter), var(--safe-l));
  padding-right: max(var(--gutter), var(--safe-r));
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  view-transition-name: site-header;
  transition: background-color 240ms ease, border-color 240ms ease;
}
.is-home .site-header:not(.is-scrolled) { background: transparent; border-color: transparent; }
.brand { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; text-decoration: none; }
.brand img { height: 30px; width: auto; }
.brand__name { display: flex; flex-direction: column; line-height: 1; }
.brand__name b { font-family: var(--font-display); font-size: 1.45rem; font-weight: 820; text-transform: uppercase; letter-spacing: .01em; }
.brand__name span { font-size: .8125rem; font-weight: 600; color: var(--ink-3); }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; font-weight: 600; font-size: 1rem; text-decoration: none; color: var(--ink-2); border-radius: 999px; transition: color 200ms ease, background-color 200ms ease; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--blue); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--ink); background: var(--mist); } }
.header-cta { margin-left: 8px; }
.menu-btn { display: none; margin-left: auto; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: rgba(255,255,255,.7); font-weight: 700; transition: transform 160ms var(--ease-out); }
.menu-btn:active { transform: scale(.97); }
@media (max-width: 1080px) { .nav, .header-cta { display: none; } .menu-btn { display: inline-flex; } }

/* ---------- mobile menu ---------- */
.menu {
  position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--paper); color: var(--ink);
  opacity: 1; transform: none;
  transition: opacity 220ms var(--ease-out), transform 320ms var(--ease-out), display 320ms allow-discrete, overlay 320ms allow-discrete;
}
.menu:not([open]) { opacity: 0; transform: translateY(-16px); }
@starting-style { .menu[open] { opacity: 0; transform: translateY(-16px); } }
.menu::backdrop { background: transparent; }
.menu__inner { display: flex; flex-direction: column; min-height: 100%; padding: 0 var(--gutter) calc(28px + var(--safe-b)); }
.menu__top { display: flex; align-items: center; height: var(--header-h); }
.menu__close { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--ink); border-radius: 999px; background: none; font-weight: 700; }
.menu__links { list-style: none; padding: 20px 0 0; display: grid; gap: 2px; }
.menu__links a { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: clamp(2.3rem, 9vw, 3.4rem); line-height: 1; }
.menu__links a[aria-current="page"] { color: var(--blue); }
.menu__links li { transition: opacity 300ms var(--ease-out), transform 400ms var(--ease-out); transition-delay: calc(var(--i, 0) * 35ms + 60ms); }
@starting-style { .menu[open] .menu__links li { opacity: 0; transform: translateY(14px); } }
.menu__foot { margin-top: auto; padding-top: 28px; display: grid; gap: 12px; }
.menu__foot .btn { width: 100%; }

/* ---------- rail (floating actions) ---------- */
.rail {
  position: fixed; z-index: 35; width: 96px;
  right: max(var(--gutter), calc(var(--safe-r) + 12px));
  bottom: max(24px, calc(var(--safe-b) + 14px));
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  view-transition-name: action-rail;
  transition: transform 320ms var(--ease-out), opacity 220ms ease;
}
.rail.is-tucked { transform: translateX(calc(100% + 40px)); opacity: 0; pointer-events: none; }
/* on the Home hero the hero CTAs already offer Demo and Come funziona */
.rail [data-home-only] { transition: opacity 240ms ease, visibility 0s linear 0s; }
/* during the journey the hero's own buttons only arrive at the end (.hero-cta), so the rail keeps its own until then */
:root:not(.scrub) .rail.is-hero [data-home-only], .hero-cta .rail.is-hero [data-home-only] { opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.lbl-m { display: none; }
.has-sheet .rail { opacity: 0; pointer-events: none; }
.glyph { display: grid; justify-items: center; gap: 5px; text-decoration: none; color: var(--ink); background: none; border: 0; padding: 0; }
.glyph__disc {
  display: grid; place-items: center;
  width: var(--glyph); height: var(--glyph); border-radius: 50%;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  transition: transform 160ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.glyph:active .glyph__disc { transform: scale(.94); }
.glyph__label { font-size: .75rem; font-weight: 700; line-height: 1.1; color: var(--ink-2); background: rgba(255,255,255,.86); padding: 2px 6px; border-radius: 6px; }
.glyph[aria-expanded="true"] .glyph__disc, .glyph.is-on .glyph__disc { background: var(--blue); color: #fff; border-color: var(--blue); }
.glyph--wa .glyph__disc { background: #25d366; color: #fff; border-color: #1fb457; }
.glyph--next { transition: opacity 200ms ease, visibility 0s linear 0s; }
.rail.is-last .glyph--next { opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.glyph--wa .icon { width: 28px; height: 28px; }
.glyph--bot .glyph__disc img { width: 38px; height: auto; }
@media (hover: hover) and (pointer: fine) {
  .glyph:hover .glyph__disc { background: var(--blue); color: #fff; border-color: var(--blue); }
  .glyph--wa:hover .glyph__disc { background: #1fb457; }
  .glyph--bot:hover .glyph__disc { background: var(--mist); }
}
@media (max-width: 760px) {
  .glyph__label { display: none; } .rail { gap: 12px; width: var(--glyph); }
  .glyph--next { display: none; }
  .glyph--demo .glyph__label { display: block; }
  .rail [data-home-only]:not(.glyph--demo) { display: none; }
  .glyph--bot .glyph__label { display: block; } .lbl-d { display: none; } .lbl-m { display: inline; }
}
@media (max-height: 620px) { .rail [data-home-only], .glyph--next { display: none; } .glyph__label { display: none; } }

/* ---------- feed (home) ---------- */
html:has(.is-home) { scroll-snap-type: y mandatory; }
@media (max-height: 559px) { html:has(.is-home) { scroll-snap-type: none; } }
.feed { position: relative; }
.item {
  position: relative; isolation: isolate;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 28px) var(--gutter) calc(40px + var(--safe-b));
  padding-right: calc(var(--gutter) + var(--glyph) + 28px);
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--mist);
}
.item__media, .item__media > *, .item__media img, .item__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.item__media { z-index: -2; }
.item[data-item] .item__media img { transform: scale(1.05); transition: transform 1600ms var(--ease-out); }
.item[data-item].is-active .item__media img { transform: scale(1); }
.item__media video { opacity: 0; transition: opacity 600ms ease; }
.item__media video.is-ready { opacity: 1; }
/* ---------- Home hero journey (with .scrub, gate in the head script) ----------
   The hero pins inside an 800svh track: the scroll scrubs the 12 s film and five beats take turns over it. */
.scrub-stops, .hero-cue { display: none; }
.scrub .scrub-track { position: relative; height: 800svh; scroll-snap-align: start; }
.scrub .scrub-track > .item { position: sticky; top: var(--pin, 0px); scroll-snap-align: none; }
/* a detent about one wheel notch apart: engines that jump a whole snap area on one notch step through the film instead */
.scrub .scrub-stops { position: absolute; top: 0; left: 0; width: 1px; display: grid; grid-auto-rows: 10svh; pointer-events: none; }
.scrub .scrub-stops i { scroll-snap-align: start; }
/* still hero: a wider veil keeps the glass edges of the poster off the title */
@media (min-width: 761px) { :root:not(.scrub) .scrub-track .item__scrim::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.45) 40%, rgba(255,255,255,0) 75%); } }
/* journey: the film stays bright and each beat brings its own white glow while it is on */
.scrub #inizio { --tglow: 0 0 1px rgba(255,255,255,.9), 0 1px 12px rgba(255,255,255,.7), 0 6px 36px rgba(255,255,255,.65); }
.scrub #inizio .item__scrim { background: linear-gradient(180deg, rgba(255,255,255,.78) 0, rgba(255,255,255,0) 150px), radial-gradient(ellipse 75% 65% at 0% 100%, rgba(255,255,255,.62), rgba(255,255,255,0) 72%); }
.scrub #inizio [data-band] { opacity: var(--o, 0); transition: none; }
.scrub #inizio [data-band]:not(.is-on) { pointer-events: none; }
.scrub #t-hero, .scrub #inizio .beat { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; isolation: isolate; text-shadow: var(--tglow); }
.scrub #inizio .beat { display: block; max-width: 15em; font-family: var(--font-display); font-weight: 820; text-transform: uppercase; line-height: .92; letter-spacing: -.005em; font-size: clamp(2.3rem, 1.2rem + 3.7vw, 4.6rem); color: var(--ink); text-wrap: balance; }
.scrub #inizio .beat--last { position: relative; }
.scrub #t-hero::before, .scrub #inizio .beat::before { content: ""; position: absolute; inset: -24% -12%; z-index: -1; pointer-events: none; opacity: calc(.3 + .7 * var(--k, 1)); background: radial-gradient(closest-side, rgba(255,255,255,.82), rgba(255,255,255,.5) 58%, rgba(255,255,255,0)); }
/* the blue scan band crosses right behind the second beat: its glow runs deeper (tuned on the worst frame) */
.scrub #inizio [data-fx="scan"]::before { background: radial-gradient(closest-side, rgba(255,255,255,.92), rgba(255,255,255,.7) 60%, rgba(255,255,255,0)); }
.scrub #inizio .w, .scrub #inizio .c { display: inline-block; }
.scrub #inizio .w { white-space: nowrap; }
/* each entrance echoes the film at that moment; transform and opacity only, scrubbed off the beat's --k */
/* rise: the words climb in reading order while the camera glides through the panes */
.scrub [data-fx="rise"] .w { --kc: clamp(0, (var(--k, 1) - var(--th, 0)) * 3, 1); opacity: var(--kc); transform: translateY(calc((1 - var(--kc)) * .45em)); }
/* scan: the letters snap in from the left as the blue band sweeps across */
.scrub [data-fx="scan"] .c { --kc: clamp(0, (var(--k, 1) - var(--th, 0)) * 4, 1); opacity: var(--kc); transform: translateX(calc((1 - var(--kc)) * -.55em)); }
/* scatter: the letters gather from seeded offsets as the panes fold into the three spheres */
.scrub [data-fx="scatter"] .c { --kc: clamp(0, (var(--k, 1) - var(--th, 0)) * 2.6, 1); opacity: var(--kc); transform: translate(calc((1 - var(--kc)) * var(--jx, 0px)), calc((1 - var(--kc)) * var(--jy, 0px))) rotate(calc((1 - var(--kc)) * var(--jr, 0deg))); }
/* punch: the words land with an overshoot as the light network condenses into one sphere */
.scrub [data-fx="punch"] .w { --kc: clamp(0, (var(--k, 1) - var(--th, 0)) * 3, 1); --ks: clamp(0, (var(--k, 1) - var(--th, 0) - .1) * 3.2, 1); opacity: var(--kc); transform: scale(calc(.6 + .52 * var(--kc) - .12 * var(--ks))); }
/* depth: the last line comes toward the camera along the path of light, then the actions settle */
.scrub [data-fx="depth"] { transform: scale(calc(.82 + .18 * var(--k, 1))); transform-origin: 0 100%; }
.scrub #inizio [data-fx="cta"] { --kb: clamp(0, (var(--k, 1) - .45) * 2.5, 1); opacity: calc(var(--o, 0) * var(--kb)); transform: translateY(calc((1 - var(--kb)) * 14px)); }
/* the loading ring fills while the film downloads, then turns into the scroll cue */
.scrub .hero-cue { display: block; position: absolute; z-index: 2; left: 50%; bottom: calc(22px + var(--safe-b)); width: 46px; height: 46px; translate: -50% 0; }
.hero-cue svg { width: 100%; height: 100%; fill: none; stroke-width: 2.5; overflow: visible; }
.hero-cue__track { stroke: rgba(5, 11, 46, .14); }
.hero-cue__ring { stroke: var(--blue); stroke-dasharray: 126; stroke-dashoffset: var(--ld, 126); transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 200ms linear; }
.hero-cue__chev { stroke: var(--ink); stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity 300ms ease; }
.hero-cue.is-loaded .hero-cue__chev { opacity: 1; animation: cue-bob 2.4s var(--ease-in-out) -1.2s infinite; }
@keyframes cue-bob { 50% { transform: translateY(3px); } }
@media (max-width: 760px) {
  .scrub .hero-cue { left: auto; right: max(var(--gutter), var(--safe-r)); bottom: auto; top: calc(var(--header-h) + 40px); translate: none; }
  .scrub #t-hero { margin-right: 0; } /* at the bottom of the frame the title must stay clear of the rail column */
}
/* the top band keeps the header readable over moving media */
.item__scrim { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.78) 0, rgba(255,255,255,0) 150px),
              linear-gradient(180deg, rgba(255,255,255,0) 34%, rgba(255,255,255,.62) 58%, rgba(255,255,255,.93) 78%, #fff 100%),
              linear-gradient(90deg, rgba(255,255,255,.72) 0%, rgba(255,255,255,0) 58%); }
.item--right .item__scrim { background: linear-gradient(180deg, rgba(255,255,255,.78) 0, rgba(255,255,255,0) 150px), linear-gradient(180deg, rgba(255,255,255,0) 34%, rgba(255,255,255,.62) 58%, rgba(255,255,255,.93) 78%, #fff 100%), linear-gradient(270deg, rgba(255,255,255,.5) 0%, rgba(255,255,255,0) 50%); }
.item__caption { position: relative; max-width: 800px; display: grid; gap: 18px; }
.item__title { color: var(--ink); }
/* the hero title also follows the screen height, so the pinned hero fits short laptop windows */
.t-hero { font-size: clamp(3.1rem, min(1.6rem + 6.2vw, 12.5svh), 6rem); }
/* the customer speaks in a lighter, sentence-case voice; AgiBot and the brand keep the heavy caps */
.display.t-q { text-transform: none; font-weight: 640; letter-spacing: 0; line-height: .96; }
.item__caption .author { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 34em; align-items: flex-start; }
.item__caption .author > span { display: grid; gap: 2px; }
.item__caption .author span span { color: var(--ink-2); }
.item__text { max-width: 30em; font-size: clamp(1.08rem, 1rem + .35vw, 1.28rem); line-height: 1.5; color: var(--ink-2); }
.item__actions { margin-top: 4px; }
/* the answer is the product: each case shows the exchange, not a description of it */
.item__convo { display: grid; gap: 10px; max-width: 34em; }
.item__convo .msg { font-size: 1rem; box-shadow: var(--shadow-1); }
.item__convo .msg--bot { background: #fff; }
.msg__who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: .8125rem; color: var(--ink-3); }
.msg__who img { width: 30px; height: auto; }
.msg__who b { color: var(--ink); font-weight: 800; }
.tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: .72rem; font-weight: 800; }
.msg__next { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: .875rem; font-weight: 700; color: var(--blue); }
.msg__next .icon { width: 16px; height: 16px; }
.path { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; counter-reset: p; max-width: 40em; }
.path li { counter-increment: p; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px 0 6px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-weight: 700; font-size: .95rem; }
.path li::before { content: counter(p); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); color: #fff; font-size: .8rem; font-variant-numeric: tabular-nums; }

.author { display: flex; align-items: center; gap: 12px; font-size: .9375rem; line-height: 1.4; }
.author__avatar { display: grid; place-items: center; width: 52px; height: 34px; border-radius: 12px; background: #fff; border: 1px solid var(--line); flex: none; }
.author__avatar img { width: 40px; height: auto; }
.author b { display: block; font-weight: 800; color: var(--ink); }
.author span { color: var(--ink-3); }

/* caption entrance: content is visible by default; JS adds the choreography */
.js .item[data-item]:not(.is-active) .item__caption > * { opacity: 0; transform: translateY(18px); }
.item__caption > * { transition: opacity 500ms var(--ease-out), transform 700ms var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }

.pager { position: fixed; z-index: 30; left: max(14px, var(--safe-l)); top: 50%; translate: 0 -50%; display: grid; gap: 4px; }
.pager button { display: grid; place-items: center; width: 28px; height: 30px; padding: 0; border: 0; background: none; }
.pager button::before { content: ""; width: 4px; height: 22px; border-radius: 4px; background: rgba(5, 11, 46, .2); transition: background-color 240ms ease, height 300ms var(--ease-out); }
.pager button[aria-current="true"]::before { background: var(--blue); height: 30px; }
@media (max-width: 900px) {
  /* phones get a Stories-like segmented bar under the header instead of the side pager */
  .pager { left: max(var(--gutter), var(--safe-l)); right: max(var(--gutter), var(--safe-r)); top: calc(var(--header-h) + 4px); translate: none; display: flex; gap: 4px; }
  .pager button { flex: 1; width: auto; height: 24px; }
  .pager button::before { width: 100%; height: 3px; }
  .pager button[aria-current="true"]::before { height: 3px; }
}
.pager { transition: opacity 200ms ease; }
.at-footer .pager { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .item { padding-bottom: calc(28px + var(--safe-b)); padding-right: calc(var(--gutter) + var(--glyph) + 14px); }
  .item__scrim, .item--right .item__scrim { background: linear-gradient(180deg, rgba(255,255,255,.78) 0, rgba(255,255,255,0) 120px), linear-gradient(180deg, rgba(255,255,255,0) 18%, rgba(255,255,255,.76) 38%, rgba(255,255,255,.95) 56%, #fff 100%); }
  /* three lines on phones: the hero title may run under the rail column, which only occupies the bottom of the frame */
  .t-hero { font-size: clamp(2.3rem, 10.6vw, 3.1rem); margin-right: calc(-1 * (var(--glyph) + 14px)); }
  .item__caption { gap: 14px; }
  .item .btn { --h: 48px; padding: 0 18px; font-size: 1rem; }
}

/* ---------- page shells ---------- */
main { display: block; }
.section { padding: clamp(72px, 9vw, 140px) var(--gutter); }
.section--tight { padding-top: clamp(48px, 6vw, 88px); padding-bottom: clamp(48px, 6vw, 88px); }
.section--mist { background: var(--mist); }
.wrap { max-width: 1280px; margin: 0 auto; }
/* keep content clear of the floating action rail */
.page-hero, .closer, .article-hero { padding-right: calc(var(--gutter) + var(--glyph) + 28px); }
@media (min-width: 1100px) { .section, .page-hero--plain { padding-left: calc(var(--gutter) + var(--glyph) + 24px); padding-right: calc(var(--gutter) + var(--glyph) + 24px); } }
@media (min-width: 761px) and (max-width: 1099px) { .section { padding-right: calc(var(--gutter) + var(--glyph) + 20px); } }
.wrap--narrow { max-width: 860px; margin: 0 auto; }
.section-head { display: grid; gap: 18px; max-width: 900px; margin-bottom: clamp(36px, 5vw, 64px); }

/* page hero = a feed item in miniature */
.page-hero { position: relative; isolation: isolate; min-height: min(86svh, 880px); display: flex; align-items: flex-end; padding: calc(var(--header-h) + 40px) var(--gutter) clamp(40px, 6vw, 72px); overflow: hidden; background: var(--mist); }
.page-hero .item__caption { max-width: 920px; }
.page-hero--short { min-height: min(64svh, 640px); }
.page-hero--plain { min-height: 0; padding-top: calc(var(--header-h) + clamp(56px, 8vw, 120px)); background: var(--paper); }
@media (max-width: 760px) { .page-hero { min-height: 78svh; padding-right: calc(var(--gutter) + var(--glyph) + 14px); } .page-hero--plain { min-height: 0; } }

/* reveal (non-feed pages): visible by default, animated in with JS */
.js [data-reveal]:not(.is-in) { opacity: 0; transform: translateY(22px); }
[data-reveal] { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }

/* ---------- come funziona: stage ---------- */
.how { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.stage-wrap { position: sticky; top: calc(var(--header-h) + 24px); }
.stage {
  position: relative; aspect-ratio: 4 / 5; max-height: calc(100svh - var(--header-h) - 48px); width: 100%;
  border-radius: var(--radius-l); overflow: hidden; background: var(--mist);
  border: 1px solid var(--line);
}
.stage__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.stage__tag { position: absolute; left: 18px; top: 18px; z-index: 3; padding: 6px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: .8125rem; font-weight: 700; }
.src { position: absolute; z-index: 2; width: 46%; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.92); border: 1px solid var(--line); box-shadow: var(--shadow-1);
  transition: transform 700ms var(--ease-out), opacity 500ms ease, border-color 300ms ease, background-color 300ms ease; }
.src b { display: block; font-size: .9375rem; line-height: 1.25; }
.src i { display: block; margin-top: 8px; height: 6px; border-radius: 3px; background: var(--haze); font-style: normal; }
.src i + i { width: 72%; margin-top: 6px; }
.src:nth-of-type(1) { left: 7%; top: 13%; rotate: -4deg; }
.src:nth-of-type(2) { left: 48%; top: 9%; rotate: 3deg; }
.src:nth-of-type(3) { left: 12%; top: 35%; rotate: 2deg; }
.src:nth-of-type(4) { left: 50%; top: 31%; rotate: -3deg; }
.src:nth-of-type(5) { left: 28%; top: 54%; rotate: 1deg; }
.bubble { position: absolute; z-index: 4; left: 8%; right: 8%; padding: 14px 18px; border-radius: 18px; font-size: 1rem; line-height: 1.45; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity 400ms ease, transform 600ms var(--ease-out); }
.bubble--q { bottom: 34%; left: auto; width: 70%; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.bubble--a { bottom: 12%; width: auto; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble--a small { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px; border-radius: 999px; background: var(--mist); border: 1px solid var(--line); font-size: .8125rem; font-weight: 700; color: var(--ink-2); }
.next-step { position: absolute; z-index: 4; left: 8%; bottom: 4%; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 700; font-size: .9375rem;
  opacity: 0; transform: translateY(10px); transition: opacity 400ms ease, transform 600ms var(--ease-out); }
.stage[data-step="2"] .bubble--q, .stage[data-step="3"] .bubble--q, .stage[data-step="4"] .bubble--q, .stage[data-step="5"] .bubble--q { opacity: 1; transform: none; }
.stage[data-step="3"] .src:not(.is-hit), .stage[data-step="4"] .src:not(.is-hit), .stage[data-step="5"] .src:not(.is-hit) { opacity: .28; transform: scale(.94); }
.stage[data-step="3"] .src.is-hit, .stage[data-step="4"] .src.is-hit, .stage[data-step="5"] .src.is-hit { border-color: var(--blue); background: #fff; transform: translateY(-6px); }
.stage[data-step="3"] .src.is-hit b::after, .stage[data-step="4"] .src.is-hit b::after, .stage[data-step="5"] .src.is-hit b::after { content: " · pertinente"; color: var(--blue); }
.stage[data-step="4"] .bubble--a, .stage[data-step="5"] .bubble--a { opacity: 1; transform: none; }
.stage[data-step="4"] .bubble--q, .stage[data-step="5"] .bubble--q { transform: translateY(-46%); }
.stage[data-step="5"] .next-step { opacity: 1; transform: none; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.step { min-height: 64svh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px 0; counter-increment: s; }
.step__n { font-family: var(--font-display); font-weight: 820; font-size: 1.25rem; color: var(--blue); font-variant-numeric: tabular-nums; }
.step__n::before { content: counter(s, decimal-leading-zero) " / 05"; }
.step p { max-width: 46ch; color: var(--ink-2); font-size: 1.15rem; }
.js .step { opacity: .72; transition: opacity 400ms ease; }
.js .step.is-current { opacity: 1; }
@media (max-width: 900px) {
  .how { grid-template-columns: 1fr; gap: 0; }
  .stage-wrap { top: calc(var(--header-h) + 8px); z-index: 2; }
  .stage { aspect-ratio: auto; height: 40svh; max-height: none; }
  .src { width: 44%; padding: 10px 12px; } .src b { font-size: .8125rem; } .src i { display: none; }
  .bubble { font-size: .9rem; padding: 10px 14px; } .bubble--q { bottom: 38%; }
  /* the copy sits in the band below the pinned stage, so the active step is never hidden under it */
  .step { min-height: 78svh; justify-content: flex-start; padding-top: calc(40svh + 36px); padding-right: calc(var(--glyph) + 10px); }
}

/* in-page index of the three solutions */
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line-2); font-weight: 700; text-decoration: none; transition: border-color 200ms ease, color 200ms ease; }
@media (hover: hover) and (pointer: fine) { .jump a:hover { border-color: var(--blue); color: var(--blue); } }
.item--case { scroll-margin-top: 0; }
.facts-band { padding-top: clamp(28px, 4vw, 52px); padding-bottom: clamp(56px, 7vw, 104px); }
.facts-band .facts { margin-top: 0; padding-top: 0; border-top: 0; max-width: 960px; }
/* cause → action rules (Come funziona) */
.rules { width: 100%; border-collapse: collapse; border-top: 2px solid var(--ink); }
.rules th, .rules td { text-align: left; vertical-align: top; padding: 20px 24px 20px 0; border-bottom: 1px solid var(--line-2); }
.rules thead th { padding-top: 14px; padding-bottom: 14px; font-size: .875rem; font-weight: 800; color: var(--ink-3); }
.rules tbody th { width: 34%; font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: .95; }
.rules td { color: var(--ink-2); font-size: 1.0625rem; }
@media (max-width: 640px) { .rules thead { display: none; } .rules tr, .rules th, .rules td { display: block; } .rules tbody th { width: auto; padding-bottom: 6px; border-bottom: 0; } .rules td { padding-top: 0; } }

/* two-column contrast */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border-top: 1px solid var(--line-2); }
.split > * { padding: clamp(24px, 3.5vw, 48px) clamp(0px, 3vw, 44px) clamp(24px, 3.5vw, 48px) 0; }
.split > * + * { border-left: 1px solid var(--line-2); padding-left: clamp(20px, 3vw, 44px); }
.split h3 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem); line-height: .95; margin-bottom: 14px; }
.split ul { padding-left: 1.1em; color: var(--ink-2); }
.split li + li { margin-top: .4em; }
.split li::marker { color: var(--blue); }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } .split > * + * { border-left: 0; border-top: 1px solid var(--line-2); padding-left: 0; } }

.note { display: flex; gap: 14px; align-items: flex-start; max-width: 760px; padding: 18px 20px; border-radius: var(--radius-m); background: var(--paper); border: 1px solid var(--line); color: var(--ink-2); }
.note .icon { color: var(--blue); margin-top: 3px; }

/* cycle / timeline */
.timeline { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 32px); counter-reset: t; }
.timeline li { counter-increment: t; padding-top: 22px; border-top: 2px solid var(--ink); }
.timeline li::before { content: counter(t); display: block; font-family: var(--font-display); font-weight: 820; font-size: 3.2rem; line-height: 1; color: var(--blue); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.timeline h3 { font-size: 1.2rem; line-height: 1.3; margin-bottom: 8px; }
.timeline p { color: var(--ink-2); }
@media (max-width: 900px) { .timeline { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .timeline { grid-template-columns: 1fr; } }

.solution { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 88px); align-items: start; scroll-margin-top: calc(var(--header-h) + 16px); }
.solution + .solution { margin-top: clamp(80px, 10vw, 150px); }
.solution h2 { margin-bottom: 18px; }
.convo { margin: 28px 0; display: grid; gap: 10px; max-width: 560px; }
.convo__label { font-size: .8125rem; font-weight: 800; color: var(--ink-3); }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; line-height: 1.45; }
.msg--user { justify-self: end; background: var(--blue); color: #fff; border-bottom-right-radius: 6px; }
.msg--bot { background: var(--mist); border: 1px solid var(--line); border-bottom-left-radius: 6px; color: var(--ink); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 32px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.facts h3 { font-size: 1rem; font-weight: 800; margin-bottom: 8px; }
.facts ul { padding-left: 1.1em; color: var(--ink-2); font-size: 1rem; }
.facts li + li { margin-top: .35em; }
.facts li::marker { color: var(--blue); }
@media (max-width: 900px) { .solution { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } }

/* roles table */
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.roles > div { padding: 26px clamp(0px, 2vw, 28px) 26px 0; }
.roles > div + div { border-left: 1px solid var(--line-2); padding-left: clamp(18px, 2vw, 28px); }
.roles h3 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: 2.2rem; line-height: .95; }
.roles .role-tag { display: inline-block; margin: 10px 0 12px; font-size: .875rem; font-weight: 800; color: var(--blue); }
.roles p { color: var(--ink-2); }
.roles .is-us h3 { color: var(--blue); }
@media (max-width: 760px) { .roles { grid-template-columns: 1fr; } .roles > div + div { border-left: 0; border-top: 1px solid var(--line-2); padding-left: 0; } }

/* ---------- per le aziende ---------- */
.values { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line-2); }
.values > div { padding: clamp(26px, 3.6vw, 52px) clamp(0px, 3vw, 48px) clamp(26px, 3.6vw, 52px) 0; border-bottom: 1px solid var(--line-2); }
.values > div:nth-child(even) { border-left: 1px solid var(--line-2); padding-left: clamp(20px, 3vw, 48px); padding-right: 0; }
.values h3 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: clamp(1.9rem, 1.4rem + 1.5vw, 2.75rem); line-height: .93; margin-bottom: 14px; }
.values p { color: var(--ink-2); max-width: 46ch; }
@media (max-width: 760px) { .values { grid-template-columns: 1fr; } .values > div:nth-child(even) { border-left: 0; padding-left: 0; } }
.offer { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
.offer__list { list-style: none; padding: 0; border-top: 2px solid var(--ink); }
.offer__list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; padding: 18px 0; border-bottom: 1px solid var(--line); font-size: 1.125rem; }
.offer__list .icon { color: var(--blue); margin-top: 3px; }
.offer__aside { padding: clamp(24px, 3vw, 36px); border-radius: var(--radius-l); background: var(--haze); color: var(--ink); }
.offer__aside h3 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: 2.2rem; line-height: .95; margin-bottom: 14px; }
.offer__aside p { color: var(--ink-2); }
.offer__aside .btn { margin-top: 22px; }
@media (max-width: 900px) { .offer { grid-template-columns: 1fr; } }
.materials { columns: 2; column-gap: clamp(24px, 4vw, 64px); padding: 0; list-style: none; }
.materials li { break-inside: avoid; padding: 16px 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.materials b { display: block; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 760px) { .materials { columns: 1; } }

/* FAQ */
.faq { border-top: 2px solid var(--ink); }
.faq details { border-bottom: 1px solid var(--line-2); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; padding: 16px 0; cursor: pointer; font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { transition: transform 300ms var(--ease-out); color: var(--blue); }
.faq details[open] summary .icon { transform: rotate(45deg); }
.faq details::details-content { block-size: 0; overflow: clip; transition: block-size 320ms var(--ease-out), content-visibility 320ms allow-discrete; }
.faq details[open]::details-content { block-size: auto; }
.faq .faq__a { padding: 0 0 22px; max-width: 32em; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .faq summary:hover { color: var(--blue); } }

/* closing item (CTA band inside the feed world) */
.closer { position: relative; isolation: isolate; overflow: hidden; display: flex; align-items: flex-end; min-height: min(80svh, 760px); padding: clamp(64px, 8vw, 120px) var(--gutter) clamp(48px, 6vw, 88px); background: var(--mist); }
.closer .item__caption { max-width: 860px; }
@media (max-width: 760px) { .closer { padding-right: calc(var(--gutter) + var(--glyph) + 14px); } }

/* ---------- risorse ---------- */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 64px); align-items: end; text-decoration: none; color: inherit; }
.feature__cover { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-l); overflow: hidden; background: var(--mist); }
.feature__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out); }
.feature__body { display: grid; gap: 16px; padding-bottom: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; font-weight: 700; color: var(--ink-3); }
.meta span + span::before { content: "·"; margin-right: 14px; color: var(--line-2); }
@media (hover: hover) and (pointer: fine) { .feature:hover .feature__cover img { transform: scale(1.03); } .feature:hover h2 { color: var(--blue); } }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } .feature__cover { aspect-ratio: 16 / 11; } }
.articles { list-style: none; padding: 0; margin-top: clamp(56px, 7vw, 96px); border-top: 2px solid var(--ink); }
.articles a { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: clamp(14px, 2.4vw, 32px); align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line-2); text-decoration: none; }
.articles .thumb { aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: var(--mist); }
.articles .thumb img { width: 100%; height: 100%; object-fit: cover; }
.articles h3 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.3rem); line-height: .95; }
.articles p { margin-top: 8px; color: var(--ink-2); max-width: 34em; }
.articles .icon { color: var(--blue); transition: transform 240ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .articles a:hover h3 { color: var(--blue); } .articles a:hover .icon { transform: translateX(6px); } }
@media (max-width: 640px) { .articles a { grid-template-columns: 84px minmax(0, 1fr); } .articles .icon { display: none; } .articles p { display: none; } }

.article-hero { position: relative; isolation: isolate; min-height: min(78svh, 820px); display: flex; align-items: flex-end; padding: calc(var(--header-h) + 40px) var(--gutter) clamp(36px, 5vw, 64px); overflow: hidden; background: var(--mist); }
.article-hero__media { position: absolute; inset: 0; z-index: -2; view-transition-name: article-cover; }
.article-hero__media img { width: 100%; height: 100%; object-fit: cover; }
.article-hero .item__caption { max-width: 980px; }
.article-body { padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(64px, 8vw, 120px); }
.article-body .prose { margin: 0 auto; font-size: 1.125rem; line-height: 1.7; }
.article-body .prose > p:first-child { font-size: 1.3rem; line-height: 1.55; color: var(--ink); }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.back-link .icon { width: 18px; height: 18px; }
@media (max-width: 760px) { .article-hero { min-height: 70svh; padding-right: calc(var(--gutter) + var(--glyph) + 14px); } }

/* ---------- contatti / forms ---------- */
.contact { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 80px); align-items: start; }
@media (max-width: 960px) { .contact { grid-template-columns: 1fr; } }
.form { display: grid; gap: 20px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 640px) { .form__row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 8px; }
.field label, .field legend { font-weight: 700; font-size: 1rem; }
.field .opt { font-weight: 500; color: var(--ink-3); }
.input {
  width: 100%; min-height: 52px; padding: 12px 16px;
  border: 1.5px solid var(--line-2); border-radius: 12px; background: #fff;
  font-size: 1rem; line-height: 1.4;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
textarea.input { min-height: 132px; resize: vertical; }
select.input { appearance: none; padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23050b2e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 51, 214, .18); }
.input[aria-invalid="true"] { border-color: var(--error); background: var(--error-bg); }
.field__error { display: flex; align-items: flex-start; gap: 6px; font-size: .9375rem; font-weight: 600; color: var(--error); }
.field__error .icon { width: 18px; height: 18px; margin-top: 2px; }
.field__error:empty { display: none; }
.check { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; font-size: 1rem; color: var(--ink-2); }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--blue); }
.form__note { flex-basis: 100%; font-size: .9375rem; color: var(--ink-3); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding-top: 4px; }
.form__actions .btn { min-width: 220px; }
.form__status { font-weight: 600; }
.form__status.is-error { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; background: var(--error-bg); color: var(--error); }
.spinner { width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: spin 640ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.success { display: grid; gap: 14px; padding: clamp(24px, 3vw, 36px); border-radius: var(--radius-l); background: var(--mist); border: 1px solid var(--line); }
.success .icon { width: 36px; height: 36px; color: var(--ok); }
.success h3 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: 2.3rem; line-height: .95; }
.aside-card { display: grid; gap: 14px; padding: clamp(22px, 3vw, 32px); border-radius: var(--radius-l); background: var(--mist); }
.aside-card + .aside-card { margin-top: 16px; }
.aside-card h2 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: 2rem; line-height: .95; }
.wa-btn { background: #25d366; color: var(--ink); border-color: #25d366; }
@media (hover: hover) and (pointer: fine) { .wa-btn:hover { background: #1fb457; border-color: #1fb457; } }

/* ---------- sheets (form + chat) ---------- */
.sheet {
  position: fixed; inset: auto 0 0 0; margin: 0 auto;
  width: min(760px, 100%); max-width: 100%; max-height: min(92svh, 900px); height: auto;
  padding: 0; border: 0; border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-2);
  overflow: hidden; overscroll-behavior: contain;
  transform: translateY(0);
  transition: transform 460ms var(--ease-drawer), display 460ms allow-discrete, overlay 460ms allow-discrete;
}
.sheet:not([open]) { transform: translateY(100%); transition-duration: 260ms; }
@starting-style { .sheet[open] { transform: translateY(100%); } }
.sheet::backdrop { background: rgba(5, 11, 46, .34); transition: background-color 300ms ease, display 300ms allow-discrete, overlay 300ms allow-discrete; }
.sheet:not([open])::backdrop { background: rgba(5, 11, 46, 0); }
@starting-style { .sheet[open]::backdrop { background: rgba(5, 11, 46, 0); } }
.sheet__panel { display: flex; flex-direction: column; max-height: inherit; }
.sheet__head { display: flex; align-items: flex-start; gap: 16px; padding: 18px clamp(20px, 3vw, 32px) 14px; border-bottom: 1px solid var(--line); }
.sheet__head h2 { font-family: var(--font-display); font-weight: 820; text-transform: uppercase; font-size: clamp(2rem, 1.6rem + 1.5vw, 2.6rem); line-height: .95; }
.sheet__head p { margin-top: 6px; color: var(--ink-2); }
.sheet__body { overflow-y: auto; padding: 22px clamp(20px, 3vw, 32px) calc(28px + var(--safe-b)); }
.icon-btn { display: grid; place-items: center; flex: none; width: 44px; height: 44px; margin-left: auto; border: 1px solid var(--line); border-radius: 50%; background: #fff; transition: transform 160ms var(--ease-out), background-color 200ms ease; }
.icon-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--mist); } }

.chat {
  position: fixed; inset: auto auto auto auto;
  right: calc(max(var(--gutter), calc(var(--safe-r) + 12px)) + var(--glyph) + 16px);
  bottom: max(24px, calc(var(--safe-b) + 14px));
  width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100svh - var(--header-h) - 48px));
  margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 22px;
  background: var(--paper); color: var(--ink); box-shadow: var(--shadow-2);
  overflow: hidden; transform-origin: 100% 100%; max-width: none; max-height: none;
  opacity: 1; transform: none;
  transition: opacity 200ms var(--ease-out), transform 240ms var(--ease-out), display 240ms allow-discrete, overlay 240ms allow-discrete;
}
.chat:not([open]) { opacity: 0; transform: scale(.96) translateY(8px); transition-duration: 150ms; }
@starting-style { .chat[open] { opacity: 0; transform: scale(.96) translateY(8px); } }
.chat::backdrop { background: rgba(5, 11, 46, .3); }
.chat__panel { display: flex; flex-direction: column; height: 100%; }
.chat__head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 18px; border-bottom: 1px solid var(--line); }
.chat__head img { width: 44px; height: auto; }
.chat__head h2 { font-size: 1.0625rem; line-height: 1.2; font-weight: 800; }
.chat__head h2 span { font-weight: 600; color: var(--ink-3); }
.demo-pill { display: inline-flex; align-items: center; min-height: 24px; margin-top: 3px; padding: 0 9px; border-radius: 999px; background: var(--tint); color: var(--navy); font-size: .75rem; font-weight: 800; }
.chat__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
.chat__notice { font-size: .875rem; line-height: 1.4; color: var(--ink-2); padding: 10px 12px; border-radius: 12px; background: var(--mist); }
.chat .msg { font-size: .98rem; animation: msg-in 260ms var(--ease-out) both; }
.chat .msg--bot .chat__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chat__actions a, .chat__actions button, .suggest button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-size: .875rem; font-weight: 700; text-decoration: none; transition: transform 160ms var(--ease-out), border-color 200ms ease; }
.chat__actions a:active, .chat__actions button:active, .suggest button:active { transform: scale(.97); }
@media (hover: hover) and (pointer: fine) { .chat__actions a:hover, .chat__actions button:hover, .suggest button:hover { border-color: var(--blue); color: var(--blue); } }
.suggest { display: flex; flex-wrap: wrap; gap: 6px; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--mist); align-self: flex-start; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); animation: dot 900ms ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: 120ms; } .typing i:nth-child(3) { animation-delay: 240ms; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes msg-in { from { opacity: 0; transform: translateY(8px); } }
.chat__form { display: flex; gap: 8px; padding: 12px 12px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); }
.chat__form .input { min-height: 48px; border-radius: 999px; padding: 10px 18px; }
.chat__send { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--blue); color: #fff; transition: transform 160ms var(--ease-out); }
.chat__send:active { transform: scale(.94); }
.chat__team { padding: 8px 18px 0; font-size: .875rem; color: var(--ink-3); }
.chat__team a { color: var(--blue); font-weight: 700; }
@media (max-width: 720px) {
  .chat { inset: auto 0 0 0; right: 0; width: 100%; max-width: 100%; height: min(88svh, 760px); border-radius: 22px 22px 0 0; border-width: 1px 0 0; transform-origin: 50% 100%; transition: transform 420ms var(--ease-drawer), display 420ms allow-discrete, overlay 420ms allow-discrete; }
  .chat:not([open]) { opacity: 1; transform: translateY(100%); transition-duration: 240ms; }
  @starting-style { .chat[open] { opacity: 1; transform: translateY(100%); } }
}

/* ---------- footer ---------- */
.site-footer { scroll-snap-align: end; padding: clamp(56px, 7vw, 96px) var(--gutter) calc(40px + var(--safe-b)); padding-right: calc(var(--gutter) + var(--glyph) + 24px); background: var(--mist); color: var(--ink); border-top: 1px solid var(--line); }
.footer-grid { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 36px; }
.footer-brand { display: grid; gap: 16px; align-content: start; }
.footer-brand .logo-tile { display: inline-grid; place-items: center; justify-self: start; padding: 10px 14px; border-radius: 14px; background: #fff; }
.footer-brand .logo-tile img { height: 34px; width: auto; }
.footer-brand p { color: var(--ink-2); max-width: 26em; }
.site-footer h2 { font-size: .9375rem; font-weight: 800; color: var(--ink); margin-bottom: 12px; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .site-footer a:hover { color: var(--blue); text-decoration: underline; } }
.footer-base { max-width: 1280px; margin: 44px auto 0; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; font-size: .9rem; color: var(--ink-3); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* short landscape phones: keep the hero action above the fold */
@media (max-height: 500px) and (orientation: landscape) {
  .t-xl { font-size: clamp(2rem, 10vh, 3.1rem); }
  .t-l { font-size: clamp(1.7rem, 8vh, 2.5rem); }
  .item, .page-hero, .article-hero { padding-top: calc(var(--header-h) + 14px); padding-bottom: 18px; }
  .item__caption { gap: 10px; }
}

/* ---------- page transitions (cross-document) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-leave 380ms var(--ease-drawer) both; }
::view-transition-new(root) { animation: vt-enter 520ms var(--ease-drawer) both; }
html[data-vt="back"]::view-transition-old(root) { animation-name: vt-leave-back; }
html[data-vt="back"]::view-transition-new(root) { animation-name: vt-enter-back; }
::view-transition-group(article-cover) { animation-duration: 560ms; animation-timing-function: var(--ease-drawer); }
::view-transition-old(article-cover), ::view-transition-new(article-cover) { height: 100%; object-fit: cover; }
@keyframes vt-leave { to { transform: translateY(-14%); opacity: .2; } }
@keyframes vt-enter { from { transform: translateY(100%); } }
@keyframes vt-leave-back { to { transform: translateY(14%); opacity: .2; } }
@keyframes vt-enter-back { from { transform: translateY(-100%); } }
.vt-fallback main { animation: page-in 520ms var(--ease-out) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(28px); } }

/* ---------- reduced motion: keep fades, drop movement ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  html:has(.is-home) { scroll-snap-type: none; }
  .item[data-item] .item__media img, .item[data-item].is-active .item__media img { transform: none; transition: none; }
  .js .item[data-item]:not(.is-active) .item__caption > *, .js [data-reveal]:not(.is-in) { opacity: 1; transform: none; }
  [data-reveal], .item__caption > * { transition: none; }
  .sheet, .sheet:not([open]), .chat, .chat:not([open]), .menu, .menu:not([open]) { transform: none; transition: opacity 160ms ease, display 160ms allow-discrete, overlay 160ms allow-discrete; }
  .sheet:not([open]), .chat:not([open]), .menu:not([open]) { opacity: 0; }
  @starting-style { .sheet[open], .chat[open], .menu[open] { opacity: 0; transform: none; } .menu[open] .menu__links li { opacity: 1; transform: none; } }
  .rail.is-tucked { transform: none; }
  .src, .bubble, .next-step { transition: opacity 200ms ease; transform: none !important; }
  .js .step { opacity: 1; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: vt-fade 160ms ease both; }
  ::view-transition-old(root) { animation-direction: reverse; }
  ::view-transition-group(*) { animation-duration: 0s; }
  .vt-fallback main { animation: none; }
  .typing i, .spinner { animation-duration: 1.6s; }
  .chat .msg { animation: none; }
}
@keyframes vt-fade { from { opacity: 0; } }
