/* Sensiii · landing di marketing. Palette e tono allineati all'app (tokens).
   Font di marca self-hostati (Figtree/Lexend, SIL OFL): nessuna richiesta a
   terzi (Google Fonts) per rispetto GDPR. Variabili: un solo woff2 per famiglia
   copre l'intero intervallo di pesi. Fallback di sistema finché il font carica. */

/* Latin subset. unicode-range preso dalla CSS2 API di Google Fonts. */
@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/fonts/figtree-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Lexend";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/fonts/lexend-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #f5f7f4;
  --card: #ffffff;
  --ink: #15302d;
  --muted: #44605c;
  --primary: #2b6f66;
  --primary-ink: #ffffff;
  --soft: #dcede9;
  --line: #dce3df;
  --dot-1: #2f62a8; /* propriocezione */
  --dot-2: #d98a2b; /* vestibolare */
  --dot-3: #6b4c9a; /* interocezione */
  --font: "Lexend", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --maxw: 60rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1f1d;
    --card: #172a27;
    --ink: #eaf0ee;
    --muted: #a9bbb7;
    --soft: #23403b;
    --line: #2a403c;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 3rem) 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 6vw, 4.5rem);
}

/* Hero */
.hero {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 42rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3.25rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0;
}
.lead {
  font-size: clamp(1.05rem, 2.5vw, 1.25rem);
  color: var(--muted);
  margin: 0;
}
.cta {
  font-family: var(--font-display);
  align-self: flex-start;
  background: var(--primary);
  color: var(--primary-ink);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0.9rem 1.6rem;
  border-radius: 999px;
  min-height: 3.5rem;
  display: inline-flex;
  align-items: center;
  transition:
    transform 0.1s ease,
    filter 0.15s ease;
}
.cta:hover {
  filter: brightness(1.05);
}
.cta:active {
  transform: translateY(1px);
}
.cta:focus-visible {
  outline: 3px solid var(--dot-1);
  outline-offset: 2px;
}
.hint {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0;
}
.inline-link {
  color: var(--primary);
  font-weight: 600;
}

/* Punti */
.points {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) {
  .points {
    grid-template-columns: repeat(3, 1fr);
  }
}
.points article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  padding: 1.25rem;
}
.points h2 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.points p {
  margin: 0;
  color: var(--muted);
}

/* Footer */
.foot {
  border-top: 1px solid var(--line);
  padding-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.foot nav {
  display: flex;
  gap: 1.25rem;
}
.foot a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.foot a:hover {
  text-decoration: underline;
}
.foot a:focus-visible {
  outline: 3px solid var(--dot-1);
  outline-offset: 2px;
}
.copy {
  margin: 0;
  color: var(--muted);
}

/* Logo header (marchio ufficiale, swap chiaro/scuro via <picture>) */
.brand-link {
  display: inline-flex;
  border-radius: 6px;
}
.brand-link:focus-visible {
  outline: 3px solid var(--dot-1);
  outline-offset: 4px;
}
.logo {
  height: 2.6rem;
  width: auto;
  display: block;
}

/* Sezioni con titolo */
.section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.section > h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
}
.section > .sub {
  color: var(--muted);
  margin: 0;
  max-width: 42rem;
}

/* Griglia di card (per chi è · perché Sensiii) */
.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
.cards article {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  padding: 1.25rem;
}
.cards h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
}
.cards p {
  margin: 0;
  color: var(--muted);
}

/* Passi numerati */
.steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  gap: 1rem;
  padding: 0;
  margin: 0;
  grid-template-columns: 1fr;
}
@media (min-width: 46rem) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
  }
}
.steps li {
  counter-increment: step;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.125rem;
  padding: 1.25rem;
}
.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--soft);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  margin-bottom: 0.6rem;
}
.steps h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.3rem;
}
.steps p {
  margin: 0;
  color: var(--muted);
}

/* FAQ (accordion nativo <details>, zero JavaScript) */
.faq {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  padding: 0 1rem;
}
.faq summary {
  font-family: var(--font-display);
  font-weight: 600;
  cursor: pointer;
  padding: 0.95rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}
.faq summary::-webkit-details-marker {
  display: none;
}
.faq summary::after {
  content: "+";
  color: var(--primary);
  font-size: 1.4rem;
  line-height: 1;
}
.faq details[open] summary::after {
  content: "–";
}
.faq summary:focus-visible {
  outline: 3px solid var(--dot-1);
  outline-offset: 3px;
  border-radius: 4px;
}
.faq p {
  margin: 0 0 0.95rem;
  color: var(--muted);
}

/* Contatti */
.contact {
  background: var(--soft);
  border-radius: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}
.contact h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 1.9rem);
  margin: 0;
}
.contact p {
  margin: 0;
  color: var(--muted);
  max-width: 40rem;
}

/* Pagina informativa (privacy) */
.legal {
  max-width: 46rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.legal h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.25rem;
}
.legal h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.25rem;
}
.legal p {
  margin: 0.35rem 0;
  color: var(--muted);
}
.legal .lead {
  color: var(--ink);
}
.legal ul {
  margin: 0.35rem 0;
  padding-left: 1.2rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.legal strong {
  color: var(--ink);
}
.legal .cta {
  margin-top: 1rem;
}
.notice {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  padding: 0.9rem 1.1rem;
  color: var(--ink) !important;
}
.notice code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

/* ---------------------------------------------------------------------------
   Pagine legali (US-30): indice, tabelle, citazioni, elenco delle versioni.
   Generate da scripts/build_legal.py: le classi qui sotto sono il contratto
   con quello script, non si rinominano a cuor leggero.
   --------------------------------------------------------------------------- */

/* Indice cliccabile in testa al documento. */
.legal .toc {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  padding: 1rem 1.25rem;
  margin: 1rem 0 0.5rem;
}
.legal .toc h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}
.legal .toc ul {
  margin: 0;
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: var(--muted);
}
.legal .toc a,
.legal .versions a {
  color: var(--primary);
  text-decoration: none;
}
.legal .toc a:hover,
.legal .versions a:hover {
  text-decoration: underline;
}
.legal .toc a:focus-visible,
.legal .versions a:focus-visible,
.legal .inline-link:focus-visible {
  outline: 3px solid var(--dot-1);
  outline-offset: 2px;
  border-radius: 3px;
}

/* L'ancora non deve finire sotto il bordo superiore della finestra. */
.legal h2[id] {
  scroll-margin-top: 1.5rem;
}

.legal h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.25rem;
}
.legal ol {
  margin: 0.35rem 0;
  padding-left: 1.2rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.legal li > ul,
.legal li > ol {
  margin-top: 0.5rem;
}
.legal hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.75rem 0 0.5rem;
  width: 100%;
}
.legal blockquote {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  border-left: 3px solid var(--primary);
  background: var(--soft);
  border-radius: 0 0.5rem 0.5rem 0;
}
.legal blockquote p {
  margin: 0;
  color: var(--ink);
}

/* Tabelle. Su schermo stretto si impilano: ogni cella mostra l'intestazione
   dalla propria `data-label`, così la riga resta leggibile senza scorrimento
   orizzontale — che su un documento legale è il modo più sicuro di non farlo
   leggere a nessuno. */
.table-wrap {
  margin: 0.75rem 0;
}
.legal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.legal thead {
  display: none;
}
.legal tbody tr {
  display: block;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.6rem;
  background: var(--card);
}
.legal tbody td {
  display: block;
  color: var(--muted);
  padding: 0.15rem 0;
}
.legal tbody td::before {
  content: attr(data-label);
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink);
}
.legal tbody td:empty {
  display: none;
}

@media (min-width: 46rem) {
  .legal thead {
    display: table-header-group;
  }
  .legal tbody tr {
    display: table-row;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    background: transparent;
  }
  .legal thead th {
    text-align: left;
    font-family: var(--font-display);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    color: var(--ink);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--line);
  }
  .legal tbody td {
    display: table-cell;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }
  .legal tbody td::before {
    display: none;
  }
}

/* Elenco delle versioni pubblicate, in fondo al documento. */
.legal .versions {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.legal .versions h2 {
  font-size: 1rem;
  margin: 0 0 0.35rem;
}
.legal .versions p {
  margin: 0 0 0.5rem;
}
.legal .versions ul {
  gap: 0.3rem;
}

/* Piè di pagina con i dati societari (US-30 CA-2). Va a capo invece di
   generare scorrimento orizzontale: a 390 px la riga non ci sta. */
.legal-foot {
  margin-top: 2.5rem;
}
.legal-foot .company {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  max-width: 44rem;
  text-wrap: pretty;
}
