/* ==========================================================================
   tomthesign.com: stile condiviso (dark, branding Instagram @tom_thesign)
   Font ospitati sul sito (nessuna richiesta a terzi al caricamento).
   ========================================================================== */

/* ---------- Font, self-hosted --------------------------------------------- */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/assets/fonts/inter-tight-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/assets/fonts/inter-tight-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('/assets/fonts/inter-tight-800.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono-500.woff2') format('woff2');
}

/* ---------- Token --------------------------------------------------------- */
:root {
  --bg: #0b0b0b;
  --fg: #f3f1ec;
  --accent: #c9f31d;
  --beige: #e8dfd0;
  --muted: #a39e95;
  --line: #242320;
  --maxw: 1280px;

  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- Reset / base --------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color-scheme: dark;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* clip, non hidden: hidden farebbe del body un contenitore di scroll e
     l'header sticky non resterebbe piu' attaccato in alto. */
  overflow-x: clip;
}

@media (min-width: 720px) {
  body { font-size: 18px; }
}

img, video { max-width: 100%; display: block; }

a { color: inherit; }

ul { list-style: none; }

button {
  font-family: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Layout ---------------------------------------------------------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 720px) {
  .wrap { padding: 0 32px; }
}

.section {
  padding: 56px 0;
}

@media (min-width: 720px) {
  .section { padding: 96px 0; }
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* ---------- Separatore tipografico ------------------------------------------ */
.sep {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: var(--line);
  vertical-align: middle;
  margin: 0 16px;
}

/* ---------- Bottoni ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  color: var(--fg);
  background: transparent;
  border: 1px solid var(--fg);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn:hover,
.btn:focus-visible {
  background: var(--fg);
  color: var(--bg);
}

.btn--accent {
  background: var(--accent);
  color: #0b0b0b;
  border-color: var(--accent);
  transform: rotate(-1.5deg);
  transition: background-color .2s ease, border-color .2s ease, transform .25s ease;
}

.btn--accent:hover,
.btn--accent:focus-visible {
  background: #d9ff54;
  border-color: #d9ff54;
  color: #0b0b0b;
  transform: rotate(0deg);
}

/* ---------- Card --------------------------------------------------------------- */
.card {
  background: #141412;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 28px;
}

/* ---------- Etichetta "AI generated" -------------------------------------------
   Il contenitore della foto/video (es. .card__media) va messo in
   position: relative; .ai-label si posiziona sopra, in basso a destra. */
.ai-label {
  position: absolute;
  right: 12px;
  bottom: 10px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

/* ---------- Header / nav --------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex: none;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
  flex: none;
  /* Sopra il pannello aperto (.primary-nav, z-index 95, fixed): senza, il
     pannello copre il bottone e il menu aperto non si chiude piu'. */
  position: relative;
  z-index: 96;
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--fg);
  transition: transform .25s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile e tablet: pannello a scomparsa (sotto i 1024px: con Brand & Retail
   fra le voci, il menu su una riga non ci sta più, Tom 30/10) */
.primary-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(86vw, 360px);
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
  padding: 96px 28px 40px;
  transform: translateX(100%);
  /* Chiuso: anche invisibile, cosi' i link non si raggiungono col Tab e i
     lettori di schermo non li leggono. La visibilita' cambia dopo la fine
     dello slide in uscita (ritardo .3s), subito in apertura. */
  visibility: hidden;
  transition: transform .3s ease, visibility 0s linear .3s;
  z-index: 95;
}

.primary-nav.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .3s ease, visibility 0s linear 0s;
}

.primary-nav__links {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.primary-nav__links a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  text-decoration: none;
  color: var(--fg);
}

.primary-nav__links a:hover,
.primary-nav__links a:focus-visible {
  color: var(--accent);
}

.primary-nav__extra {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}

.nav-retail {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
}

.nav-retail:hover,
.nav-retail:focus-visible {
  color: var(--fg);
}

.primary-nav__extra .btn--accent {
  width: 100%;
}

body.nav-locked {
  overflow: hidden;
}

@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .primary-nav {
    position: static;
    width: auto;
    height: auto;
    background: none;
    border-left: none;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 40px;
    padding: 0;
    margin-left: auto;
    transform: none;
    visibility: visible;
    transition: none;
  }

  .primary-nav__links {
    flex-direction: row;
    gap: 28px;
  }

  .primary-nav__links a,
  .primary-nav__extra a { white-space: nowrap; }

  .primary-nav__links a {
    font-size: 15px;
    font-weight: 500;
  }

  .primary-nav__extra {
    flex-direction: row;
    align-items: center;
    gap: 24px;
  }

  .primary-nav__extra .btn--accent {
    width: auto;
  }
}

/* ---------- Footer ---------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px 24px;
  font-size: 14px;
  color: var(--muted);
}

.footer-col {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.footer-col a {
  text-decoration: none;
  color: var(--muted);
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--fg);
}

.footer-email {
  color: var(--fg);
}

.footer-col--links {
  gap: 20px;
}

@media (max-width: 479px) {
  .footer-grid {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-col--contact .sep {
    display: none;
  }
  .footer-col--contact {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ---------- Home: hero col reel ------------------------------------------
   Telefono: video 16:9 a tutta larghezza in cima, frase e bottone sotto.
   Da 900px: video a tutto schermo nell'hero, frase e bottone sovrapposti
   in basso a sinistra su un gradiente scuro. */
.hero {
  position: relative;
}

.hero__media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Ancorato in basso a destra: qualunque taglio fatto da `cover` toglie
     solo da sinistra e/o dall'alto, mai dall'angolo in basso a destra, dove
     il video sorgente porta incisa la scritta "AI generated" (obbligo di
     legge, deve restare sempre visibile). */
  object-position: right bottom;
}

.hero__video[hidden] {
  display: none;
}

.hero__gradient {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}

.hero__play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(11, 11, 11, 0.72);
  border: 1px solid var(--fg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero__play[hidden] {
  display: none;
}

.hero__play::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--fg);
}

/* Pausa / riproduci del reel: sempre visibile, in alto a destra (in basso a
   destra c'e' la scritta "AI generated"). Solo un simbolo disegnato in CSS,
   il nome per i lettori di schermo e' nell'aria-label. .is-paused mostra il
   triangolo "riproduci", altrimenti le due barre "pausa". */
.hero__pausa {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(11, 11, 11, 0.6);
  border: 1px solid rgba(243, 241, 236, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero__pausa::before {
  content: '';
  display: block;
  width: 10px;
  height: 14px;
  border-left: 3px solid var(--fg);
  border-right: 3px solid var(--fg);
}

.hero__pausa.is-paused::before {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-style: solid;
  border-width: 7px 0 7px 11px;
  border-color: transparent transparent transparent var(--fg);
}

.hero__content {
  position: relative;
  z-index: 3;
  padding: 32px 0 0;
}

.hero__phrase {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
}

.hero__audio-toggle {
  background: transparent;
}

@media (min-width: 900px) {
  .hero {
    min-height: 620px;
  }

  .hero__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
  }

  .hero__gradient {
    opacity: 1;
    /* Ancorato all'angolo in basso a sinistra (dove sta la frase): schiarisce
       rapidamente verso destra e verso l'alto, cosi' l'angolo opposto, in
       basso a destra, dove il video porta la scritta "AI generated" incisa,
       resta sempre leggibile (mai lavato dal nero). */
    background: radial-gradient(
      140% 160% at 0% 100%,
      rgba(11, 11, 11, 0.95) 0%,
      rgba(11, 11, 11, 0.55) 32%,
      rgba(11, 11, 11, 0) 62%
    );
  }

  .hero__content {
    position: absolute;
    inset: auto 0 0 0;
    padding: 0 0 56px;
  }

  /* Da qui il reel copre tutto l'hero, quasi o del tutto alla sua scala: la
     scritta "AI generated" incisa nel video si legge da sola, e quella in
     HTML le finirebbe sopra (due scritte sovrapposte). Sotto i 900px il
     video e' piccolo, l'incisa non si legge, e vale quella in HTML. */
  .hero__media > .ai-label {
    display: none;
  }

  .hero__phrase {
    font-size: 40px;
    color: var(--fg);
  }
}

/* ---------- Riquadri con spaziatura verticale (servizi, lavori, passi) ---- */
.card--stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card--stack h3 {
  font-size: 20px;
}

.card--stack p {
  color: var(--muted);
  font-size: 15px;
}

.service-tile {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease;
}

.service-tile:hover,
.service-tile:focus-visible {
  border-color: var(--accent);
}

.service-tile__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 2px;
  background: var(--line);
}

.service-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.work-card {
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease;
}

.work-card:hover,
.work-card:focus-visible {
  border-color: var(--accent);
}

.work-card__media {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}

.work-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.step-card__number {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

/* ---------- Chi sono ------------------------------------------------------ */
.about-grid {
  display: grid;
  gap: 28px;
}

.about-grid__photo {
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}

.about-grid__photo img {
  width: 100%;
  display: block;
}

@media (min-width: 720px) {
  .about-grid {
    grid-template-columns: minmax(220px, 320px) 1fr;
    align-items: center;
    gap: 48px;
  }
}

/* ---------- Call -------------------------------------------------------- */
.call-block {
  text-align: center;
}

.call-block .btn {
  margin-top: 28px;
}

/* ---------- Esempio (pagine dei servizi) -----------------------------------
   Figura con l'immagine di un lavoro vero e la sua didascalia. L'aspect-ratio
   si imposta inline per figura (le immagini non condividono proporzioni). */
.example-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.example-figure {
  display: flex;
  flex-direction: column;
  gap: 12px;
  /* Un esempio da solo non deve allargarsi a tutta la pagina (un verticale
     arriverebbe a oltre 2000px di altezza su desktop): stesso limite di
     .lavoro-video, allineato a sinistra come il testo della sezione. */
  max-width: 420px;
}

.example-figure--wide {
  max-width: 720px;
}

.example-figure__media {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
}

.example-figure__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.example-figure a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.example-figure a .example-figure__media {
  transition: outline-color .2s ease;
  outline: 1px solid transparent;
  outline-offset: 2px;
}

.example-figure a:hover .example-figure__media,
.example-figure a:focus-visible .example-figure__media {
  outline-color: var(--accent);
}

.example-figure figcaption {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- Lavori (pagina di un singolo lavoro) ---------------------------
   .lavoro-video è il contenitore del <video> quando il pezzo è un video;
   l'aspect-ratio si imposta inline per pagina (verticale o orizzontale). Le
   gallery di immagini (BATA, carosello Baoly) riusano .example-grid /
   .example-figure già definiti sopra. */
.lavoro-video {
  position: relative;
  border-radius: 2px;
  overflow: hidden;
  background: var(--line);
  max-width: 420px;
  margin: 0 auto;
}

.lavoro-video--wide {
  max-width: 720px;
}

.lavoro-video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lavoro-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

/* ---------- Finestra "Prenota una call" -------------------------------------
   Costruita da sito.js al primo clic su .cta-call, mai presente nell'HTML:
   niente da nascondere qui finche' il JS non la crea. body.cal-locked blocca
   lo scroll, sullo stesso principio di body.nav-locked sopra. */
body.cal-locked {
  overflow: hidden;
}

.cal-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cal-modal[hidden] {
  display: none;
}

.cal-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 11, 11, 0.85);
}

.cal-modal__panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  height: min(90vh, 760px);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}

.cal-modal__close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  color: var(--fg);
  cursor: pointer;
}

.cal-modal__close:hover,
.cal-modal__close:focus-visible {
  color: var(--accent);
  border-color: var(--accent);
}

/* Cal.com allunga l'iframe quanto il suo contenuto: se supera la finestra
   si scorre qui dentro, perché la pagina sotto è bloccata (Tom, 1/11). */
.cal-modal__embed {
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Link diretto a Cal.com sotto l'embed, sempre presente: se l'embed non
   arriva (script bloccato, rete lenta) si prenota comunque da li'. */
.cal-modal__fallback {
  flex: none;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cal-modal__fallback:hover,
.cal-modal__fallback:focus-visible {
  color: var(--accent);
}

/* L'embed di Cal.com crea da solo un <iframe> qui dentro: deve riempire il
   contenitore, Cal.com non lo fa da solo su ogni sito che lo ospita. */
.cal-modal__embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Instagram (griglia servita dal sito, mai da instagram.com) -----
   Sempre 3 colonne quadrate, anche a 375px: a differenza di .example-grid
   qui non si vuole un numero di colonne che cambia con la larghezza. */
.instagram-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.instagram-grid__item {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--line);
  outline: 1px solid transparent;
  outline-offset: 2px;
  transition: outline-color .2s ease;
}

.instagram-grid__item:hover,
.instagram-grid__item:focus-visible {
  outline-color: var(--accent);
}

.instagram-grid__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Pagina legale (/privacy) -----------------------------------------
   Testo lungo da leggere su scuro, anche da telefono: colonna stretta,
   paragrafi ariosi, elenchi con il punto, link sottolineati. */
.legal .wrap {
  max-width: 760px;
}

.legal h1 {
  font-size: 40px;
  margin-bottom: 8px;
}

.legal h2 {
  font-size: 22px;
  margin: 48px 0 12px;
}

.legal p,
.legal ul,
.legal dl {
  margin-bottom: 16px;
}

.legal ul {
  list-style: disc;
  padding-left: 22px;
}

.legal li + li {
  margin-top: 8px;
}

.legal a {
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.legal a:hover,
.legal a:focus-visible {
  color: var(--accent);
}

.legal__date {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}

.legal__facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px 24px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.legal__facts dt {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-top: 10px;
}

.legal__facts dt:first-child {
  margin-top: 0;
}

@media (min-width: 720px) {
  .legal h1 { font-size: 56px; }

  .legal__facts {
    grid-template-columns: max-content 1fr;
    align-items: baseline;
  }

  .legal__facts dt {
    margin-top: 0;
  }
}

/* ---------- Lista dei sistemi ---------------------------------------------- */
.gruppo-sistemi { margin-top: 2rem; }
.gruppo-sistemi h3 { color: var(--accent); }
.lista-sistemi {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.sistema { background: var(--bg); padding: 1.25rem; }
.sistema h4 { margin: 0 0 .4rem; font-family: var(--font-display); font-size: 1.15rem; }
.sistema p { margin: 0; color: var(--muted); }
.sistema .tags { margin-top: .75rem; display: flex; flex-wrap: wrap; gap: .4rem; }
/* Come le etichette della home: verde pieno, testo nero (Tom, 30/10). */
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #0b0b0b;
  background: var(--accent);
  padding: 6px 9px 5px;
}
@media (min-width: 720px) {
  .lista-sistemi { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1080px) {
  .lista-sistemi { grid-template-columns: repeat(3, 1fr); }
}
#cosa-si-automatizza .gruppo-sistemi + p { margin-top: 2rem; }
#indipendenti h2 + p { margin-bottom: 1.5rem; }

/* Riquadro vuoto al posto di un'immagine ancora da fare: la sua aria-label
   tra parentesi quadre fa bloccare l'uscita dalla verifica. */
.segnaposto-immagine {
  aspect-ratio: 4 / 5;
  background: var(--antracite-2, #1a1a1a);
}

/* /sistemi: usa le classi di /siti (siti.css), con poche aggiunte sotto .sis. */
.sis .sis-segnaposto { width: 100%; }
.sis .af-sezione h2 + p { margin-top: 16px; }
/* I sistemi in riquadri staccati e stondati, come i riquadri di /siti. */
.sis .lista-sistemi { gap: 12px; background: none; border: 0; }
.sis .sistema {
  background: var(--antracite-2, #141414);
  border: 1px solid var(--linea-v2);
  border-radius: 14px;
  padding: 22px;
}
.sis #domande h2 { margin-bottom: 28px; }
.sis .si-modi .si-prezzo__voce { color: var(--accent); }
.sis .sis-affiancamento { margin-top: 16px; color: var(--tenue); }
.sis .sis-affiancamento a { color: var(--testo); text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* La riga sotto gli esempi: mono e verde acido come le etichette dei modi. */
.sis .sis-su-misura { margin-top: 32px; font-family: var(--font-mono); font-size: 15px; line-height: 1.5; }
.sis .sis-su-misura a { color: var(--accent); text-decoration: none; }
.sis .sis-su-misura a:hover, .sis .sis-su-misura a:focus-visible { text-decoration: underline; text-underline-offset: 3px; }
/* Il conto delle ore: i due campi a sinistra, l'esito a destra in un riquadro
   come quelli dei sistemi; sul telefono uno sotto l'altro. */
.sis .sis-conto { display: grid; gap: 12px; margin-top: 32px; }
.sis .sis-conto__campi { display: grid; gap: 20px; align-content: start; }
.sis .sis-conto__campo span { display: block; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--tenue); margin-bottom: 10px; }
.sis .sis-conto__campo input {
  width: 100%;
  max-width: 220px;
  background: var(--antracite-2, #141414);
  border: 1px solid var(--linea-v2);
  border-radius: 14px;
  color: var(--testo);
  font: 700 32px/1.1 var(--font-display);
  padding: 14px 18px;
}
.sis .sis-conto__campo input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.sis .sis-conto__esito {
  background: var(--antracite-2, #141414);
  border: 1px solid var(--linea-v2);
  border-radius: 14px;
  padding: 26px;
  color: var(--tenue);
}
/* Adesso e con un sistema affiancati; il dopo in verde acido. */
.sis .sis-conto__confronto { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.sis .sis-conto__dopo { border-left: 1px solid var(--linea-v2); padding-left: 20px; }
.sis .sis-conto__quando { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 8px; }
.sis .sis-conto__dopo .sis-conto__quando { color: var(--accent); }
.sis .sis-conto__esito p { font-size: 15px; line-height: 1.5; }
.sis .sis-conto__esito p.sis-conto__ore { font: 700 30px/1.1 var(--font-display); color: var(--testo); margin-bottom: 6px; }
.sis .sis-conto__dopo p.sis-conto__ore, .sis .sis-conto__dopo strong { color: var(--accent); }
.sis .sis-conto__esito p.sis-conto__tornano { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--linea-v2); font-size: 18px; color: var(--testo); }
.sis .sis-conto__tornano strong { color: var(--accent); }
.sis .sis-conto__nota { margin-top: 16px; font-size: 14px; color: var(--tenue); }
/* Fa per te se / Non fa per te se: due riquadri come i modi, il primo col
   filo e l'etichetta verdi; le righe con una lineetta corta al posto del pallino. */
.sis .sis-perte .si-prezzo:first-child { border-color: var(--accent); }
.sis .sis-perte .si-prezzo:first-child .si-prezzo__voce { color: var(--accent); }
.sis .sis-perte ul { list-style: none; margin-top: 10px; }
.sis .sis-perte li { position: relative; padding-left: 20px; color: var(--tenue); }
.sis .sis-perte li + li { margin-top: 10px; }
.sis .sis-perte li::before { content: ""; position: absolute; left: 0; top: .8em; width: 10px; height: 1px; background: currentColor; }
.sis .sis-perte .si-prezzo:first-child li::before { background: var(--accent); }
@media (min-width: 880px) {
  .sis .sis-conto { grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
}
/* Sottolineato verde acido, come i link WhatsApp ed email di /siti. */
/* "gratuita" sottolineato in verde acido su tutto il sito (Tom, 30/10). */
/* "La prima call dura 30 minuti ed è gratuita" in grassetto bianco su tutte le pagine (Tom, 30/10). */
.call-gratuita { color: #fff; font-weight: 700; }
.sis-sottolineato { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (min-width: 720px) {
  .sis .si-modi { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- WhatsApp su tutte le pagine (Tom, 30/10): verde e logo, si riconosce al volo.
   Su /siti siti.js lo nasconde quando copre i bottoni. ---------- */
.si-whatsapp {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .8);
}
.si-whatsapp:hover, .si-whatsapp:focus-visible { background: #1ebe5b; }
.si-whatsapp--via { visibility: hidden; }
/* Spazio in fondo pari al bottone, così l'ultima riga del footer resta libera. */
body:has(.si-whatsapp) .site-footer { padding-bottom: 84px; }

/* ---------- Coerenza fra le pagine (Tom, 30/10) ----------
   Schede dei sistemi come in home: titolo grande, testo piccolo, etichette in fondo. */
.sis .sistema { display: flex; flex-direction: column; padding: 28px 26px 26px; }
.sis .sistema h4 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 10px; }
.sis .sistema p { font-size: 15px; line-height: 1.55; }
.sis .sistema .tags { margin-top: auto; padding-top: 22px; gap: 6px; }
/* Automazioni / Con l'AI: mono maiuscolo verde acido. */
.sis .gruppo-sistemi h3 {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 20px;
}
/* Etichette mono dei riquadri (Il sito, Il canone, i tre modi) in maiuscolo come in home. */
.si .si-prezzo__voce { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; }
/* Bottone secondario a filo verde acido, come "Tutti i sistemi" in home. */
.af-btn:not(.af-btn--pieno) { border-color: var(--accent); color: var(--accent); }
.af-btn:not(.af-btn--pieno):hover,
.af-btn:not(.af-btn--pieno):focus-visible { background: var(--accent); color: #0b0b0b; }

/* ---------- /affiancamento nello stile di /sistemi (Tom, 30/10) ---------- */
/* Il nome della pagina sopra il titolo (Affiancamento, Sistemi, Siti web): mono maiuscolo. */
.v2 .af-servizio {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
}
.af .si-passi strong { color: var(--testo); }
/* Cosa ti resta alla fine: riquadri stondati come le schede di /sistemi (Tom, 30/10). */
.af .af-risultato {
  background: var(--antracite-2, #141414);
  border: 1px solid var(--linea-v2);
  border-radius: 14px;
  padding: 28px 26px 26px;
}
/* Quattro riquadri: due per riga, poi quattro sugli schermi larghi. */
@media (min-width: 720px) { .af .af-risultati { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1180px) { .af .af-risultati { grid-template-columns: repeat(4, 1fr); } }
.af .af-risultato p { font-size: 15px; line-height: 1.55; }
/* Serve se ti riconosci qui: titolo sopra, quattro riquadri stondati (Tom, 30/10). */
@media (min-width: 960px) { .af #per-chi-e .af-dueColonne { grid-template-columns: 1fr; gap: 40px; } }
.af .af-segnali { grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .af .af-segnali { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1180px) { .af .af-segnali { grid-template-columns: repeat(4, 1fr); } }
.af .af-segnali li,
.af .af-segnali li:first-child {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px 26px 26px;
  background: var(--antracite-2, #141414);
  border: 1px solid var(--linea-v2);
  border-radius: 14px;
}
.v2.af .af-segnali p { font-size: 17px; line-height: 1.45; }
.af .af-icona { stroke: var(--accent); }
/* Chi ti affianca: la stessa foto di Chi sono in home, inquadrata uguale. */
.af .af-chi__foto img { object-position: center 30%; }
/* Formato dell'affiancamento sotto "Come funziona" e "Non fa per te se" (Tom, 30/10, da Cinori). */
.af .af-formato { font-family: var(--font-mono); font-size: 14px; color: var(--accent); margin: 8px 0 4px; }
.af .af-non-e { margin-top: 32px; }
.af .af-non-e__titolo { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 10px; }
.af .af-non-e ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.af .af-non-e li { color: var(--tenue); }
.af .af-non-e li::before { content: "× "; color: var(--accent); }
.af .af-non-e a { color: var(--testo); text-decoration-color: var(--accent); text-underline-offset: 3px; }
/* Chi ti affianca: il grassetto in bianco, come nel resto del sito. */
.af .af-chi strong { color: var(--testo); }
/* La durata e il costo della prima call in verde acido, sotto i bottoni (Tom, 30/10). */
.af-acido { color: var(--accent); }

/* ---------- /retail e /retail/it/ nello stile di /sistemi (decisione 104) ---------- */
/* Selettore EN / IT accanto al menu, fuori dal <nav>: così il menu delle
   pagine italiane resta identico. Sul telefono sta a sinistra di [ MENU ]. */
.rt-lingue {
  display: flex;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  order: 1;
  margin-left: auto;
}
.rt .nav-toggle { order: 2; }
.rt-lingue a { color: var(--tenue); text-decoration: none; padding: 8px 0; }
.rt-lingue a::before { content: "[ "; }
.rt-lingue a::after { content: " ]"; }
.rt-lingue a:hover,
.rt-lingue a:focus-visible { color: var(--testo); }
.rt-lingue a[aria-current="page"] { color: var(--accent); }
@media (min-width: 1024px) {
  .rt .primary-nav { order: 1; }
  .rt-lingue { order: 2; margin-left: 0; padding-left: 24px; border-left: 1px solid var(--linea-v2); }
}
/* Menu inglese con le sei sezioni della pagina (Tom, 30/10): su una riga sopra i 1100px,
   sotto resta il pannello a scomparsa come sul telefono. */
.rt .primary-nav a, .rt-lingue a { white-space: nowrap; }
@media (min-width: 1100px) {
  .rt-sei-voci .primary-nav { gap: 32px; }
  .rt-sei-voci .primary-nav__links { gap: 20px; }
}
@media (min-width: 1024px) and (max-width: 1099px) {
  .rt-sei-voci .nav-toggle { display: inline-flex; order: 2; }
  .rt-sei-voci .primary-nav {
    position: fixed;
    top: 0;
    right: 0;
    width: min(86vw, 360px);
    height: 100vh;
    height: 100dvh;
    background: var(--bg);
    border-left: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 40px;
    padding: 96px 28px 40px;
    margin-left: 0;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
    z-index: 95;
  }
  .rt-sei-voci .primary-nav.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .3s ease, visibility 0s linear 0s;
  }
  .rt-sei-voci .primary-nav__links { flex-direction: column; gap: 22px; }
  .rt-sei-voci .primary-nav__extra { flex-direction: column; align-items: flex-start; gap: 18px; }
  .rt-sei-voci .rt-lingue { order: 1; margin-left: auto; padding-left: 0; border-left: 0; }
}
/* Il bottone del menu in inglese. */
.v2 :lang(en) .nav-toggle[aria-expanded="true"]::after,
.v2:lang(en) .nav-toggle[aria-expanded="true"]::after { content: "[ CLOSE ]"; }

/* Il titolo di /retail è una frase lunga: un corpo più piccolo di /sistemi. */
.si.rt .si-cima h1 { font-size: clamp(30px, 6.4vw, 50px); max-width: 21ch; margin-bottom: 20px; }

/* Etichette mono verdi sopra i blocchi, come il nome della pagina.
   Il blocco della scala usa le stesse regole anche su /sistemi (section.rt). */
.rt .rt-etichetta {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-bottom: 14px;
}
.rt .rt-etichetta--stacco { margin-top: 56px; }
.rt .si-prezzi { margin-top: 0; }
.rt .si-prezzo:first-child { border-color: var(--linea-v2); }
.rt .si-prezzo p { color: var(--tenue); }
.v2.rt .si-prezzo p.si-prezzo__cifra,
.v2 .rt .si-prezzo p.si-prezzo__cifra { font-size: 44px; line-height: 1.1; color: var(--testo); margin-bottom: 6px; }
.rt .rt-didascalia { margin-top: 20px; color: var(--tenue); max-width: 62em; }
.rt .rt-didascalia strong { color: var(--testo); }
@media (min-width: 720px) {
  .rt .rt-tre { grid-template-columns: repeat(3, 1fr); }
}

/* Chi sono: le tre righe sotto il testo. */
.rt .af-chi p + p { margin-top: 14px; }
.rt-meta { margin-top: 28px; display: grid; gap: 4px; border-top: 1px solid var(--linea-v2); padding-top: 18px; }
.rt-meta dt {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--accent);
  margin-top: 10px;
}
.rt-meta dt:first-child { margin-top: 0; }
.rt-meta dd { margin: 0; color: var(--tenue); font-size: 15px; }

/* Cosa faccio: i quattro pilastri nelle schede di /sistemi, due per riga. */
.rt .rt-pilastri { margin-top: 36px; }
@media (min-width: 1080px) {
  .rt .rt-pilastri { grid-template-columns: repeat(2, 1fr); }
}
.rt .sistema .rt-num {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 14px;
}
.rt .sistema h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.015em; line-height: 1.15; margin-bottom: 10px; }
.rt .sistema strong { color: var(--testo); }
.rt .rt-kit { display: flex; flex-wrap: wrap; gap: 6px; }
.rt .rt-note { display: grid; gap: 14px; margin-top: 24px; max-width: 62em; }
.rt .rt-note p { color: var(--tenue); }
.rt .rt-note strong { color: var(--testo); }
.rt .rt-nota { color: var(--tenue); font-size: 14px; font-style: italic; }

/* Immagini AI: quattro per riga sugli schermi larghi, due sul telefono. */
.rt-galleria { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 32px; }
@media (min-width: 1080px) {
  .rt-galleria { grid-template-columns: repeat(4, 1fr); gap: 16px; }
}
.rt-foto { margin: 0; }
.rt-foto__img { position: relative; }
.rt-foto img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--linea-v2);
}
.rt-foto figcaption { margin-top: 10px; font-size: 15px; color: var(--testo); line-height: 1.35; }
.rt-foto figcaption span {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 2px;
}

/* Quattro modi: il retainer mensile in evidenza col filo verde. */
.rt .rt-modi .si-prezzo { display: flex; flex-direction: column; }
.rt .rt-modi .rt-in-evidenza { border-color: var(--accent); }
.rt .rt-modi h3 { font-size: 22px; margin: 6px 0 10px; }
.rt .rt-modo__meta { font-family: var(--font-mono); font-size: 12px; margin-top: 16px; }
.rt .rt-modi .sis-affiancamento { margin-top: auto; padding-top: 16px; }
.rt .rt-modi .sis-affiancamento a::after { content: " →"; }
/* Quattro modi, due per riga: sopra i due gestiti, sotto i due con il sistema in azienda. */
@media (min-width: 720px) {
  .rt .rt-due { grid-template-columns: repeat(2, 1fr); }
}
.rt .rt-due .si-prezzo p + p:not(.rt-modo__meta):not(.sis-affiancamento) { margin-top: 12px; }
.rt .af-call strong { color: var(--testo); }
/* Spazio fra i titoli e il testo sotto, anche dopo un'etichetta. */
.rt .af-sezione h2 { margin-bottom: 18px; }
