/* ============================================================
   Tuijo — sito 2026 (impianto Apple-like)
   Una sezione = un'idea = un'immagine. Nessun concetto ripetuto.
   Le pagine legali continuano a usare styles.css.
   ============================================================ */

:root {
  --teal:        #2F9DA6;
  --teal-bright: #3BA8B0;
  --teal-deep:   #145A60;
  --teal-ink:    #0C2E32;
  --teal-night:  #08252A;
  --cherry:      #D81F2C;
  --cherry-soft: #F0858E;

  --paper:       #F4EDE0;
  --paper-2:     #EFE6D6;
  --ink:         #16302F;
  --ink-soft:    #4A5E5C;
  --ink-faint:   #7E8E8B;
  --line:        rgba(22,48,47,.12);

  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --serif:   "Instrument Serif", Georgia, serif;
  --sans:    "Hanken Grotesk", system-ui, -apple-system, sans-serif;

  --maxw: 1080px;
  --nav-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: var(--nav-h); }
body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 17px;
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------------- Nav ---------------- */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 100; height: var(--nav-h);
  background: rgba(244,237,224,.78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease, background .3s ease;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand img { width: 26px; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: -.02em; color: var(--teal-deep); }
.nav-links { display: flex; gap: 34px; font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.nav-links a:hover { color: var(--ink); }
.nav-right { display: flex; align-items: center; gap: 16px; }
.lang { display: flex; gap: 12px; font-size: 14px; letter-spacing: .04em; color: var(--ink-faint); }
.lang a.on { color: var(--teal-deep); font-weight: 700; }


/* ---------------- Tipografia di sezione ---------------- */
h1 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(42px, 8.4vw, 88px); line-height: 1.02; letter-spacing: -.035em;
  color: var(--teal-ink); text-wrap: balance;
}
h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(32px, 5.2vw, 58px); line-height: 1.06; letter-spacing: -.03em;
  text-wrap: balance;
}
.serif-em { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: 0; }
.eyebrow {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--teal); margin-bottom: 14px;
}
.lead {
  font-size: clamp(18px, 2vw, 22px); line-height: 1.45; color: var(--ink-soft);
  max-width: 34ch; margin: 20px auto 0; text-wrap: balance;
}

/* ---------------- Hero ---------------- */
/* Il fondo non è zero: senza, i telefoni dell'apertura finiscono appiccicati
   alla sezione scura che segue e la loro ombra ci cade sopra. */
.hero { padding: calc(var(--nav-h) + 76px) 0 clamp(52px, 7vw, 104px); text-align: center; }
.hero .lead { max-width: 30ch; }
.badges { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.badges img { height: 48px; width: auto; }
.badges a { transition: opacity .2s ease; }
.badges a:hover { opacity: .8; }
.hero-note { margin-top: 16px; font-size: 13px; color: var(--ink-faint); }
.hero-shot { margin: clamp(38px, 5vw, 62px) auto 0; width: min(340px, 72vw); }
.hero-shot img { width: 100%; filter: drop-shadow(0 26px 34px rgba(12,46,50,.24));
  transform: translateY(var(--shift, 0px)); }
/* Da desktop l'apertura è su due colonne: testo a sinistra, telefono a destra. */
@media (min-width: 861px) {
  .hero { text-align: left; padding-bottom: clamp(64px, 7vw, 104px); }
  .hero .wrap {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .62fr);
    grid-template-rows: 1fr auto auto auto auto 1fr; column-gap: clamp(30px, 5vw, 76px);
    grid-template-areas: ". shot" "h1 shot" "lead shot" "badges shot" "note shot" ". shot";
  }
  .hero h1 { grid-area: h1; }
  .hero .lead { grid-area: lead; margin-left: 0; }
  .hero .badges { grid-area: badges; justify-content: flex-start; }
  .hero .hero-note { grid-area: note; }
  .hero .hero-shot { grid-area: shot; margin: 0 auto; width: min(340px, 100%); }
}

/* ---------------- Sezioni prodotto ----------------
   Tre impianti che si alternano: split (testo di lato), center (telefono
   che poggia sul bordo inferiore) e card (ritaglio largo dell'interfaccia). */
.stage { padding: clamp(78px, 9vw, 140px) 0; overflow: hidden; }
.stage.dark { background: var(--teal-ink); color: #fff; }
.stage.dark h2 { color: #fff; }
.stage.dark .lead { color: rgba(255,255,255,.72); }
.stage.dark .eyebrow { color: var(--teal-bright); }
.stage.dark .serif-em { color: var(--cherry-soft); }
.stage .shot img { width: 100%; filter: drop-shadow(0 24px 30px rgba(12,46,50,.22));
  transform: translateY(var(--shift, 0px)) rotate(var(--tilt, 0deg)); }
.stage.dark .shot img { filter: drop-shadow(0 24px 34px rgba(0,0,0,.45)); }

/* -- split: testo a un lato, telefono all'altro -- */
.stage.split .wrap {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, .82fr);
  align-items: center; gap: clamp(30px, 5vw, 76px);
}
.stage.split .lead { margin: 20px 0 0; max-width: 36ch; }
.stage.split .shot { width: min(300px, 64vw); margin: 0 auto; }
.stage.split .shot img { --tilt: 2.5deg; }
.stage.split.rev .copy { order: 2; }
.stage.split.rev .shot { order: 1; }
.stage.split.rev .shot img { --tilt: -2.5deg; }
/* compact: stesso impianto, ma con meno peso — per le funzioni secondarie */
.stage.split.compact { padding: clamp(60px, 7vw, 100px) 0; }
.stage.split.compact .wrap { grid-template-columns: minmax(0, 1fr) minmax(0, .5fr); }
/* rovesciata: la colonna stretta è quella dell'immagine, che qui viene prima */
.stage.split.compact.rev .wrap { grid-template-columns: minmax(0, .5fr) minmax(0, 1fr); }
.stage.split.compact h2 { font-size: clamp(27px, 3.4vw, 38px); }
.stage.split.compact .lead { font-size: clamp(17px, 1.7vw, 19px); max-width: 34ch; }
.stage.split.compact .shot { width: min(210px, 46vw); }

/* nella colonna può starci anche un ritaglio largo invece del telefono */
.stage.split .shot.wide { width: min(440px, 78vw); }
.stage.split .shot.wide img { --tilt: 0deg; border-radius: 14px; }

/* -- center: il telefono poggia sul bordo inferiore, come su apple.com -- */
.stage.center { padding-bottom: 0; text-align: center; }
.stage.center .lead { margin: 20px auto 0; }
.stage.center .shot { margin: clamp(34px, 5vw, 58px) auto 0; width: min(346px, 70vw); }

/* -- reel: più schermate che si alternano da sole quando la sezione è in vista.
      Senza JavaScript resta la prima, che è già marcata .on nel markup. -- */
.reel { position: relative; }
.reel .fr { opacity: 0; transition: opacity .55s ease; }
.reel .fr.on { opacity: 1; }
.reel .fr + .fr { position: absolute; left: 0; top: 0; }

/* -- full: il telefono intero, centrato sotto al testo. A differenza di
      .center non poggia sul bordo: la schermata si deve vedere tutta. -- */
.stage.full { text-align: center; }
.stage.full .lead { margin: 20px auto 0; }
.stage.full .shot { margin: clamp(34px, 5vw, 58px) auto 0; width: min(330px, 68vw); }

/* ---------------- Scena dell'abbinamento ----------------
   Tre passi, una schermata per passo. Il telefono sta a destra con i bottoni
   in colonna al suo fianco; ogni bottone mostra la sua schermata. Senza
   JavaScript resta la prima, già marcata .on nel markup. */
.scene-inner {
  display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: center; gap: clamp(30px, 5vw, 76px);
}
.scene-stage { display: flex; align-items: center; justify-content: center; gap: clamp(24px, 3vw, 40px); }
.scene-phone { position: relative; flex: none; width: min(280px, 64vw); }
.scene-phone .fr { width: 100%; opacity: 0; transition: opacity .45s ease;
  filter: drop-shadow(0 24px 34px rgba(0,0,0,.45)); }
.scene-phone .fr.on { opacity: 1; }
.scene-phone .fr + .fr { position: absolute; left: 0; top: 0; }

.scene-steps { display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  list-style: none; counter-reset: step; flex: none; white-space: nowrap; }
.scene-steps li { counter-increment: step; }
.scene-steps button {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font: inherit;
  padding: 11px 22px 11px 12px; border-radius: 999px; font-size: 16px; font-weight: 600;
  color: rgba(255,255,255,.55); background: transparent; border: 1px solid rgba(255,255,255,.2);
  transition: color .3s ease, border-color .3s ease, background .3s ease, transform .2s ease;
}
.scene-steps button:hover { color: #fff; border-color: rgba(124,224,215,.6); transform: translateX(3px); }
.scene-steps button:focus-visible { outline: 2px solid var(--teal-bright); outline-offset: 3px; }
.scene-steps button::before {
  content: counter(step); display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: rgba(255,255,255,.12); font-size: 13px; transition: inherit;
}
.scene-steps button[aria-pressed="true"] { color: #fff; border-color: rgba(124,224,215,.5); background: rgba(124,224,215,.12); }
.scene-steps button[aria-pressed="true"]::before { background: var(--teal-bright); color: #06282C; }
/* il passo successivo pulsa piano, per far capire che si tocca */
.scene-steps button.next::before { animation: tuijo-pulse 1.8s ease-in-out infinite; }
@keyframes tuijo-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(124,224,215,.55); } 50% { box-shadow: 0 0 0 7px rgba(124,224,215,0); } }

@media (max-width: 860px) {
  .scene-inner { grid-template-columns: 1fr; text-align: center; }
  .scene-stage { flex-direction: column; }
  .scene-steps { align-items: center; }
}

/* ---------------- Sicurezza ---------------- */
.security { padding: clamp(90px, 11vw, 160px) 0; text-align: center; background: var(--paper-2); }
.sec-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 46px 40px;
  margin-top: clamp(46px, 6vw, 72px); text-align: left;
}
.sec-item h3 { font-family: var(--display); font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sec-item p { margin-top: 8px; font-size: 16px; color: var(--ink-soft); }
.sec-item .n { display: block; font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--teal); margin-bottom: 10px; }
.sec-foot { margin-top: clamp(44px, 5vw, 64px); font-size: 14px; color: var(--ink-faint); }
.sec-foot b { color: var(--ink-soft); font-weight: 600; }

/* ---------------- Backup ----------------
   Stessa griglia della sicurezza, su fondo scuro per staccarla. */
.security.backup { background: var(--teal-ink); color: #fff; }
.security.backup h2, .security.backup .sec-item h3 { color: #fff; }
.security.backup .lead, .security.backup .sec-item p { color: rgba(255,255,255,.72); }
.security.backup .eyebrow, .security.backup .sec-item .n { color: var(--teal-bright); }
.security.backup .sec-foot { color: rgba(255,255,255,.55); }
.security.backup .sec-foot b { color: #fff; }

/* ---------------- FAQ ---------------- */
.faq-sec { padding: clamp(80px, 10vw, 140px) 0; }
.faq-sec h2 { text-align: center; }
.faq-list { max-width: 760px; margin: clamp(38px, 5vw, 56px) auto 0; }
.faq { border-top: 1px solid var(--line); }
.faq:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 22px 40px 22px 0; position: relative;
  font-size: 18px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 13px; height: 13px;
  margin-top: -6px; transition: transform .25s ease;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v16M4 12h16' stroke='%23000' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 4v16M4 12h16' stroke='%23000' stroke-width='2.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
  color: var(--teal-deep);
}
.faq[open] summary::after { transform: rotate(135deg); }
.faq p { padding: 0 40px 24px 0; color: var(--ink-soft); font-size: 16.5px; }

/* ---------------- Supporto ---------------- */
.support { padding: clamp(70px, 9vw, 120px) 0; text-align: center; border-top: 1px solid var(--line); }
.support .lead { max-width: 46ch; }
.support .lead a { color: var(--teal-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.support .mail {
  display: inline-block; margin-top: 28px; padding: 13px 26px; border-radius: 999px;
  background: var(--teal-deep); color: #fff; font-weight: 700; font-size: 17px; transition: background .2s ease;
}
.support .mail:hover { background: var(--teal-ink); }

/* ---------------- Pagine legali (privacy) ---------------- */
.legal { padding: calc(var(--nav-h) + clamp(56px, 7vw, 96px)) 0 clamp(70px, 8vw, 110px); }
.legal-head, .legal-body { max-width: 760px; margin: 0 auto; }
.legal-head { margin-bottom: 44px; }
.legal-head h1 { font-size: clamp(40px, 6vw, 68px); }
.legal-head h1 .serif-em { color: var(--cherry); }
.legal-head p { font-size: 19px; color: var(--ink-soft); margin-top: 18px; }
.legal-date {
  display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 26px;
  padding: 11px 20px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line);
  font-size: 14px; color: var(--ink-soft);
}
.legal-date b { color: var(--teal-deep); }
.legal-date > span { white-space: nowrap; }
.legal-date .sep { width: 1px; height: 16px; background: var(--line); }
.legal-body h2 {
  font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.01em; color: var(--teal-ink);
  margin: 52px 0 16px; padding-top: 30px; border-top: 1px solid var(--line);
}
.legal-body h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.legal-body h3 { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--teal-deep); margin: 30px 0 12px; }
.legal-body p { color: var(--ink-soft); font-size: 16.5px; margin-bottom: 14px; }
.legal-body a { color: var(--teal-deep); font-weight: 600; }
.legal-body ul { list-style: none; margin: 16px 0 20px; display: flex; flex-direction: column; gap: 11px; }
.legal-body li { position: relative; padding-left: 26px; color: var(--ink-soft); font-size: 16.5px; }
.legal-body li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); }
.legal-body li.no::before { background: var(--cherry); border-radius: 3px; }
.legal-body strong { color: var(--ink); font-weight: 700; }
.legal-callout { background: var(--teal-ink); color: #fff; border-radius: 22px; padding: 28px 30px; margin: 30px 0; }
.legal-callout h3 { color: #fff; margin: 0 0 10px; font-size: 20px; }
.legal-callout p { color: rgba(255,255,255,.8); margin: 0; }
.legal-callout strong { color: #fff; }
.legal-note {
  display: flex; gap: 14px; align-items: flex-start; margin: 22px 0; padding: 20px 22px;
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 16px; font-size: 15.5px; color: var(--ink-soft);
}
.legal-note .ni { flex-shrink: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(47,157,166,.12); color: var(--teal-deep); }
.legal-note .ni svg { width: 17px; height: 17px; }
.legal-note strong { color: var(--teal-deep); }
.legal-back { display: inline-flex; align-items: center; gap: 8px; margin-top: 40px; font-weight: 600; color: var(--teal-deep); }
.legal-back svg { width: 17px; height: 17px; }
.legal-back:hover { color: var(--cherry); }
@media (max-width: 860px) { .legal-body h2 { font-size: 23px; } }

/* ---------------- CTA finale ---------------- */
.cta { padding: clamp(80px, 10vw, 140px) 0 clamp(90px, 11vw, 150px); text-align: center; background: var(--paper-2); }
.cta h2 { max-width: 16ch; margin: 0 auto; }

/* ---------------- Footer ---------------- */
.foot { padding: 40px 0 56px; font-size: 13px; color: var(--ink-faint); border-top: 1px solid var(--line); }
.foot-nav { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: center; }
.foot-nav a:hover { color: var(--ink-soft); }
.foot-bottom { margin-top: 22px; text-align: center; }

/* ---------------- Reveal ---------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }

/* Scorrimento: le immagini si muovono un po' più lentamente del testo. */
[data-move] { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  [data-move] { --shift: 0px !important; }
  .stage.split .shot img, .stage.split.rev .shot img { --tilt: 0deg; }
  .scene-steps button.next::before { animation: none; }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .stage.split .wrap { grid-template-columns: 1fr; gap: clamp(30px, 6vw, 48px); text-align: center; }
  .stage.split .lead { margin: 20px auto 0; }
  .stage.split.rev .copy { order: 1; }
  .stage.split.rev .shot { order: 2; }
  .stage.split .shot { width: min(280px, 62vw); }
  .sec-grid { grid-template-columns: 1fr; gap: 34px; max-width: 460px; margin-left: auto; margin-right: auto; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .badges img { height: 42px; }
  .lang { gap: 6px; }
  .stage.center .shot { width: 74vw; }
  .stage.split .shot { width: 66vw; }
}
