/* ============================================================
   METALMEC — Sezioni (ordine = ordine pagina)
   ============================================================ */

/* --- 2. HERO (heritage · video scrubbing 1962→oggi, pinnata) --- */
/* .hero-pin crea la distanza di scroll dello scrub: la hero resta pinnata
   (sticky) mentre si scorre qui dentro, poi si sblocca. La showcase (z-index
   superiore, opaca, margin-top negativo) sale a coprirla. Vedi js/main.js. */
.hero-pin {
  height: 450vh;
}

.hero {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  color: var(--white);
  z-index: 0;
}

.hero--heritage {
  background: #0b0d10;
}

.hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

/* Video di sfondo scrubbato dallo scroll (poster come fallback) */
.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}

/* Scrim: velo scuro in alto e in basso (dove stanno i titoloni) per la
   leggibilità dei testi bianchi centrati sopra il video. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg,
      rgba(8, 10, 13, 0.74) 0%,
      rgba(8, 10, 13, 0.40) 24%,
      rgba(8, 10, 13, 0.34) 52%,
      rgba(8, 10, 13, 0.46) 76%,
      rgba(8, 10, 13, 0.72) 100%);
}

/* Contenuto hero: 3 zone impilate e centrate (titolo / lead+CTA / DAL 1962). */
.hero__content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  padding: calc(var(--header-h) + 28px) var(--gutter) 52px;
}

/* Titoloni: "OFFICINE MECCANICHE" (alto) e "DAL 1962" (basso) */
.hero__officine,
.hero__year1962 {
  margin: 0;
  width: 100%;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 0.98;
  color: var(--white);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.42);
}

.hero__officine {
  font-size: clamp(2.6rem, 8.2vw, 8rem);
  letter-spacing: -0.02em;
}

.hero__year1962 {
  font-size: clamp(2.4rem, 7vw, 6.6rem);
  letter-spacing: 0.01em;
}

/* Wrapper di parola: il titolo va a capo solo tra le parole (non a metà). */
.hero__word {
  display: inline-block;
  white-space: nowrap;
}

/* Ogni lettera è animabile singolarmente (dissolvenza sparsa al load) */
.hero__ch {
  display: inline-block;
}

/* Zona centrale: lead + CTA a pillola */
.hero__mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 620px;
}

.hero__lead {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lead);
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);
}

.hero__cta {
  margin: 0;
}

/* Barra timeline 1962 → oggi, riempita in base allo scrub */
.hero__timeline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
}

.hero__progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #fff, rgba(255, 255, 255, 0.5));
}

/* --- 3. SEZIONE PRODUZIONE (3 card) --- */
/* Sale a coprire la hero pinnata: opaca (bg bianco), z-index sopra la hero,
   margin-top negativo per sovrapporsi. min-height 100vh per coprire l'intero
   viewport durante la transizione (nessuno spiraglio sulla hero sotto). */
.showcase {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  margin-top: -100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--white);          /* fondo bianco opaco (copertura hero) */
  padding-block: 96px;
  text-align: center;
}

.showcase .container {
  position: relative;
  z-index: 1;
}

/* Casella che contiene testa + 3 card. Su sezione bianca è una card chiara
   (bordo + ombra morbida), testo scuro. (Reintrodotta su richiesta cliente
   2026-07-11 dopo il passaggio a fondo bianco.) */
.showcase__panel {
  max-width: 920px;
  margin-inline: auto;
  padding: 52px 44px 44px;
  border-radius: 28px;
  background: #f5f6f8;
  border: 1px solid rgba(20, 22, 28, 0.08);
  box-shadow: 0 18px 50px rgba(20, 22, 28, 0.08);
}

.showcase__head {
  max-width: 820px;
  margin-inline: auto;
}

.showcase__sub {
  margin-top: 24px;
  font-size: var(--text-body);
  line-height: 1.5;
}

.dept-cards {
  --fan: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 28px;
}

.dept-card {
  position: relative;
  width: 230px;
  height: 324px;
  border-radius: 20px;
  color: var(--white);
  text-align: center;
  will-change: transform, opacity;
}

/* Effetto ventaglio allo scroll (ispirato a frame.mp4):
   le card laterali emergono dal centro e si aprono verso i lati.
   --fan va da 0 (impilate al centro) a 1 (posizione finale). */
.dept-card:not(.dept-card--featured) {
  opacity: var(--fan);
}

.dept-card:first-child {
  transform:
    translateX(calc((1 - var(--fan)) * 248px))
    scale(calc(0.7 + 0.3 * var(--fan)));
}

.dept-card:last-child {
  transform:
    translateX(calc((1 - var(--fan)) * -248px))
    scale(calc(0.7 + 0.3 * var(--fan)));
}

.dept-card--featured {
  z-index: 3;
  transform: scale(calc(0.9 + 0.1 * var(--fan)));
}

.dept-card--featured {
  width: 255px;
  height: 360px;
  border-radius: 22px;
}

.dept-card__center {
  position: absolute;
  top: 36%;
  left: 0;
  right: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dept-card__label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.9;
}

.dept-card__value {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
}

.dept-card--featured .dept-card__value {
  font-size: 2.15rem;
}

.dept-card__pill {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 6px;
}

.dept-card__note {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(5, 7, 10, 0.14);
}

.dept-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(140deg, #7b5cff, #5a3ff0);
  flex-shrink: 0;
}

.dept-card__note-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.dept-card__note-text strong {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dept-card__note-text small {
  font-size: 0.68rem;
  color: var(--muted);
}

.dept-card__amount {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* --- 4. STRIP CERTIFICAZIONI --- */
.certs {
  margin-top: 190px;
  padding-bottom: 96px;
  text-align: center;
}

.certs__title {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 56px;
}

.certs__list {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.certs__item {
  flex: 1;
  min-width: 0;
}

.certs__item figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.certs__badge {
  height: 51px;
  color: var(--ink);
  opacity: 0.75;
}

.certs__item figcaption {
  font-size: var(--text-body);
  line-height: 1.4;
  color: var(--ink);
}

/* --- 5. SEZIONE DARK LAVORAZIONI (tabs) --- */
.works {
  position: relative;
  background: #000;
  color: var(--white);
}

.works__panels {
  display: grid;
}

.works__panel {
  grid-area: 1 / 1;
  width: 100%;
  aspect-ratio: 1425 / 900;
  max-height: 110vh;
  /* Contenuto centrato in altezza e in larghezza dentro il box a proporzioni
     fisse (uguale per laser/piega/salda): la CTA resta nella stessa posizione
     cambiando tab. */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s;
  pointer-events: none;
}

.works__panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.works__content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.works__content p {
  max-width: 560px;
  margin-inline: auto;
}

.works__content h2 {
  color: var(--white);
}

.works__content p {
  margin-top: 26px;
  font-family: var(--font-display);
  font-size: var(--text-lead);
  line-height: 1.34;
}

.works__content .btn {
  margin-top: 32px;
}

/* Bagliore di saldatura pulsante (solo opacity) */
.works__glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(28% 24% at 62% 68%, rgba(255, 170, 90, 0.55), transparent 70%);
  animation: glow-pulse 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* Carosello dischi nella sezione saldatura */
.works__discs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 92px;
  z-index: 1;
}

/* Video di sfondo del pannello (uno per lavorazione: laser/piega/salda).
   Va in play solo quando il pannello è attivo (gestito in main.js). */
.works__video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

.works__panel.is-active .works__video {
  opacity: 1;
}

/* Velo scuro per la leggibilità del testo bianco sopra il video */
.works__scrim {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.12) 30%,
    rgba(0, 0, 0, 0.18) 62%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

/* Il bagliore di saldatura resta sopra il video ma sotto il contenuto */
.works__glow {
  z-index: 0;
}

/* --- 6. SEZIONE CAPACITÀ PRODUTTIVA (dark, tabs) --- */
.production {
  position: relative;
  background: #000;
  color: var(--white);
  overflow: hidden;
}

.production__panels {
  display: grid;
}

.production__panel {
  grid-area: 1 / 1;
  padding: 120px var(--gutter) 150px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-out), visibility 0.4s;
  pointer-events: none;
}

.production__panel.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.production__content {
  text-align: center;
  max-width: 820px;
  margin-inline: auto;
}

.production__content h2 {
  color: var(--white);
}

.production__content p {
  max-width: 580px;
  margin: 26px auto 0;
  font-family: var(--font-display);
  font-size: var(--text-lead);
  line-height: 1.34;
}

.production__content .btn {
  margin-top: 32px;
}

/* Ingresso dell'INTERA sezione da destra, agganciato allo scroll (var --enter
   0→1 impostata sulla sezione in main.js). Il pannello parte completamente fuori
   schermo a destra (100vw) e scorre dentro tutto intero: video/dischi, testi e
   pulsanti (tab) insieme, come un blocco solido (effetto "wow"). A --enter=1
   torna a translateX 0. Default 1 = a posto (senza JS o con prefers-reduced-motion).
   Nota: durante l'ingresso lo spazio a sinistra mostra lo sfondo pagina finché
   il pannello non arriva del tutto (scelta confermata dall'utente). */
[data-enter-right] {
  transform: translateX(calc((1 - var(--enter, 1)) * 100vw));
  will-change: transform;
}

.production__visual {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* Modello 3D interattivo (desktop): sostituisce i dischi rotanti in entrambi i
   pannelli produzione. Il canvas three.js viene iniettato in .model3d da
   js/model3d.js. Su desktop mostriamo il 3D e nascondiamo i dischi CSS; su
   mobile è il contrario (vedi responsive.css) e il .glb non viene scaricato. */
.production__visual .model3d {
  display: block;
  position: relative;
  width: min(520px, 46vw);
  height: min(520px, 46vw);
  cursor: grab;
}

.production__visual .model3d canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.production__visual .disc-carousel {
  display: none;
}

/* Dimensioni carosello per contesto */
.disc-carousel--lg {
  --disc-size: 250px;
  --disc-radius: 262px;
  --disc-fs: 1.55rem;
}

.disc-carousel--md {
  --disc-size: 190px;
  --disc-radius: 205px;
  --disc-fs: 1.3rem;
}

/* --- 8. SEZIONE QUALITÀ (chiara, 2 colonne) --- */
.quality {
  padding-block: 150px 120px;
  background: var(--white);
}

.quality__grid {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
}

.quality__copy p {
  max-width: 490px;
  margin-top: 30px;
  font-size: var(--text-body);
  line-height: 1.5;
}

.quality__copy .btn {
  margin-top: 36px;
}

.quality__visual {
  display: flex;
  justify-content: center;
}

/* --- 9. CTA FINALE --- */
.final-cta {
  padding-block: 120px 90px;
  text-align: center;
}

.final-cta h2 {
  font-size: clamp(2.25rem, 3.9vw, 4.25rem);
  max-width: 1020px;
  margin-inline: auto;
  line-height: 1.06;
}

.final-cta .btn {
  margin-top: 40px;
}

/* --- 10. NOTE LEGALI --- */
.legal-notes {
  padding-block: 40px 90px;
}

.legal-notes p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 18px;
}

.legal-notes a {
  text-decoration: underline;
}

/* --- 11. FOOTER --- */
.site-footer {
  background: var(--ink);
  color: var(--white);
  padding-block: 96px 48px;
}

.site-footer__title {
  color: var(--white);
  font-size: clamp(1.75rem, 2.8vw, 2.5rem);
  margin-bottom: 40px;
}

/* Card reparti: 3 + 2 */
.plans {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 24px;
}

.plans__item {
  grid-column: span 2;
  display: grid;
}

.plans__item--wide {
  grid-column: span 3;
}

.plan-card {
  position: relative;
  display: block;
  background: var(--white);
  color: var(--ink);
  border-radius: 16px;
  padding: 28px 26px 56px;
  transition: transform var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}

.plan-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.plan-card__name {
  font-size: 1.625rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.plan-card__price {
  margin-top: 14px;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 600;
}

.plan-card__desc {
  margin-top: 16px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #55555a;
}

.plan-card__arrow {
  position: absolute;
  right: 24px;
  bottom: 20px;
  font-size: 1.375rem;
  transition: transform var(--dur-fast) ease;
}

.plan-card:hover .plan-card__arrow {
  transform: translateX(4px);
}

/* (.site-footer__ad e .site-footer__legal rimossi col relativo HTML — 2026-07-11) */

/* Righe di link inline */
.site-footer__linkrows {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid var(--line-dark);
}

.site-footer__linkrows p {
  font-size: 0.8125rem;
  line-height: 2;
  color: var(--muted-dark);
  margin-bottom: 10px;
}

.site-footer__linkrows a {
  color: var(--muted-dark);
  transition: color var(--dur-fast);
}

.site-footer__linkrows a:hover {
  color: var(--white);
}

.site-footer__linkrows span {
  margin-inline: 6px;
  opacity: 0.5;
}

.site-footer__rowlabel {
  color: var(--white);
  margin-right: 4px;
}

.site-footer__rowlabel a {
  color: var(--white);
}

/* Colonne mappa sito */
.site-footer__columns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 32px 24px;
  margin-top: 48px;
  padding-top: 48px;
  border-top: 1px solid var(--line-dark);
}

.site-footer__group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.site-footer__group h3 {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white);
}

.site-footer__group a {
  font-size: 0.875rem;
  line-height: 1.35;
  color: var(--muted-dark);
  transition: color var(--dur-fast);
}

.site-footer__group a:hover {
  color: var(--white);
}

/* Riga social */
.site-footer__social {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  padding-block: 28px;
  border-top: 1px solid var(--line-dark);
}

.site-footer__social-logo {
  color: var(--white);
}

.site-footer__icons {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-footer__icons a {
  color: var(--muted-dark);
  transition: color var(--dur-fast);
}

.site-footer__icons a:hover {
  color: var(--white);
}

/* Riga finale: selettori + link legali */
.site-footer__bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding-top: 28px;
  border-top: 1px solid var(--line-dark);
}

.site-footer__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 8px 16px;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius-pill);
  color: var(--white);
  font-size: 0.875rem;
  transition: border-color var(--dur-fast);
}

.site-footer__chip:hover {
  border-color: var(--muted-dark);
}

.site-footer__legal-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-left: auto;
}

.site-footer__legal-links a {
  font-size: 0.8125rem;
  color: var(--muted-dark);
  transition: color var(--dur-fast);
}

.site-footer__legal-links a:hover {
  color: var(--white);
}
