/* ============================================================
   Colmar S.r.l. · Lavanderia Industriale
   Palette derivata dal logo (#0850B0) · tema chiaro
   ============================================================ */

/* ---------- Font ---------- */
@font-face {
  font-family: 'Baloo 2';
  src: url('../assets/fonts/baloo2-var.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Archivo';
  src: url('../assets/fonts/archivo-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ---------- Token ---------- */
:root {
  --blu:          oklch(0.453 0.166 258.7);   /* #0850B0, dal logo */
  --blu-vivo:     oklch(0.55 0.16 258.7);
  --blu-profondo: oklch(0.31 0.12 259);
  --inchiostro:   oklch(0.24 0.04 259);
  --ghiaccio:     oklch(0.962 0.014 252);
  --carta:        oklch(0.995 0.003 252);
  --cielo:        oklch(0.88 0.05 252);
  --su-blu-muto:  oklch(0.87 0.055 258);

  --font-display: 'Baloo 2', 'Avenir Next Rounded', system-ui, sans-serif;
  --font-corpo: 'Archivo', 'Helvetica Neue', Arial, sans-serif;

  --raggio: 1.25rem;
  --raggio-pill: 100rem;

  --z-header: 100;
  --z-menu: 200;

  --spazio-sezione: clamp(4.5rem, 10vw, 8rem);
  --transizione: 0.55s cubic-bezier(0.19, 1, 0.22, 1); /* ease-out-expo */
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  font-family: var(--font-corpo);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--inchiostro);
  background: var(--carta);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.08;
  margin: 0 0 1rem;
  text-wrap: balance;
  color: var(--blu);
}

h1 {
  font-size: clamp(2.5rem, 6.5vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.015em;
}

h2 {
  font-size: clamp(1.9rem, 4vw, 2.9rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 { font-size: clamp(1.25rem, 2.2vw, 1.55rem); font-weight: 700; }
h4 { font-size: 1.125rem; font-weight: 700; margin-bottom: 0.35rem; }

p { margin: 0 0 1.1rem; max-width: 68ch; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: var(--blu); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--blu-vivo); }

ul { padding-left: 1.2rem; }
li { margin-bottom: 0.35rem; }

:focus-visible {
  outline: 2px solid var(--blu);
  outline-offset: 3px;
  border-radius: 4px;
}

.contenitore {
  max-width: 72rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.sezione { padding-block: var(--spazio-sezione); }
.sezione-ghiaccio { background: var(--ghiaccio); }

.sezione-testa { margin-bottom: clamp(2.5rem, 6vw, 4rem); }
.sezione-testa p { font-size: 1.125rem; }

.salta {
  position: absolute;
  left: -200vw;
  top: 0;
  background: var(--blu);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: var(--z-menu);
  border-radius: 0 0 var(--raggio) 0;
}
.salta:focus { left: 0; color: #fff; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  padding: 0.8rem 1.6rem;
  border-radius: var(--raggio-pill);
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.19, 1, 0.22, 1),
              background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease,
              box-shadow 0.25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-grande { padding: 1rem 2rem; font-size: 1.0625rem; }
.btn-piccolo { padding: 0.5rem 1.1rem; font-size: 0.9375rem; margin-top: 0.75rem; }

.btn-pieno {
  background: var(--blu);
  color: #fff;
  box-shadow: 0 10px 24px -12px var(--blu);
}
.btn-pieno:hover { background: var(--blu-vivo); color: #fff; box-shadow: 0 14px 28px -12px var(--blu); }

.btn-vuoto {
  border-color: var(--blu);
  color: var(--blu);
  background: transparent;
}
.btn-vuoto:hover { background: var(--blu); color: #fff; }

.btn-bianco {
  background: #fff;
  color: var(--blu);
}
.btn-bianco:hover { background: var(--ghiaccio); color: var(--blu-profondo); }

.btn-vuoto-bianco {
  border-color: #fff;
  color: #fff;
  background: transparent;
}
.btn-vuoto-bianco:hover { background: #fff; color: var(--blu); }

/* ---------- Testata ---------- */
.testata {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--carta);
  background: color-mix(in oklab, var(--carta) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.testata.scorsa {
  border-bottom-color: var(--cielo);
  box-shadow: 0 6px 24px -18px var(--blu-profondo);
}
.testata-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 0.75rem clamp(1.25rem, 4vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.testata-logo img { width: clamp(170px, 20vw, 230px); height: auto; }
.testata-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 1.8rem);
}
.testata-nav > a:not(.btn) {
  font-weight: 550;
  font-size: 0.9875rem;
  text-decoration: none;
  color: var(--inchiostro);
}
.testata-nav > a:not(.btn):hover { color: var(--blu); }
.testata-cta { padding: 0.55rem 1.25rem; font-size: 0.9375rem; }

.testata-menu {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  cursor: pointer;
}
.testata-menu span {
  display: block;
  height: 2.5px;
  border-radius: 2px;
  background: var(--blu);
  transition: transform 0.3s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.2s ease;
}

/* ---------- Eroe ---------- */
.eroe {
  position: relative;
  overflow: hidden;
  background: var(--carta);
  padding-block: clamp(5rem, 12vh, 9rem) clamp(4.5rem, 10vh, 7rem);
}
.eroe-tessuto {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(58%, 46rem);
  background: url('../assets/img/raso-rigato.jpg') center / cover no-repeat;
  -webkit-mask-image: linear-gradient(105deg, transparent 0%, #000 38%);
  mask-image: linear-gradient(105deg, transparent 0%, #000 38%);
  opacity: 0.9;
}
.eroe-inner { position: relative; }
.eroe-luogo {
  font-weight: 600;
  color: var(--blu-vivo);
  margin-bottom: 1.25rem;
}
.eroe h1 em {
  font-style: normal;
  color: var(--blu-vivo);
}
.eroe-sotto {
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  max-width: 34rem;
  margin-block: 1.5rem 2.25rem;
}
.eroe-azioni { display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* choreography al load: lo stato nascosto arriva solo via JS (.anima-pronta) */
.anima-pronta .anima-eroe {
  opacity: 0;
  transform: translateY(22px);
  animation: eroe-sale 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}
.anima-pronta .anima-eroe:nth-child(1) { animation-delay: 0.05s; }
.anima-pronta .anima-eroe:nth-child(2) { animation-delay: 0.15s; }
.anima-pronta .anima-eroe:nth-child(3) { animation-delay: 0.28s; }
.anima-pronta .anima-eroe:nth-child(4) { animation-delay: 0.4s; }
@keyframes eroe-sale {
  to { opacity: 1; transform: none; }
}

/* ---------- Nastro (marquee) ---------- */
.nastro {
  background: var(--blu);
  color: #fff;
  overflow: hidden;
  padding-block: 0.8rem;
}
.nastro-traccia {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  width: max-content;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.125rem;
  white-space: nowrap;
}
.nastro-traccia i { font-style: normal; font-size: 0.8em; opacity: 0.7; }
.nastro-scorre .nastro-traccia { animation: nastro-va 28s linear infinite; }
@keyframes nastro-va {
  to { transform: translateX(-50%); }
}

/* ---------- Azienda ---------- */
.azienda {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.azienda-scheda {
  background: var(--ghiaccio);
  border-radius: var(--raggio);
  overflow: hidden;
}
.azienda-scheda-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.azienda-scheda ul {
  list-style: none;
  margin: 0;
  padding: 1.5rem 1.75rem 1.75rem;
}
.azienda-scheda li {
  padding-block: 0.55rem;
  border-bottom: 1px solid var(--cielo);
}
.azienda-scheda li:last-child { border-bottom: none; margin-bottom: 0; }
.azienda-scheda strong {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--blu);
  margin-right: 0.3rem;
}

/* ---------- Ciclo ---------- */
.ciclo {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.75rem, 4vw, 3rem);
  counter-reset: ciclo;
}
.ciclo li {
  border-top: 2px solid var(--cielo);
  padding-top: 1.1rem;
}
.ciclo-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.4rem;
  line-height: 1;
  color: var(--cielo);
  display: block;
  margin-bottom: 0.5rem;
}
.ciclo h3 { margin-bottom: 0.5rem; }
.ciclo p { font-size: 1rem; }

.oltre { margin-top: clamp(3rem, 7vw, 5rem); }
.oltre-titolo { color: var(--inchiostro); margin-bottom: 1.5rem; }
.oltre-riga {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem 2.5rem;
}
.oltre-riga article {
  background: var(--carta);
  border: 1px solid var(--cielo);
  border-radius: var(--raggio);
  padding: 1.5rem 1.6rem;
}
.oltre-riga h4 { color: var(--blu); }
.oltre-riga p { font-size: 0.9875rem; margin-bottom: 0; }

/* ---------- Settori ---------- */
.settore {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
  margin-bottom: clamp(3rem, 8vw, 5.5rem);
}
.settore:last-child { margin-bottom: 0; }
.settore-media img {
  border-radius: var(--raggio);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.settore-inverso .settore-media { order: 2; }
.settore-inverso .settore-testo { order: 1; }
.settore-testo ul { margin-block: 0.75rem 1rem; }

/* ---------- Galleria prodotti ---------- */
.galleria {
  display: flex;
  gap: 1.25rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.5rem clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--cielo) transparent;
}
.galleria figure {
  margin: 0;
  flex: 0 0 clamp(240px, 30vw, 360px);
  scroll-snap-align: start;
}
.galleria img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--raggio);
}
.galleria figcaption {
  font-size: 0.9375rem;
  font-weight: 550;
  color: var(--blu-profondo);
  padding-top: 0.6rem;
}

/* ---------- Preventivo (drenched) ---------- */
.preventivo {
  background:
    radial-gradient(60rem 40rem at 110% -10%, oklch(0.5 0.17 258.7 / 0.55), transparent 60%),
    radial-gradient(50rem 36rem at -15% 115%, oklch(0.27 0.11 259 / 0.7), transparent 55%),
    var(--blu);
  color: #fff;
}
.preventivo-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}
.preventivo h2 { color: #fff; }
.preventivo-testo p { color: var(--su-blu-muto); font-size: 1.125rem; }
.preventivo-testo strong { color: #fff; }
.preventivo-nota { font-size: 1rem; }

.preventivo-form { display: grid; gap: 1.1rem; }
.campo { display: grid; gap: 0.4rem; }
.campo-riga {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}
.campo label {
  font-weight: 600;
  font-size: 0.9375rem;
}
.campo input,
.campo select,
.campo textarea {
  font: inherit;
  color: var(--inchiostro);
  background: #fff;
  border: 2px solid transparent;
  border-radius: 0.8rem;
  padding: 0.75rem 1rem;
  width: 100%;
}
.campo input::placeholder,
.campo textarea::placeholder { color: oklch(0.45 0.03 259); }
.campo input:focus-visible,
.campo select:focus-visible,
.campo textarea:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
.campo textarea { resize: vertical; min-height: 5rem; }

.form-errore {
  background: #fff;
  color: oklch(0.45 0.19 25);
  font-weight: 600;
  border-radius: 0.8rem;
  padding: 0.7rem 1rem;
  margin: 0;
}

.preventivo-azioni {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 0.4rem;
}

/* ---------- Contatti ---------- */
.contatti-griglia {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2rem 2.5rem;
}
.contatto h3 {
  font-size: 1.125rem;
  margin-bottom: 0.4rem;
}
.contatto h3 + p { margin-bottom: 1.25rem; }
.contatto ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.contatto li {
  padding-block: 0.45rem;
  border-bottom: 1px solid var(--cielo);
  font-size: 0.9875rem;
}
.contatto li:last-child { border-bottom: none; }

/* ---------- Fondo ---------- */
.fondo {
  background: var(--blu-profondo);
  color: var(--su-blu-muto);
  padding-block: clamp(2.5rem, 6vw, 4rem);
}
.fondo-inner { display: grid; gap: 1.5rem; }
.fondo-logo { width: 200px; height: auto; }
.fondo-dati p { margin-bottom: 0.3rem; font-size: 0.9375rem; }
.fondo-dati strong { color: #fff; }
.fondo-copy { font-size: 0.875rem; opacity: 0.8; }

/* ---------- Reveal su scroll ---------- */
/* Visibile di default; il JS nasconde solo ciò che è sotto il fold,
   e solo quando l'observer è attivo */
.rivela {
  transition: opacity 0.7s ease, transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}
.rivela.rivela-nascosta {
  opacity: 0;
  transform: translateY(18px);
}

/* ---------- Mobile ---------- */
@media (max-width: 860px) {
  .testata-menu { display: flex; }
  .testata-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--carta);
    border-bottom: 1px solid var(--cielo);
    box-shadow: 0 20px 40px -24px var(--blu-profondo);
    padding: 0.5rem 1.25rem 1.25rem;
    display: none;
  }
  .testata-nav.aperta { display: flex; }
  .testata-nav > a:not(.btn) {
    padding: 0.9rem 0.25rem;
    border-bottom: 1px solid var(--ghiaccio);
    font-size: 1.0625rem;
  }
  .testata-cta { margin-top: 1rem; justify-content: center; }

  .menu-aperto .testata-menu span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  .menu-aperto .testata-menu span:nth-child(2) { opacity: 0; }
  .menu-aperto .testata-menu span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

  .eroe-tessuto {
    inset: auto 0 0 0;
    width: 100%;
    height: 32%;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 65%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 65%);
    opacity: 0.55;
  }
  .eroe { padding-bottom: clamp(9rem, 30vh, 13rem); }

  .azienda,
  .settore,
  .preventivo-inner { grid-template-columns: 1fr; }
  .settore-inverso .settore-media { order: 0; }
  .settore-inverso .settore-testo { order: 0; }
  .campo-riga { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .eroe-azioni .btn { width: 100%; justify-content: center; }
  .preventivo-azioni .btn { width: 100%; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .anima-pronta .anima-eroe {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .nastro-scorre .nastro-traccia { animation: none; }
  .rivela,
  .rivela.rivela-nascosta {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover { transform: none; }
}
