/* Valori ripresi dall'app: ui/theme/Color.kt, Spacing.kt, Motion.kt, Gradients.kt. */
/* Outfit, licenza OFL: un solo file variabile, lo stesso font dell'app. */
@font-face {
  font-family: 'Outfit';
  src: url('/fonts/outfit.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0d0d0d;
  --surface: #161616;
  --high: #1f1f1f;
  --line: #2a2a2a;
  --text: #ffffff;
  /* Testo secondario: due toni soli. --text-2 per i sottotitoli, --muted per note e etichette. */
  --text-2: color-mix(in srgb, var(--text) 78%, transparent);
  --muted: #9e9e9e;
  --accent: #ff1469;
  --on-accent: #0d0d0d;
  /* Il labbro dei tasti: sotto l'accento e sotto i tasti spenti (SetCheckmarkButton). */
  --accent-lip: color-mix(in srgb, var(--accent) 62%, #000);
  --lip: #161618;
  --line-hover: #343438;

  /* Podio: oro, argento, bronzo. */
  --gold: #ffc800;
  --silver: #c8d0da;
  --bronze: #e0955e;

  /* Figura anatomica: su fondo scuro, i muscoli spenti si leggono appena. */
  --skin: #5b5b63;
  --hair: #45454c;
  --rest: #303036;

  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --r-pill: 999px;

  --ease-decel: cubic-bezier(0.05, 0.7, 0.1, 1);
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 120ms;
  --t-medium: 280ms;
  --t-slow: 420ms;
  --t-glide: 720ms;

  /* Gli stessi passi di Spacing.kt. --section-y e' lo stacco tra una sezione e l'altra. */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --section-y: clamp(6rem, 3rem + 6vw, 8.75rem);

  /* Scala tipografica: ogni testo del sito usa uno di questi. Le misure fluide hanno sempre
     una parte in rem, cosi' lo zoom del browser le ingrandisce. */
  --fs-xs: 0.8125rem; /* etichette, note, didascalie */
  --fs-sm: 0.9375rem; /* tasti, chip, conteggi */
  --fs-md: 1.0625rem; /* CTA, valori delle serie */
  --fs-body: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem); /* sottotitoli */
  --fs-lg: clamp(1.125rem, 1rem + 0.6vw, 1.5rem); /* titoli delle schede, numeri piccoli */
  --fs-stat: clamp(2.25rem, 1.5rem + 2.4vw, 4rem); /* numeri grandi */
  --fs-h2: clamp(2.25rem, 1.6rem + 3vw, 4.5rem); /* titoli di sezione */
  /* Titolo su due righe; da 1024 px sta su una riga sola (vedi sotto). */
  --fs-display: clamp(3rem, 0.25rem + 16.3vw, 8.5rem);

  --nav-h: 64px;
  --gutter: max(clamp(16px, 4vw, 48px), calc((100vw - 1440px) / 2));
  --display: 'Outfit', system-ui, sans-serif;
  --body: 'Outfit', system-ui, sans-serif;
}

@media (min-width: 1024px) {
  :root {
    /* Il titolo della chiusura (.soon): su una riga, mai piu' alto del 13% dello schermo. */
    --fs-display: clamp(4rem, min(1rem + 6.6vw, 13dvh), 8.5rem);
  }
}

/* Fondo chiaro dell'app (GymPaper e vicini in Color.kt). L'accento resta lo stesso dei due fondi
   e --on-accent resta scuro: sull'accento si legge meglio il nero. */
:root[data-mode='light'] {
  color-scheme: light;
  --bg: #f3f3f5;
  --surface: #ffffff;
  --high: #f1f1f4;
  --line: #e2e2e6;
  --text: #0d0d0d;
  --muted: #5a5a5a;
  --lip: #d6d6dc;
  --line-hover: #e6e6ea;

  /* AnatomyPalette.Light: muscoli spenti chiari, sagoma piu' scura. */
  --skin: #9e9ea7;
  --hair: #85858e;
  --rest: #dadadf;
}

/* I temi dell'app: cambia una variabile e la segue tutto il sito. */
:root[data-accent='orange'] {
  --accent: #ff9100;
}
:root[data-accent='green'] {
  --accent: #3ddc97;
}
:root[data-accent='cyan'] {
  --accent: #52a8ff;
}
:root[data-accent='violet'] {
  --accent: #8b5cf6;
}

/* Si vede solo la cattura del colore in uso (componente Shots). */
.shot:not([data-a='magenta']),
:root[data-accent] .shot[data-a='magenta'] {
  display: none;
}
:root[data-accent='orange'] .shot[data-a='orange'],
:root[data-accent='green'] .shot[data-a='green'],
:root[data-accent='cyan'] .shot[data-a='cyan'],
:root[data-accent='violet'] .shot[data-a='violet'] {
  display: block;
}

/* Il cambio di tema si apre a cerchio: lo guida ThemePicker. */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

html {
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  /* La barra di scorrimento segue il tema: sottile, cursore nell'accento, binario nel fondo. */
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--accent) 75%, var(--bg)) var(--bg);
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Su telefono niente lampo grigio al tocco: ogni tasto ha gia' il suo stato premuto. */
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
p,
ol,
ul {
  margin: 0;
  padding: 0;
}

ol,
ul {
  list-style: none;
}

img,
svg {
  display: block;
}

a {
  color: inherit;
}

/* Due soli titoli: il display dell'hero e h2 per ogni sezione. La seconda riga in accento. */
h2 {
  font-family: var(--display);
  font-size: var(--fs-h2);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-wrap: balance;
}

h2 span {
  display: block;
  color: var(--accent);
}

/* Il sottotitolo sotto ogni h2. */
.lead {
  max-width: 44ch;
  margin-top: var(--s-4);
  color: var(--text-2);
  font-size: var(--fs-body);
  text-wrap: pretty;
}

/* La selezione del testo segue l'accento, come tutto il resto. */
::selection {
  background: var(--accent);
  color: var(--on-accent);
}

/* Dentro un testo gia' in accento l'evidenziazione si inverte, per restare leggibile. */
.hero__accent::selection,
h2 span::selection,
.soon h2::selection {
  background: var(--text);
  color: var(--bg);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border-radius: var(--r-pill);
  background: var(--accent);
  box-shadow: 0 5px 0 var(--accent-lip);
  color: var(--on-accent);
  font-family: var(--display);
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    translate var(--t-fast) var(--ease-decel),
    box-shadow var(--t-fast) var(--ease-decel),
    filter var(--t-medium) var(--ease-decel);
}

/* Solo con un puntatore vero: sul tocco l'hover resterebbe acceso dopo il tap. */
@media (hover: hover) {
  .cta:hover {
    filter: brightness(1.08);
  }
}

.cta:active {
  translate: 0 3px;
  box-shadow: 0 2px 0 var(--accent-lip);
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Righe e spunta della scheda, come in DraftExerciseCard.kt: le usano la mappa e l'hero. */
/* Colonne come in SetHeaderRow: stessa griglia per titoli e righe. */
.set {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 2.25rem 1.15fr 1fr 1fr 48px;
  align-items: center;
  min-height: 50px;
  overflow: hidden;
  border-radius: var(--r-12);
  text-align: center;
}

.set--cols {
  min-height: 24px;
  color: var(--muted);
  /* Unica misura fuori scala: e' quella dei titoli di colonna dell'app (SetHeaderRow). */
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.card__sets {
  display: grid;
  gap: 4px;
}

/* La velatura parte dalla spunta e attraversa la riga. */
.set[data-set]::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  scale: 0 1;
  transform-origin: right;
  transition: scale var(--t-slow) var(--ease-decel);
}

.set.is-done::before {
  scale: 1 1;
}

/* L'anello sulla prossima serie, come nextRing dell'app. */
.set[data-set]::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 55%, transparent);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-medium) var(--ease-decel);
}

.is-active .set.is-next::after {
  opacity: 1;
}

.set__n {
  color: var(--muted);
  font-weight: 700;
  transition: color var(--t-medium) var(--ease-decel);
}

.set.is-done .set__n {
  color: var(--accent);
}

.set__last {
  color: var(--muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.set__val {
  font-family: var(--display);
  font-size: var(--fs-md);
  font-weight: 700;
}

.check {
  display: grid;
  place-items: center;
  width: 48px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Da fare sporge sul suo labbro; fatta, affonda come un tasto (SetCheckmarkButton). */
.check__box {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-8);
  background: var(--line);
  box-shadow: 0 3px 0 var(--lip);
  transition:
    background var(--t-fast) var(--ease-decel),
    box-shadow var(--t-medium) var(--ease-pop),
    translate var(--t-medium) var(--ease-pop),
    scale var(--t-medium) var(--ease-pop);
}

.check:hover .check__box {
  background: var(--line-hover);
}

.check:active .check__box {
  translate: 0 2px;
  scale: 0.94;
  box-shadow: 0 1px 0 var(--lip);
}

.check[aria-pressed='true'] .check__box {
  background: var(--accent);
  translate: 0 3px;
  box-shadow: 0 0 0 transparent;
}

.check:focus-visible {
  outline: none;
}

.check:focus-visible .check__box {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.check svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.check__idle {
  stroke: var(--muted);
  transition: opacity var(--t-fast) var(--ease-decel);
}

.check__done {
  stroke: var(--on-accent);
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  transition: stroke-dashoffset var(--t-medium) var(--ease-decel);
}

[aria-pressed='true'] .check__idle {
  opacity: 0;
}

[aria-pressed='true'] .check__done {
  stroke-dashoffset: 0;
}

/* L'invito a toccare, finche' non si tocca davvero. */
.check__box::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--accent);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .map:not(.has-touched) .is-active .is-next .check__box::after {
    animation: invite 1800ms var(--ease-decel) infinite;
  }
}

@keyframes invite {
  0% {
    opacity: 0.8;
    scale: 1;
  }
  60%,
  100% {
    opacity: 0;
    scale: 1.45;
  }
}



/* pages/index.astro */
.nav {
    position: fixed;
    inset: 0 0 auto;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-h);
    padding-inline: var(--gutter);
    background: color-mix(in srgb, var(--bg) 62%, transparent);
    backdrop-filter: blur(16px);
  }

  /* Il nome segue il colore del tema, come il kettlebell accanto. */
  .nav a:first-child {
    color: var(--accent);
    text-decoration: none;
  }

  /* Sempre a portata di pollice, anche su telefono: e' l'unica azione del sito. */
  .nav__cta {
    min-height: 44px;
    padding: 0 var(--s-4);
    font-size: var(--fs-sm);
    box-shadow: 0 3px 0 var(--accent-lip);
  }

  @media (min-width: 640px) {
    .nav__cta {
      min-height: 40px;
      padding: 0 18px;
    }
  }

  /* Su telefono il primo schermo ha gia' il tasto della hero: quello in barra entra solo
     quando l'altro e' uscito, cosi' non ce ne sono mai due uguali insieme. */
  @media (max-width: 639px) {
    @supports (animation-timeline: scroll()) {
      .nav__cta {
        animation: nav-cta-in linear both;
        animation-timeline: scroll(root);
        animation-range: 55vh 75vh;
      }
    }
  }

  @keyframes nav-cta-in {
    from {
      opacity: 0;
      visibility: hidden;
      translate: 0 -8px;
    }
  }

  /* La chiusura e' l'unica sezione centrata: titolo, piattaforme e modulo su un asse solo,
     con il bagliore dell'accento che sale dal fondo. */
  .soon {
    position: relative;
    isolation: isolate;
    display: grid;
    justify-items: center;
    padding: var(--section-y) var(--gutter);
    text-align: center;
  }

  /* Come la hero in alto: un solo bagliore al centro che svanisce nel fondo da entrambi i lati,
     cosi' la pagina si apre e si chiude con lo stesso respiro. Il piede di pagina ci sta dentro. */
  .soon::before {
    content: '';
    position: absolute;
    inset: 0 0 -6rem;
    z-index: -1;
    mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 60%, transparent);
    background: radial-gradient(
      ellipse var(--soon-glow, 46% 60%) at 50% 52%,
      color-mix(in srgb, var(--accent) 30%, transparent),
      color-mix(in srgb, var(--accent) 8%, transparent) 62%,
      transparent 82%
    );
  }

  /* Su telefono il 46% della larghezza diventava una striscia verticale: ellisse piu' larga. */
  @media (max-width: 767px) {
    .soon {
      --soon-glow: 90% 45%;
    }
  }

  .soon h2 {
    color: var(--accent);
  }

  /* La chiusura riprende il display dell'hero, dove sta su una riga. */
  @media (min-width: 1024px) {
    .soon h2 {
      font-size: var(--fs-display);
      letter-spacing: -0.04em;
    }
  }

  .soon__form {
    width: min(100%, 30rem);
    margin-top: var(--s-7);
    text-align: left;
  }

  .soon ul {
    display: grid;
    grid-template-columns: repeat(2, auto);
    justify-content: center;
    gap: var(--s-2) var(--s-6);
    margin-top: var(--s-6);
    font-family: var(--display);
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
  }

  /* Da tablet in su le quattro piattaforme stanno su una riga. */
  @media (min-width: 640px) {
    .soon ul {
      grid-template-columns: repeat(4, auto);
    }
  }

  /* Posizionato: il bagliore di .soon scende 6rem sotto la sezione e, senza, restava sopra il
     piede intercettando i clic sui link. */
  .foot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    padding: var(--s-5) var(--gutter) max(var(--s-5), env(safe-area-inset-bottom));
    color: var(--accent);
  }

  .foot p {
    color: var(--muted);
    font-size: var(--fs-xs);
  }

  .social {
    display: flex;
    gap: var(--s-2);
  }

  /* 48px: bersaglio comodo al dito anche con un'icona da 22. A riposo grigie; sotto il
     puntatore prendono i colori veri del marchio, salgono di 2px e premute affondano. */
  .social a {
    position: relative;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: var(--muted);
    isolation: isolate;
    transition:
      color var(--t-fast) var(--ease-decel),
      translate var(--t-medium) var(--ease-pop),
      scale var(--t-medium) var(--ease-pop);
  }

  /* Il fondo di marca e' un livello a parte: un gradiente non si dissolve, l'opacita' si'. */
  .social a::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    opacity: 0;
    scale: 0.6;
    transition:
      opacity var(--t-fast) var(--ease-decel),
      scale var(--t-medium) var(--ease-pop);
  }

  .social a[href*="instagram"]::before {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
  }

  .social a[href*="tiktok"]::before {
    background: #000;
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.14);
  }

  .social svg {
    width: 22px;
    height: 22px;
    transition: filter var(--t-fast) var(--ease-decel);
  }

  .social a:focus-visible,
  .social a:active {
    color: #fff;
  }

  .social a:focus-visible::before,
  .social a:active::before {
    opacity: 1;
    scale: 1;
  }

  /* Lo sdoppiamento ciano/rosso e' il segno di TikTok, non un bagliore. */
  .social a[href*="tiktok"]:is(:focus-visible, :active) svg {
    filter: drop-shadow(-1.5px -1px 0 #25f4ee) drop-shadow(1.5px 1px 0 #fe2c55);
  }

  @media (hover: hover) and (pointer: fine) {
    .social a:hover {
      color: #fff;
      translate: 0 -2px;
    }

    .social a:hover::before {
      opacity: 1;
      scale: 1;
    }

    .social a[href*="tiktok"]:hover svg {
      filter: drop-shadow(-1.5px -1px 0 #25f4ee) drop-shadow(1.5px 1px 0 #fe2c55);
    }
  }

  .social a:active {
    translate: 0 1px;
    scale: 0.92;
    transition-duration: 90ms;
  }

  @media (prefers-reduced-motion: reduce) {
    .social a,
    .social a::before {
      transition: color var(--t-fast), opacity var(--t-fast);
      translate: none !important;
      scale: none !important;
    }
  }

/* components/Figure.astro */
.figure svg {
    width: 100%;
    height: 100%;
  }

  .figure .s {
    fill: var(--skin);
  }

  .figure .h {
    fill: var(--hair);
  }

  .figure .m {
    fill: var(--rest);
    transition: fill var(--t-slow) var(--ease-decel);
  }

/* components/Logo.astro */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--display);
    font-size: 1.375rem;
    font-weight: 800;
    letter-spacing: -0.03em;
  }

  /* Il tracciato ingrandito sporge un poco dal viewBox: senza, la cima resta tagliata. */
  .logo svg {
    overflow: visible;
    width: auto;
    height: 1.25em;
  }

/* components/Phone.astro */
/* Bordo sottile e tasti laterali; sullo schermo solo un riflesso appena percepibile. */
  .phone {
    position: relative;
    padding: 2.2%;
    border-radius: 13% / 6.4%;
    background: linear-gradient(145deg, #3e3e45, #141416 38%, #1a1a1d 70%, #34343a);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent),
      inset 0 0 0 2.5px rgb(0 0 0 / 0.5),
      0 2px 4px rgb(0 0 0 / 0.4),
      0 40px 80px rgb(0 0 0 / 0.55);
  }

  /* Sul fondo chiaro l'ombra scura diventava una macchia grigia, visibile anche sotto la barra
     in alto: piu' leggera e piu' corta. */
  :root[data-mode='light'] .phone {
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent),
      inset 0 0 0 2.5px rgb(0 0 0 / 0.5),
      0 2px 4px rgb(0 0 0 / 0.18),
      0 24px 48px rgb(0 0 0 / 0.16);
  }

  .phone::before {
    content: '';
    position: absolute;
    top: 21%;
    right: -0.7%;
    width: 0.9%;
    height: 11%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(90deg, #1b1b1e, #3a3a40);
    box-shadow: 0 170% 0 -0.5px #2c2c31;
  }

  .phone__screen {
    position: relative;
    overflow: hidden;
    border-radius: 10.9% / 5.3%;
    background: var(--bg);
  }

  .phone__screen::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(118deg, color-mix(in srgb, var(--text) 5%, transparent), transparent 26%);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 5%, transparent);
    pointer-events: none;
  }

  .phone__screen img {
    width: 100%;
    height: auto;
  }

/* components/Watch.astro */
.watch {
    position: relative;
    aspect-ratio: 1;
  }

  /* Cinturino intero e opaco ma corto: oltre la cassa curva dietro il polso, come nelle foto
     di prodotto. Le estremita' si scuriscono per la curva, non diventano trasparenti. */
  .watch__band {
    position: absolute;
    top: -45%;
    left: 0;
    width: 100%;
    height: 190%;
    filter: drop-shadow(0 24px 32px rgb(0 0 0 / 0.6));
  }

  /* Tutto nero, come un solo pezzo: niente anello chiaro attorno allo schermo, il bordo
     si stacca dal cinturino appena, con un grigio scurissimo. */
  .watch__case {
    position: absolute;
    inset: 0;
    padding: 12%;
    overflow: hidden;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #000 88%, #121215);
    box-shadow: 0 18px 40px rgb(0 0 0 / 0.75);
  }

  .watch__case::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(ellipse 58% 34% at 34% 11%, rgb(255 255 255 / 0.13), transparent 74%);
    pointer-events: none;
  }

  .watch__case img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
  }

  .watch__crown {
    position: absolute;
    top: 42.5%;
    right: -3.2%;
    width: 5.4%;
    height: 15%;
    border-radius: 0 34% 34% 0;
    background: linear-gradient(180deg, #17171a, #3a3a40 50%, #17171a);
  }

/* components/Hero.astro */
.hero {
    position: relative;
    isolation: isolate;
    /* Solo in larghezza: in altezza l'ombra del telefono deve poter sfumare oltre il bordo,
       altrimenti la sezione la taglia con una riga dritta. */
    overflow-x: clip;
    display: grid;
    padding: calc(var(--nav-h) + var(--s-6)) var(--gutter) var(--s-6);
  }

  /* Un solo bagliore d'accento, dietro al telefono, che svanisce nel fondo. La maschera lo
     spegne prima del bordo della sezione: su telefono l'ellisse scendeva oltre e restava
     tagliata da una riga netta sotto il telefono. */
  .hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    mask-image: linear-gradient(to bottom, #000 55%, transparent 96%);
    background: radial-gradient(
      ellipse 76% 46% at 50% 74%,
      color-mix(in srgb, var(--accent) 40%, transparent),
      transparent 72%
    );
  }

  /* Su desktop il telefono occupa tutta l'altezza: bagliore piu' stretto e alto, come prima. */
  @media (min-width: 1024px) {
    .hero::before {
      mask-image: none;
      background: radial-gradient(
        ellipse 48% 62% at 50% 55%,
        color-mix(in srgb, var(--accent) 40%, transparent),
        transparent 72%
      );
    }
  }

  h1 {
    font-family: var(--display);
    font-size: var(--fs-display);
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 0.95;
  }

  /* Il taglio lascia spazio alla g: le righe salgono da sotto la loro linea. */
  .line {
    display: block;
    overflow: clip;
    padding-bottom: 0.14em;
    margin-bottom: -0.14em;
  }

  .line > span {
    display: inline-block;
  }

  .hero__accent {
    color: var(--accent);
  }

  .hero__sub {
    max-width: 36ch;
    margin: var(--s-5) 0 var(--s-6);
  }

  .hero__stage {
    display: grid;
    justify-items: center;
    margin-top: var(--s-7);
  }

  .hero__device {
    position: relative;
    width: min(64vw, 300px);
  }

  .hero__phone {
    width: 100%;
  }

  /* Copre l'angolo in basso a sinistra del telefono. */
  .hero__watch {
    position: absolute;
    left: -26%;
    bottom: 12%;
    width: 50%;
  }

  /* Desktop: tre colonne nel primo schermo. Il telefono prende l'altezza che resta (2,02 e' il
     rapporto altezza/larghezza della cornice) e il titolo si misura sulla colonna che gli resta:
     "conta." e' largo circa 2,7em, quindi colonna / 2,8. */
  @media (min-width: 1024px) {
    .hero {
      --hero-h: max(100dvh, 680px);
      --phone-w: calc((var(--hero-h) - var(--nav-h) - 2 * var(--s-6)) / 2.02);
      --col: calc((100vw - 2 * var(--gutter) - var(--phone-w) - 2 * var(--s-7)) / 2);
      grid-template-columns: minmax(0, 1fr) var(--phone-w) minmax(0, 1fr);
      grid-template-rows: auto 1fr auto auto;
      column-gap: var(--s-7);
      height: var(--hero-h);
    }

    /* Le due righe del titolo diventano celle della griglia: una in alto a sinistra, una in
       basso a destra. Resta un solo h1 per chi legge con lo screen reader; le righe ne
       ereditano il carattere anche con display: contents. */
    h1 {
      display: contents;
      font-size: min(calc(var(--col) / 2.8), 11rem);
    }

    .hero__l1 {
      grid-area: 1 / 1;
      margin-top: 5dvh;
    }

    .hero__l2 {
      grid-area: 3 / 3;
    }

    .hero__copy {
      grid-area: 4 / 3;
      padding-bottom: 5dvh;
    }

    .hero__sub {
      margin-top: var(--s-4);
    }

    .hero__stage {
      grid-area: 1 / 2 / -1 / 2;
      margin-top: 0;
    }

    .hero__device {
      width: var(--phone-w);
    }
  }

  @media (prefers-reduced-motion: no-preference) {
    .line > span {
      animation: line-up 900ms var(--ease-decel) both;
    }
    /* "conta." arriva per ultima, dopo il telefono: e' la chiusura della frase. */
    .hero__l2 > span {
      animation-delay: 520ms;
    }

    .hero__sub,
    .hero__cta {
      animation: rise var(--t-glide) var(--ease-decel) 760ms both;
    }

    .hero__phone {
      animation: phone-in 1000ms var(--ease-decel) 160ms both;
    }

    .hero__watch {
      animation: watch-in 620ms var(--ease-pop) 820ms both;
    }

    /* Scorrendo il palco sale piano: solo una trasformazione, legata allo scroll. */
    @supports (animation-timeline: scroll()) {
      .hero__stage {
        animation: stage-lift linear both;
        animation-timeline: scroll(root);
        animation-range: 0 100vh;
      }
    }
  }

  @keyframes line-up {
    from {
      translate: 0 112%;
    }
  }

  @keyframes rise {
    from {
      opacity: 0;
      translate: 0 20px;
    }
  }

  @keyframes phone-in {
    from {
      opacity: 0;
      translate: 0 96px;
    }
  }

  @keyframes watch-in {
    from {
      opacity: 0;
      scale: 0.6;
    }
  }

  @keyframes stage-lift {
    to {
      transform: translateY(-40px);
    }
  }

/* components/Intro.astro */
:root.intro-on {
    overflow: hidden;
  }

  /* L'hero aspetta dietro l'apertura: i suoi elementi partono quando il colore l'ha coperto. */
  :root.intro-on .hero * {
    animation-play-state: paused !important;
  }

.intro {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: none;
    place-items: center;
    padding: var(--gutter);
    overflow: hidden;
    background: var(--bg);
    transition: background 200ms linear;
  }

  :root.intro-on .intro,
  .intro.is-shrink {
    display: grid;
  }

  .intro.is-shrink {
    background: transparent;
    pointer-events: none;
  }

  .intro.is-shrink .intro__card {
    display: none;
  }

  .intro__card {
    width: min(100%, 680px);
    animation: intro-rise 620ms var(--ease-decel) both;
  }

  .intro__name {
    padding: 0 8px 20px;
    font-family: var(--display);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    text-wrap: balance;
  }

  .intro__row {
    grid-template-columns: 3rem 1fr 1fr 84px;
    min-height: 84px;
    border-radius: var(--r-16);
  }

  .intro__row--cols {
    min-height: 28px;
    font-size: var(--fs-xs);
  }

  .intro__row .set__n {
    font-size: 1.25rem;
  }

  .intro__row .set__val {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
  }

  .intro__check {
    width: 84px;
    height: 84px;
  }

  .intro__check .check__box {
    width: 60px;
    height: 60px;
    border-radius: var(--r-12);
    box-shadow: 0 5px 0 var(--lip);
  }

  .intro__check svg {
    width: 36px;
    height: 36px;
  }

  .intro__check[aria-pressed='true'] .check__box {
    translate: 0 5px;
    box-shadow: 0 0 0 transparent;
  }

  .intro__row.is-next .check__box::after {
    animation: invite 1400ms var(--ease-decel) infinite;
  }

  .intro__flood {
    position: absolute;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border-radius: 50%;
    background: var(--accent);
    scale: 0;
    transition:
      scale 600ms cubic-bezier(0.45, 0, 0.2, 1),
      translate 600ms cubic-bezier(0.45, 0, 0.2, 1),
      opacity 600ms ease-in;
  }

  .intro.is-flood .intro__flood {
    scale: var(--s);
  }

  .intro.is-shrink .intro__flood {
    opacity: 0;
    transition-duration: 760ms;
    transition-timing-function: cubic-bezier(0.05, 0.7, 0.1, 1);
  }

  @keyframes intro-rise {
    from {
      opacity: 0;
      translate: 0 24px;
    }
  }

/* components/MuscleMap.astro */
.map-dot {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 20;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent);
    pointer-events: none;
    will-change: transform;
  }

.map {
    padding: var(--section-y) var(--gutter) var(--s-7);
    --skin: #8a8a92;
    --hair: #6a6a72;
    --rest: #3a3a41;
  }

  :root[data-mode='light'] .map {
    --skin: #9e9ea7;
    --hair: #85858e;
    --rest: #dadadf;
  }

  .map__head {
    max-width: 44rem;
    margin-bottom: var(--s-6);
  }

  .map__head .lead {
    max-width: 52ch;
  }

  /* Telefono: figure ferme in alto, schede che scorrono sotto. */
  .map__body {
    display: grid;
  }

  .map__stage {
    position: sticky;
    top: var(--nav-h);
    z-index: 1;
    order: -1;
    padding: 10px 0;
    background: var(--bg);
  }

  /* Su telefono le schede scorrono sotto le figure: il bordo sfuma invece di tagliarle. */
  .map__stage::after {
    content: '';
    position: absolute;
    inset: 100% 0 auto;
    height: var(--s-5);
    background: linear-gradient(var(--bg), transparent);
    pointer-events: none;
  }

  .map__figures {
    display: flex;
    justify-content: center;
    gap: 4%;
    height: 27dvh;
  }

  .map__figures > .figure {
    height: 100%;
    aspect-ratio: 436 / 1217;
  }

  .map__figures path[data-m] {
    transform-box: fill-box;
    transform-origin: center;
    transition: fill var(--t-slow) var(--ease-decel);
  }

  /* A lato delle figure: sotto non resterebbe spazio per la scheda. */
  .map__side {
    position: absolute;
    top: 50%;
    right: 0;
    translate: 0 -50%;
  }

  .map__totals-title,
  .map__totals,
  .map__sample {
    display: none;
  }

  /* Le stesse chip della classifica (Leaderboard), con la linguetta sotto quella scelta. */
  .map__sex {
    display: inline-grid;
    gap: var(--s-1);
    padding: var(--s-1);
    border-radius: var(--r-16);
    background: var(--surface);
  }

  .map__sex button {
    min-width: 60px;
    min-height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: var(--r-12);
    background: transparent;
    color: var(--muted);
    font: 700 var(--fs-sm) var(--display);
    cursor: pointer;
    transition:
      background var(--t-medium) var(--ease-decel),
      color var(--t-medium) var(--ease-decel);
  }

  .map__sex button:hover {
    color: var(--text);
  }

  .map__sex button[aria-pressed='true'] {
    background: var(--accent);
    box-shadow: 0 3px 0 var(--accent-lip);
    color: var(--on-accent);
  }

  .map__steps {
    padding-top: 16px;
  }

  .map__step {
    padding: 8px 0;
  }

  /* La scheda dell'app. Spente quelle lontane: guida l'occhio, ma restano toccabili. */
  .card {
    padding: 16px 12px 14px;
    border-radius: var(--r-16);
    background: var(--surface);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--text) 6%, transparent),
      0 24px 48px rgb(0 0 0 / 0.32);
    opacity: 0.5;
    scale: 0.98;
    transition:
      opacity var(--t-medium) var(--ease-decel),
      scale var(--t-slow) var(--ease-decel),
      box-shadow var(--t-slow) var(--ease-decel);
  }

  .is-active .card {
    opacity: 1;
    scale: 1;
  }

  .card.is-complete {
    box-shadow:
      inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent),
      0 24px 48px color-mix(in srgb, var(--accent) 14%, rgb(0 0 0 / 0.4));
  }

  .card__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px 10px;
  }

  h3 {
    font-family: var(--display);
    font-size: var(--fs-lg);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    text-wrap: balance;
  }

  .card__count {
    display: inline-flex;
    align-items: center;
    flex: none;
    gap: 4px;
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 600;
    transition: color var(--t-medium) var(--ease-decel);
  }

  .card__count b {
    display: inline-block;
    color: var(--text);
  }

  .is-complete .card__count,
  .is-complete .card__count b {
    color: var(--accent);
  }

  .card__tick {
    width: 0;
    height: 18px;
    opacity: 0;
    scale: 0.4;
    fill: none;
    stroke: var(--accent);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition:
      width var(--t-medium) var(--ease-decel),
      opacity var(--t-medium) var(--ease-decel),
      scale var(--t-slow) var(--ease-pop);
  }

  .is-complete .card__tick {
    width: 18px;
    opacity: 1;
    scale: 1;
  }

  .card__adds {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
    padding-inline: 4px;
  }

  .card__adds li {
    padding: 5px 10px;
    border-radius: var(--r-pill);
    background: var(--high);
    color: var(--muted);
    font-size: var(--fs-xs);
    transition:
      background var(--t-medium) var(--ease-decel),
      color var(--t-medium) var(--ease-decel);
  }

  .card__adds li.is-on {
    background: color-mix(in srgb, var(--accent) 18%, var(--high));
    color: var(--text);
  }

  .card__adds b {
    display: inline-block;
    margin-left: 3px;
    font-family: var(--display);
  }

  .card__adds .is-on b {
    color: var(--accent);
  }

  @media (min-width: 1024px) {
    .map__body {
      grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
      gap: 56px;
    }

    .map__stage {
      top: var(--nav-h);
      order: 0;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 11rem;
      align-items: center;
      gap: 32px;
      height: calc(100dvh - var(--nav-h));
      padding: 24px 0;
      background: transparent;
    }

    .map__stage::after {
      content: none;
    }

    /* Le figure si misurano sull'altezza, ma mai piu' larghe della loro colonna: senza questo
       tetto uscivano di lato e finivano sotto l'elenco delle serie. */
    .map__figures {
      container-type: size;
      align-items: center;
      height: 100%;
      min-height: 0;
    }

    .map__figures > .figure {
      height: min(100cqh, 48cqw * 1217 / 436);
    }

    .map__side {
      position: static;
      translate: none;
      display: block;
    }

    .map__totals-title,
    .map__sample {
      display: block;
      color: var(--muted);
      font-size: var(--fs-xs);
    }

    .map__totals {
      display: grid;
      gap: 6px;
      min-height: 19rem;
      align-content: start;
      margin: 12px 0;
    }

    .map__totals li {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 12px;
    }

    .map__totals li[hidden] {
      display: none;
    }

    .map__totals b {
      display: inline-block;
      font-family: var(--display);
      font-size: var(--fs-lg);
      font-weight: 800;
      letter-spacing: -0.02em;
    }

    .map__sex {
      display: inline-flex;
      margin-top: 20px;
    }

    .map__sex button {
      min-width: 72px;
      padding: 0 16px;
    }

    .map__steps {
      padding: 14vh 0 26vh;
    }

    .map__step {
      display: flex;
      align-items: center;
      min-height: 62vh;
      padding: 0;
    }

    .map__step .card {
      width: 100%;
      padding: 20px 16px 16px;
    }
  }

/* components/Leaderboard.astro */
/* Telefono: titolo, classifica, regole. Desktop: titolo e regole a sinistra, classifica a
     destra, cosi' la meta' destra della sezione non resta vuota. */
  .friends {
    display: grid;
    grid-template-areas: 'head' 'board' 'rules';
    justify-items: start;
    padding: var(--section-y) var(--gutter);
  }

  .friends__head {
    grid-area: head;
    margin-bottom: var(--s-6);
  }

  .friends__board {
    grid-area: board;
    display: grid;
    justify-items: start;
    width: 100%;
  }

  .rules {
    grid-area: rules;
  }

  @media (min-width: 1024px) {
    .friends {
      grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
      grid-template-areas: 'head board' 'rules board';
      grid-template-rows: auto 1fr;
      column-gap: var(--s-7);
    }

    .friends__board {
      align-self: center;
      justify-items: center;
    }

    .rules {
      align-self: end;
      gap: var(--s-5);
    }
  }

  /* Su una riga sola che scorre, come i chip dell'app. */
  .chips {
    display: flex;
    gap: var(--s-1);
    min-width: 0;
    max-width: 100%;
    margin: 0 0 var(--s-6);
    padding: var(--s-1);
    overflow-x: auto;
    border: 0;
    border-radius: var(--r-16);
    background: var(--surface);
    scrollbar-width: none;
    /* Quando le chip non ci stanno, l'ultima sfuma: si capisce che la riga scorre. La maschera
       e' piu' larga della riga di 48 px e scorrendo si sposta, cosi' in fondo la sfumatura esce. */
    mask: linear-gradient(to right, #000 calc(100% - var(--s-7)), transparent) 100% 0 / calc(100% + var(--s-7)) 100%
      no-repeat;
  }

  @supports (animation-timeline: scroll()) {
    .chips {
      animation: chips-fade linear both;
      animation-timeline: scroll(self inline);
    }
  }

  @keyframes chips-fade {
    to {
      mask-position: 0 0;
    }
  }

  /* Su desktop ci stanno tutte: niente sfumatura. */
  @media (min-width: 480px) {
    .chips {
      mask: none;
      animation: none;
    }
  }

  /* Su schermi stretti le chips si riducono quanto basta per restare su una sola riga. */
  @media (max-width: 767px) {
    .chips {
      gap: 2px;
      overflow: hidden;
      mask: none;
      animation: none;
    }

    .chips .chip {
      flex: 0 1 auto;
      min-width: max-content;
      justify-content: center;
      padding-inline: 8px;
      font-size: var(--fs-xs);
    }
  }

  .chip {
    position: relative;
    display: inline-flex;
    flex: none;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--s-4);
    border-radius: var(--r-12);
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition:
      background var(--t-medium) var(--ease-decel),
      color var(--t-medium) var(--ease-decel);
  }

  .chip:hover {
    color: var(--text);
  }

  .chip:has(:checked) {
    background: var(--accent);
    box-shadow: 0 3px 0 var(--accent-lip);
    color: var(--on-accent);
  }

  .chip:has(:focus-visible) {
    outline: 2px solid var(--text);
    outline-offset: 2px;
  }

  .chip input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
  }

  /* I posti sono fissi: chi cambia rango scivola verso il suo. */
  .podium {
    position: relative;
    width: min(100%, 720px);
    height: clamp(300px, 44vh, 400px);
  }

  .person {
    --slot: 1;
    --height: 0%;
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 33.333%;
    height: 100%;
    padding-inline: 4px;
    translate: calc(var(--slot) * 100%) 0;
    transition:
      translate var(--t-slow) var(--ease-decel),
      opacity var(--t-medium) var(--ease-decel);
  }

  .person[data-rank='1'] {
    --slot: 1;
    --height: 54%;
    --block: var(--gold);
  }
  .person[data-rank='2'] {
    --slot: 0;
    --height: 38%;
    --block: var(--silver);
  }
  .person[data-rank='3'] {
    --slot: 2;
    --height: 26%;
    --block: var(--bronze);
  }
  .person[data-rank='4'] {
    --slot: 1;
    --block: var(--silver);
    opacity: 0;
    pointer-events: none;
  }

  .person__avatar {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 24%, var(--surface));
    color: var(--accent);
    font-family: var(--display);
    font-size: var(--fs-sm);
    font-weight: 800;
  }

  .person--me .person__avatar {
    background: var(--accent);
    color: var(--on-accent);
  }

  .person__name {
    font-weight: 700;
  }

  .person--me .person__name {
    color: var(--accent);
  }

  .person__value {
    margin-bottom: 10px;
    color: var(--muted);
    font-family: var(--display);
    font-size: var(--fs-lg);
    font-weight: 800;
    white-space: nowrap;
  }

  .person__block {
    display: flex;
    justify-content: center;
    width: 100%;
    height: var(--height);
    padding-top: 10px;
    overflow: hidden;
    border-radius: var(--r-16);
    background: var(--block);
    box-shadow: inset 0 -8px 0 rgb(0 0 0 / 0.16);
    color: var(--on-accent);
    font-family: var(--display);
    font-size: var(--fs-stat);
    line-height: 1;
    transition:
      height var(--t-slow) var(--ease-decel),
      background var(--t-medium) var(--ease-decel);
  }

  .is-waiting .person__block {
    height: 0;
    padding-top: 0;
  }

  .is-waiting .person__avatar,
  .is-waiting .person__name,
  .is-waiting .person__value {
    opacity: 0;
  }

  .person__avatar,
  .person__name,
  .person__value {
    transition: opacity var(--t-slow) var(--ease-decel) 200ms;
  }

  .fourth {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    width: min(100%, 720px);
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--r-12);
    background: var(--surface);
    font-weight: 700;
    text-align: left;
  }

  .fourth b,
  .fourth__value {
    font-family: var(--display);
    font-weight: 800;
  }

  .fourth b {
    color: var(--muted);
  }

  .friends__sample {
    width: min(100%, 720px);
    margin-top: var(--s-3);
    text-align: center;
    color: var(--muted);
    font-size: var(--fs-xs);
  }

  .rules {
    display: grid;
    gap: var(--s-5);
    width: 100%;
    margin-top: var(--s-7);
  }

  .rules li {
    display: grid;
    /* Colonna larga quanto "+10" alla misura dei numeri, cosi' i testi restano allineati. */
    grid-template-columns: calc(var(--fs-stat) * 1.9) 1fr;
    align-items: center;
    gap: 12px;
  }

  .rules b {
    color: var(--accent);
    font-family: var(--display);
    font-size: var(--fs-stat);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1;
  }

  .rules span {
    color: var(--text-2);
    text-wrap: balance;
  }

  /* Tre regole in fila solo su tablet: su desktop stanno impilate sotto il titolo. */
  @media (min-width: 768px) and (max-width: 1023px) {
    .rules {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: var(--s-6);
    }

    .rules li {
      grid-template-columns: 1fr;
    }
  }

/* components/ThemePicker.astro */
.theme {
    position: relative;
    isolation: isolate;
    /* Solo in larghezza: in altezza l'ombra del telefono deve poter sfumare oltre il bordo,
       altrimenti la sezione la taglia con una riga dritta. */
    overflow-x: clip;
    display: grid;
    gap: var(--s-7);
    padding: var(--section-y) var(--gutter);
  }

  .theme::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    /* Sfuma sopra e sotto, cosi' la sezione non ha bordi netti. */
    mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
    background: radial-gradient(
      circle 90vmax at 76% 50%,
      color-mix(in srgb, var(--accent) 28%, var(--bg)),
      var(--bg) 85%
    );
  }

  .theme__try {
    margin-bottom: var(--s-6);
  }

  /* Il selettore: i cinque nomi uno sotto l'altro, grandi. Quello scelto prende il suo colore e
     il suo pallino si allarga; gli altri restano spenti finche' non ci si passa sopra. */
  .options {
    display: grid;
    width: fit-content;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .option {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--s-4);
    min-height: 48px;
    padding-block: var(--s-1);
    color: color-mix(in srgb, var(--text) 32%, transparent);
    font-family: var(--display);
    font-size: var(--fs-stat);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    cursor: pointer;
    transition: color var(--t-medium) var(--ease-decel);
  }

  .option input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
  }

  .option__dot {
    flex: none;
    width: 0.28em;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--c);
    transition: scale var(--t-medium) var(--ease-pop);
  }

  .option:hover {
    color: var(--text);
  }

  .option:has(:checked) {
    color: var(--c);
  }

  .option:has(:checked) .option__dot {
    scale: 1.6;
  }

  .option:has(:focus-visible) .option__name {
    outline: 2px solid var(--text);
    outline-offset: 4px;
    border-radius: var(--r-8);
  }

  /* Fondo scuro o chiaro: le stesse chip della classifica (Leaderboard), con la linguetta
     sotto quella scelta. */
  .mode {
    display: inline-flex;
    gap: var(--s-1);
    margin-top: var(--s-5);
    padding: var(--s-1);
    border-radius: var(--r-16);
    background: var(--surface);
  }

  .mode[hidden] {
    display: none;
  }

  .mode button {
    min-width: 72px;
    min-height: 44px;
    padding: 0 var(--s-4);
    border: 0;
    border-radius: var(--r-12);
    background: transparent;
    color: var(--muted);
    font: 700 var(--fs-sm) var(--display);
    cursor: pointer;
    transition:
      background var(--t-medium) var(--ease-decel),
      color var(--t-medium) var(--ease-decel);
  }

  .mode button:hover {
    color: var(--text);
  }

  .mode button[aria-pressed='true'] {
    background: var(--accent);
    box-shadow: 0 3px 0 var(--accent-lip);
    color: var(--on-accent);
  }

  .theme__phone {
    justify-self: center;
    width: min(62vw, 320px);
  }

  @media (min-width: 1024px) {
    .theme {
      grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
      align-items: center;
      gap: var(--s-7);
      min-height: 100dvh;
    }

    .theme__phone {
      width: min(100%, 340px);
    }
  }

/* components/Waitlist.astro */
.waitlist {
    display: grid;
    gap: var(--s-2);
    width: min(100%, 30rem);
  }

  .waitlist__label {
    color: var(--muted);
    font-size: var(--fs-sm);
    font-weight: 600;
  }

  /* Campo e tasto in una pillola sola: il tasto sta dentro il bordo del campo. */
  .waitlist__row {
    display: flex;
    gap: var(--s-1);
    padding: var(--s-1);
    border: 1px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--surface);
    transition: border-color var(--t-fast) var(--ease-decel);
  }

  .waitlist__row:focus-within {
    border-color: var(--accent);
  }

  .waitlist__input {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 var(--s-4);
    border: 0;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--fs-md);
  }

  .waitlist__input::placeholder {
    color: var(--muted);
  }

  .waitlist__input:focus {
    outline: none;
  }

  .waitlist__send {
    min-height: 48px;
    padding: 0 var(--s-5);
    border: 0;
    box-shadow: none;
  }

  .waitlist__send:disabled {
    cursor: progress;
    opacity: 0.7;
  }

  .waitlist__status {
    min-height: 1.5em;
    color: var(--muted);
    font-size: var(--fs-sm);
  }

  .waitlist__status[data-kind='ok'] {
    color: var(--accent);
  }

  .waitlist__status[data-kind='error'] {
    color: var(--text);
  }

  /* Su telefono stretto il tasto va sotto il campo, a tutta larghezza. */
  @media (max-width: 479px) {
    .waitlist__row {
      flex-direction: column;
      border-radius: var(--r-16);
    }

    .waitlist__send {
      width: 100%;
    }
  }

/* Prima riga dei titoli a due righe: testo normale, la seconda e' in accento. */
h2 .plain {
  display: inline;
  color: inherit;
}

h2 .plain::after {
  content: ' ';
}

/* Barra: a destra lingua e tasto. */
.nav__right {
  display: flex;
  align-items: center;
  gap: var(--s-2);
}

.lang {
  min-width: 48px;
  min-height: 44px;
  padding: 0 var(--s-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font: 700 var(--fs-sm) var(--display);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: color var(--t-medium) var(--ease-decel);
}

.lang:hover {
  color: var(--text);
}

/* "counts." e' piu' largo di "conta.": il titolo si misura su 3,4em invece di 2,8em. */
@media (min-width: 1024px) {
  :root[lang='en'] h1 {
    font-size: min(calc(var(--col) / 3.4), 11rem);
  }
}

/* ---------- Privacy e cookie (privacy.html) ---------- */
/* Stessa pagina scura, stesso bagliore dell'accento in alto: un testo da leggere, colonna stretta. */
.legal {
  position: relative;
  isolation: isolate;
  padding: calc(var(--nav-h) + var(--s-7)) var(--gutter) var(--section-y);
}

.legal::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 70vh;
  z-index: -1;
  mask-image: linear-gradient(to bottom, #000 40%, transparent);
  background: radial-gradient(ellipse 60% 70% at 20% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 72%);
}

.legal__body {
  max-width: 68ch;
}

.legal h1 {
  font-size: var(--fs-h2);
  line-height: 0.95;
  margin-bottom: var(--s-4);
}

.legal h1 span {
  color: var(--accent);
}

.legal__date {
  color: var(--muted);
  font-size: var(--fs-xs);
}

.legal__lead {
  margin-top: var(--s-5);
  color: var(--text-2);
  font-size: var(--fs-body);
  line-height: 1.5;
}

.legal h2 {
  margin: var(--s-7) 0 var(--s-3);
  font-family: var(--display);
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.legal p,
.legal li {
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.6;
}

.legal p + p,
.legal ul {
  margin-top: var(--s-3);
}

.legal ul {
  padding-left: 1.2em;
}

.legal li + li {
  margin-top: var(--s-2);
}

.legal li::marker {
  color: var(--accent);
}

.legal strong {
  color: var(--text);
  font-weight: 700;
}

.legal a {
  color: var(--accent);
  text-underline-offset: 3px;
}

/* Le voci salvate nel browser: una scheda come quelle dell'app. */
.legal__table {
  width: 100%;
  margin-top: var(--s-4);
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: var(--r-16);
  background: var(--surface);
  font-size: var(--fs-sm);
}

.legal__table th,
.legal__table td {
  padding: var(--s-3) var(--s-4);
  text-align: left;
  vertical-align: top;
  color: var(--text-2);
}

.legal__table th {
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.legal__table tr + tr td {
  border-top: 1px solid var(--line);
}

.legal__table code {
  color: var(--accent);
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
}

/* Su telefono la tabella diventa una scheda per voce. */
@media (max-width: 559px) {
  .legal__table thead {
    display: none;
  }

  .legal__table tr {
    display: grid;
    padding: var(--s-2) 0;
  }

  .legal__table td {
    padding: var(--s-1) var(--s-4);
  }

  .legal__table tr + tr td {
    border-top: 0;
  }

  .legal__table tr + tr {
    border-top: 1px solid var(--line);
  }
}

/* Il link alla privacy nel piede di pagina e la nota sotto il modulo della lista d'attesa. */
.foot__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: var(--s-4);
}

.foot__links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: var(--fs-xs);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-decel);
}

.foot__links a:hover,
.foot__links a:focus-visible {
  color: var(--text);
}

.waitlist__note {
  margin-top: var(--s-3);
  color: var(--muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.waitlist__note a {
  color: var(--text-2);
  text-underline-offset: 3px;
}

.waitlist__note a:hover {
  color: var(--accent);
}

/* Su telefono logo e social restano in riga, privacy e copyright scendono sotto. */
@media (max-width: 559px) {
  .foot {
    flex-wrap: wrap;
    row-gap: 0;
  }

  .foot__links {
    width: 100%;
    justify-content: space-between;
  }
}

/* Nelle pagine legali il logo del piede e' un link alla home: senza sottolineatura, come in barra. */
.foot a.logo {
  text-decoration: none;
}
