/* Compro Modernariato — stile della single page (mobile-first) */

@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #CA080C;
  /* Stesso rosso, più luminoso e morbido: solo su fondi scuri (contrasto AA su #2A2C2F) */
  --red-soft: #F26B6B;
  --anthracite: #45484C;
  --text: #313335;
  --muted: #7B7E81;
  --bg: #F3F5F6;
  --ink: #1F2023;
  --line: #DDDEDB;
  --logo-dark: #211B1D;
  --wa: #25D366;

  /* Varianti per testi piccoli con contrasto WCAG AA (≥ 4.5:1) */
  --muted-strong: #66696C;
  --muted-on-dark: #A3A6A9;
  --wa-text: #08331B;

  --heading: #2A2C2F;
  --contact-bg: #2A2C2F;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --header-h: 60px;
  --gutter: 22px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { color: var(--heading); margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { margin: 0; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--anthracite);
  color: #fff;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

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

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}
.container--narrow { max-width: 760px; }

.icon { width: 1.25em; height: 1.25em; flex: none; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
/* Il blur sta su uno pseudo-elemento: backdrop-filter sull'header renderebbe
   l'header il riferimento del menu position:fixed, che non coprirebbe più lo schermo */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(243 245 246 / .85);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  height: var(--header-h);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.brand { display: block; flex: none; position: relative; z-index: 2; }
.brand img {
  /* Sui telefoni molto stretti lascia spazio al bottone del menu */
  width: min(260px, calc(100vw - 110px));
  height: auto;
}

.menu-toggle {
  position: relative;
  z-index: 2;
  width: 44px; height: 44px;
  margin-right: -10px;
  border: 0;
  background: none;
  color: var(--heading);
  cursor: pointer;
}
.menu-toggle__bars,
.menu-toggle__bars::before,
.menu-toggle__bars::after {
  position: absolute;
  left: 11px;
  width: 22px; height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .35s var(--ease), opacity .2s;
}
.menu-toggle__bars { top: 21px; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; left: 0; }
.menu-toggle__bars::before { top: -7px; }
.menu-toggle__bars::after { top: 7px; }
.menu-open .menu-toggle__bars { background: transparent; }
.menu-open .menu-toggle__bars::before { transform: translateY(7px) rotate(45deg); background: var(--heading); }
.menu-open .menu-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); background: var(--heading); }

/* Senza JS il menu resta una riga di link visibile sotto il logo */
.menu ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.menu a { text-decoration: none; font-weight: 600; }
.menu__cta { display: none; }

html:not(.js) .menu-toggle { display: none; }
/* Senza JS il menu va su più righe: un header fisso occuperebbe troppo schermo */
html:not(.js) .site-header { position: static; }
html:not(.js) .site-header__inner { height: auto; flex-wrap: wrap; padding-block: 12px; }
html:not(.js) .menu { font-size: .9rem; }

.js .menu {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  gap: 32px;
  overflow-y: auto;
  padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s var(--ease), visibility .35s;
}
.js .menu ul { flex-direction: column; gap: 6px; }
.js .menu ul a {
  display: block;
  padding: 6px 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--heading);
  transform: translateY(12px);
  transition: transform .5s var(--ease), color .2s;
}
.js .menu ul a:hover { color: var(--red); }
.js .menu__cta { display: inline-flex; align-self: flex-start; }
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity .35s var(--ease), visibility 0s; }
.menu-open .menu ul a { transform: none; }
.menu-open { overflow: hidden; }

/* ---------- Tipografia comune ---------- */

.kicker {
  margin-bottom: 12px;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--red);
}

.section { padding: 64px 0; scroll-margin-top: var(--header-h); }
.section h2 {
  margin-bottom: 28px;
  font-size: clamp(1.9rem, 6.5vw, 3.2rem);
  line-height: 1.08;
  font-weight: 800;
}
.section--white { background: #fff; }

/* ---------- Bottoni ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), background-color .2s, color .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgb(0 0 0 / .12); }
.btn:active { transform: translateY(0); }
.btn--wa { background: var(--wa); color: var(--wa-text); }
.btn--mail, .btn--tel { border-color: currentColor; background: transparent; }
.btn--lg { padding: 17px 26px; font-size: 1.05rem; }

/* ---------- Hero ---------- */

.hero { padding: 28px 0 0; overflow: hidden; }
.hero h1 {
  font-size: clamp(2.6rem, 12vw, 5.4rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -.035em;
}
.hero h1 span { color: var(--red); }
.hero__lead {
  max-width: 34ch;
  margin-top: 16px;
  font-size: 1.06rem;
  line-height: 1.55;
}
.hero__lead strong { color: var(--heading); }
.hero__actions {
  display: none;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.hero__actions .btn--mail { color: var(--anthracite); }

/* ---------- Strisce che scorrono ---------- */

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.marquee-wrap { position: relative; margin-top: 32px; }
.marquee { overflow: hidden; }
.marquee__track {
  display: flex;
  width: max-content;
  animation: marquee 48s linear infinite;
}
/* Pausa al passaggio del mouse solo con un vero puntatore: su touch il tocco
   attiva :hover e lo lascia attivo, fermando la striscia per sempre */
@media (hover: hover) and (pointer: fine) {
  .marquee:hover .marquee__track { animation-play-state: paused; }
}
/* Spazio con margin (non gap): così metà track coincide con l'inizio dei cloni e il loop non salta */
.marquee picture { flex: none; margin-right: 12px; }

.marquee img {
  width: auto;
  height: 180px;
  border-radius: 12px;
  background: #ECEDEC;
}
/* Senza JS la fila non è duplicata: niente animazione, scorrimento manuale */
html:not(.js) .marquee { overflow-x: auto; }
html:not(.js) .marquee__track { animation: none; padding: 0 var(--gutter); }

.names-marquee {
  margin: 40px 0 8px;
  padding: 14px 0;
  overflow: hidden;
  border-block: 1px solid var(--line);
}
.names-marquee .marquee__track { gap: 0; animation-duration: 60s; }
.names-marquee span {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted-strong);
  white-space: nowrap;
}
.names-marquee span::after { content: "·"; margin: 0 16px; color: var(--red); }
html:not(.js) .names-marquee .marquee__track { flex-wrap: wrap; width: auto; row-gap: 6px; }

/* ---------- Come funziona ---------- */

.steps { margin: 0; padding: 0; list-style: none; }
.step {
  display: flex;
  gap: 16px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}
.step__num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--anthracite);
  color: #fff;
  font-size: .9rem;
  font-weight: 700;
}
.step h3 { margin: 4px 0 4px; font-size: 1.12rem; font-weight: 700; }
.step p { color: var(--text); }

/* ---------- Cosa compriamo ---------- */

.categories {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.category {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg);
}
.category img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  mix-blend-mode: multiply;
  transition: transform .8s var(--ease);
}
.category:hover img { transform: scale(1.04); }
.category span {
  display: block;
  padding: 10px 14px 12px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--heading);
}
.categories__more { margin-top: 20px; max-width: 60ch; }

.designers { margin-top: 32px; text-align: center; }
.designers summary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1.5px solid var(--red);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  color: var(--red);
  list-style: none;
  transition: background-color .2s, color .2s, transform .25s var(--ease);
}
.designers summary:hover { background: var(--red); color: #fff; transform: translateY(-2px); }
.designers summary::-webkit-details-marker { display: none; }
.designers summary::before {
  content: "";
  width: 8px; height: 8px;
  margin-top: -4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform .3s var(--ease);
}
.designers[open] summary::before { transform: rotate(-135deg); margin-top: 4px; }
.designers ul {
  text-align: left;
  columns: 2 160px;
  column-gap: 24px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  font-size: .9rem;
  color: var(--anthracite);
}
.designers li { padding: 3px 0; break-inside: avoid; }

/* ---------- Perché noi ---------- */

.section--dark { background: var(--contact-bg); color: var(--bg); }
.section--dark h2 { color: #fff; }
.section--dark .kicker, .section--ink .kicker { color: var(--red-soft); }

.perks {
  display: grid;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.perks li {
  padding-left: 18px;
  border-left: 2px solid var(--red-soft);
}
.perks strong { display: block; color: #fff; font-size: 1.08rem; }
.perks span { display: block; margin-top: 4px; color: #C9CCCF; font-size: .95rem; }
.perks__note { margin-top: 32px; max-width: 62ch; color: #C9CCCF; }

/* ---------- Chi siamo ---------- */

.prose p + p { margin-top: 1em; }
.prose { font-size: 1.05rem; }

/* ---------- Contatti ---------- */

.section--ink { background: var(--contact-bg); color: #fff; text-align: center; }
.contact h2 { color: #fff; font-size: clamp(2.2rem, 9vw, 4rem); }
.contact__lead { color: #B9BCC0; margin: -8px auto 28px; max-width: 40ch; }
.contact__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  margin: 0 auto;
}
.contact .btn--tel { color: var(--red-soft); border-color: var(--red-soft); }
.contact .btn--mail { color: #fff; }
.contact .btn { white-space: normal; }
/* Sui telefoni stretti l'indirizzo email deve stare nel bottone: testo e margini si adattano */
.contact .btn--lg { padding-inline: clamp(12px, 4vw, 26px); font-size: clamp(.875rem, 4.4vw, 1.05rem); gap: 8px; }
/* Chiamaci: sempre su una riga; su mobile senza "+39" per farlo stare */
.btn__text { display: flex; align-items: center; white-space: nowrap; }
.btn__sep { white-space: pre; }
.btn__prefix { display: none; }

/* ---------- Footer ---------- */

.site-footer {
  padding: 24px 0 28px;
  background: var(--ink);
  color: var(--muted-on-dark);
  font-size: .8rem;
  text-align: center;
}
.site-footer a { color: #B9BCC0; }

/* ---------- CTA sempre visibili ---------- */

.sticky-cta {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  gap: 10px;
  padding: 18px 14px calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(rgb(243 245 246 / 0), var(--bg) 40%);
  transition: transform .4s var(--ease), opacity .3s;
}
.sticky-cta .btn { flex: 1; padding: 13px 10px; }
.sticky-cta .btn--mail { color: var(--anthracite); background: rgb(255 255 255 / .7); }
/* Nascosta quando la sezione Contatti è a schermo (gestito dal JS) */
.sticky-cta.is-hidden { transform: translateY(110%); opacity: 0; }
.site-footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

.fab-wa {
  position: fixed;
  right: 24px; bottom: 24px;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--wa);
  color: var(--wa-text);
  box-shadow: 0 10px 30px rgb(0 0 0 / .2);
  transition: transform .25s var(--ease), opacity .3s;
}
.fab-wa .icon { width: 28px; height: 28px; }
.fab-wa:hover { transform: scale(1.08); }
.fab-wa.is-hidden { opacity: 0; pointer-events: none; transform: scale(.8); }

/* ---------- Reveal (solo con JS attivo) ---------- */

.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
  /* Rete di sicurezza: se main.js non parte, i contenuti compaiono comunque */
  animation: reveal-fallback .6s 2.5s forwards;
}
.js [data-reveal].is-visible { opacity: 1; transform: none; animation: none; }
.js.reveal-ready [data-reveal] { animation: none; }

@keyframes reveal-fallback { to { opacity: 1; transform: none; } }

/* ---------- Tablet / desktop ---------- */

@media (min-width: 768px) {
  :root { --gutter: 40px; --header-h: 72px; }
  .site-footer { padding-bottom: 28px; }
  .sticky-cta { display: none; }
  .fab-wa { display: flex; }
  .brand img { width: 300px; }
  .hero { padding-top: 64px; }
  .hero__lead { max-width: 44ch; font-size: 1.15rem; }
  .kicker { font-size: .9rem; }
  .hero__actions { display: flex; }
  .marquee-wrap { margin-top: 56px; }
  .marquee img { height: 260px; }
  .section { padding: 104px 0; }
  .perks { grid-template-columns: repeat(2, 1fr); gap: 36px 48px; }
  .contact__actions { flex-direction: row; flex-wrap: wrap; justify-content: center; max-width: none; }
  .btn__prefix { display: inline; }
}

@media (min-width: 900px) {
  .menu-toggle { display: none; }
  .js .menu, html:not(.js) .menu {
    position: static;
    flex-direction: row;
    align-items: center;
    gap: 28px;
    padding: 0;
    background: none;
    opacity: 1;
    visibility: visible;
  }
  .menu ul, .js .menu ul { flex-direction: row; flex-wrap: nowrap; gap: 22px; white-space: nowrap; }
  .js .menu ul a { padding: 0; font-size: .92rem; font-weight: 600; letter-spacing: 0; transform: none; color: var(--anthracite); }
  .js .menu ul a:hover { color: var(--red); }
  .js .menu__cta { padding: 10px 18px; font-size: .9rem; }
  /* Su desktop il bottone in header resta compatto: "WhatsApp" */
  .menu__cta-extra { display: none; }
  html:not(.js) .site-header__inner { flex-wrap: nowrap; height: var(--header-h); padding-block: 0; }

  .steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
  .step { flex-direction: column; padding-top: 28px; }
  .categories { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
  .category img { height: 260px; }
  .perks { grid-template-columns: repeat(4, 1fr); }
  .designers ul { columns: 4 180px; }
}

@media (min-width: 900px) and (max-width: 1099px) {
  .js .menu__cta { display: none; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .js [data-reveal] { opacity: 1; transform: none; }
  .marquee, .names-marquee { overflow-x: auto; }
  .names-marquee .marquee__track { flex-wrap: wrap; width: auto; row-gap: 6px; padding: 0 var(--gutter); }
}

/* ---------- Pagina 404 ---------- */

.notfound {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px var(--gutter);
}
.notfound .brand img { width: 220px; margin-bottom: 56px; }
.notfound h1 { font-size: clamp(2.4rem, 10vw, 4.6rem); line-height: 1; font-weight: 800; letter-spacing: -.035em; }
.notfound h1 span { color: var(--red); }
.notfound p { margin-top: 16px; font-size: 1.1rem; }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.btn--home { background: var(--anthracite); color: #fff; }
.notfound .btn--mail { color: var(--anthracite); }
