/* BCW · sito — Material 3 Expressive
   Stessi colori, font e forme dell'app (e di BCW-web): palette Tonal Spot dal rosso mattone di BCW
   (#A23E2F), Google Sans Flex con l'asse ROND per i titoli arrotondati, MaterialShapes e molle di
   M3 Expressive. I colori di un tema scelto nella sezione "Temi" sono generati da assets/js/theme.js
   con material-color-utilities e sovrascrivono le variabili qui sotto. */

@font-face {
  font-family: "Google Sans Flex";
  src: url("../fonts/GoogleSansFlex-latin-wght-ROND.woff2") format("woff2");
  font-weight: 1 1000;
  font-style: normal;
  font-display: swap;
}

/* MARK: - Colori */

:root {
  color-scheme: light;
  --primary: #8c4e43; --on-primary: #fff7f6;
  --primary-container: #faaa9d; --on-primary-container: #602b22;
  --secondary: #785751; --on-secondary: #fff7f6;
  --secondary-container: #ffdad4; --on-secondary-container: #694a45;
  --tertiary: #795927; --on-tertiary: #fff8f2;
  --tertiary-container: #f6cb8d; --on-tertiary-container: #5f4211;
  --error: #a8364b; --on-error: #fff7f7; --error-container: #f97386; --on-error-container: #6e0523;
  --surface: #fff8f6; --surface-dim: #edd5d1; --surface-bright: #fff8f6;
  --surface-container-lowest: #fffcfb; --surface-container-low: #fff0ee; --surface-container: #fee9e6;
  --surface-container-high: #fae3df; --surface-container-highest: #f6ddd9;
  --on-surface: #3e2f2c; --on-surface-variant: #6d5b58;
  --outline: #8a7673; --outline-variant: #e3cdc9;
  --inverse-surface: #392e2c; --inverse-on-surface: #ffedea; --inverse-primary: #faaa9d;
  --brand: #a23e2f;

  --good: #2b6a45; --on-good: #ffffff; --good-container: #aff2c2; --on-good-container: #00210f;
  --fair: #855300; --on-fair: #ffffff; --fair-container: #ffddb8; --on-fair-container: #2a1700;
  --poor: #ab3429; --on-poor: #ffffff; --poor-container: #ffdad5; --on-poor-container: #410001;
  --neutral: #426182; --on-neutral: #ffffff; --neutral-container: #d1e4ff; --on-neutral-container: #001d35;

  --subject-0: #9e412b; --subject-0-container: #ffdad2; --on-subject-0-container: #3d0600;
  --subject-1: #29685f; --subject-1-container: #afefe2; --on-subject-1-container: #00201c;
  --subject-2: #5357a0; --subject-2-container: #e1e0ff; --on-subject-2-container: #0c0e5a;
  --subject-3: #7c5808; --subject-3-container: #ffdea9; --on-subject-3-container: #271900;
  --subject-4: #854a78; --subject-4-container: #ffd7f1; --on-subject-4-container: #370531;
  --subject-5: #306388; --subject-5-container: #cce5ff; --on-subject-5-container: #001e31;
  --subject-6: #4c671d; --subject-6-container: #cdee94; --on-subject-6-container: #131f00;
  --subject-7: #99452f; --subject-7-container: #ffdad2; --on-subject-7-container: #3c0800;
  --subject-8: #6b5c4a; --subject-8-container: #f4dfc9; --on-subject-8-container: #241a0c;
  --subject-9: #136779; --subject-9-container: #adecff; --on-subject-9-container: #001f26;
  --subject-10: #944555; --subject-10-container: #ffd9de; --on-subject-10-container: #3e0215;
  --subject-11: #47663c; --subject-11-container: #c8edb7; --on-subject-11-container: #042101;
  --break: #9a8c78;

  --scrim: rgb(29 17 15 / .38);
  --shadow-color: 29 17 15;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --primary: #f9b6ab; --on-primary: #61342c;
    --primary-container: #76453d; --on-primary-container: #ffdbd5;
    --secondary: #e7bdb6; --on-secondary: #563934;
    --secondary-container: #51342f; --on-secondary-container: #f2cbc4;
    --tertiary: #ffdaa8; --on-tertiary: #694a19;
    --tertiary-container: #6b4c1a; --on-tertiary-container: #ffdeb0;
    --error: #f97386; --on-error: #490013; --error-container: #871c34; --on-error-container: #ffb0bb;
    --surface: #130d0b; --surface-dim: #130d0b; --surface-bright: #372926;
    --surface-container-lowest: #0e0908; --surface-container-low: #1a1110; --surface-container: #221715;
    --surface-container-high: #291d1b; --surface-container-highest: #302220;
    --on-surface: #f9e0dc; --on-surface-variant: #bca6a2;
    --outline: #84716e; --outline-variant: #4a3a37;
    --inverse-surface: #f1dfdb; --inverse-on-surface: #392e2c; --inverse-primary: #8c4e43;
    --brand: #e3826a;

    --good: #94d5a7; --on-good: #00391d; --good-container: #0d512f; --on-good-container: #aff2c2;
    --fair: #ffb95f; --on-fair: #472a00; --fair-container: #653e00; --on-fair-container: #ffddb8;
    --poor: #ffb4a9; --on-poor: #690002; --poor-container: #8a1c14; --on-poor-container: #ffdad5;
    --neutral: #aac9ef; --on-neutral: #0f3251; --neutral-container: #2a4969; --on-neutral-container: #d1e4ff;

    --subject-0: #ffb4a3; --subject-0-container: #7f2a17; --on-subject-0-container: #ffdad2;
    --subject-1: #94d2c7; --subject-1-container: #055047; --on-subject-1-container: #afefe2;
    --subject-2: #bfc1ff; --subject-2-container: #3b3f86; --on-subject-2-container: #e1e0ff;
    --subject-3: #efbf6a; --subject-3-container: #5e4100; --on-subject-3-container: #ffdea9;
    --subject-4: #f8b0e4; --subject-4-container: #6a335f; --on-subject-4-container: #ffd7f1;
    --subject-5: #9cccf6; --subject-5-container: #114b6f; --on-subject-5-container: #cce5ff;
    --subject-6: #b1d27b; --subject-6-container: #354e04; --on-subject-6-container: #cdee94;
    --subject-7: #ffb4a2; --subject-7-container: #7b2e1a; --on-subject-7-container: #ffdad2;
    --subject-8: #d7c3ae; --subject-8-container: #524434; --on-subject-8-container: #f4dfc9;
    --subject-9: #8bd1e5; --subject-9-container: #004e5d; --on-subject-9-container: #adecff;
    --subject-10: #ffb2be; --subject-10-container: #772e3e; --on-subject-10-container: #ffd9de;
    --subject-11: #acd19d; --subject-11-container: #304e26; --on-subject-11-container: #c8edb7;
    --break: #b8ac98;

    --scrim: rgb(8 4 3 / .55);
    --shadow-color: 0 0 0;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary: #f9b6ab; --on-primary: #61342c;
  --primary-container: #76453d; --on-primary-container: #ffdbd5;
  --secondary: #e7bdb6; --on-secondary: #563934;
  --secondary-container: #51342f; --on-secondary-container: #f2cbc4;
  --tertiary: #ffdaa8; --on-tertiary: #694a19;
  --tertiary-container: #6b4c1a; --on-tertiary-container: #ffdeb0;
  --error: #f97386; --on-error: #490013; --error-container: #871c34; --on-error-container: #ffb0bb;
  --surface: #130d0b; --surface-dim: #130d0b; --surface-bright: #372926;
  --surface-container-lowest: #0e0908; --surface-container-low: #1a1110; --surface-container: #221715;
  --surface-container-high: #291d1b; --surface-container-highest: #302220;
  --on-surface: #f9e0dc; --on-surface-variant: #bca6a2;
  --outline: #84716e; --outline-variant: #4a3a37;
  --inverse-surface: #f1dfdb; --inverse-on-surface: #392e2c; --inverse-primary: #8c4e43;
  --brand: #e3826a;

  --good: #94d5a7; --on-good: #00391d; --good-container: #0d512f; --on-good-container: #aff2c2;
  --fair: #ffb95f; --on-fair: #472a00; --fair-container: #653e00; --on-fair-container: #ffddb8;
  --poor: #ffb4a9; --on-poor: #690002; --poor-container: #8a1c14; --on-poor-container: #ffdad5;
  --neutral: #aac9ef; --on-neutral: #0f3251; --neutral-container: #2a4969; --on-neutral-container: #d1e4ff;

  --subject-0: #ffb4a3; --subject-0-container: #7f2a17; --on-subject-0-container: #ffdad2;
  --subject-1: #94d2c7; --subject-1-container: #055047; --on-subject-1-container: #afefe2;
  --subject-2: #bfc1ff; --subject-2-container: #3b3f86; --on-subject-2-container: #e1e0ff;
  --subject-3: #efbf6a; --subject-3-container: #5e4100; --on-subject-3-container: #ffdea9;
  --subject-4: #f8b0e4; --subject-4-container: #6a335f; --on-subject-4-container: #ffd7f1;
  --subject-5: #9cccf6; --subject-5-container: #114b6f; --on-subject-5-container: #cce5ff;
  --subject-6: #b1d27b; --subject-6-container: #354e04; --on-subject-6-container: #cdee94;
  --subject-7: #ffb4a2; --subject-7-container: #7b2e1a; --on-subject-7-container: #ffdad2;
  --subject-8: #d7c3ae; --subject-8-container: #524434; --on-subject-8-container: #f4dfc9;
  --subject-9: #8bd1e5; --subject-9-container: #004e5d; --on-subject-9-container: #adecff;
  --subject-10: #ffb2be; --subject-10-container: #772e3e; --on-subject-10-container: #ffd9de;
  --subject-11: #acd19d; --subject-11-container: #304e26; --on-subject-11-container: #c8edb7;
  --break: #b8ac98;

  --scrim: rgb(8 4 3 / .55);
  --shadow-color: 0 0 0;
}


/* MARK: - Forme, tipografia, movimento */

:root {
  --r-xs: 4px; --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-li: 20px;
  --r-xl: 28px; --r-xli: 32px; --r-xxl: 48px; --r-full: 999px;

  --font: "Google Sans Flex", "Google Sans", "Roboto Flex", Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --elev-1: 0 1px 2px rgb(var(--shadow-color) / .18), 0 1px 3px 1px rgb(var(--shadow-color) / .08);
  --elev-2: 0 1px 2px rgb(var(--shadow-color) / .18), 0 2px 6px 2px rgb(var(--shadow-color) / .08);
  --elev-3: 0 4px 12px -2px rgb(var(--shadow-color) / .16), 0 12px 32px -8px rgb(var(--shadow-color) / .22);
  --elev-float: 0 2px 6px rgb(var(--shadow-color) / .1), 0 18px 40px -12px rgb(var(--shadow-color) / .32);

  /* Molle di M3 Expressive (da BCW-web): spaziali con un piccolo rimbalzo, effetti senza. */
  --spring-fast: linear(0, 0.008 1.3%, 0.029 2.5%, 0.07 4%, 0.123 5.5%, 0.244 8.3%, 0.531 14%, 0.649 16.5%, 0.756 19%, 0.848 21.5%, 0.924 24%, 0.985 26.5%, 1.03 29%, 1.064 31.8%, 1.089 35.5%, 1.094 39.8%, 1.081 44.8%, 1.019 58.8%, 0.998 67.3%, 0.991 78%, 1);
  --spring-fast-dur: 360ms;
  --spring: linear(0, 0.005 1.3%, 0.024 2.8%, 0.053 4.3%, 0.098 6%, 0.201 9.3%, 0.431 15.8%, 0.532 18.8%, 0.631 22%, 0.718 25.3%, 0.785 28.2%, 0.846 31.5%, 0.894 34.8%, 0.932 38%, 0.964 41.8%, 0.987 45.8%, 1.003 50.2%, 1.012 55.3%, 1.015 64.8%, 1);
  --spring-dur: 435ms;
  --spring-slow-dur: 650ms;
  --effects: linear(0, 0.004 1%, 0.019 2.3%, 0.042 3.5%, 0.079 5%, 0.161 7.8%, 0.362 13.8%, 0.464 17%, 0.557 20.3%, 0.637 23.5%, 0.706 26.8%, 0.767 30.3%, 0.817 33.8%, 0.86 37.5%, 0.899 42%, 0.929 46.8%, 0.953 52.3%, 0.971 58.5%, 0.991 73.8%, 1);
  --effects-fast-dur: 150ms;
  --effects-dur: 230ms;
  --emphasized-decelerate: cubic-bezier(.05, .7, .1, 1);
  --emphasized: cubic-bezier(.2, 0, 0, 1);

  --container: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(88px, 12vw, 152px);
  --topbar: 80px;
}

@media (prefers-reduced-motion: reduce) {
  :root { --spring-fast: ease-out; --spring: ease-out; --spring-fast-dur: 120ms; --spring-dur: 160ms; --spring-slow-dur: 200ms; }
}

/* MARK: - Base */

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--surface);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  font-variation-settings: "ROND" 30;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--surface);
  transition: background-color var(--effects-dur) var(--effects);
}

/* Le forme che girano ai bordi non devono allargare la pagina: sui telefoni il browser
   rimpicciolirebbe tutto. Il clip sta sui contenuti e non su html o body, perché lì passa alla
   finestra e su iOS può bloccare lo scorrimento. */
main, footer { overflow-x: clip; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--primary); text-underline-offset: .18em; text-decoration-thickness: from-font; }
button, input { font: inherit; color: inherit; letter-spacing: inherit; font-variation-settings: inherit; }
button { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
p { margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; font-variation-settings: "ROND" 100; text-wrap: balance; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--primary-container); color: var(--on-primary-container); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: var(--r-s); }

[hidden] { display: none !important; }
.icon { width: 24px; height: 24px; fill: currentColor; flex: none; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: fixed; top: 12px; left: 12px; z-index: 200;
  padding: 12px 18px; border-radius: var(--r-full);
  background: var(--inverse-surface); color: var(--inverse-on-surface);
  font-weight: 600; text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--spring-dur) var(--spring);
}
.skip:focus { transform: none; }

.container { width: min(100% - 2 * var(--gutter), var(--container)); margin-inline: auto; }

/* Scala tipografica (titoli enfatizzati di M3 Expressive, asse ROND pieno). */
.display-xl {
  font-size: clamp(46px, 6.8vw, 100px);
  line-height: .96;
  font-weight: 720;
  letter-spacing: -.028em;
  font-variation-settings: "ROND" 100;
}
.display {
  font-size: clamp(38px, 5.4vw, 72px);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.024em;
  font-variation-settings: "ROND" 100;
}
.headline { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; font-weight: 650; letter-spacing: -.01em; }
.title { font-size: 20px; line-height: 1.3; font-weight: 620; font-variation-settings: "ROND" 100; }
.lead { font-size: clamp(18px, 1.55vw, 21px); line-height: 1.5; color: var(--on-surface-variant); text-wrap: pretty; }
.body { font-size: 16px; line-height: 1.55; color: var(--on-surface-variant); text-wrap: pretty; }
.small { font-size: 14px; line-height: 1.45; color: var(--on-surface-variant); }
.mono { font-family: var(--mono); font-size: .92em; }

/* MARK: - Forme di Material */

.shape { fill: var(--c, var(--primary-container)); }

.shaped {
  --s: 56px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  flex: none;
  color: var(--on-c, var(--on-primary-container));
}
.shaped > .shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transition: transform var(--spring-slow-dur) var(--spring), fill var(--effects-dur) var(--effects);
}
.shaped > .icon { position: relative; width: calc(var(--s) * .46); height: calc(var(--s) * .46); }
.shaped > b { position: relative; font-weight: 750; font-variation-settings: "ROND" 100; font-size: calc(var(--s) * .38); letter-spacing: -.02em; }
:is(a, .tile, .card, .platform, details):hover > .shaped > .shape,
:is(a, .tile, .card, .platform):hover .shaped.spin-on-hover > .shape { transform: rotate(40deg) scale(1.05); }

.spin { animation: spin var(--period, 40s) linear infinite; }
.spin.reverse { animation-direction: reverse; }
@keyframes spin { to { rotate: 360deg; } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }

/* MARK: - Pulsanti */

.btn {
  --h: 48px;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--h);
  padding: 0 calc(var(--h) * .46);
  border-radius: calc(var(--h) / 2);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .1px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: border-radius var(--spring-fast-dur) var(--spring-fast), background-color var(--effects-dur) var(--effects),
    color var(--effects-dur) var(--effects), transform var(--spring-fast-dur) var(--spring-fast);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: currentColor;
  opacity: 0;
  transition: opacity var(--effects-fast-dur) linear;
}
.btn:hover::before { opacity: .08; }
.btn:focus-visible::before, .btn:active::before { opacity: .12; }
/* Pressione: l'angolo si stringe con la molla (forma che cambia, come i pulsanti di M3 Expressive). */
.btn:active { border-radius: calc(var(--h) * .24); }
.btn .icon { width: 20px; height: 20px; }
.btn.l { --h: 56px; font-size: 17px; }
.btn.l .icon { width: 22px; height: 22px; }
.btn.xl { --h: 68px; font-size: 19px; padding: 0 32px; }
.btn.xl .icon { width: 26px; height: 26px; }
.btn.s { --h: 40px; font-size: 14px; }
.btn.s .icon { width: 18px; height: 18px; }
.btn.filled { background: var(--primary); color: var(--on-primary); }
.btn.tonal { background: var(--secondary-container); color: var(--on-secondary-container); }
.btn.elevated { background: var(--surface-container-low); color: var(--primary); box-shadow: var(--elev-1); }
.btn.outlined { color: var(--on-surface-variant); box-shadow: inset 0 0 0 1px var(--outline-variant); }
.btn.text { color: var(--primary); padding: 0 14px; }
.btn.inverse { background: var(--inverse-surface); color: var(--inverse-on-surface); }
.btn[aria-disabled="true"] { cursor: default; }
.btn[aria-disabled="true"]:active { border-radius: calc(var(--h) / 2); }

.icon-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 24px;
  color: var(--on-surface-variant);
  text-decoration: none;
  transition: border-radius var(--spring-fast-dur) var(--spring-fast), background-color var(--effects-dur) var(--effects);
}
.icon-btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: 0; transition: opacity var(--effects-fast-dur) linear; }
.icon-btn:hover::before { opacity: .08; }
.icon-btn:active { border-radius: 14px; }
.icon-btn:active::before { opacity: .12; }

/* Chip di stato e di filtro. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-s);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
}
.chip .icon { width: 18px; height: 18px; }
.chip.good { background: var(--good-container); color: var(--on-good-container); }
.chip.fair { background: var(--fair-container); color: var(--on-fair-container); }
.chip.poor { background: var(--poor-container); color: var(--on-poor-container); }
.chip.primary { background: var(--primary-container); color: var(--on-primary-container); }
.chip.tertiary { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.chip.outline { background: transparent; box-shadow: inset 0 0 0 1px var(--outline-variant); }
.chip.pill { border-radius: var(--r-full); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px 0 10px;
  border-radius: var(--r-full);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .2px;
}
.eyebrow .icon { width: 20px; height: 20px; }

/* Il logo: "BCW" in Google Sans Flex e la barra del marchio sotto (come l'icona dell'app). */
.logo {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .11em;
  font-weight: 800;
  font-variation-settings: "ROND" 100;
  letter-spacing: -.02em;
  line-height: .8;
  color: var(--on-surface);
}
.logo::after {
  content: "";
  width: 48%;
  height: .13em;
  border-radius: 1em;
  background: var(--brand);
  transition: background-color var(--effects-dur) var(--effects);
}
.logo.inline { flex-direction: row; align-items: center; gap: .26em; line-height: 1; }
.logo.inline::after { width: .9em; height: .17em; }

/* MARK: - Barra in alto e navigazione */

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px max(12px, env(safe-area-inset-left)) 0;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

/* Elementi flottanti ai bordi dello schermo: pieni, come la barra di navigazione dell'app. */
.floating {
  background: var(--surface-container-high);
  box-shadow: 0 1px 6px rgb(var(--shadow-color) / .2), 0 6px 28px rgb(var(--shadow-color) / .14);
}

.brand-pill {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 22px;
  border-radius: 28px;
  text-decoration: none;
  font-size: 26px;
  transition: border-radius var(--spring-fast-dur) var(--spring-fast);
}
.brand-pill:active { border-radius: 16px; }

.actions-pill { display: flex; align-items: center; gap: 2px; height: 56px; padding: 4px; border-radius: 28px; }

.navbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  height: 64px;
  padding: 8px;
  border-radius: 32px;
}
.nav-item {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 18px;
  border-radius: 24px;
  color: var(--on-surface-variant);
  font-size: 15px;
  font-weight: 620;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--effects-dur) var(--effects), color var(--effects-dur) var(--effects),
    padding var(--spring-dur) var(--spring), border-radius var(--spring-fast-dur) var(--spring-fast);
}
.nav-item::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: currentColor; opacity: 0; transition: opacity var(--effects-fast-dur) linear; }
.nav-item:hover::before { opacity: .08; }
.nav-item:active { border-radius: 14px; }
/* L'icona compare solo nella scheda attiva. Niente transizione sulla larghezza: Safari non
   ridimensiona la pillola mentre un SVG cambia larghezza e il testo ne uscirebbe. */
.nav-item .icon { display: none; width: 22px; height: 22px; margin-right: 8px; }
@keyframes nav-icon-in { from { opacity: 0; transform: scale(.3) rotate(-30deg); } }
/* Scheda attiva: pillola piena con l'icona, come la barra di navigazione flottante dell'app. */
.nav-item.active { background: var(--primary); color: var(--on-primary); padding-left: 16px; }
.nav-item.active .icon { display: block; animation: nav-icon-in var(--spring-dur) var(--spring); }

.topbar .only-mobile { display: none; }

@media (max-width: 899px) {
  :root { --topbar: 72px; }
  .topbar { padding-top: 10px; }
  .brand-pill { height: 52px; font-size: 23px; padding: 0 18px; }
  .actions-pill { height: 52px; }
  .actions-pill .icon-btn { width: 44px; height: 44px; }
  .topbar .only-mobile { display: inline-grid; }
  /* Sui telefoni la navigazione è la barra flottante in basso, come nell'app. */
  /* left e right a 0 con margini automatici: con left: 50% lo spazio disponibile sarebbe metà
     schermo e Safari stringerebbe le voci, facendo uscire il testo dalla pillola attiva. */
  .navbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: fit-content;
    max-width: calc(100% - 20px);
    margin-inline: auto;
    height: 64px;
  }
  .nav-item { padding: 0 13px; font-size: 14px; }
  .nav-item.active { padding-left: 12px; }
  .nav-item.desktop-only { display: none; }
  html { scroll-padding-top: 84px; }
  body { padding-bottom: 72px; }
}
@media (max-width: 359px) {
  .nav-item { padding: 0 10px; font-size: 13px; }
  .nav-item.active .icon { display: none; }
}

/* Comparsa dei colori: la pagina parte in bianco e nero e i colori arrivano con un cerchio che si
   allarga dalla barra sotto il titolo, come nell'introduzione dell'app (assets/js/site.js, con una
   View Transition). Se lo script non parte, dopo 3 secondi i colori tornano comunque. */
.intro :is(main, footer, .topbar > *) { filter: grayscale(1); animation: ungray 0s 3s forwards; }
.intro-fade :is(main, footer, .topbar > *) { transition: filter 900ms var(--effects); }
@keyframes ungray { to { filter: none; } }

/* Cambio di tema con il cerchio che si allarga dal colore scelto (View Transitions). */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* MARK: - Comparsa allo scorrimento */

.reveal {
  opacity: 0;
  translate: 0 36px;
  transition: opacity 600ms var(--effects), translate var(--spring-slow-dur) var(--spring);
  transition-delay: calc(var(--d, 0) * 70ms);
}
.reveal.in { opacity: 1; translate: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; translate: none; transition: none; } }
.no-js .reveal { opacity: 1; translate: none; }

/* MARK: - Telefono */

.phone {
  --w: 300px;
  position: relative;
  width: var(--w);
  aspect-ratio: 1206 / 2622;
  padding: calc(var(--w) * .03);
  border-radius: calc(var(--w) * .165);
  background: linear-gradient(150deg, #4a403e, #191312 38%, #2a2321 70%, #4a403e);
  box-shadow: inset 0 0 0 1.5px #5d5250, inset 0 0 0 4px #120e0d, var(--elev-float);
  flex: none;
}
.phone .screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: calc(var(--w) * .137);
  background: var(--surface);
  isolation: isolate;
}
.phone .screen img, .phone .screen picture { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.phone .island {
  position: absolute;
  top: calc(var(--w) * .056);
  left: 50%;
  z-index: 3;
  translate: -50% 0;
  width: calc(var(--w) * .31);
  height: calc(var(--w) * .092);
  border-radius: calc(var(--w) * .05);
  background: #000;
}

/* Dynamic Island con l'attività in diretta (compatta): la sigla della materia e il tempo. */
.island.live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 calc(var(--w) * .022) 0 calc(var(--w) * .014);
  transition: width var(--spring-slow-dur) var(--spring);
}
.island.live.on { width: calc(var(--w) * .4); }
.island .badge, .island .time { opacity: 0; transition: opacity 300ms var(--effects) 200ms; }
.island.live.on .badge, .island.live.on .time { opacity: 1; }
.island .badge { --s: calc(var(--w) * .07); color: #fff; }
.island .badge > .shape { fill: var(--subject-2-dark, #bfc1ff); }
.island .badge b { color: #0c0e5a; font-size: calc(var(--w) * .036); }
.island .time {
  color: var(--subject-2-dark, #bfc1ff);
  font-size: calc(var(--w) * .046);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}

/* MARK: - Hero */

.hero {
  position: relative;
  padding: calc(var(--topbar) + clamp(28px, 4.5vw, 64px)) 0 clamp(56px, 7vw, 104px);
  overflow: clip;
}
.hero-decor { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.hero-decor svg { position: absolute; }
.hero-decor .d1 { --c: var(--primary-container); width: min(64vw, 760px); right: -14vw; top: 2vh; opacity: .7; }
.hero-decor .d2 { --c: var(--tertiary-container); width: min(38vw, 420px); left: -12vw; bottom: -6vw; opacity: .55; }
.hero-decor .d3 { --c: var(--secondary-container); width: 120px; left: 46%; top: 16%; opacity: .9; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 28px; }

.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 12px 0 6px;
  border-radius: 22px;
  background: var(--surface-container-high);
  color: var(--on-surface);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color var(--effects-dur) var(--effects), border-radius var(--spring-fast-dur) var(--spring-fast);
}
.news-chip:hover { background: var(--surface-container-highest); }
.news-chip:active { border-radius: 14px; }
.news-chip .new {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
}
.news-chip .icon { width: 20px; height: 20px; color: var(--on-surface-variant); transition: transform var(--spring-dur) var(--spring); }
.news-chip:hover .icon { transform: translateX(3px); }

.hero h1 { max-width: 12ch; }
/* "bello" con la barra del marchio sotto, che si disegna all'arrivo. */
.underlined { position: relative; display: inline-block; white-space: nowrap; color: var(--primary); }
.underlined::after {
  content: "";
  position: absolute;
  left: 2%;
  bottom: -.1em;
  width: 96%;
  height: .1em;
  border-radius: 1em;
  background: var(--brand);
  transform-origin: left;
  animation: draw-bar 900ms var(--spring) 300ms both;
}
@keyframes draw-bar { from { transform: scaleX(0); } }
.intro .underlined::after { animation-delay: 150ms; }

.hero .lead { max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; }
.facts li { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 550; color: var(--on-surface-variant); }
.facts .icon { width: 20px; height: 20px; color: var(--primary); }

.hero-art { position: relative; display: grid; place-items: center; min-height: 640px; }
.hero-art .phone { --w: clamp(260px, 25vw, 330px); rotate: 3deg; z-index: 1; }
.hero-art .blob { position: absolute; width: 112%; max-width: 620px; --c: var(--primary-container); opacity: .85; }

.float { position: absolute; z-index: 2; }
.hero-art .w-avg { left: max(-4%, calc(50% - 330px)); top: 9%; rotate: -7deg; }
.hero-art .live-card { right: max(-8%, calc(50% - 380px)); bottom: 15%; rotate: 3deg; width: min(330px, 86vw); }
.hero-art .chip-float { left: max(0%, calc(50% - 300px)); bottom: 9%; rotate: -4deg; box-shadow: var(--elev-3); }
.pop { animation: pop 700ms var(--spring) both; animation-delay: calc(400ms + var(--d, 0) * 140ms); }
.intro .pop { animation-delay: calc(1400ms + var(--d, 0) * 140ms); }
@keyframes pop { from { opacity: 0; scale: .6; } }
@media (prefers-reduced-motion: reduce) { .pop { animation: none; } }

/* MARK: - Widget e attività in diretta (disegnati in HTML, seguono il tema) */

.widget {
  --size: 158px;
  width: var(--size);
  height: var(--size);
  padding: 14px;
  border-radius: 26px;
  background: var(--surface-container-lowest);
  box-shadow: var(--elev-3);
  color: var(--on-surface);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.widget.tinted { background: var(--primary-container); color: var(--on-primary-container); }

.w-avg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.w-avg .ring { width: 94px; height: 94px; }
.w-avg .label { font-size: 13px; font-weight: 650; line-height: 1.1; }
.w-avg .sub { font-size: 11.5px; color: var(--on-surface-variant); margin-top: -4px; }

.ring { position: relative; display: grid; place-items: center; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ring .track { stroke: var(--tone-container, var(--good-container)); fill: none; stroke-linecap: round; transition: stroke var(--effects-dur); }
.ring .value { stroke: var(--tone, var(--good)); fill: none; stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--effects-dur); }
.ring .num { position: relative; font-weight: 720; font-variation-settings: "ROND" 100; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.w-avg .ring .num { font-size: 24px; }

.tone-good { --tone: var(--good); --tone-container: var(--good-container); --on-tone-container: var(--on-good-container); }
.tone-fair { --tone: var(--fair); --tone-container: var(--fair-container); --on-tone-container: var(--on-fair-container); }
.tone-poor { --tone: var(--poor); --tone-container: var(--poor-container); --on-tone-container: var(--on-poor-container); }

/* Lezione in corso sulla schermata di blocco. */
.live-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px 14px;
  border-radius: 26px;
  background: color-mix(in srgb, var(--surface-container-lowest) 92%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--elev-3);
  font-variant-numeric: tabular-nums;
}
.live-top { display: flex; align-items: center; gap: 12px; }
.live-top .shaped { --s: 50px; --c: var(--subject-2); color: #fff; }
.live-top .shaped b { color: var(--on-primary, #fff); font-size: 19px; }
.subject-2 .shaped b, .live-top .shaped b { color: #fff; }
.live-what { flex: 1; min-width: 0; line-height: 1.2; }
.live-what .kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .9px; text-transform: uppercase; color: var(--subject-2); }
.live-what .subject { font-size: 21px; font-weight: 650; font-variation-settings: "ROND" 100; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-what .where { font-size: 14px; color: var(--on-surface-variant); }
.live-left { text-align: right; line-height: 1.1; }
.live-left small { display: block; font-size: 12px; color: var(--on-surface-variant); }
.live-left strong { font-size: 27px; font-weight: 650; letter-spacing: -.02em; }
.live-bar { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--on-surface-variant); }
.live-bar .track { position: relative; flex: 1; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--subject-2) 22%, transparent); overflow: hidden; }
.live-bar .track i { position: absolute; inset: 0 auto 0 0; width: var(--p, 33%); border-radius: 2px; background: var(--subject-2); transition: width 1s linear; }
.live-next {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--surface-container);
  font-size: 13.5px;
  font-weight: 600;
}
.live-next .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--subject-3); }
.live-next .icon { width: 16px; height: 16px; color: var(--on-surface-variant); }

/* Widget Orario (piccolo): il giorno e le lezioni in una lista segmentata. */
.w-timetable { display: flex; flex-direction: column; gap: 3px; padding: 12px; }
.w-timetable header { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 6px; }
.w-timetable header strong { font-size: 15px; font-weight: 700; font-variation-settings: "ROND" 100; }
.w-timetable header span { font-size: 11px; color: var(--on-surface-variant); font-weight: 600; }
.w-row {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--surface-container);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
}
.w-row:first-of-type { border-radius: 12px 12px 4px 4px; }
.w-row:last-child { border-radius: 4px 4px 12px 12px; }
.w-row i { width: 4px; height: 12px; border-radius: 2px; background: var(--sc); flex: none; }
.w-row em { margin-left: auto; font-style: normal; font-weight: 500; color: var(--on-surface-variant); font-size: 10.5px; }
.w-row.now { height: 32px; background: color-mix(in srgb, var(--sc) 22%, var(--surface-container)); font-size: 12px; }
.w-row.now i { height: 18px; }

/* Widget Lezione in corso (piccolo). */
.w-now { display: flex; flex-direction: column; gap: 2px; }
.w-now .kicker { font-size: 10.5px; font-weight: 750; letter-spacing: .8px; color: var(--subject-5); text-transform: uppercase; }
.w-now .subject { font-size: 19px; font-weight: 650; line-height: 1.1; font-variation-settings: "ROND" 100; }
.w-now .where { font-size: 12px; color: var(--on-surface-variant); }
.w-now .left { margin-top: auto; font-size: 12px; color: var(--on-surface-variant); }
.w-now .left b { font-size: 18px; color: var(--on-surface); font-weight: 650; }
.w-now .bar { height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--subject-5) 22%, transparent); overflow: hidden; margin: 4px 0 6px; }
.w-now .bar i { display: block; height: 100%; width: var(--p, 60%); background: var(--subject-5); border-radius: 2px; }
.w-now .next { font-size: 11px; font-weight: 600; color: var(--on-surface-variant); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Widget Prossima verifica (piccolo). */
.w-test { display: flex; flex-direction: column; gap: 4px; }
.w-test .shaped { --s: 40px; --c: var(--fair-container); --on-c: var(--on-fair-container); }
.w-test .days { margin-top: auto; font-size: 40px; line-height: .9; font-weight: 720; font-variation-settings: "ROND" 100; letter-spacing: -.03em; }
.w-test .days small { font-size: 14px; font-weight: 600; letter-spacing: 0; color: var(--on-surface-variant); margin-left: 4px; }
.w-test .what { font-size: 13px; font-weight: 650; }
.w-test .when { font-size: 11.5px; color: var(--on-surface-variant); }

/* MARK: - Nastro delle funzioni */

.marquee {
  display: grid;
  gap: 12px;
  padding: 8px 0 0;
  overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track { display: flex; gap: 12px; width: max-content; animation: marquee 70s linear infinite; }
.marquee-track.reverse { animation-direction: reverse; animation-duration: 80s; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(calc(-50% - 6px)); } }
@media (prefers-reduced-motion: reduce) {
  .marquee-track { animation: none; flex-wrap: wrap; justify-content: center; width: auto; }
  .marquee-track [aria-hidden="true"] { display: none; }
}
.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 20px 0 8px;
  border-radius: 26px;
  background: var(--surface-container);
  font-size: 15.5px;
  font-weight: 600;
  white-space: nowrap;
}
.feature-chip .shaped { --s: 38px; }
.feature-chip:nth-child(3n + 2) .shaped { --c: var(--secondary-container); --on-c: var(--on-secondary-container); }
.feature-chip:nth-child(3n) .shaped { --c: var(--tertiary-container); --on-c: var(--on-tertiary-container); }

/* MARK: - Sezioni */

.section { position: relative; padding: var(--section) 0; }
.section.tight { padding-top: calc(var(--section) * .5); }
.section-head { display: flex; flex-direction: column; align-items: center; gap: 20px; max-width: 820px; margin: 0 auto clamp(40px, 6vw, 72px); text-align: center; }
.section-head .lead { max-width: 40em; }
.section-head.left { align-items: flex-start; text-align: left; margin-left: 0; }

/* MARK: - Funzioni (bento) */

.bento { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--r-xli);
  background: var(--surface-container);
  overflow: hidden;
  transition: background-color var(--effects-dur) var(--effects);
}
.tile h3 { font-size: clamp(26px, 2.5vw, 34px); line-height: 1.1; font-weight: 680; letter-spacing: -.015em; max-width: 16ch; }
.tile .body { max-width: 34em; }
.tile .chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.tile.primary { background: var(--primary-container); color: var(--on-primary-container); }
.tile.primary .body { color: color-mix(in srgb, var(--on-primary-container) 82%, transparent); }
.tile.tertiary { background: var(--tertiary-container); color: var(--on-tertiary-container); }
.tile.tertiary .body { color: color-mix(in srgb, var(--on-tertiary-container) 82%, transparent); }
.tile.secondary { background: var(--secondary-container); color: var(--on-secondary-container); }
.tile.secondary .body { color: color-mix(in srgb, var(--on-secondary-container) 82%, transparent); }
.tile.high { background: var(--surface-container-high); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* Riquadri con il telefono che spunta dal basso. */
.tile.with-phone { min-height: 600px; padding-bottom: 0; }
/* Il telefono spunta dal fondo del riquadro: il margine negativo ne nasconde la parte bassa. */
.tile.with-phone .phone { --w: 290px; margin: auto auto calc(var(--w) * -.5); rotate: -2deg; transition: translate var(--spring-slow-dur) var(--spring), rotate var(--spring-slow-dur) var(--spring); }
.tile.with-phone:hover .phone { translate: 0 -12px; rotate: 0deg; }
.tile.with-phone.side { flex-direction: row; align-items: flex-start; gap: 24px; min-height: 520px; }
.tile.with-phone.side .copy { display: flex; flex-direction: column; gap: 14px; flex: 1; min-width: 0; padding-bottom: 36px; }
.tile.with-phone.side .phone { margin: 0 0 calc(var(--w) * -.36); flex: none; align-self: flex-end; }

/* "E se prendessi…": simulatore della media. */
.sim { display: grid; gap: 18px; }
.sim-top { display: flex; align-items: center; gap: 20px; }
.sim .ring { width: 132px; height: 132px; flex: none; }
.sim .ring .num { font-size: 34px; }
.sim-info { display: grid; gap: 6px; }
.sim-info .subject { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 650; }
.sim-info .subject i { width: 10px; height: 10px; border-radius: 3px; rotate: 45deg; background: var(--subject-0); }
.delta { justify-self: start; }
.delta .icon { transition: transform var(--spring-dur) var(--spring); }
.delta.down .icon { transform: rotate(180deg); }
.grades { display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; align-items: center; }
.grade {
  --s: 46px;
  position: relative;
  display: grid;
  place-items: center;
  width: var(--s);
  height: var(--s);
  font-weight: 720;
  font-size: 17px;
  font-variation-settings: "ROND" 100;
  letter-spacing: -.02em;
  color: var(--on-tone-container);
}
.grade svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--tone-container); }
.grade span { position: relative; }
.grade.ghost svg { fill: transparent; stroke: var(--tone); stroke-width: 5; stroke-dasharray: 11 8; overflow: visible; }
.grade.ghost { color: var(--tone); animation: pop 520ms var(--spring) both; cursor: pointer; }
.grade.ghost:hover svg { fill: var(--tone-container); }
.picker { display: flex; flex-wrap: wrap; gap: 6px; }
.picker button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 22px;
  background: var(--surface-container-highest);
  font-weight: 700;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  transition: border-radius var(--spring-fast-dur) var(--spring-fast), background-color var(--effects-dur);
}
.picker button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: 0; transition: opacity var(--effects-fast-dur); }
.picker button:hover::before { opacity: .08; }
.picker button:active { border-radius: 12px; }
.picker button:disabled { opacity: .38; cursor: default; }
.picker .reset { display: inline-flex; align-items: center; gap: 6px; background: transparent; color: var(--primary); }
.picker .reset .icon { width: 18px; height: 18px; }
.sim-goal { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--r-l); background: var(--surface-container-high); font-size: 15px; }
.sim-goal .icon { color: var(--primary); }
.sim-goal b { font-weight: 700; color: var(--on-surface); }

/* Piccole funzioni: icone in forme, in una griglia collegata. */
.mini-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; border-radius: var(--r-xli); overflow: hidden; }
.mini {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--surface-container);
  border-radius: 6px;
}
.mini .shaped { --s: 52px; }
.mini h4 { font-size: 18px; font-weight: 650; line-height: 1.25; }
.mini p { font-size: 14.5px; line-height: 1.45; color: var(--on-surface-variant); }
.mini:hover .shaped > .shape { transform: rotate(40deg) scale(1.05); }
.mini:nth-child(4n + 2) .shaped { --c: var(--secondary-container); --on-c: var(--on-secondary-container); }
.mini:nth-child(4n + 3) .shaped { --c: var(--tertiary-container); --on-c: var(--on-tertiary-container); }
.mini:nth-child(4n + 4) .shaped { --c: var(--surface-container-highest); --on-c: var(--primary); }

/* MARK: - In diretta */

.live-section { overflow: clip; }
.live-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
  padding: clamp(28px, 5vw, 72px);
  border-radius: var(--r-xxl);
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  overflow: hidden;
}
.live-panel .lead, .live-panel .body { color: color-mix(in srgb, var(--inverse-on-surface) 78%, transparent); }
.live-panel .eyebrow { background: color-mix(in srgb, var(--inverse-on-surface) 14%, transparent); color: var(--inverse-on-surface); }
.live-panel .copy { display: flex; flex-direction: column; align-items: flex-start; gap: 22px; position: relative; z-index: 1; }
.live-panel .decor { position: absolute; width: 520px; right: -140px; top: -160px; --c: color-mix(in srgb, var(--inverse-primary) 16%, transparent); }
.live-points { display: grid; gap: 14px; list-style: none; }
.live-points li { display: flex; gap: 12px; align-items: flex-start; font-size: 16px; line-height: 1.45; color: color-mix(in srgb, var(--inverse-on-surface) 86%, transparent); }
.live-points .icon { width: 22px; height: 22px; color: var(--inverse-primary); margin-top: 1px; }

.live-demo { position: relative; z-index: 1; display: grid; justify-items: center; gap: 22px; }

/* Dynamic Island grande, che si allarga toccandola (come tenendola premuta su iPhone). */
.big-island {
  --subject: #bfc1ff;
  position: relative;
  width: 300px;
  height: 64px;
  border-radius: 32px;
  background: #000;
  color: #fff;
  box-shadow: 0 0 0 1px rgb(255 255 255 / .06), 0 20px 50px -20px rgb(0 0 0 / .7);
  cursor: pointer;
  overflow: hidden;
  transition: width var(--spring-slow-dur) var(--spring), height var(--spring-slow-dur) var(--spring), border-radius var(--spring-slow-dur) var(--spring);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
.big-island.open { width: min(420px, 100%); height: 196px; border-radius: 48px; }
.big-island .compact {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 12px;
  transition: opacity 220ms var(--effects);
}
.big-island.open .compact { opacity: 0; pointer-events: none; }
.big-island .compact .shaped { --s: 40px; --c: var(--subject); }
.big-island .compact .shaped b { color: #0c0e5a; font-size: 16px; }
.big-island .compact .time { font-size: 22px; font-weight: 600; color: var(--subject); }
.big-island .expanded {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 24px 30px;
  opacity: 0;
  transform: scale(.92);
  transition: opacity 260ms var(--effects), transform var(--spring-dur) var(--spring);
  pointer-events: none;
}
.big-island.open .expanded { opacity: 1; transform: none; transition-delay: 120ms; pointer-events: auto; }
.big-island .row { display: flex; align-items: center; gap: 14px; }
.big-island .row .shaped { --s: 48px; --c: var(--subject); }
.big-island .row .shaped b { color: #0c0e5a; font-size: 19px; }
.big-island .row .what { flex: 1; min-width: 0; line-height: 1.2; }
.big-island .row .what small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .9px; color: var(--subject); }
.big-island .row .what strong { display: block; font-size: 21px; font-weight: 650; }
.big-island .row .what span { font-size: 13.5px; color: rgb(255 255 255 / .62); }
.big-island .row .left { font-size: 26px; font-weight: 600; color: var(--subject); }
.big-island .bar { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: rgb(255 255 255 / .6); }
.big-island .bar .track { flex: 1; height: 5px; border-radius: 3px; background: rgb(255 255 255 / .16); overflow: hidden; }
.big-island .bar .track i { display: block; height: 100%; width: var(--p, 33%); background: var(--subject); border-radius: 3px; transition: width 1s linear; }
.big-island .next { font-size: 13px; color: rgb(255 255 255 / .7); }
.big-island .next b { color: #fff; font-weight: 600; }
.island-hint { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: color-mix(in srgb, var(--inverse-on-surface) 64%, transparent); }
.island-hint .icon { width: 18px; height: 18px; }

.live-demo .live-card { width: min(380px, 100%); background: var(--surface-container-lowest); color: var(--on-surface); }
.widget-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.widget-row .widget { --size: 150px; box-shadow: 0 16px 40px -16px rgb(0 0 0 / .6); }
.widget-row .widget:nth-child(1) { rotate: -3deg; }
.widget-row .widget:nth-child(3) { rotate: 3deg; }

/* MARK: - Temi */

.themes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.themes .copy { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; max-width: 390px; }
.swatch {
  --sz: 56px;
  position: relative;
  width: var(--sz);
  height: var(--sz);
  border-radius: 50%;
  padding: 5px;
  background: var(--surface-container-high);
  transition: border-radius var(--spring-dur) var(--spring), background-color var(--effects-dur), transform var(--spring-fast-dur) var(--spring-fast);
}
.swatch:hover { transform: scale(1.06); }
.swatch:active { transform: scale(.94); }
.swatch .dots {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
  background:
    linear-gradient(var(--a) 0 50%, transparent 50%),
    linear-gradient(90deg, var(--b) 0 50%, var(--c3) 50%);
  transition: border-radius var(--spring-dur) var(--spring);
}
.swatch .icon {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  color: #fff;
  filter: drop-shadow(0 1px 2px rgb(0 0 0 / .4));
  opacity: 0;
  transform: scale(.4);
  transition: opacity var(--effects-dur), transform var(--spring-dur) var(--spring);
}
/* Colore scelto: il cerchio diventa un quadrato arrotondato, con la spunta. */
.swatch[aria-checked="true"] { border-radius: 18px; background: var(--primary); }
.swatch[aria-checked="true"] .dots { border-radius: 13px; }
.swatch[aria-checked="true"] .icon { opacity: 1; transform: none; }
:root[data-theme="dark"] .swatch .dots { background: linear-gradient(var(--ad) 0 50%, transparent 50%), linear-gradient(90deg, var(--bd) 0 50%, var(--cd) 50%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .swatch .dots { background: linear-gradient(var(--ad) 0 50%, transparent 50%), linear-gradient(90deg, var(--bd) 0 50%, var(--cd) 50%); }
}
.swatch.custom .dots { background: conic-gradient(from 0deg, #e8705a, #e0b54a, #6cbf6f, #4aa9c9, #6f74d8, #c46fd0, #e8705a); }
.swatch.custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; border: 0; padding: 0; }
.swatch.custom .icon { opacity: 1; transform: none; color: #fff; }
.swatch.custom[aria-checked="true"] .icon { opacity: 1; }

/* Gruppo di pulsanti collegati (chiaro, automatico, scuro). */
.button-group { display: inline-flex; gap: 2px; padding: 0; }
.button-group button {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  background: var(--surface-container-highest);
  color: var(--on-surface-variant);
  font-weight: 620;
  font-size: 15px;
  border-radius: 8px;
  transition: border-radius var(--spring-dur) var(--spring), background-color var(--effects-dur), color var(--effects-dur);
}
.button-group button::before { content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: 0; transition: opacity var(--effects-fast-dur); }
.button-group button:hover::before { opacity: .08; }
.button-group button:first-child { border-radius: 24px 8px 8px 24px; }
.button-group button:last-child { border-radius: 8px 24px 24px 8px; }
.button-group button[aria-pressed="true"] { background: var(--secondary); color: var(--on-secondary); border-radius: 24px; }
.button-group button .icon { width: 20px; height: 20px; }

.icon-preview { display: flex; align-items: center; gap: 16px; }
/* L'ombra segue l'icona: stessa grandezza e stesso raggio degli angoli (rx 230 su 1024). */
.icon-preview .app-icon { display: block; flex: none; width: 72px; height: 72px; border-radius: 22.46%; box-shadow: var(--elev-2); }
.icon-preview .app-icon :is(svg, img) { display: block; width: 100%; height: 100%; border-radius: inherit; }

.themes-art { position: relative; display: grid; place-items: center; min-height: 660px; }
.themes-art .phone { --w: clamp(270px, 26vw, 330px); z-index: 1; }
.themes-art .blob { position: absolute; width: min(100%, 600px); --c: var(--primary-container); }
.themes-art .blob2 { position: absolute; width: 150px; right: 6%; top: 6%; --c: var(--tertiary); }
.themes-art .accent-name {
  position: absolute;
  left: 4%;
  bottom: 10%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 8px;
  border-radius: 22px;
  background: var(--surface-container-lowest);
  box-shadow: var(--elev-3);
  font-weight: 650;
}
.accent-name i { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); }

/* Confronto Material 3 Expressive / Liquid Glass. */
@property --pos { syntax: "<percentage>"; inherits: true; initial-value: 50%; }
.compare-wrap { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: center; margin-top: var(--section); }
.compare-wrap .copy { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.compare { position: relative; justify-self: center; }
.compare .phone { --w: clamp(270px, 26vw, 320px); }
.compare .layer { position: absolute; inset: 0; }
.compare .layer.glass { clip-path: inset(0 0 0 var(--pos, 50%)); }
.compare .divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos, 50%);
  width: 4px;
  translate: -50% 0;
  z-index: 4;
  background: var(--primary);
  pointer-events: none;
}
.compare .divider::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  translate: -50% -50%;
  border-radius: 50%;
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' fill='white'%3E%3Cpath d='M400-280 200-480l200-200 42 42-128 128h332L518-638l42-42 200 200-200 200-42-42 128-128H314l128 128-42 42Z'/%3E%3C/svg%3E") center / 26px no-repeat;
  box-shadow: var(--elev-3);
}
.compare input[type="range"] {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
}
.compare-labels { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; }

/* MARK: - BCW+ */

.plus {
  position: relative;
  border-radius: var(--r-xxl);
  background: var(--primary-container);
  color: var(--on-primary-container);
  overflow: hidden;
  isolation: isolate;
}
.plus-decor svg { position: absolute; z-index: -1; }
.plus-decor .p1 { --c: color-mix(in srgb, var(--primary) 14%, transparent); width: 440px; right: -80px; top: -120px; }
.plus-decor .p2 { --c: color-mix(in srgb, var(--tertiary) 16%, transparent); width: 360px; left: -120px; bottom: 30%; }
.plus-decor .p3 { --c: color-mix(in srgb, var(--secondary) 14%, transparent); width: 120px; left: 12%; top: 60px; }
.plus-hero { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: clamp(40px, 6vw, 72px) 24px 32px; text-align: center; }
.plus-showcase { display: flex; justify-content: center; margin-bottom: 8px; }
.plus-showcase .widget { --size: 164px; box-shadow: 0 18px 40px -18px rgb(var(--shadow-color) / .5); }
.plus-showcase .widget:first-child { rotate: -6deg; translate: 13px 6px; }
.plus-showcase .widget:last-child { rotate: 5deg; translate: -13px -4px; }
.wordmark { display: inline-flex; align-items: center; gap: .16em; font-size: clamp(56px, 8vw, 88px); line-height: 1; font-weight: 800; font-variation-settings: "ROND" 100; letter-spacing: -.01em; }
.wordmark .shaped { --s: 1.02em; --c: var(--primary); color: var(--on-primary); }
.wordmark .shaped .icon { width: .7em; height: .7em; }
.plus-hero .tagline { font-size: clamp(20px, 2vw, 24px); font-weight: 600; font-variation-settings: "ROND" 100; opacity: .85; }

.plus-body {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr);
  gap: 12px;
  padding: 0 clamp(12px, 3vw, 40px) clamp(12px, 3vw, 40px);
}
.list-group { display: flex; flex-direction: column; gap: 3px; }
.list-group > * { background: var(--surface-container-low); color: var(--on-surface); border-radius: 6px; }
.list-group > :first-child { border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl); }
.list-group > :last-child { border-bottom-left-radius: var(--r-xl); border-bottom-right-radius: var(--r-xl); }
.feature-row { display: flex; align-items: flex-start; gap: 16px; padding: 20px; }
.feature-row .shaped { --s: 48px; --c: color-mix(in srgb, var(--tint) 18%, transparent); color: var(--tint); }
.feature-row h3 { font-size: 18px; font-weight: 650; font-variation-settings: "ROND" 30; margin-bottom: 4px; }
.feature-row p { font-size: 15px; line-height: 1.5; color: var(--on-surface-variant); }

.price-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  border-radius: var(--r-xl);
  background: var(--surface-container-low);
  color: var(--on-surface);
}
.price { display: flex; align-items: baseline; gap: 10px; }
.price strong { font-size: 64px; line-height: 1; font-weight: 720; font-variation-settings: "ROND" 100; letter-spacing: -.03em; }
.price span { font-size: 15px; color: var(--on-surface-variant); font-weight: 600; }
.price-card .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.price-card .btn { width: 100%; }
.price-card .note { font-size: 13.5px; line-height: 1.5; color: var(--on-surface-variant); }
.plus-foot { padding: 0 24px clamp(32px, 4vw, 48px); text-align: center; font-size: 15px; max-width: 46em; margin: 0 auto; color: color-mix(in srgb, var(--on-primary-container) 80%, transparent); }

/* MARK: - Scarica */

.platforms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.platform {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 0 28px;
  border-radius: var(--r-xli);
  background: var(--surface-container);
  overflow: hidden;
}
.platform > :not(.platform-art) { margin-inline: 28px; }
.platform-art { position: relative; height: 270px; overflow: hidden; display: grid; place-items: start center; background: var(--surface-container-high); }
.platform-art .phone { --w: 230px; margin-top: 34px; transition: translate var(--spring-slow-dur) var(--spring); }
.platform:hover .platform-art .phone { translate: 0 -10px; }
.platform-art .browser { width: 118%; margin-top: 34px; translate: 9% 0; transition: translate var(--spring-slow-dur) var(--spring); }
.platform:hover .platform-art .browser { translate: 7% -8px; }
.platform-art .android-art { place-self: center; display: grid; place-items: center; }
.platform-art .android-art .shaped { --s: 170px; --c: var(--tertiary-container); --on-c: var(--on-tertiary-container); }
.platform-art .android-art .icon { width: 84px; height: 84px; }
.platform header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.platform header h3 { font-size: 24px; font-weight: 680; }
.platform .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.platform .req { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--on-surface-variant); }
.platform .req .icon { width: 18px; height: 18px; }

.browser { border-radius: 14px; background: var(--surface-container-lowest); box-shadow: var(--elev-float); overflow: hidden; }
.browser .bar { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; background: var(--surface-container-highest); }
.browser .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--outline-variant); }
.browser .bar span { margin-left: 10px; height: 14px; flex: 0 1 52%; border-radius: 7px; background: var(--surface-container-low); }
.browser img, .browser picture { width: 100%; display: block; }

.backend-card {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 12px;
  padding: 22px 28px;
  border-radius: var(--r-xli);
  background: var(--surface-container-low);
  box-shadow: inset 0 0 0 1px var(--outline-variant);
}
.backend-card .shaped { --c: var(--secondary-container); --on-c: var(--on-secondary-container); }
.backend-card .copy { flex: 1; min-width: 0; display: grid; gap: 4px; }
.backend-card h3 { font-size: 19px; font-weight: 650; }

/* MARK: - Aperta e privata */

/* MARK: Account BCW */
.account-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 12px; align-items: start; }
.account-main { display: grid; gap: 12px; }
.account-demo { display: grid; gap: 14px; padding: 20px; border-radius: var(--r-xli); background: var(--surface-container); }
.account-demo header { display: flex; align-items: center; gap: 12px; }
.account-demo header > div { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.account-demo header strong { font-size: 17px; font-weight: 680; }
.account-demo header span { font-size: 13.5px; color: var(--on-surface-variant); }
.account-demo .avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 750; font-size: 19px; font-variation-settings: "ROND" 100; }
.linked { display: flex; flex-direction: column; gap: 3px; }
.profile { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; background: var(--surface-container-lowest); border-radius: 6px; }
.profile:first-child { border-radius: var(--r-l) var(--r-l) 6px 6px; }
.profile:last-child { border-radius: 6px 6px var(--r-l) var(--r-l); }
.profile > div { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.profile strong { font-size: 15px; font-weight: 650; }
.profile span:not(.initials) { font-size: 13px; color: var(--on-surface-variant); }
.profile .initials { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 14px; background: var(--pc); color: #fff; font-size: 14px; font-weight: 720; }
.profile > .icon { width: 22px; height: 22px; color: var(--primary); }
.synced { display: flex; flex-wrap: wrap; gap: 8px; }
.server-card {
  position: sticky;
  top: calc(var(--topbar) + 16px);
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: clamp(24px, 3vw, 36px);
  border-radius: var(--r-xli);
  background: var(--tertiary-container);
  color: var(--on-tertiary-container);
}
.server-card .decor { position: absolute; z-index: -1; width: 300px; right: -90px; top: -110px; --c: color-mix(in srgb, var(--tertiary) 18%, transparent); }
.server-card .eyebrow { background: color-mix(in srgb, var(--on-tertiary-container) 12%, transparent); color: var(--on-tertiary-container); }
.server-card h3 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; font-weight: 700; font-variation-settings: "ROND" 100; letter-spacing: -.01em; }
.server-card p { font-size: 15.5px; line-height: 1.55; color: color-mix(in srgb, var(--on-tertiary-container) 86%, transparent); }
.server-card p a { color: inherit; font-weight: 650; }
.terminal { width: 100%; overflow-x: auto; padding: 16px 18px; border-radius: var(--r-l); background: #1d1b1a; color: #f3ece9; font-family: var(--mono); font-size: 13px; line-height: 1.7; }
.terminal .c { color: #a8a09d; }
.server-card .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.server-card .chip { background: color-mix(in srgb, var(--surface-container-lowest) 70%, transparent); }
.server-card .actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 899px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .server-card { position: static; }
}

.trust { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 28px;
  border-radius: var(--r-xli);
  background: var(--surface-container);
}
.card h3 { font-size: 20px; font-weight: 650; line-height: 1.25; }
.card p { font-size: 15px; line-height: 1.55; color: var(--on-surface-variant); }
.card .shaped { --s: 56px; }
.card a.more { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; font-weight: 650; text-decoration: none; }
.card a.more .icon { width: 18px; height: 18px; transition: transform var(--spring-dur) var(--spring); }
.card a.more:hover .icon { transform: translateX(3px); }

/* MARK: - Domande (elenco segmentato con sezioni espandibili) */

.faq { display: flex; flex-direction: column; gap: 3px; }
.faq details {
  background: var(--surface-container);
  border-radius: 6px;
  transition: border-radius var(--spring-dur) var(--spring), background-color var(--effects-dur);
}
.faq details:first-child { border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl); }
.faq details:last-child { border-bottom-left-radius: var(--r-xl); border-bottom-right-radius: var(--r-xl); }
.faq details[open] { background: var(--surface-container-high); border-radius: var(--r-xl); margin: 6px 0; }
.faq details[open]:first-child { margin-top: 0; }
.faq details[open]:last-child { margin-bottom: 0; }
.faq summary {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  padding: 14px 18px 14px 22px;
  cursor: pointer;
  list-style: none;
  font-size: 17px;
  font-weight: 620;
  line-height: 1.35;
  border-radius: inherit;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .q { flex: 1; }
.faq summary .shaped { --s: 40px; }
.faq summary .chev {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 20px;
  background: var(--surface-container-highest);
  color: var(--on-surface-variant);
  transition: transform var(--spring-dur) var(--spring), background-color var(--effects-dur), border-radius var(--spring-dur) var(--spring);
}
.faq details[open] .chev { transform: rotate(180deg); background: var(--primary); color: var(--on-primary); border-radius: 12px; }
.faq summary:hover .chev { background: var(--surface-container-highest); }
.faq details[open] summary:hover .chev { background: var(--primary); }
.answer { padding: 0 22px 22px; display: grid; gap: 12px; font-size: 16px; line-height: 1.6; color: var(--on-surface-variant); }
.faq summary .shaped + .q { margin-left: -2px; }
.faq .shaped ~ .q + .chev { }
.answer.indent { padding-left: 78px; }
.answer ol, .answer ul { display: grid; gap: 8px; padding-left: 22px; }
.answer li::marker { color: var(--primary); font-weight: 700; }
.answer strong { color: var(--on-surface); font-weight: 650; }
.answer code, .mono-chip { font-family: var(--mono); font-size: .88em; padding: 2px 7px; border-radius: 6px; background: var(--surface-container-highest); color: var(--on-surface); }
.answer .path { font-weight: 650; color: var(--on-surface); white-space: nowrap; }
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-l);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: 15px;
  line-height: 1.5;
}
.callout .icon { width: 22px; height: 22px; margin-top: 1px; }
.callout.warn { background: var(--fair-container); color: var(--on-fair-container); }
@supports (interpolate-size: allow-keywords) {
  .faq details { interpolate-size: allow-keywords; }
  .faq details::details-content { height: 0; overflow: clip; transition: height var(--spring-dur) var(--spring), content-visibility var(--spring-dur) allow-discrete; }
  .faq details[open]::details-content { height: auto; }
}

.faq-wrap { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.faq-wrap .copy { position: sticky; top: 120px; display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }

/* MARK: - Piè di pagina */

.footer { padding: clamp(64px, 8vw, 96px) 0 calc(40px + env(safe-area-inset-bottom)); background: var(--surface-container-low); border-radius: var(--r-xxl) var(--r-xxl) 0 0; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 40px; }
.footer .big-logo { font-size: clamp(72px, 11vw, 140px); }
.footer .tag { margin-top: 20px; max-width: 26em; }
.footer h4 { font-size: 14px; font-weight: 700; letter-spacing: .4px; color: var(--on-surface-variant); margin-bottom: 14px; text-transform: uppercase; }
.footer ul { list-style: none; display: grid; gap: 10px; }
.footer ul a { color: var(--on-surface); text-decoration: none; font-weight: 550; display: inline-flex; align-items: center; gap: 8px; }
.footer ul a:hover { color: var(--primary); text-decoration: underline; }
.footer ul .icon { width: 18px; height: 18px; color: var(--on-surface-variant); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--outline-variant); font-size: 14px; color: var(--on-surface-variant); }
.footer-bottom a { color: inherit; }

/* MARK: - Supporto */

.support-hero { position: relative; padding: calc(var(--topbar) + clamp(40px, 7vw, 88px)) 0 clamp(40px, 5vw, 64px); overflow: clip; text-align: center; }
.support-hero .container { display: flex; flex-direction: column; align-items: center; gap: 24px; }
.support-hero .decor svg { position: absolute; z-index: -1; }
.support-hero .decor .s1 { --c: var(--primary-container); width: 420px; left: -140px; top: 40px; opacity: .7; }
.support-hero .decor .s2 { --c: var(--tertiary-container); width: 300px; right: -90px; top: 160px; opacity: .6; }
.support-hero .decor .s3 { --c: var(--secondary-container); width: 90px; right: 22%; top: 120px; }

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 640px);
  height: 64px;
  padding: 0 8px 0 22px;
  border-radius: 32px;
  background: var(--surface-container-high);
  transition: background-color var(--effects-dur), box-shadow var(--effects-dur), border-radius var(--spring-dur) var(--spring);
}
.search:focus-within { background: var(--surface-container-highest); box-shadow: var(--elev-2); }
.search .icon { color: var(--on-surface-variant); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 17px; }
.search input::placeholder { color: var(--on-surface-variant); opacity: .8; }
.search input::-webkit-search-cancel-button { display: none; }
.search .clear { display: none; }
.search.has-text .clear { display: inline-grid; }

.filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-s);
  box-shadow: inset 0 0 0 1px var(--outline-variant);
  color: var(--on-surface-variant);
  font-size: 14.5px;
  font-weight: 620;
  transition: background-color var(--effects-dur), color var(--effects-dur), border-radius var(--spring-dur) var(--spring), box-shadow var(--effects-dur);
}
.filter-chip .icon { width: 18px; height: 18px; }
.filter-chip:hover { background: color-mix(in srgb, var(--on-surface) 6%, transparent); }
.filter-chip[aria-pressed="true"] { background: var(--secondary-container); color: var(--on-secondary-container); box-shadow: none; border-radius: var(--r-l); }

.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick a { text-decoration: none; color: inherit; }
.quick .card { height: 100%; transition: background-color var(--effects-dur), border-radius var(--spring-dur) var(--spring); }
.quick a:hover .card { background: var(--surface-container-high); }
.quick a:active .card { border-radius: var(--r-l); }
.quick .card .row { display: flex; align-items: center; justify-content: space-between; }
.quick .card .row > .icon { color: var(--on-surface-variant); transition: transform var(--spring-dur) var(--spring); }
.quick a:hover .card .row > .icon { transform: translate(3px, -3px); }

.topic { display: grid; grid-template-columns: minmax(0, .34fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: clamp(36px, 5vw, 56px) 0; border-top: 1px solid var(--outline-variant); }
.topic:first-child { border-top: 0; }
.topic > header { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.topic > header h2 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; font-weight: 680; }
.topic > header .shaped { --s: 64px; }
.topic[hidden], .faq details[hidden] { display: none; }
.empty { display: none; flex-direction: column; align-items: center; gap: 14px; padding: 64px 0; text-align: center; }
.empty.show { display: flex; }
.empty .shaped { --s: 88px; --c: var(--surface-container-high); --on-c: var(--on-surface-variant); }

mark { background: color-mix(in srgb, var(--tertiary-container) 85%, transparent); color: var(--on-tertiary-container); border-radius: 4px; padding: 0 2px; }

.repos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.repo { display: flex; gap: 18px; padding: 24px; border-radius: var(--r-xli); background: var(--surface-container); }
.repo .copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.repo h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; font-size: 20px; font-weight: 650; font-variation-settings: "ROND" 30; }
.repo h3 code { font-family: var(--mono); font-size: 17px; font-weight: 600; }
.repo .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.repo .links { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0 -12px; }
.repo .links .btn { --h: 40px; font-size: 14.5px; }
.repo.wide { grid-column: span 2; }

.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.req-list { list-style: none; display: grid; gap: 10px; }
.req-list li { display: flex; gap: 10px; font-size: 15px; line-height: 1.45; color: var(--on-surface-variant); }
.req-list li .icon { width: 20px; height: 20px; color: var(--primary); margin-top: 1px; }
.req-list b { color: var(--on-surface); font-weight: 650; }

.cta-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: clamp(28px, 5vw, 56px);
  border-radius: var(--r-xxl);
  background: var(--primary-container);
  color: var(--on-primary-container);
  overflow: hidden;
  isolation: isolate;
}
.cta-panel .decor { position: absolute; z-index: -1; width: 300px; right: -60px; bottom: -120px; --c: color-mix(in srgb, var(--primary) 16%, transparent); }
.cta-panel .copy { display: grid; gap: 12px; }
.cta-panel ul { display: grid; gap: 6px; padding-left: 20px; font-size: 15.5px; color: color-mix(in srgb, var(--on-primary-container) 85%, transparent); }

/* MARK: - Disposizione su schermi piccoli */

@media (max-width: 1099px) {
  .span-7, .span-5 { grid-column: span 12; }
  .span-3 { grid-column: span 6; }
  .mini-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .platforms { grid-template-columns: minmax(0, 1fr); max-width: 620px; margin-inline: auto; }
  .plus-body { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: span 3; }
  .info-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 899px) {
  .hero-grid, .themes, .compare-wrap, .live-panel, .faq-wrap { grid-template-columns: minmax(0, 1fr); }
  .hero-copy { align-items: center; text-align: center; }
  .hero h1 { margin-inline: auto; }
  .cta-row, .facts { justify-content: center; }
  .hero-art { min-height: 0; padding: 24px 0 8px; }
  .hero-art .w-avg { left: 2%; top: 4%; }
  .hero-art .live-card { right: 0; left: auto; bottom: 10%; width: min(300px, 78vw); }
  .hero-art .chip-float { display: none; }
  .themes-art { order: -1; min-height: 0; padding: 12px 0; }
  .compare-wrap .copy { order: -1; }
  .faq-wrap .copy { position: static; }
  .topic { grid-template-columns: minmax(0, 1fr); }
  .repos { grid-template-columns: minmax(0, 1fr); }
  .repo.wide { grid-column: auto; }
  .quick { grid-template-columns: minmax(0, 1fr); }
  .cta-panel { grid-template-columns: minmax(0, 1fr); }
  .tile.with-phone.side { flex-direction: column; min-height: 0; }
  .tile.with-phone.side .phone { margin: 8px auto calc(var(--w) * -.5); align-self: center; }
  .tile.with-phone.side .copy { padding-bottom: 0; }
}

@media (max-width: 599px) {
  .span-3, .span-4, .span-6, .span-8 { grid-column: span 12; }
  .mini-grid { grid-template-columns: minmax(0, 1fr); }
  .mini { flex-direction: row; align-items: flex-start; padding: 20px; }
  .mini .copy { display: grid; gap: 4px; }
  .trust { grid-template-columns: minmax(0, 1fr); }
  .tile.with-phone { min-height: 0; }
  .tile.with-phone .phone { --w: 250px; }
  .sim-top { flex-direction: column; align-items: flex-start; }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid > :first-child { grid-column: span 2; }
  .live-panel { border-radius: var(--r-xli); }
  .plus { border-radius: var(--r-xli); }
  /* I widget restano quelli veri, solo rimpiccioliti: così i testi non vengono tagliati. */
  .plus-showcase .widget, .widget-row .widget { --size: 158px; zoom: .86; }
  .widget-row .widget:nth-child(3) { display: none; }
  .big-island { width: 260px; }
  .big-island .expanded { padding: 22px 20px; gap: 12px; }
  .big-island .row { gap: 10px; }
  .big-island .row .shaped { --s: 40px; }
  .big-island .row .shaped b { font-size: 16px; }
  .big-island .row .what strong { font-size: 18px; }
  .big-island .row .what span { font-size: 12.5px; }
  .big-island .row .left { font-size: 22px; }
  .big-island .bar { font-size: 12px; gap: 8px; }
  .big-island .next { font-size: 12.5px; text-align: center; }
  .news-chip { gap: 8px; font-size: 14px; white-space: nowrap; }
  .faq summary { font-size: 16px; padding-left: 18px; }
  .answer, .answer.indent { padding: 0 18px 18px; }
  .backend-card { flex-direction: column; align-items: flex-start; }
  .button-group button { padding: 0 14px; }
  .swatch { --sz: 50px; }
  .hero-art .w-avg { --size: 132px; }
  .hero-art .w-avg .ring { width: 78px; height: 78px; }
  .hero-art .w-avg .ring .num { font-size: 20px; }
}
