/* ============================================
   AMBROSI SRL — Unified Theme Stylesheet
   Version: 3.1 | 2026
   Dark / Light con toggle
   ============================================ */

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

/* ============================================
   TEMA DARK (default)
   ============================================ */
:root {
  --bg:           #0a0a0a;
  --bg-alt:       #1e1e1e;
  --bg-deep:      #111111;
  --bg-card:      #1e1e1e;
  --text:         #f5f2ee;
  --text-mid:     rgba(245,242,238,0.65);
  --text-light:   #8a9ba8;
  --accent:       #77151e;
  --accent-vis:   #a02028;   /* leggibile su dark */
  --accent-tint:  rgba(119,21,30,0.1);
  --border:       rgba(255,255,255,0.06);
  --border-acc:   rgba(119,21,30,0.3);
  --nav-bg:       rgba(10,10,10,0.92);
  --num-bg:       #0a0a0a;
  --num-text:     #f5f2ee;
  --num-span:     #d94060;
  --num-label:    #8a9ba8;
  --client-bg:    #1e1e1e;
  --client-text:  rgba(255,255,255,0.15);
  --client-hover: #252525;
  --client-htxt:  rgba(255,255,255,0.5);
  --footer-bg:    #060606;
  --footer-text:  #f4f1ec;
  --footer-sub:   #7a7068;
  --shadow:       none;
  --noise-op:     0.4;
  --form-bg:      rgba(255,255,255,0.04);
  --form-border:  rgba(255,255,255,0.1);
  --form-text:    #f5f2ee;
  --form-ph:      rgba(255,255,255,0.25);
  --contact-bg:   #111111;
  --contact-text: #f5f2ee;
  --contact-info: rgba(245,242,238,0.75);
  --service-bg:   #1e1e1e;
  --sector-bg:    transparent;
  --sector-text:  #8a9ba8;
  --gallery-bg:   #1e1e1e;
}

/* ============================================
   TEMA LIGHT
   ============================================ */
[data-theme="light"] {
  --bg:           #f4f1ec;
  --bg-alt:       #eae6de;
  --bg-deep:      #ddd8ce;
  --bg-card:      #f4f1ec;
  --text:         #1a1614;
  --text-mid:     #4a3f38;
  --text-light:   #7a6f68;
  --accent:       #77151e;
  --accent-vis:   #77151e;   /* leggibile su light direttamente */
  --accent-tint:  #fce9ea;
  --border:       rgba(0,0,0,0.08);
  --border-acc:   rgba(119,21,30,0.2);
  --nav-bg:       rgba(244,241,236,0.94);
  --num-bg:       #1a1614;
  --num-text:     #f4f1ec;
  --num-span:     #e05060;
  --num-label:    #7a7068;
  --client-bg:    #ede9e2;
  --client-text:  rgba(26,22,20,0.18);
  --client-hover: #77151e;   /* rosso pieno su hover */
  --client-htxt:  #ffffff;   /* testo bianco su rosso */
  --footer-bg:    #e8e4dc;
  --footer-text:  #1a1614;
  --footer-sub:   #6a5f58;
  --shadow:       0 12px 40px rgba(119,21,30,0.08);
  --noise-op:     0.15;
  --form-bg:      #ffffff;
  --form-border:  #ddd8ce;
  --form-text:    #1a1614;
  --form-ph:      #7a6f68;
  --contact-bg:   #eae6de;
  --contact-text: #1a1614;
  --contact-info: #4a3f38;
  --service-bg:   #f4f1ec;
  --sector-bg:    #f4f1ec;
  --sector-text:  #4a3f38;
  --gallery-bg:   #ddd8ce;
}

/* ============================================
   TRANSIZIONE TEMA (fluida)
   ============================================ */
*, *::before, *::after {
  transition:
    background-color 0.45s cubic-bezier(0.4,0,0.2,1),
    border-color     0.45s cubic-bezier(0.4,0,0.2,1),
    color            0.35s cubic-bezier(0.4,0,0.2,1),
    box-shadow       0.45s cubic-bezier(0.4,0,0.2,1);
}
/* Override: no transition su elementi con animazioni proprie */
.hero-title .line,
.cursor, .cursor-ring,
.gallery-grid,
.marquee-inner,
.scroll-line,
.nav-logo img,
.footer-logo img { transition: none !important; }


/* Elementi che usano filter/transform/opacity/max-height come animazione:
   la transizione globale non include queste proprietà quindi non interferisce.
   Le regole specifiche con !important le gestiscono individualmente. */

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none;
}

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
  position: fixed;
  bottom: 36px;
  right: 36px;
  z-index: 1000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(119,21,30,0.4);
  transition: transform 0.3s, box-shadow 0.3s !important;
  outline: none;
}
.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 32px rgba(119,21,30,0.55);
}
.theme-toggle:active { transform: scale(0.95); }

/* Icone sole / luna */
.icon-sun, .icon-moon {
  position: absolute;
  width: 20px; height: 20px;
  stroke: #fff;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  transition: opacity 0.3s, transform 0.4s !important;
}
:root .icon-sun   { opacity: 1;  transform: rotate(0deg)   scale(1); }
:root .icon-moon  { opacity: 0;  transform: rotate(90deg)  scale(0.5); }
[data-theme="light"] .icon-sun  { opacity: 0;  transform: rotate(-90deg) scale(0.5); }
[data-theme="light"] .icon-moon { opacity: 1;  transform: rotate(0deg)   scale(1); }

/* Tooltip */
.theme-toggle::before {
  content: attr(data-tip);
  position: absolute;
  right: 62px;
  white-space: nowrap;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--bg-alt);
  color: var(--text);
  padding: 6px 12px;
  border: 1px solid var(--border-acc);
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: opacity 0.2s, transform 0.2s !important;
}
.theme-toggle:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* ============================================
   CURSOR
   ============================================ */
.cursor {
  position: fixed;
  width: 10px; height: 10px;
  background: var(--accent-vis);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99999;
  transform: translate(-50%, -50%);
}
.cursor-ring {
  position: fixed;
  width: 36px; height: 36px;
  border: 1px solid rgba(119,21,30,0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  transition: width 0.15s, height 0.15s !important;
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 28px 60px;
  transition: background 0.4s, padding 0.4s;
}
nav.scrolled {
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 18px 60px;
  border-bottom: 1px solid var(--border-acc);
}
.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img {
  display: block;
  height: 36px;
  width: auto !important;
  max-width: none !important;
  transition: opacity 0.3s !important;
}

/* Dark theme (default): mostra logo sfondo black, nasconde chiaro */
.logo-dark  { opacity: 1; }
.logo-light { display: none !important; }

/* Light theme: mostra logo sfondo chiaro, nasconde dark */
[data-theme="light"] .logo-dark  { display: none !important; }
[data-theme="light"] .logo-light { display: block !important; opacity: 1; }
.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
}
.nav-links a {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-light);
  text-decoration: none;
}
.nav-links a:hover { color: var(--accent-vis); }
.nav-cta {
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 10px 22px;
  text-decoration: none;
}
.nav-cta:hover { background: var(--accent-vis); transform: translateY(-1px); }

/* ============================================
   CTA BUTTON — shared across sections
   ============================================ */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  color: #fff;
  background: var(--accent);
  padding: 16px 36px;
  border: 1px solid var(--accent);
  position: relative;
  overflow: hidden;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s !important;
}
.cta-btn::after {
  content: '\2192';
  font-size: 14px;
  transition: transform 0.3s !important;
  display: inline-block;
}
.cta-btn:hover {
  background: transparent;
  color: var(--accent-vis);
  border-color: var(--accent-vis);
  transform: translateY(-2px);
}
.cta-btn:hover::after {
  transform: translateX(5px);
}

/* Wrapper centrato con spaziatura verticale */
.section-cta-wrap {
  display: flex;
  justify-content: center;
  padding: 60px 0 20px;
}

/* Nella sezione about la CTA è allineata a sinistra sotto la citazione */
.about-text .cta-btn {
  margin-top: 36px;
}

/* Tema light: bordo visibile su sfondo chiaro */
[data-theme="light"] .cta-btn {
  color: #fff;
}
[data-theme="light"] .cta-btn:hover {
  color: var(--accent-vis);
  background: transparent;
}

/* ============================================
   HERO
   ============================================ */
#hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-video, .hero-video-fallback {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: grayscale(30%) contrast(1.1);
}
.hero-video { opacity: 0.42; }
.hero-video-fallback { opacity: 0.42; display: none; }

[data-theme="light"] .hero-video,
[data-theme="light"] .hero-video-fallback { opacity: 0.52; filter: grayscale(20%) contrast(1.05) brightness(1.1); }

/* ── Light theme: service cards — overlay chiaro ── */
[data-theme="light"] .service-card-bg {
  filter: grayscale(100%) brightness(1.05) contrast(0.85);
}
[data-theme="light"] .service-card:hover .service-card-bg {
  filter: grayscale(20%) brightness(0.88) contrast(0.95);
}
[data-theme="light"] .service-card-overlay {
  background: linear-gradient(to top, rgba(244,241,236,0.82) 0%, rgba(244,241,236,0.3) 50%, transparent 100%);
}
[data-theme="light"] .service-card:hover .service-card-overlay {
  background: linear-gradient(to top, rgba(119,21,30,0.55) 0%, rgba(119,21,30,0.15) 50%, transparent 100%);
}

/* ── Light theme: client cards — overlay chiaro ── */
[data-theme="light"] .client-card-bg {
  filter: grayscale(100%) brightness(1.1) contrast(0.8);
}
[data-theme="light"] .client-card:hover .client-card-bg,
[data-theme="light"] .client-card.active .client-card-bg {
  filter: grayscale(20%) brightness(0.85) contrast(0.95);
}
[data-theme="light"] .client-card-overlay {
  background: linear-gradient(to top, rgba(244,241,236,0.82) 0%, rgba(244,241,236,0.3) 50%, transparent 100%);
}
[data-theme="light"] .client-card:hover .client-card-overlay,
[data-theme="light"] .client-card.active .client-card-overlay {
  background: linear-gradient(to top, rgba(119,21,30,0.55) 0%, rgba(119,21,30,0.15) 50%, transparent 100%);
}

/* ── Light theme: numbers section ── */
[data-theme="light"] #numbers {
  background: var(--bg-deep);
}
[data-theme="light"] .number-block {
  background: var(--bg-alt);
  border: 1px solid rgba(119,21,30,0.1);
}
[data-theme="light"] .num-value {
  color: var(--accent);
}
[data-theme="light"] .num-label {
  color: var(--text-mid);
}
[data-theme="light"] .num-suffix {
  color: var(--accent);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(10,10,10,0.2) 0%, rgba(10,10,10,0.0) 40%, rgba(10,10,10,0.88) 100%);
  transition: background 0.45s !important;
}
[data-theme="light"] .hero-overlay {
  background: linear-gradient(to bottom, rgba(244,241,236,0.3) 0%, rgba(244,241,236,0.0) 35%, rgba(244,241,236,0.92) 100%);
}
.hero-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(119,21,30,0.1) 0%, transparent 50%);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 0 60px 80px;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: flex-end;
}
.hero-title {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(68px, 9.5vw, 130px);
  line-height: 0.95;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
}
.hero-title .line { display: block; }
.hero-title .line:nth-child(1) { animation-delay: 0.1s; }
.hero-title .line:nth-child(2) { animation-delay: 0.25s; color: var(--accent-vis); }
.hero-title .line:nth-child(3) { animation-delay: 0.4s; }

.hero-right {
  display: flex; flex-direction: column; align-items: flex-end; gap: 28px;
  padding-bottom: 12px; 
}

.hero-desc {
  font-size: 15px; line-height: 1.7;
  color: var(--text-mid); max-width: 360px; text-align: right; font-style: italic;
}
.hero-stats { display: flex; gap: 36px; }
.stat-item { text-align: center; }
.stat-num { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; font-size: 42px; color: var(--accent-vis); line-height: 1; display: block; }
.stat-label { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-light); }
.hero-scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
   cursor: pointer; text-decoration: none;
}
.hero-scroll span { font-family: 'IBM Plex Mono', monospace; font-size: 9px; letter-spacing: 3px; text-transform: uppercase; color: var(--text-light); }
.scroll-line {
  width: 1px; height: 50px;
  background: linear-gradient(to bottom, var(--accent-vis), transparent);
  animation: scrollPulse 2s infinite;
}
@keyframes scrollPulse { 0%,100% { opacity:1; transform:scaleY(1); } 50% { opacity:0.4; transform:scaleY(0.5); } }

/* ============================================
   SHARED
   ============================================ */
section { position: relative; }
.section-tag { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent-vis); margin-bottom: 16px; }
.section-title { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; font-size: clamp(40px,5.5vw,76px); line-height: 1.0; letter-spacing: 1px; text-transform: uppercase; color: var(--text); }

/* ============================================
   MARQUEE
   ============================================ */
.marquee-strip { background: var(--accent); padding: 14px 0; overflow: hidden; white-space: nowrap; }
.marquee-inner { display: inline-flex; animation: marquee 22s linear infinite; }
.marquee-inner span { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; font-size: 20px; letter-spacing: 4px; text-transform: uppercase; color: #fff; padding: 0 40px; }
.marquee-inner span.dot { padding: 0; color: rgba(255,255,255,0.35); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================
   ABOUT
   ============================================ */
#about { padding: 140px 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 100px; align-items: center; background: var(--bg); }
.about-img-wrap { position: relative; aspect-ratio: 4/5; overflow: hidden; }
.about-img-wrap img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(40%); transition: filter 0.6s, transform 0.6s !important; }
.about-img-wrap:hover img { filter: grayscale(0%); transform: scale(1.04); }
.about-img-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(119,21,30,0.1) 0%, transparent 60%); pointer-events: none; }

.about-text .section-title { margin-bottom: 32px; }
.about-text p { font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; line-height: 1.8; color: var(--text-mid); margin-bottom: 20px; }
.ceo-quote { margin-top: 40px; padding-left: 24px; border-left: 2px solid var(--accent); }
.ceo-quote blockquote { font-family: 'IBM Plex Sans', sans-serif; font-size: 16px; font-style: italic; font-weight: 400; line-height: 1.75; color: var(--text); margin-bottom: 12px; }
.ceo-quote cite { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-vis); font-style: normal; }

/* ============================================
   NUMBERS
   ============================================ */
#numbers { padding: 100px 60px; background: var(--bg-alt); display: grid; grid-template-columns: repeat(4,1fr); gap: 2px; }
.number-block { padding: 60px 40px; background: var(--num-bg); position: relative; overflow: hidden; }
.number-block:hover { filter: brightness(1.06); }
.number-block::before { content:''; position:absolute; top:0;left:0; width:100%;height:2px; background:var(--accent); transform:scaleX(0); transform-origin:left; transition:transform 0.4s !important; }
.number-block:hover::before { transform:scaleX(1); }
.num-value { font-family: 'Barlow Semi Condensed', sans-serif; font-weight: 700; font-size: 80px; line-height: 1; color: var(--num-text); margin-bottom: 8px; }
.num-value span { color: var(--num-span); }
.num-label { font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--num-label); }

/* ============================================
   SERVICES
   ============================================ */
#services { padding: 140px 60px; background: var(--bg); }
.services-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 80px; }
.services-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 2px; }

/* Card base */
.service-card {
  position: relative;
  overflow: hidden;
  padding: 48px 40px;
  border: 1px solid transparent;
  min-height: 340px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), box-shadow 0.4s !important;
}
.service-card:hover { transform: translateY(-4px); }

/* Immagine di sfondo — layer separato per controllare grayscale */
.service-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) brightness(0.65);
  transform: scale(1.0);
  transition: filter 0.65s cubic-bezier(0.4,0,0.2,1), transform 0.65s cubic-bezier(0.4,0,0.2,1) !important;
  z-index: 0;
}
.service-card:hover .service-card-bg {
  filter: grayscale(0%) brightness(0.55);
  transform: scale(1.06);
}

/* Overlay scuro sopra l'immagine — garantisce leggibilità testo sempre */
.service-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.45) 50%,
    rgba(0,0,0,0.15) 100%
  );
  z-index: 1;
  transition: background 0.65s !important;
}
.service-card:hover .service-card-overlay {
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.78) 0%,
    rgba(0,0,0,0.35) 50%,
    rgba(0,0,0,0.05) 100%
  );
}

/* Nel tema light l'overlay ha una tinta leggermente rossa su hover */


/* Tutti i contenuti della card sopra bg e overlay */
.service-card-content {
  position: relative;
  z-index: 2;
}

/* Bordo bottom accent */
.service-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1) !important;
  z-index: 3;
}
.service-card:hover::after { transform: scaleX(1); }

/* Testo sempre bianco (sia dark che light) perché sopra foto scura */
.service-card .service-num {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 700;
  font-size: 72px;
  color: rgba(255,255,255,0.07);
  line-height: 1;
  position: absolute;
  top: 20px; right: 24px;
  z-index: 2;
}
.service-icon {
  width: 44px; height: 44px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  transition: background 0.3s, border-color 0.3s !important;
}
.service-card:hover .service-icon {
  background: rgba(119,21,30,0.7);
  border-color: rgba(255,255,255,0.4);
}
.service-icon svg { width: 20px; height: 20px; stroke: #ffffff; fill: none; stroke-width: 1.6; }

.service-title {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 700;
  font-size: 24px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 12px;
}
.service-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  line-height: 1.7;
  color: rgba(255,255,255,0.65);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1), opacity 0.4s !important;
  opacity: 0;
}
.service-card:hover .service-desc {
  max-height: 120px;
  opacity: 1;
}

/* Immagini di sfondo per ogni card */
.service-card[data-service="tornitura"]  .service-card-bg { background-image: url('../images/services/tornitura.webp'); }
.service-card[data-service="fresatura"]  .service-card-bg { background-image: url('../images/services/fresatura.webp'); }
.service-card[data-service="jit"]        .service-card-bg { background-image: url('../images/services/jit.webp'); }
.service-card[data-service="produzione"] .service-card-bg { background-image: url('../images/services/produzione.webp'); }
.service-card[data-service="qualita"]    .service-card-bg { background-image: url('../images/services/qualita.webp'); }
.service-card[data-service="lean"]       .service-card-bg { background-image: url('../images/services/lean.webp'); }

/* Fallback colore se l'immagine non è ancora caricata */
.service-card[data-service="tornitura"]  .service-card-bg { background-color: #2a2a2a; }
.service-card[data-service="fresatura"]  .service-card-bg { background-color: #252525; }
.service-card[data-service="jit"]        .service-card-bg { background-color: #2e2e2e; }
.service-card[data-service="produzione"] .service-card-bg { background-color: #272727; }
.service-card[data-service="qualita"]    .service-card-bg { background-color: #2c2c2c; }
.service-card[data-service="lean"]       .service-card-bg { background-color: #242424; }

/* Light theme: border visibile sulle card */
[data-theme="light"] .service-card { border: 1px solid rgba(119,21,30,0.12); }
[data-theme="light"] .service-card:hover { box-shadow: 0 16px 48px rgba(0,0,0,0.35); border-color: transparent; }

/* ============================================
   SECTORS
   ============================================ */
#sectors { padding: 120px 60px 140px; background: var(--bg); }
.sectors-title-row { margin-bottom: 60px; }

/* Sectors — layout numero grande + griglia 3 colonne */
.sectors-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 60px;
  align-items: start;
}
.sectors-big-num {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 800;
  font-size: 200px;
  line-height: 1;
  color: #111;
  position: relative;
  user-select: none;
  letter-spacing: -4px;
}
.sectors-big-num sup {
  position: absolute;
  bottom: 14px;
  right: -8px;
  font-size: 44px;
  color: var(--accent);
  letter-spacing: 0;
  font-weight: 800;
}
.sectors-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border-acc);
}
.sector-item {
  background: var(--bg);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid transparent;
  transition: color 0.22s, background 0.22s, border-color 0.22s;
}
.sector-item:hover {
  color: var(--text);
  background: var(--bg-card);
  border-bottom-color: var(--accent);
}
.sector-item .si-n {
  font-size: 8px;
  color: #222;
  width: 20px;
  flex-shrink: 0;
  transition: color 0.22s;
}
.sector-item:hover .si-n { color: var(--accent); }

/* ============================================
   GALLERY
   ============================================ */
#gallery { padding: 140px 0; background: var(--gallery-bg); overflow: hidden; }
.gallery-header { padding: 0 60px; margin-bottom: 60px; }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 0 60px;
}
.gallery-item { height:260px; overflow:hidden; position:relative; cursor:pointer; }
.gallery-item img { width:100%;height:100%;object-fit:cover; filter:grayscale(100%) brightness(0.85); transition:filter 0.4s,transform 0.4s !important; }
.gallery-item:hover img { filter:grayscale(0%) brightness(1); transform:scale(1.08); }
.gallery-item-label { position:absolute; bottom:12px;left:12px; font-family:'IBM Plex Mono', monospace; font-size:9px; letter-spacing:2px; text-transform:uppercase; color:#fff; background:rgba(119,21,30,0.8); padding:4px 10px; opacity:0; transition:opacity 0.3s !important; }
.gallery-item:hover .gallery-item-label { opacity:1; }

/* ── Gallery Lightbox ── */
.gallery-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
}
.gallery-lightbox.open {
  display: flex;
}
.gallery-lightbox img {
  max-width: 92vw;
  max-height: 85vh;
  object-fit: contain;
  display: block;
  border: 1px solid rgba(255,255,255,0.1);
}
.gallery-lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  font-family: 'IBM Plex Mono', monospace;
  line-height: 1;
  background: none;
  border: none;
  padding: 8px;
  z-index: 1;
  transition: color 0.2s !important;
}
.gallery-lightbox-close:hover { color: #a02028; }

/* ============================================
   CLIENTS
   ============================================ */
#clients { padding: 120px 60px; background: var(--bg); }
.clients-header { text-align:left; margin-bottom:70px; }
.clients-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:2px; }
.client-card { aspect-ratio:3/2; position:relative; overflow:hidden; cursor:pointer; border:1px solid var(--border); }
[data-theme="light"] .client-card { border-color:rgba(119,21,30,0.1); }
.client-card-bg { position:absolute; inset:0; background-size:cover; background-position:center; filter:grayscale(100%) brightness(0.65); transform:scale(1.0); transition:filter 0.55s ease, transform 0.55s ease !important; }
.client-card:hover .client-card-bg { filter:grayscale(0%) brightness(0.45); transform:scale(1.06); }
.client-card[data-client="ono"]    .client-card-bg { background-color:#1a1a2e; background-image:url('../images/clients/ono.webp'); }
.client-card[data-client="orotig"] .client-card-bg { background-color:#16213e; background-image:url('../images/clients/orotig.webp'); }
.client-card[data-client="gea"]    .client-card-bg { background-color:#0f3460; background-image:url('../images/clients/gea.webp'); }
.client-card[data-client="zirkonzahn"] .client-card-bg { background-color:#1b1b2f; background-image:url('../images/clients/zirkonzahn.webp'); }
.client-card[data-client="accossato"]  .client-card-bg { background-color:#162447; background-image:url('../images/clients/accossato.webp'); }
.client-card[data-client="faiveley"]   .client-card-bg { background-color:#1f4068; background-image:url('../images/clients/faiveley.webp'); }
.client-card-overlay { position:absolute; inset:0; background:linear-gradient(to top,rgba(0,0,0,0.82) 0%,rgba(0,0,0,0.1) 60%,transparent 100%); z-index:1; }
.client-card-content { position:absolute; inset:0; z-index:2; display:flex; flex-direction:column; justify-content:flex-end; padding:24px 28px; }
.client-card-name { font-family:'Barlow Semi Condensed',sans-serif; font-weight:700; font-size:22px; letter-spacing:2px; text-transform:uppercase; color:#fff; margin:0 0 8px; transition:transform 0.35s ease !important; }
.client-card-desc { font-family:'IBM Plex Sans',sans-serif; font-size:12px; line-height:1.65; color:rgba(255,255,255,0.82); margin:0; max-height:0; overflow:hidden; opacity:0; transform:translateY(10px); transition:max-height 0.45s ease, opacity 0.35s ease 0.08s, transform 0.35s ease 0.08s !important; }
.client-card:hover .client-card-name { transform:translateY(-4px); }
.client-card:hover .client-card-desc { max-height:80px; opacity:1; transform:translateY(0); }
.client-card::after { content:''; position:absolute; bottom:0; left:0; width:0; height:2px; background:var(--accent); z-index:3; transition:width 0.4s ease !important; }
.client-card:hover::after { width:100%; }

/* ============================================
   CONTACT
   ============================================ */
#contact { padding: 140px 60px; background: var(--contact-bg); color: var(--contact-text); border-top: 1px solid var(--border-acc); }
.contact-grid { display:grid; grid-template-columns:1fr 1fr; gap:120px; align-items:start; }
.contact-left .section-tag { color:var(--accent-vis); }
.contact-left .section-title { color:var(--contact-text); margin-bottom:32px; }
.contact-info-item { display:flex; gap:20px; align-items:flex-start; margin-bottom:28px; padding-bottom:28px; border-bottom:1px solid var(--border); }
.contact-info-item:last-child { border-bottom:none; }
.info-icon { width:36px;height:36px; border:1px solid var(--border-acc); background:var(--accent-tint); display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:2px; }
.info-icon svg { width:14px;height:14px; stroke:var(--accent-vis); fill:none; stroke-width:2; }
[data-theme="light"] .info-icon {
  background: #ffffff;
  border: 1px solid rgba(119,21,30,0.3);
  box-shadow: 0 2px 8px rgba(119,21,30,0.07);
}
[data-theme="light"] .info-icon svg { stroke: #77151e; }
.info-label { font-family:'IBM Plex Mono', monospace; font-size:9px; letter-spacing:2px; text-transform:uppercase; color:var(--accent-vis); margin-bottom:4px; }
.info-value { font-size:15px; color:var(--contact-info); line-height:1.5; }
.form-group { margin-bottom:22px; }
.form-group label { display:block; font-family:'IBM Plex Mono', monospace; font-size:9px; letter-spacing:2px; text-transform:uppercase; color:var(--accent-vis); margin-bottom:8px; }
.form-group input, .form-group textarea { width:100%; background:var(--form-bg); border:1px solid var(--form-border); border-bottom:1px solid var(--border-acc); padding:14px 16px; font-family:'IBM Plex Sans', sans-serif; font-size:14px; color:var(--form-text); outline:none; resize:none; }
.form-group input::placeholder, .form-group textarea::placeholder { color:var(--form-ph); }
.form-group input:focus, .form-group textarea:focus { border-color:var(--accent-vis); box-shadow:0 0 0 3px rgba(119,21,30,0.1); }
.form-submit { font-family:'IBM Plex Sans', sans-serif; font-weight:600; font-size:12px; letter-spacing:1.5px; text-transform:uppercase; background:var(--accent); color:#fff; border:none; padding:18px 44px; cursor:pointer; width:100%; margin-top:6px; }
.form-submit:hover { background:var(--accent-vis); transform:translateY(-1px); }

/* ============================================
   FOOTER
   ============================================ */
footer { background:var(--footer-bg); border-top:1px solid var(--border-acc); padding:60px; display:flex; justify-content:space-between; align-items:flex-end; }
.footer-logo { margin-bottom: 12px; line-height: 1; }
.footer-logo img { display: block; height: 52px; width: auto; }
[data-theme="light"] .footer-logo .logo-dark  { display: none; }
[data-theme="light"] .footer-logo .logo-light { display: block; }
[data-theme="light"] footer { border-top-color: rgba(119,21,30,0.15); }
[data-theme="light"] .footer-right a:hover { color: var(--accent); }
[data-theme="light"] .footer-logo span { color: var(--accent); }
.footer-logo .logo-light { display: none; }
.footer-logo span { color:#d94060; }
.footer-tagline { font-family:'IBM Plex Mono', monospace; font-size:9px; letter-spacing:3px; text-transform:uppercase; color:var(--footer-sub); }
.footer-right { text-align:right; font-family:'IBM Plex Mono', monospace; font-size:9px; letter-spacing:1px; color:var(--footer-sub); line-height:2; }
.footer-right a { color:var(--footer-sub); text-decoration:none; }
.footer-right a:hover { color:#d94060; }

/* ============================================
   SCROLL REVEAL
   ============================================ */
.reveal {}
.reveal.visible { opacity:1; transform:none; }
.reveal-left {}
.reveal-left.visible { opacity:1; transform:none; }
.reveal-right {}
.reveal-right.visible { opacity:1; transform:none; }

/* NOISE */
body::before { content:''; position:fixed; inset:0; background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E"); pointer-events:none; z-index: 1; opacity:var(--noise-op); }

/* ============================================
   FAQ
   ============================================ */
#faq {
  padding: 140px 60px;
  background: var(--bg-alt);
  position: relative;
}
.faq-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 80px;
}
.faq-subtitle {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-mid);
  text-align: right;
  max-width: 280px;
}
.faq-list {
  max-width: 860px;
  margin: 0 auto;
}

/* Item */
.faq-item {
  border-top: 1px solid var(--border);
  overflow: hidden;
}
.faq-item:last-child {
  border-bottom: 1px solid var(--border);
}

/* Question button */
.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 28px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: color 0.25s !important;
}
.faq-question:hover,
.faq-item.open .faq-question {
  color: var(--accent-vis);
}

/* Icona +/− */
.faq-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-acc);
  position: relative;
  transition: background 0.25s, border-color 0.25s, transform 0.4s cubic-bezier(0.4,0,0.2,1) !important;
}
.faq-icon::before,
.faq-icon::after {
  content: '';
  position: absolute;
  background: var(--accent-vis);
  transition: opacity 0.25s, transform 0.35s !important;
}
/* orizzontale */
.faq-icon::before {
  width: 12px; height: 1.5px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
/* verticale */
.faq-icon::after {
  width: 1.5px; height: 12px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
}
/* quando aperto: ruota e scompare verticale */
.faq-item.open .faq-icon {
  background: var(--accent);
  border-color: var(--accent);
  transform: rotate(45deg);
}
.faq-item.open .faq-icon::before,
.faq-item.open .faq-icon::after {
  background: #fff;
}

/* Answer panel */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.45s cubic-bezier(0.4,0,0.2,1) !important;
}
.faq-answer p {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-mid);
  padding: 0 48px 28px 0;
}
.faq-answer a {
  color: var(--accent-vis);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s !important;
}
.faq-answer a:hover {
  border-bottom-color: var(--accent-vis);
}

/* Left accent bar when open */
.faq-item.open {
  border-top-color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* ── Social links footer ── */
.footer-social {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  align-items: center;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--footer-sub);
  transition: color 0.25s, transform 0.25s !important;
}
.social-link svg {
  width: 18px;
  height: 18px;
}
.social-link:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   JIT4C — Scroll-Driven Full-Screen
   ═══════════════════════════════════════════ */

#jit4c {
  background: var(--bg);
}

.jit4c-intro-row {
  padding: 120px 60px 80px;
  max-width: 680px;
}

.jit4c-lead {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-mid);
  margin-top: 24px;
  font-style: italic;
}

/* ── Sticky scroll outer — 4 step * 100vh ── */
.jit4c-sticky-outer {
  position: relative;
  height: 400vh;
}

.jit4c-sticky-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

/* ── Sfondi che si alternano ── */
.jit4c-bg-panels {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.jit4c-bg-panel {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease !important;
}
.jit4c-bg-panel.active { opacity: 1; }
.jit4c-bg-panel[data-step="0"] { background: radial-gradient(ellipse 60% 70% at 75% 50%, rgba(119,21,30,0.10) 0%, transparent 70%); }
.jit4c-bg-panel[data-step="1"] { background: radial-gradient(ellipse 60% 70% at 75% 50%, rgba(119,21,30,0.09) 0%, transparent 70%); }
.jit4c-bg-panel[data-step="2"] { background: radial-gradient(ellipse 60% 70% at 75% 50%, rgba(119,21,30,0.12) 0%, transparent 70%); }
.jit4c-bg-panel[data-step="3"] { background: radial-gradient(ellipse 60% 70% at 75% 50%, rgba(119,21,30,0.10) 0%, transparent 70%); }

/* ── Stage: occupa tutto l'inner ── */
.jit4c-stage {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: stretch;
}

/* ── Layout 2 colonne: sinistra testo, destra SVG ── */
.jit4c-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  height: 100%;
}

/* ── Dots indicatore (dentro la colonna sinistra) ── */
.jit4c-steps-indicator {
  position: absolute;
  left: 60px;
  bottom: 48px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  z-index: 10;
}
.jit4c-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid var(--text-muted);
  transition: background 0.3s, transform 0.3s, border-color 0.3s !important;
}
.jit4c-step-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
}

/* ── Colonna sinistra: cards ── */
.jit4c-cards {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 50px 0 60px;
  overflow: hidden;
}

/* Tutte le card: absolute, centrate verticalmente allo stesso modo */
.jit4c-card {
  position: absolute;
  left: 60px;
  right: 50px;
  top: 50%;
  transform: translateY(-50%) translateY(30px);
  opacity: 0;
  transition: opacity 0.55s ease, transform 0.55s ease !important;
  pointer-events: none;
}
.jit4c-card.active {
  opacity: 1;
  transform: translateY(-50%);
  pointer-events: auto;
}

/* Tag step */
.jit4c-card-tag {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

/* Numero grande */
.jit4c-card-big {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(80px, 11vw, 160px);
  line-height: 0.9;
  color: var(--text);
  letter-spacing: -3px;
  margin-bottom: 12px;
}
.jit4c-card-big span {
  font-size: 0.42em;
  color: var(--accent);
  letter-spacing: 0;
}

/* Titolo card */
.jit4c-card-title {
  font-family: 'Barlow Semi Condensed', sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.5vw, 48px);
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 20px;
}

/* Descrizione */
.jit4c-card-desc {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-mid);
  max-width: 400px;
}

/* Label verticale */
.jit4c-side-label {
  display: none;
}

/* ── Colonna destra: SVG ── */
.jit4c-visuals {
  position: relative;
  border-left: 1px solid var(--border-acc);
  overflow: hidden;
}

.jit4c-visual {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.6s ease, transform 0.6s ease !important;
  pointer-events: none;
}
.jit4c-visual.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.jit4c-svg {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  color: var(--text);
  display: block;
}

/* ── Mobile: layout colonna normale ── */
@media (max-width: 900px) {
  .jit4c-intro-row { padding: 80px 24px 48px; }
  .jit4c-sticky-outer { height: auto; }
  .jit4c-sticky-inner { position: relative; height: auto; overflow: visible; }
  .jit4c-stage { display: none; }
  .jit4c-mobile-cards { display: flex; flex-direction: column; gap: 2px; padding: 0 0 60px; }
  #jit4c .section-cta-wrap { padding: 0 24px 80px !important; }
}

.jit4c-mobile-card {
  padding: 40px 24px;
  border-bottom: 1px solid var(--border-acc);
}
.jit4c-mobile-card .jit4c-card-big {
  font-size: clamp(54px, 16vw, 90px);
  letter-spacing: -2px;
  margin-bottom: 10px;
}
.jit4c-mobile-card .jit4c-card-title {
  font-size: clamp(22px, 5vw, 32px);
  margin-bottom: 14px;
}
.jit4c-mobile-card .jit4c-card-desc {
  font-size: 14px;
  line-height: 1.75;
  margin-bottom: 40px;
}
.jit4c-mobile-chart {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border-acc);
  border-radius: 2px;
  padding: 16px 12px 8px;
  overflow: hidden;
}

@media (min-width: 901px) {
  .jit4c-mobile-cards { display: none; }
}

/* ── JIT4C SVG — classi tema dark/light ── */

/* Tratto principale (lancette, outline) */
.svg-stroke-main { stroke: #f5f2ee; }
[data-theme="light"] .svg-stroke-main { stroke: #1a1614; }

/* Tratto dimmed (griglia, sfondi) */
.svg-stroke-dim  { stroke: rgba(245,242,238,0.15); }
[data-theme="light"] .svg-stroke-dim  { stroke: rgba(26,22,20,0.2); }

/* Tratto mid (tacche orologio) */
.svg-stroke-mid  { stroke: rgba(245,242,238,0.3); }
[data-theme="light"] .svg-stroke-mid  { stroke: rgba(26,22,20,0.3); }

/* Fill sfondo (interno cerchi) */
.svg-fill-bg     { fill: #0a0a0a; }
[data-theme="light"] .svg-fill-bg     { fill: #f4f1ec; }

/* Fill sfondo solido (nodi, aree) */
.svg-fill-bg-solid { fill: #0a0a0a; }
[data-theme="light"] .svg-fill-bg-solid { fill: #f4f1ec; }

/* Testo accent rosso */
.svg-text-accent { fill: #77151e; font-weight: 600; }

/* Testo principale */
.svg-text-main   { fill: #f5f2ee; }
[data-theme="light"] .svg-text-main   { fill: #1a1614; }

/* Testo muted */
.svg-text-muted  { fill: rgba(245,242,238,0.45); }
[data-theme="light"] .svg-text-muted  { fill: rgba(26,22,20,0.5); }

/* Punti griglia (step 2) */
.svg-dot-dim     { fill: rgba(245,242,238,0.6); }
[data-theme="light"] .svg-dot-dim     { fill: rgba(26,22,20,0.5); }

/* Arco orologio — animazione */
.jit4c-arc {
  stroke: #77151e;
  stroke-dasharray: 1256.6;
  stroke-dashoffset: 1256.6;
}
.jit4c-visual.active .jit4c-arc {
  animation: jit4c-arc-fill 1.8s cubic-bezier(0.4,0,0.2,1) 0.3s forwards !important;
}
@keyframes jit4c-arc-fill {
  to { stroke-dashoffset: 25; }
}

/* ── JIT4C barre SMED ── */
.jit4c-bar-grow {
  transform: scaleY(0);
  animation: none;
}
.jit4c-visual.active .jit4c-bar-grow {
  animation: jit4c-bar-grow 0.9s cubic-bezier(0.4,0,0.2,1) 0.4s forwards !important;
}
@keyframes jit4c-bar-grow {
  to { transform: scaleY(1); }
}

/* Fix pulse per step 3 — usa cx/cy 250 250 del nuovo SVG */
.jit4c-pulse {
  animation: jit4c-pulse-anim 2.5s ease-out infinite !important;
}
@keyframes jit4c-pulse-anim {
  0%   { opacity: 0.18; }
  100% { opacity: 0; r: 120; }
}

/* Nav right: lang switcher + CTA */
.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════
   LANG SWITCHER — Desktop + Mobile
   ═══════════════════════════════════════════ */

.lang-switcher {
  position: relative;
}

.lang-current {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-acc);
  border-radius: 2px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: color 0.2s, border-color 0.2s !important;
  white-space: nowrap;
  line-height: 1;
}
.lang-current:hover {
  color: var(--text);
  border-color: var(--accent);
}
.lang-current svg {
  transition: transform 0.2s !important;
  opacity: 0.5;
  flex-shrink: 0;
}
.lang-current[aria-expanded="true"] svg { transform: rotate(180deg); }

.lang-flag { font-size: 14px; line-height: 1; }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-alt);
  border: 1px solid var(--border-acc);
  border-radius: 2px;
  list-style: none;
  padding: 6px 0;
  margin: 0;
  min-width: 185px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s !important;
  z-index: 600;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.lang-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.lang-dropdown li { padding: 0; }
.lang-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s !important;
}
.lang-dropdown a:hover {
  color: var(--text);
  background: rgba(119,21,30,0.06);
}
.lang-dropdown a.lang-active { color: var(--accent); }
.lang-dropdown .lang-flag { font-size: 16px; }

/* Light theme */
[data-theme="light"] .lang-dropdown {
  box-shadow: 0 8px 32px rgba(0,0,0,0.10);
}


@media (max-width: 900px) {
  nav { padding:16px 20px; grid-template-columns: auto 1fr auto; gap: 0; }
  nav.scrolled { padding:12px 20px; }
  .nav-links { display:none; }
  .lang-current { padding: 5px 8px; font-size: 9px; }
  .lang-current-code { display: none; }
  .lang-flag { font-size: 16px; }
  .hero-content { grid-template-columns:1fr !important; padding:0 24px 60px !important; }
  .hero-right { align-items:flex-start; }
  .hero-desc { text-align:left; }

  /* hero-scroll nascosto */
  .hero-scroll { display:none; }

  /* Numbers */
  #numbers { grid-template-columns:repeat(2,1fr); padding:40px 16px; }
  .number-block { padding:32px 20px; }
  .num-value { font-size:48px; }
  .num-label { font-size:10px; letter-spacing:1px; }

  #about { grid-template-columns:1fr; padding:80px 24px; gap:60px; }
  #services { padding:80px 24px; }
  .services-header { flex-direction:column; align-items:flex-start; }

  /* Services: 2 colonne + expand al click */
  .services-grid { grid-template-columns:repeat(2,1fr); gap:2px; }
  .service-card { min-height:200px; padding:24px 20px; }
  .service-card .service-num { font-size:18px; }
  .service-card .service-title { font-size:16px; }
  .service-card .service-desc { max-height:0; opacity:0; overflow:hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease !important; }
  .service-card.expanded .service-desc { max-height:200px; opacity:1; }
  .service-card.expanded { min-height:260px; z-index:2; }

  #sectors { padding:0 24px 80px; }
  .sectors-layout { grid-template-columns: 1fr; gap: 32px; }
  .sectors-big-num { font-size: 120px; }
  .sectors-cols { grid-template-columns: repeat(2, 1fr); }
  .sector-item { padding: 14px 16px; font-size: 9px; }

  /* Gallery: stop animazione, griglia 2 colonne, lightbox al click */
  #gallery { padding:80px 0; }
  .gallery-header { padding:0 24px; margin-bottom:40px; }
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px;
  }
  .gallery-item { height:180px; }
  .gallery-item img { filter:grayscale(100%) brightness(0.85); }
  .gallery-item-label { opacity:1; }

  /* Lightbox overlay */

  /* Partner di eccellenza: stesso stile service-card (no aspect-ratio fisso) */
  #clients { padding:80px 24px; }
  .clients-grid { grid-template-columns:repeat(2,1fr); gap:2px; }
  .client-card {
    aspect-ratio: unset;
    min-height: 180px;
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  .client-card-bg { filter:grayscale(100%) brightness(0.55); transition:filter 0.4s ease, transform 0.4s ease !important; }
  .client-card-content {
    position: relative;
    z-index: 2;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .client-card-name { font-size:14px; letter-spacing:1px; transform:none; }
  .client-card-desc {
    max-height: 0; opacity:0;
    transform: translateY(6px);
    transition: max-height 0.4s ease, opacity 0.4s ease, transform 0.4s ease !important;
  }
  .client-card.active { min-height:unset; }
  .client-card.active .client-card-bg { filter:grayscale(0%) brightness(0.45); transform:scale(1.06); }
  .client-card.active .client-card-name { color:#fff; }
  .client-card.active .client-card-desc { max-height:300px; opacity:1; transform:translateY(0); font-size:11px; }
  .client-card.active::after { width:100%; }

  #faq { padding:80px 24px; }
  .faq-header { flex-direction:column; align-items:flex-start; gap:16px; margin-bottom:48px; }
  .faq-subtitle { text-align:left; max-width:100%; }
  .faq-question { font-size:17px; }
  #contact { padding:80px 24px; }
  .contact-grid { grid-template-columns:1fr; gap:60px; }
  footer { padding:40px 24px; flex-direction:column; gap:24px; align-items:flex-start; }
  .footer-right { text-align:left; }
  .theme-toggle { bottom:24px; right:24px; }
}
