/* ==========================================================================
   Sodalius — sito vetrina
   Palette e tipografia centralizzate come variabili: cambiane il valore qui
   e si aggiorna in tutto il sito.
   ========================================================================== */

:root {
  /* Colori */
  --cream:        #F7F5F1;  /* sfondo principale */
  --cream-2:      #F2F0EB;  /* sezioni Watch e CTA finale */
  --white:        #FFFFFF;  /* fascia Features */
  --ink:          #1E2A24;  /* verde scuro: titoli e testo forte */
  --ink-black:    #14100E;  /* cornici telefono/watch */
  --burgundy:     #800020;  /* accento principale */
  --burgundy-dark:#5C0017;  /* hover link */
  --teal:         #008080;  /* sezione Pericoli */
  --muted:        #6B7D73;  /* testo secondario */
  --muted-2:      #7A8C84;  /* testo footer/etichette */
  --line:         #E1DDD5;  /* bordi chiari */
  --line-2:       #E9E5DE;  /* bordo tab inattive */

  /* Tipografia */
  --font: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Layout */
  --pad-x: 64px;            /* padding orizzontale sezioni (desktop) */
  --maxw: 1280px;           /* larghezza massima contenuto */
}

/* Reset di base */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--cream);
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--burgundy); text-decoration: none; }
a:hover { color: var(--burgundy-dark); text-decoration: underline; }

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

h1, h2, h3, p { margin: 0; }

/* Contenitore centrato con larghezza massima */
.wrap { max-width: var(--maxw); margin: 0 auto; }

/* Sezioni: padding verticale + orizzontale coerenti */
.section { padding: 96px var(--pad-x); }

/* ==========================================================================
   Navigazione
   ========================================================================== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px var(--pad-x);
  max-width: var(--maxw);
  margin: 0 auto;
}
/* Wordmark ufficiale (assets/sodalius-wordmark.svg).
   La scritta è convertita in tracciati, quindi non dipende dal caricamento di
   Montserrat: si disegna identica anche se il font non arriva. Il rapporto è
   circa 10,2:1, quindi si dimensiona per altezza e la larghezza segue. */
.nav__logo { display: flex; align-items: center; }
.nav__logo img { display: block; height: 20px; width: auto; }
.nav__links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}
.nav__links a { color: var(--muted); }
.nav__links a:hover { color: var(--ink); text-decoration: none; }
.nav__cta {
  border: 1.5px solid var(--ink);
  color: var(--ink) !important;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13px;
}
.nav__cta:hover { background: var(--ink); color: var(--white) !important; text-decoration: none; }

/* ==========================================================================
   Badge store (App Store / Google Play)
   Asset UFFICIALI di Apple e Google, in assets/badges/.
   NON modificare colore, proporzioni, testo o bordi: entrambe le aziende lo
   vietano espressamente. Non ridisegnarli e non sostituirli con ricostruzioni.

   Perché le due altezze CSS sono diverse: il PNG di Google include 41px di
   spazio libero per lato su 250px di altezza, quindi l'artwork visibile è il
   67,2% dell'immagine. Il badge Apple invece riempie tutto il suo viewBox.
   Rendendo Google a 65px e Apple a 44px (44 / 0,672 ≈ 65) i due risultano
   otticamente della stessa altezza — le guideline di entrambi richiedono che
   nessuno dei due appaia più piccolo dell'altro. Lo spazio libero di Google
   resta intatto e svolge la sua funzione di clear space.
   ========================================================================== */
.badges { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  transition: transform 0.15s ease;
}
.badge:hover { transform: translateY(-1px); }
.badge__img { display: block; width: auto; }
.badge__img--apple  { height: 44px; }
.badge__img--google { height: 65px; }

/* ==========================================================================
   Cornici telefono
   ========================================================================== */
.phone {
  background: var(--ink);
  border-radius: 46px;
  padding: 11px;
  box-shadow: 0 32px 72px rgba(30,42,36,0.28);
  max-width: 100%;   /* su schermi stretti si restringe invece di sfondare la pagina */
}
.phone__screen { border-radius: 37px; overflow: hidden; position: relative; }
.phone__screen img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  padding: 72px var(--pad-x) 96px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.hero__text { display: flex; flex-direction: column; gap: 26px; }
.hero__title {
  font-size: clamp(40px, 7vw, 66px);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-wrap: balance;
}
.hero__title .accent { color: var(--burgundy); }
.hero__sub {
  font-size: 20px;
  line-height: 1.55;
  font-weight: 500;
  color: var(--muted);
  max-width: 480px;
  text-wrap: pretty;
}
.hero__tags {
  display: flex;
  gap: 28px;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted-2);
  flex-wrap: wrap;
}
.hero__tags .dot { color: var(--burgundy); }
.hero__media { display: flex; justify-content: center; }
.hero__media .phone { width: 320px; transform: rotate(2deg); }
/* aspect-ratio invece di height fissa: se il telefono si restringe,
   lo schermo si accorcia in proporzione invece di deformarsi.
   298 = 320 di telefono meno i 22 di cornice. */
.hero__media .phone__screen { aspect-ratio: 298 / 620; }

/* ==========================================================================
   Features (fascia bianca con tab)
   ========================================================================== */
.features { background: var(--white); display: flex; flex-direction: column; gap: 48px; }
.features__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.features__title {
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 520px;
  text-wrap: balance;
}
.features__intro {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--muted);
  max-width: 380px;
  text-wrap: pretty;
}
.features__body {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 72px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.features__phone { display: flex; justify-content: center; }
.features__phone .phone { width: 310px; box-shadow: 0 28px 64px rgba(30,42,36,0.2); }
.features__phone .phone__screen { aspect-ratio: 288 / 600; }
.features__phone .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; }
.features__phone .slide.is-active { opacity: 1; }

.tabs { display: flex; flex-direction: column; gap: 8px; }
.tab {
  cursor: pointer;
  border-left: 3px solid var(--line-2);
  padding: 22px 26px;
  opacity: 0.45;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: none;
  text-align: left;
  font-family: inherit;
  transition: opacity .25s ease, border-color .25s ease;
}
.tab.is-active { opacity: 1; border-left-color: var(--burgundy); }
.tab__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--burgundy);
}
.tab__title { font-size: 21px; font-weight: 700; color: var(--ink); }
.tab__text { font-size: 15px; line-height: 1.6; font-weight: 500; color: var(--muted); }

/* ==========================================================================
   Apple Watch
   ========================================================================== */
.watch { background: var(--cream-2); display: flex; flex-direction: column; gap: 56px; }
.watch__top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.eyebrow {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--burgundy);
}
.section-title {
  font-size: clamp(30px, 5vw, 42px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
.section-lead {
  font-size: 17px;
  line-height: 1.65;
  font-weight: 500;
  color: var(--muted);
  text-wrap: pretty;
}
.watch__col { display: flex; flex-direction: column; gap: 20px; }
.steps { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step__num {
  width: 26px; height: 26px; flex: 0 0 auto;
  border-radius: 999px;
  background: var(--burgundy);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.step__title { font-size: 16px; font-weight: 700; color: var(--ink); }
.step__text { font-size: 14px; line-height: 1.55; font-weight: 500; color: var(--muted); }

.watch__devices { display: flex; align-items: flex-end; justify-content: center; }
/* min-width:0 sblocca il restringimento: senza, un flex item non scende mai
   sotto la sua larghezza min-content, e questo gruppo (270 + 176 - 46 di
   sovrapposizione = 400px) sfondava la pagina su schermi stretti. */
.watch__devices .phone { width: 270px; min-width: 0; border-radius: 42px; box-shadow: 0 28px 64px rgba(30,42,36,0.2); }
.watch__devices .phone__screen { border-radius: 34px; aspect-ratio: 248 / 520; }

/* Il quadrante è un container: tutte le misure interne sono espresse in cqw,
   cioè in percentuale della larghezza dell'orologio (100cqw = 176px, la misura
   di riferimento del disegno). Così quando l'orologio si restringe su schermi
   stretti, testi e pulsanti rimpiccioliscono con lui invece di essere tagliati.
   Ogni valore è il px originale diviso 176: es. 26px → 14.773cqw. */
.watch-device {
  position: relative;
  width: 176px; min-width: 0; flex-shrink: 1;
  margin-left: -46px; margin-bottom: 44px;
  container-type: inline-size;
}
.watch-device__crown {
  position: absolute; right: -2.841cqw; top: 44.318cqw;
  width: 3.409cqw; height: 17.045cqw; border-radius: 1.705cqw; background: #4A4744;
}
.watch-device__body {
  position: relative;
  background: var(--ink-black);
  border-radius: 26.136cqw;
  padding: 5.682cqw;
  box-shadow: 0 22px 48px rgba(30,42,36,0.3);
}
.watch-device__screen {
  border-radius: 21.023cqw; overflow: hidden; aspect-ratio: 156 / 214;
  background: #000; color: #fff; padding: 6.818cqw 6.818cqw 0;
  display: flex; flex-direction: column; gap: 4.545cqw;
}
.watch-label { font-size: 5.114cqw; font-weight: 600; letter-spacing: 0.04em; color: #8A8A8E; text-align: center; }
.watch-timer { font-size: 14.773cqw; font-weight: 700; letter-spacing: -0.02em; text-align: center; font-variant-numeric: tabular-nums; }
.watch-counter { display: flex; align-items: center; gap: 3.409cqw; }
.watch-btn { width: 14.773cqw; height: 14.773cqw; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-size: 7.386cqw; font-weight: 700; }
.watch-btn--minus { background: #1C1C1E; color: #8A8A8E; }
.watch-btn--plus  { background: var(--teal); color: #fff; }
.watch-counter__val { flex: 1; display: flex; flex-direction: column; align-items: center; }
.watch-counter__num { font-size: 8.523cqw; font-weight: 700; font-variant-numeric: tabular-nums; }
.watch-counter__lbl { font-size: 4.545cqw; font-weight: 600; color: #8A8A8E; }
.watch-finish { background: var(--teal); border-radius: 999px; padding: 3.977cqw; text-align: center; font-size: 5.682cqw; font-weight: 700; }

.watch__cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  border-top: 1px solid var(--line);
  padding-top: 40px;
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
}
.watch-card { display: flex; flex-direction: column; gap: 6px; }
.watch-card__title { font-size: 15px; font-weight: 700; color: var(--ink); }
.watch-card__text { font-size: 14px; line-height: 1.55; font-weight: 500; color: var(--muted); }

/* ==========================================================================
   Hazards (blocco teal)
   ========================================================================== */
.hazards {
  background: var(--teal);
  color: var(--white);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hazards__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hazards__col { display: flex; flex-direction: column; gap: 20px; }
.hazards .eyebrow { color: rgba(255,255,255,0.75); }
.hazards .section-title { color: var(--white); }
.hazards__lead { font-size: 17px; line-height: 1.65; font-weight: 500; opacity: 0.85; text-wrap: pretty; }
.pills { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.pill {
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
}
.hazards__media { display: flex; justify-content: center; }
.hazards__media .phone { width: 258px; background: var(--ink-black); border-radius: 40px; box-shadow: 0 28px 64px rgba(0,0,0,0.35); }
.hazards__media .phone__screen { border-radius: 32px; aspect-ratio: 236 / 500; }

/* ==========================================================================
   Family
   ========================================================================== */
.family {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.family__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.family__photo {
  height: 420px;
  border-radius: 24px;
  overflow: hidden;
  background: #E7E3DB;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.family__photo img { width: 100%; height: 100%; object-fit: cover; }
.family__col { display: flex; flex-direction: column; gap: 20px; }

/* ==========================================================================
   CTA finale
   ========================================================================== */
.cta {
  background: var(--cream-2);
  color: var(--ink);
  padding: 112px var(--pad-x);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
}
.cta__title {
  font-size: clamp(32px, 5.5vw, 46px);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.025em;
  max-width: 680px;
  text-wrap: balance;
}
.cta__sub { font-size: 17px; line-height: 1.6; font-weight: 500; color: var(--muted); max-width: 480px; text-wrap: pretty; }
.cta .badges { margin-top: 6px; }

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  padding: 44px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--maxw);
  margin: 0 auto;
  flex-wrap: wrap;
  gap: 16px;
}
.footer__logo { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); }
.footer__links { font-size: 12px; font-weight: 500; color: var(--muted-2); }
.footer__links a { color: var(--muted-2); }
.footer__links a:hover { color: var(--ink); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  :root { --pad-x: 28px; }
  .section { padding: 64px var(--pad-x); }

  .nav__links { gap: 18px; }
  .nav__links a:not(.nav__cta) { display: none; }  /* su mobile restano logo + "Get the app" */
  .nav__logo img { height: 16px; }  /* il wordmark è largo: rimpicciolito per stare accanto al CTA */

  .hero,
  .features__head,
  .features__body,
  .watch__top,
  .hazards, .hazards__inner,
  .family, .family__inner {
    /* minmax(0, …) e non 1fr: una colonna 1fr non scende mai sotto la
       larghezza min-content del suo contenuto, e con dentro i mockup dei
       telefoni restava più larga dello schermo. */
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }
  .hero { padding: 40px var(--pad-x) 64px; text-align: left; }
  .hero__media .phone { transform: none; }

  .features__head { align-items: flex-start; }
  .features__body { gap: 40px; }
  .tabs { order: 2; }
  .features__phone { order: 1; }

  .watch__cards { grid-template-columns: 1fr; gap: 24px; }
  .watch__devices { margin-top: 8px; }

  .cta { padding: 72px var(--pad-x); }
}

/* Sotto i 400px il wordmark e il pulsante "Get the app" arrivano a toccarsi:
   il wordmark è largo circa 10 volte la sua altezza, quindi si accorcia ancora. */
@media (max-width: 400px) {
  .nav__logo img { height: 13px; }
}

/* Accessibilità: rispetta chi preferisce meno animazioni */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Focus visibile da tastiera */
:focus-visible { outline: 2px solid var(--burgundy); outline-offset: 3px; }

/* ==========================================================================
   Pagine legali (privacy / terms) — segnaposto
   ========================================================================== */
.legal { max-width: 760px; margin: 0 auto; padding: 80px var(--pad-x) 96px; }
.legal a.back { font-size: 14px; font-weight: 600; }
.legal h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin: 24px 0 8px; }
.legal .updated { font-size: 13px; color: var(--muted-2); margin-bottom: 40px; }
.legal h2 { font-size: 20px; font-weight: 700; color: var(--ink); margin: 36px 0 12px; }
.legal p { font-size: 16px; line-height: 1.7; color: var(--muted); margin-bottom: 16px; }
.legal .note {
  background: var(--cream-2);
  border-left: 3px solid var(--burgundy);
  padding: 16px 20px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 32px;
}
