/* Tidy Capy — stile di tutte le pagine (ADR-069).
   Caratteri sul sito stesso (OFL): nessuna richiesta a Google Fonts.
   Niente stili nelle pagine: la CSP permette solo questo file (style-src 'self'). */
@font-face { font-family: "Figtree"; src: url("fonts/Figtree.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("fonts/Figtree-Italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Kalam"; src: url("fonts/Kalam-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }

/* ---------- Colori: tema scuro (predefinito, come il progetto grafico) ---------- */
:root {
  color-scheme: dark;
  --bg: #0f1523;
  --bg-hero: #0c111d;
  --sidebar: #0b111d;
  --sidebar-line: #2a3041;
  --rule: #313746;
  --line: #222836;
  --line-2: #2f3545;
  --text: #f8f9fd;
  --text-2: #dde3f2;
  --text-3: #cfd4e6;
  --muted: #b2b9cc;
  --lav: #d3c0f9;
  --lav-2: #dabbfb;
  --link: #d3c0f9;
  --btn: #d1b5fc;
  --btn-hover: #ddc8fd;
  --btn-text: #120c2e;
  --pill: #383467;
  --pill-hover: #252344;
  --pill-text: #f2e6ff;
  --nav-text: #eef1f9;
  --tile: #28274d;
  --tile-icon: #e4d4ff;
  --chip: #171f31;
  --chip-hover: #1e2840;
  --badge: #121828;
  --badge-line: #262d40;
  --ctl-line: #262b3e;
  --feat-title: #dcdffa;
  --feat-text: #c8cfe1;
  --quote: #ccd0e4;
  --deco: #cdbaf2;
  --grad-a: #cdb5fb;
  --grad-b: #f6c7f8;
  --box: #141b2d;
  --box-line: #283050;
  --wave-1a: #33305f; --wave-1b: #2d2b59;
  --wave-2a: #9479d5; --wave-2b: #7a62bb;
  --wave-3a: #d0b2fc; --wave-3b: #cbadf9;
  --scrim: rgba(4, 7, 15, .62);
  --shadow: 0 18px 50px rgba(0, 0, 0, .35);
  --sidebar-w: 243px;
}

/* ---------- Tema chiaro (pulsante in alto a destra) ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f5fc;
  --bg-hero: #f2eefb;
  --sidebar: #ffffff;
  --sidebar-line: #e3dcf2;
  --rule: #e3dcf2;
  --line: #e6e0f3;
  --line-2: #ddd5ef;
  --text: #161330;
  --text-2: #36345a;
  --text-3: #45446a;
  --muted: #6a6987;
  --lav: #7a57d6;
  --lav-2: #6a4ad0;
  --link: #6a4ad0;
  --btn: #cdb2fb;
  --btn-hover: #c2a2fa;
  --btn-text: #150f30;
  --pill: #ebe3fe;
  --pill-hover: #f3eefe;
  --pill-text: #34287a;
  --nav-text: #2b2950;
  --tile: #ece5fe;
  --tile-icon: #6b4cd1;
  --chip: #ffffff;
  --chip-hover: #f3eefe;
  --badge: #ffffff;
  --badge-line: #ddd5ef;
  --ctl-line: #ddd5ef;
  --feat-title: #2c2560;
  --feat-text: #4d4b70;
  --quote: #56557a;
  --deco: #8b6bdb;
  --grad-a: #8d64e8;
  --grad-b: #d566d6;
  --box: #ffffff;
  --box-line: #e3dcf2;
  --wave-1a: #ebe4fd; --wave-1b: #e3daf9;
  --wave-2a: #c8b2f8; --wave-2b: #b39af1;
  --wave-3a: #9c7ff0; --wave-3b: #8f70ea;
  --scrim: rgba(30, 24, 60, .35);
  --shadow: 0 18px 40px rgba(60, 40, 120, .12);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text-3);
  font: 400 16px/1.5 "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--lav); outline-offset: 3px; border-radius: 6px; }
.i { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.i.fill { fill: currentColor; stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--btn); color: var(--btn-text); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }

/* Senza JavaScript si vedono tutte e due le lingue; con JavaScript solo quella scelta. */
html[data-lang="it"] [lang="en"]:not(html),
html[data-lang="en"] [lang="it"]:not(html) { display: none !important; }
/* Parti nascoste dalle pagine (per esempio i download per computer chiusi, tool/site_art/download_links.py):
   senza questa regola le classi che danno un display vincerebbero sull'attributo hidden. */
[hidden] { display: none !important; }

/* ---------- Struttura: barra laterale + pagina ---------- */
.layout { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; z-index: 30;
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--sidebar);
  border-right: 1px solid var(--sidebar-line);
  overflow: hidden;
}
.page { position: relative; min-width: 0; display: flex; flex-direction: column; }
.scrim { display: none; }
.page > main { flex: 1; }

.brand { display: flex; align-items: center; gap: 10px; padding: 23px 0 0 31px; color: var(--text); text-decoration: none; }
.brand:hover { color: var(--text); }
.brand img { width: 53px; height: 54px; flex: none; }
.brand-name { font-size: 26.5px; font-weight: 800; letter-spacing: -.015em; line-height: 1; white-space: nowrap; }
.brand-name b { font-weight: 800; color: var(--lav); }

.nav { display: flex; flex-direction: column; gap: 9px; margin: 33px 23px 0; }
.nav a {
  display: flex; align-items: center; gap: 21px;
  height: 48px; padding: 0 20px; border-radius: 24px;
  color: var(--nav-text); font-size: 16px; font-weight: 500; text-decoration: none;
  transition: background-color .15s;
}
.nav a:hover { background: var(--pill-hover); color: var(--nav-text); }
.nav a[aria-current="page"], .nav a.on { background: var(--pill); color: var(--pill-text); }
.nav a[aria-current="page"] .i, .nav a.on .i { color: var(--lav-2); }
/* Nella home la voce accesa segue la sezione visibile (site.js). */
.nav.spy a[aria-current="page"]:not(.on) { background: transparent; color: var(--nav-text); }
.nav.spy a[aria-current="page"]:not(.on):hover { background: var(--pill-hover); }
.nav.spy a[aria-current="page"]:not(.on) .i { color: inherit; }

.side-rule { height: 1px; margin: 31px 23px 0; border: 0; background: var(--rule); }
.side-quote { margin: 34px 0 0 38px; padding-right: 20px; }
.side-quote .heart { width: 22px; height: 22px; color: var(--lav-2); stroke-width: 1.8; }
.side-quote p { margin: 11px 0 0; color: var(--quote); font-size: 14.5px; font-style: italic; line-height: 23px; }
.side-quote .swoosh { width: 78px; height: 17px; margin: 9px 0 0 59px; color: #c0b5e0; }
:root[data-theme="light"] .side-quote .swoosh { color: var(--deco); }
.waves { position: absolute; left: 0; bottom: 0; width: 100%; height: 270px; pointer-events: none; }
.waves .w1 { fill: url(#wave-g1); }
.waves .w2 { fill: url(#wave-g2); }
.waves .w3 { fill: url(#wave-g3); }
.w1a { stop-color: var(--wave-1a); } .w1b { stop-color: var(--wave-1b); }
.w2a { stop-color: var(--wave-2a); } .w2b { stop-color: var(--wave-2b); }
.w3a { stop-color: var(--wave-3a); } .w3b { stop-color: var(--wave-3b); }

@media (max-height: 880px) {
  .waves { height: 210px; }
  .side-quote { margin-top: 26px; }
}
@media (max-height: 740px) {
  .side-quote { display: none; }
  .waves { height: 150px; }
}

/* ---------- Pulsanti in alto: lingua e tema ---------- */
.topbar { position: absolute; top: 22px; right: 30px; z-index: 20; display: flex; align-items: center; gap: 10px; }
.topbar .brand, .topbar .menu-btn { display: none; }
.ctl {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; min-width: 54px; padding: 0 14px;
  border: 1px solid var(--ctl-line); border-radius: 20px;
  background: transparent; color: #e9e4fd; cursor: pointer;
}
:root[data-theme="light"] .ctl { color: var(--nav-text); background: var(--sidebar); }
.ctl:hover { background: var(--pill-hover); }
.ctl .i { width: 21px; height: 21px; stroke-width: 1.9; }
.theme-btn .sun, :root[data-theme="light"] .theme-btn .moon { display: none; }
:root[data-theme="light"] .theme-btn .sun { display: block; }
.langs { display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 3px; border: 1px solid var(--ctl-line); border-radius: 20px; }
:root[data-theme="light"] .langs { background: var(--sidebar); }
.langs button {
  height: 32px; padding: 0 11px; border: 0; border-radius: 16px;
  background: none; color: var(--muted); font: 600 13px/1 "Figtree", sans-serif; letter-spacing: .04em; cursor: pointer;
}
.langs button:hover { color: var(--text); }
.langs button[aria-pressed="true"] { background: var(--pill); color: var(--pill-text); }

/* ---------- Elementi comuni ---------- */
.wrap { width: 100%; max-width: 1293px; margin: 0 auto; padding: 0 54px 0 72px; }
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 43px; padding: 0 24px 0 22px; border-radius: 22px;
  background: var(--btn); color: var(--btn-text);
  font-size: 15.5px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, transform .15s;
}
.btn:hover { background: var(--btn-hover); color: var(--btn-text); }
.btn:active { transform: translateY(1px); }
.btn .i { width: 19px; height: 19px; stroke-width: 2.4; }
.grad { background: linear-gradient(90deg, var(--grad-a) 0%, var(--grad-b) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Home: apertura ---------- */
.hero { background: var(--bg-hero); border-bottom: 1px solid var(--line); }
.hero .wrap {
  display: grid; grid-template-columns: minmax(330px, 475px) minmax(0, 678px);
  justify-content: space-between; column-gap: 0;
  min-height: 427px; padding-right: 68px;
}
.hero-text { padding: 65px 0 32px; }
.badge {
  display: inline-flex; align-items: center; gap: 11px;
  height: 34px; padding: 0 16px 0 14px;
  border: 1px solid var(--badge-line); border-radius: 17px; background: var(--badge);
  color: #c6c7e7; font-size: 13px; font-weight: 500; letter-spacing: .045em; text-transform: uppercase;
}
:root[data-theme="light"] .badge { color: var(--text-3); }
.badge .i { width: 19px; height: 19px; stroke-width: 1.9; }
.hero h1 { margin: 11px 0 0; color: var(--text); font-weight: 800; letter-spacing: -.022em; }
.hero h1 .l1 { display: block; font-size: 47px; font-weight: 700; line-height: 1.05; }
.hero h1 .l2 { display: block; position: relative; width: max-content; font-size: 75px; line-height: .98; }
.hero h1 .sparks { position: absolute; left: 100%; top: -.02em; width: 38px; height: 38px; margin-left: 2px; color: var(--deco); stroke-width: 3.2; }
.lead { margin: 16px 0 0; max-width: 432px; color: var(--text-2); font-size: 19px; line-height: 27.5px; }
.hero .btn { margin-top: 21px; }
.hero-art { position: relative; align-self: start; margin-top: 10px; width: 100%; max-width: 678px; }
.hero-art img { width: 100%; }
.art-deco { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.art-deco .on-blob { color: #cdbaf2; }
.art-deco .off-blob { color: var(--deco); }
.art-deco text { font-family: "Kalam", "Figtree", cursive; fill: currentColor; }

/* ---------- Home: il progetto Sfoglia ---------- */
.project { border-bottom: 1px solid var(--line-2); }
.project .wrap {
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 365px;
  min-height: 440px; padding-right: 48px;
}
.p-text { padding: 34px 0 26px; }
.app-icon { width: 86px; height: 86px; }
.project h2, .app-hero h1 { margin: 10px 0 0; color: var(--text); font-size: 39px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.p-sub { margin: 4px 0 0; color: var(--text); font-size: 19.5px; font-weight: 700; line-height: 27.5px; }
.p-desc { margin: 17px 0 0; color: var(--text-3); font-size: 15px; line-height: 21.5px; }
.p-text .btn { height: 40px; margin-top: 21px; padding: 0 22px 0 21px; }
.p-text .btn, .p-text .demo-link { display: flex; width: max-content; }
.btn .ext { width: 18px; height: 18px; stroke-width: 2.2; }
.demo-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 18px; color: #eae3fd; font-size: 14.4px; font-weight: 500; text-decoration: none; }
:root[data-theme="light"] .demo-link { color: var(--nav-text); }
.demo-link:hover { color: var(--text); }
.demo-link .play { width: 23px; height: 23px; }
/* Parti delle icone riusate con <use>: i selettori con antenati non arrivano dentro <use>, le variabili sì. */
.pl-bg { fill: var(--play-bg, #c4aaf0); }
.pl-tri { fill: var(--play-tri, #0b0820); }
.cut { fill: var(--cut, #28274d); stroke: none; }
.cut-s { fill: none; stroke: var(--cut, #28274d); }
.ln { fill: none; stroke: currentColor; }
.demo-link .arrow { width: 19px; height: 19px; margin-left: -4px; stroke-width: 2; }
.demo-link .dl { width: 22px; height: 22px; stroke-width: 2.2; color: var(--lav-2); }
.p-text .dl-link { margin-top: 12px; }

/* ---------- Video demo: finestra sopra la pagina (site.js) ---------- */
.video-dialog {
  width: min(94vw, calc(86vh * 1.6)); width: min(94vw, calc(86dvh * 1.6));
  max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px;
  background: #000; overflow: hidden; box-shadow: 0 30px 90px rgba(0, 0, 0, .6);
}
.video-dialog::backdrop { background: rgba(6, 9, 18, .84); }
.video-dialog video { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 1200; background: #000; }
.video-close {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(12, 17, 29, .72); color: #fff; cursor: pointer;
}
.video-close:hover, .video-close:focus-visible { background: rgba(12, 17, 29, .92); }
.video-close .i { width: 20px; height: 20px; }

.phones { position: relative; align-self: start; width: 510px; max-width: 100%; justify-self: start; margin: 13px 0 0 -15px; }
.phones img { width: 100%; }
.phones .art-deco path { stroke: currentColor; }

.features { margin: 0; padding: 48px 0 0; list-style: none; }
.features li { display: grid; grid-template-columns: 65px minmax(0, 1fr); column-gap: 23px; padding-bottom: 20px; }
.features li + li { padding-top: 21px; border-top: 1px solid var(--line-2); }
.tile { --cut: var(--tile); display: grid; place-items: center; width: 65px; height: 64px; border-radius: 18px; background: var(--tile); color: var(--tile-icon); }
.tile svg { width: 34px; height: 34px; fill: none; stroke: none; }
.features h3 { margin: 0; color: var(--feat-title); font-size: 15.7px; font-weight: 600; line-height: 1.3; }
.features p { margin: 4px 0 0; color: var(--feat-text); font-size: 13.8px; line-height: 21px; }
.signature { position: relative; width: 150px; height: 70px; margin: -8px 0 0 94px; color: var(--deco); }
.signature svg { width: 100%; height: 100%; overflow: visible; }
.signature text { font-family: "Kalam", "Figtree", cursive; fill: currentColor; }

/* ---------- Home: competenze ---------- */
.skills { border-bottom: 1px solid var(--line); }
.skills .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; min-height: 87px; padding-top: 11px; padding-bottom: 11px; }
.skills h2 { margin: 0; color: var(--text); font-size: 16.5px; font-weight: 700; line-height: 1.3; }
.skills p { margin: 4px 0 0; color: var(--text-3); font-size: 12.6px; }
.skills .wrap > div { flex: none; }
/* Otto tecnologie: su una riga accanto al titolo se c'è posto, altrimenti tutte sotto (mai una sola a capo). */
.chips { display: flex; flex-wrap: nowrap; justify-content: flex-end; gap: 12px; margin: 0; padding: 0; list-style: none; }
.chip { display: inline-flex; align-items: center; gap: 9px; height: 48px; padding: 0 14px 0 12px; border-radius: 24px; background: var(--chip); color: var(--text-2); font-size: 14px; font-weight: 500; }
:root[data-theme="light"] .chip { border: 1px solid var(--line-2); }
.chip img { width: 30px; height: 30px; }

/* ---------- Piè di pagina ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px; min-height: 67px; padding: 14px 24px; color: var(--muted); font-size: 12.4px; }
/* Come nel progetto grafico, il piè di pagina è centrato sulla finestra, non sulla colonna. */
@media (min-width: 1100px) { .foot { padding-right: 228px; } }
.foot a { color: inherit; text-decoration: none; }
.foot a:hover { color: var(--text); }
.foot .sep { opacity: .9; }
.foot .heart { width: 18px; height: 18px; stroke-width: 1.8; }
.foot-contact { display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Pagina di Sfoglia ---------- */
.app-hero { background: var(--bg-hero); border-bottom: 1px solid var(--line); }
.app-hero .wrap { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 510px); justify-content: space-between; align-items: center; column-gap: 32px; padding-top: 72px; padding-bottom: 36px; }
.app-hero .lead { max-width: 440px; }
.app-hero .note { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.app-hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
.app-hero .actions .demo-link { margin-top: 0; }
.section { border-bottom: 1px solid var(--line); }
.section .wrap { padding-top: 46px; padding-bottom: 50px; }
.section h2 { margin: 0; color: var(--text); font-size: 30px; font-weight: 800; letter-spacing: -.015em; }
.section .intro { margin: 8px 0 0; max-width: 620px; color: var(--text-3); }
.cards4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: 28px 0 0; padding: 0; list-style: none; }
.cards4 li { padding: 22px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--box); }
.cards4 .tile { margin-bottom: 16px; }
.cards4 h3 { margin: 0; color: var(--feat-title); font-size: 17px; font-weight: 700; }
.cards4 p { margin: 6px 0 0; color: var(--feat-text); font-size: 15px; line-height: 22px; }
.privacy-note { display: flex; align-items: center; gap: 14px; margin: 26px 0 0; padding: 16px 20px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--box); color: var(--text-2); }
.privacy-note .i { width: 26px; height: 26px; color: var(--lav-2); }
.gallery { display: flex; gap: 18px; margin: 28px -54px 0 0; padding: 4px 54px 14px 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.gallery li { flex: none; list-style: none; scroll-snap-align: start; }
.gallery img { width: 232px; height: auto; aspect-ratio: 9 / 16; border-radius: 18px; border: 1px solid var(--line-2); background: var(--box); }
.gallery ul, ul.gallery { margin-left: 0; padding-left: 0; }
/* Scarica (ADR-076): una scheda per sistema; quella del computer di chi visita va per prima. */
.downloads { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 30px 0 0; padding: 0; list-style: none; }
.downloads li { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--box); }
.downloads li.here { order: -1; border-color: var(--lav); box-shadow: var(--shadow); }
.downloads .here-label { display: none; position: absolute; top: -12px; right: 18px; padding: 3px 11px; border-radius: 99px; background: var(--btn); color: var(--btn-text); font-size: 12.5px; font-weight: 700; }
.downloads li.here .here-label { display: block; }
.downloads .os { display: flex; align-items: center; gap: 14px; }
.downloads .os svg { width: 38px; height: 38px; flex: none; color: var(--text); }
.downloads h3 { margin: 0; color: var(--feat-title); font-size: 19px; font-weight: 800; }
.downloads .req { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; line-height: 19px; }
.downloads .btn { margin: 0; }
.downloads .size { color: var(--muted); font-size: 13.5px; }
.downloads .alt { color: var(--link); }
.downloads .soon { display: inline-block; padding: 9px 16px; border: 1px dashed var(--line-2); border-radius: 99px; color: var(--text-2); font-size: 14.5px; font-weight: 600; }
.dl-group { margin: 30px 0 0; color: var(--feat-title); font-size: 17px; font-weight: 700; }
.dl-group + .downloads { margin-top: 14px; }
.downloads details { color: var(--text-3); font-size: 14.5px; line-height: 21px; }
.downloads summary { cursor: pointer; color: var(--text-2); font-weight: 600; }
.downloads details p { margin: 8px 0 0; }
.downloads code { padding: 1px 6px; border-radius: 6px; background: var(--chip); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; overflow-wrap: anywhere; }
.gallery.wide img { width: 412px; aspect-ratio: 16 / 9; }
.links3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 26px 0 0; padding: 0; list-style: none; }
.links3 a { display: flex; align-items: center; gap: 14px; height: 100%; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: 18px; background: var(--box); color: var(--text); font-weight: 600; text-decoration: none; }
.links3 a:hover { background: var(--chip-hover); }
.links3 .i { color: var(--lav-2); }
.links3 small { display: block; margin-top: 2px; color: var(--muted); font-size: 13.5px; font-weight: 400; }
.links3 .go { width: 18px; height: 18px; margin-left: auto; color: var(--muted); }

/* ---------- Pagine di testo: privacy, condizioni, assistenza, dati ---------- */
.doc-page { border-bottom: 1px solid var(--line); }
.doc-page .wrap { max-width: 980px; margin: 0; padding-top: 74px; padding-bottom: 64px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs .i { width: 15px; height: 15px; }
.doc { max-width: 780px; color: var(--text-3); font-size: 16.5px; line-height: 1.65; overflow-wrap: break-word; }
.doc h1, .doc h2 { hyphens: auto; }
.doc h1 { margin: 0 0 6px; color: var(--text); font-size: 44px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.doc h2 { margin: 36px 0 10px; padding-top: 28px; border-top: 1px solid var(--line-2); color: var(--text); font-size: 22px; font-weight: 700; line-height: 1.3; }
.doc h3 { margin: 24px 0 6px; color: var(--feat-title); font-size: 18px; font-weight: 700; }
.doc p { margin: 10px 0; }
.doc ul, .doc ol { padding-left: 22px; }
.doc li { margin: 5px 0; }
.doc strong { color: var(--text-2); font-weight: 700; }
.doc .muted, .muted { color: var(--muted); }
.doc .lead { margin: 6px 0 22px; max-width: none; font-size: 19px; }
.box { margin: 20px 0; padding: 18px 22px; border: 1px solid var(--box-line); border-radius: 18px; background: var(--box); }
.box ul { margin: 8px 0 0; }
.box > strong:first-child { color: var(--text); }
/* Pagine legali (ADR-154): lingue e indice dopo «In breve». */
.doc-langs { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.doc-langs a[aria-current] { color: var(--text); font-weight: 600; text-decoration: none; }
.doc-index { margin: 0 0 24px; padding: 14px 22px; border: 1px solid var(--line-2); border-radius: 18px; }
.doc-index ol { margin: 0; padding-left: 20px; }
.doc-index li { margin: 2px 0; }
details { margin: 12px 0; padding: 14px 20px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--box); }
details[open] { padding-bottom: 6px; }
summary { color: var(--text); font-weight: 600; cursor: pointer; }
summary::marker { color: var(--lav-2); }
details p, details ol, details ul { color: var(--text-3); }

/* ---------- Caregiver OS: «Prossimamente» (ADR-152) ----------
   Una scritta enorme col gradiente del sito che riempie la larghezza (unità del contenitore, cqi). */
.soon { position: relative; overflow: hidden; background: var(--bg-hero); border-bottom: 1px solid var(--line); }
.soon::before {
  content: ""; position: absolute; left: 50%; top: 46%; width: 920px; height: 920px; max-width: 160%;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--grad-a) 22%, transparent), transparent);
  pointer-events: none;
}
.soon .wrap {
  position: relative; container-type: inline-size;
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  min-height: calc(100vh - 120px); min-height: calc(100svh - 120px); padding-top: 64px; padding-bottom: 72px;
}
.soon-logo { width: 104px; height: 104px; animation: soon-beat 2.4s ease-in-out infinite; }
.soon-app { margin: 22px 0 0; color: var(--text-2); font-size: 15px; font-weight: 700; letter-spacing: .32em; text-transform: uppercase; }
.soon h1 {
  margin: 6px 0 0; padding: 0 .04em .06em; font-size: clamp(36px, 10.6cqi, 156px); font-weight: 900; line-height: 1;
  letter-spacing: -.035em; text-transform: uppercase; white-space: nowrap;
}
.soon-sub { margin: 18px 0 0; max-width: 520px; text-wrap: balance; color: var(--text-2); font-size: 19px; line-height: 27.5px; }
.soon-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; margin: 34px 0 0; padding: 0; list-style: none; }
.soon-links a {
  display: inline-flex; align-items: center; gap: 9px; height: 42px; padding: 0 18px 0 15px;
  border: 1px solid var(--line-2); border-radius: 21px; background: var(--box);
  color: var(--text-2); font-size: 14.5px; font-weight: 600; text-decoration: none;
}
.soon-links a:hover { background: var(--chip-hover); color: var(--text); }
.soon-links .i { width: 18px; height: 18px; color: var(--lav-2); }
@keyframes soon-beat { 0%, 56%, 100% { transform: scale(1); } 64% { transform: scale(1.08); } 72% { transform: scale(.98); } 80% { transform: scale(1.05); } }

/* ---------- 404 ---------- */
.not-found .wrap { display: flex; flex-direction: column; align-items: flex-start; padding-top: 110px; padding-bottom: 90px; }
.not-found img { width: 120px; height: auto; }
.not-found h1 { margin: 22px 0 0; color: var(--text); font-size: 64px; font-weight: 800; line-height: 1; }
.not-found .lead { margin-top: 14px; }
.not-found .btn { margin-top: 26px; }

/* ---------- Animazioni al passaggio del mouse o al tocco ----------
   site.js mette la classe .fx (col mouse finché ci si sta sopra, col dito per un attimo); con
   "riduci animazioni" la classe non arriva mai. Le parti dei disegni girano attorno al proprio centro. */
.nav a, .nav a .i, .ctl .i, .langs button, .badge, .badge .i, .btn, .btn .i, .demo-link .play, .demo-link .arrow,
.hero-art img, .hero-art .art-deco, .phones img, .phones .art-deco, .tile, .features h3, .chip, .chip img,
.cards4 li, .downloads li, .gallery img, .links3 a, .links3 .go {
  transition: transform .45s cubic-bezier(.34, 1.56, .64, 1), box-shadow .3s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.d-bubble, .d-heart, .d-dot, .d-spark, .d-mini, .d-notes, .d-arrows, .d-mark, .d-arrow, .sig-heart,
.hero h1 .sparks, .side-quote .heart, .foot .heart, .privacy-note .i { transform-box: fill-box; transform-origin: center; }
.sig-arrow { stroke-dasharray: 1; }

.brand.fx img { animation: fx-wiggle .8s ease-in-out; transform-origin: 50% 90%; }
.nav a.fx { transform: translateX(4px); }
.nav a.fx .i { transform: scale(1.15) rotate(-8deg); }
.theme-btn.fx .i { transform: rotate(-25deg) scale(1.12); }
.menu-btn.fx .i { transform: scale(1.12); }
.langs button.fx { transform: scale(1.08); }
.badge.fx { transform: translateY(-2px); border-color: var(--lav); }
.badge.fx .i { transform: rotate(-12deg) scale(1.15); }
.hero h1 .l2.fx .sparks { animation: fx-sparks .7s ease-out; transform-origin: 0 100%; }
.btn.fx { transform: translateY(-3px); box-shadow: 0 14px 28px -12px rgba(176, 132, 244, .75); }
.btn.fx .i { transform: translate(2px, -1px) rotate(-6deg) scale(1.08); }
.btn.fx:active { transform: translateY(0) scale(.97); }
.demo-link.fx .play { transform: scale(1.2); }
.demo-link.fx .arrow { transform: translateX(5px); }
.hero-art.fx img, .hero-art.fx .art-deco { transform: translateY(-6px) rotate(-.6deg); }
.hero-art.fx .d-bubble { animation: fx-wiggle .9s ease-in-out; }
.hero-art.fx .d-heart, .hero-art.fx .d-mini { animation: fx-beat 1s ease-in-out; }
.hero-art.fx .d-spark, .hero-art.fx .d-dot { animation: fx-twinkle .9s ease-in-out; }
.hero-art.fx .d-notes { animation: fx-sway 1.1s ease-in-out; }
.hero-art.fx .d-arrows { animation: fx-nudge .9s ease-in-out; }
.phones.fx img, .phones.fx .art-deco { transform: translateY(-8px) rotate(-1.2deg); }
.phones.fx .d-mark { animation: fx-twinkle .8s ease-in-out; }
.phones.fx .d-arrow { animation: fx-nudge .9s ease-in-out; }
.features li.fx .tile { transform: translateY(-3px) rotate(-7deg) scale(1.08); }
.features li.fx h3 { color: var(--text); }
.signature.fx .sig-heart { animation: fx-beat 1s ease-in-out; }
.signature.fx .sig-arrow { animation: fx-draw .9s ease-out; }
.chip.fx { transform: translateY(-4px); background: var(--chip-hover); box-shadow: 0 12px 24px -14px rgba(0, 0, 0, .65); }
.chip.fx img { transform: rotate(-12deg) scale(1.15); }
.foot-contact.fx .heart, .side-quote.fx .heart { animation: fx-beat 1s ease-in-out; }
.cards4 li.fx { transform: translateY(-5px); border-color: var(--lav); box-shadow: var(--shadow); }
.cards4 li.fx .tile { transform: rotate(-7deg) scale(1.08); }
.gallery li.fx img { transform: translateY(-6px) scale(1.03); box-shadow: var(--shadow); }
.links3 a.fx { transform: translateY(-3px); border-color: var(--lav); }
.downloads li.fx { transform: translateY(-4px); border-color: var(--lav); }
.links3 a.fx .go { transform: translateX(4px); color: var(--lav-2); }
.privacy-note.fx .i { animation: fx-wiggle .8s ease-in-out; }
.not-found img.fx { animation: fx-wiggle .9s ease-in-out; }

@keyframes fx-wiggle { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-9deg); } 45% { transform: rotate(7deg); } 70% { transform: rotate(-4deg); } 85% { transform: rotate(2deg); } }
@keyframes fx-beat { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.28); } 40% { transform: scale(.94); } 60% { transform: scale(1.16); } 80% { transform: scale(.98); } }
@keyframes fx-twinkle { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(1.6) rotate(45deg); opacity: .7; } }
@keyframes fx-sway { 0%, 100% { transform: rotate(0) translateY(0); } 35% { transform: rotate(-3deg) translateY(-3px); } 70% { transform: rotate(2deg) translateY(1px); } }
@keyframes fx-nudge { 0%, 100% { transform: translate(0, 0); } 40% { transform: translate(-5px, -3px); } 70% { transform: translate(2px, 1px); } }
@keyframes fx-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fx-sparks { 0%, 100% { transform: scale(1) rotate(0); } 40% { transform: scale(1.35) rotate(-10deg); } 70% { transform: scale(.95) rotate(4deg); } }

/* ---------- Schermi medi (portatili): stessa struttura, colonne che si adattano ---------- */
@media (max-width: 1519px) {
  .skills .wrap { flex-direction: column; align-items: flex-start; padding-top: 18px; padding-bottom: 18px; }
  .skills p br { display: none; }
  .chips { flex-wrap: wrap; justify-content: flex-start; }
}
@media (max-width: 1439px) {
  .features p br { display: none; }
}
@media (max-width: 1439px) and (min-width: 1100px) {
  .hero .wrap { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); column-gap: 28px; }
  .hero-art { align-self: center; margin-top: 70px; margin-bottom: 24px; }
  .project .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "text phones" "feat feat"; column-gap: 32px; }
  .project .p-text { grid-area: text; }
  .project .phones { grid-area: phones; justify-self: center; margin-left: 0; }
  .project .p-feat { grid-area: feat; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 28px; padding: 4px 0 34px; }
  .p-feat .features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; padding: 0; }
  .p-feat .features li, .p-feat .features li + li { grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; padding: 0; border: 0; }
  .p-feat .tile { width: 52px; height: 52px; border-radius: 15px; }
  .p-feat .tile svg { width: 28px; height: 28px; }
  .p-feat .signature { margin: 0; }
}

@media (max-width: 1299px) and (min-width: 1100px) {
  .hero .wrap { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
  .hero h1 .l1 { font-size: 40px; }
  .hero h1 .l2 { font-size: 64px; }
  .project .p-feat { grid-template-columns: minmax(0, 1fr); }
  .project .p-feat .signature { justify-self: end; margin-top: -6px; }
}

/* ---------- Tablet e telefono: barra laterale a scomparsa ---------- */
@media (max-width: 1099px) {
  /* Il menu porta alle sezioni: che il titolo non finisca sotto la barra in alto. */
  main section[id] { scroll-margin-top: 76px; }
  .layout { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0;
    width: min(290px, 84vw); height: auto;
    transform: translateX(-102%); transition: transform .25s ease;
    box-shadow: var(--shadow);
  }
  .nav-open .sidebar { transform: none; }
  .sidebar .brand { padding-top: 20px; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 25; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .25s; }
  .nav-open .scrim { opacity: 1; pointer-events: auto; }
  .nav-open { overflow: hidden; }
  .topbar {
    position: sticky; top: 0; right: auto; height: 66px; padding: 0 16px;
    background: color-mix(in srgb, var(--bg-hero) 90%, transparent);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .topbar .brand { display: flex; padding: 0; margin-right: auto; gap: 8px; }
  .topbar .brand img { width: 40px; height: 41px; }
  .topbar .brand-name { font-size: 23px; }
  .topbar .menu-btn { display: inline-flex; min-width: 44px; padding: 0 10px; }
  .wrap { padding: 0 32px; }
  .hero .wrap { grid-template-columns: minmax(0, 1fr); min-height: 0; padding: 0 32px; }
  .hero-text { padding: 44px 0 6px; }
  .hero-art { justify-self: center; margin: 4px 0 26px; }
  .project .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "text phones" "feat feat"; column-gap: 28px; min-height: 0; padding: 0 32px; }
  .project .p-text { grid-area: text; }
  .project .phones { grid-area: phones; margin-top: 30px; }
  .project .p-feat { grid-area: feat; padding-bottom: 30px; }
  .p-feat .features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding-top: 10px; }
  .p-feat .features li, .p-feat .features li + li { display: block; padding: 0; border: 0; }
  .p-feat .tile { margin-bottom: 12px; }
  .p-feat .signature { margin: 18px auto 0; }
  .skills .wrap { padding: 26px 32px; }
  .app-hero .wrap { grid-template-columns: minmax(0, 1fr); padding-top: 44px; }
  .app-hero .phones { margin-top: 26px; }
  .doc-page .wrap { padding-top: 40px; }
  .gallery { margin-right: -32px; padding-right: 32px; }
  .not-found .wrap { padding-top: 70px; }
}
@media (max-width: 760px) {
  .wrap, .hero .wrap, .project .wrap { padding-left: 16px; padding-right: 16px; }
  .skills .wrap { padding: 24px 16px; }
  .topbar .brand-name { font-size: 21px; }
  .langs button { padding: 0 9px; }
  .ctl { min-width: 44px; padding: 0 10px; }
  .hero h1 .l1 { font-size: 34px; }
  .hero h1 .l2 { font-size: 58px; }
  .hero h1 .sparks { width: 28px; height: 28px; }
  .lead { font-size: 17.5px; line-height: 26px; }
  .project .wrap { grid-template-columns: minmax(0, 1fr); grid-template-areas: "text" "phones" "feat"; }
  .phones { margin-top: 4px; }
  .p-feat .features { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .p-feat .features li { display: grid; padding: 18px 0; }
  .p-feat .features li + li { display: grid; padding: 18px 0; border-top: 1px solid var(--line-2); }
  .p-feat .tile { margin: 0; }
  .chips { gap: 10px; }
  .chip { height: 44px; padding: 0 18px 0 12px; gap: 10px; font-size: 14px; }
  .chip img { width: 26px; height: 26px; }
  .project h2, .app-hero h1, .doc h1 { font-size: 36px; }
  .gallery { margin-right: -16px; padding-right: 16px; }
  .gallery img { width: 200px; }
  .doc { font-size: 16px; }
}
@media (max-width: 400px) {
  .topbar { gap: 6px; padding: 0 12px; }
}
@media (max-width: 370px) {
  .topbar .brand-name { display: none; }
  .hero h1 .l1 { font-size: 31px; }
  .hero h1 .l2 { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
  .soon-logo { animation: none; }
}

/* Prezzi (pagina di Sfoglia) */
.prices { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin: 28px 0 0; padding: 0; list-style: none; }
.prices > li { padding: 24px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--box); }
.prices > li.pro { border-color: var(--lav-2); }
.prices h3 { margin: 0; color: var(--feat-title); font-size: 18px; font-weight: 700; }
.prices .amount { margin: 10px 0 0; color: var(--text); font-size: 28px; font-weight: 800; line-height: 1.2; }
.prices .alt-amount { margin: 4px 0 0; color: var(--text-2); font-size: 15px; }
.prices .incl { margin: 16px 0 0; padding: 0 0 0 20px; color: var(--feat-text); font-size: 15px; line-height: 22px; }
.prices .incl li + li { margin-top: 6px; }
