/* =========================================================
   FDMWEB — style.css
   Design system: nero + giallo + bianco, mobile-first, vanilla CSS
   ========================================================= */

:root {
  --color-primary: #0a0a0a;
  --color-primary-light: #1f1f1f;
  --color-primary-dark: #000000;
  --color-accent: #ffc700;
  --color-accent-dark: #e0ac00;
  --color-accent-text: #8a6500;
  --color-whatsapp: #25d366;
  --color-whatsapp-dark: #1ebe5a;

  --bg: #ffffff;
  --bg-alt: #f4f4f4;
  --bg-card: #ffffff;
  --text: #111111;
  --text-muted: #5a5a5a;
  --border: #e4e4e4;

  --font-base: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.14);

  --container-w: 1160px;
  --header-h: 76px;
}

/* -------------------- Reset -------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-base);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; cursor: pointer; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 12px 18px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* -------------------- Typography -------------------- */
h1 { font-size: clamp(2rem, 5vw, 3.4rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; }
h1 span { color: var(--color-accent-text); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }

.eyebrow {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent-text);
  margin-bottom: 10px;
}
.eyebrow-light { color: #ffe066; }

.section-lead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 640px;
  margin-top: 14px;
}
.section-lead-light { color: #cfcfcf; }

.section-head { margin-bottom: 44px; }

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  border: 2px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); }
.btn .icon { width: 18px; height: 18px; }
.btn.btn-sm { padding: 9px 16px; font-size: 0.85rem; }
.btn.btn-block { width: 100%; }

.btn-primary {
  background: var(--color-accent);
  color: #0a0a0a;
  box-shadow: 0 8px 20px rgba(255, 199, 0, 0.35);
}
.btn-primary:hover { background: var(--color-accent-dark); }

.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--color-primary); }

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.3);
}
.btn-whatsapp:hover { background: var(--color-whatsapp-dark); }

/* -------------------- Header -------------------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-img { height: 32px; width: auto; display: block; }

.main-nav ul { display: flex; gap: 30px; }
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: #ffffff;
  position: relative;
  padding: 6px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px; width: 0;
  background: var(--color-accent);
  transition: width 0.2s ease;
}
.main-nav a:hover::after { width: 100%; }

.header-cta { display: flex; align-items: center; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  background: none;
  border: none;
  padding: 0;
}
.nav-toggle span {
  width: 100%;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* -------------------- Hero -------------------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 640px;
  display: flex;
  align-items: center;
  padding: calc(var(--header-h) + 64px) 0 80px;
  background:
    radial-gradient(720px 420px at 85% -10%, rgba(255, 199, 0, 0.14), transparent 60%),
    linear-gradient(180deg, #fff, var(--bg));
}
.hero-bg-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, #fff 0%, rgba(255, 255, 255, 0.94) 34%, rgba(255, 255, 255, 0.72) 58%, rgba(255, 255, 255, 0.32) 100%);
}
.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
}
.hero-content { max-width: 620px; }
.hero-lead { margin-top: 20px; font-size: 1.1rem; color: var(--text-muted); max-width: 540px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }
.hero-badges {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 30px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}
.hero-badges li { display: flex; align-items: center; gap: 8px; }
.icon-sm { width: 16px; height: 16px; color: var(--color-accent-text); flex-shrink: 0; }

/* -------------------- Sections -------------------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }
.section-dark {
  background: linear-gradient(160deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
}

/* -------------------- Partner -------------------- */
.section-partners {
  padding: 110px 0;
}
.section-partners .container { text-align: center; }
.section-partners .section-head { max-width: 560px; margin: 0 auto 56px; }
.partner-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffe066;
}
.partners-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(48px, 8vw, 110px);
}
.partner-logo {
  width: auto;
  opacity: 0.75;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.partner-logo:hover { opacity: 1; transform: translateY(-2px); }
.partner-logo--alfano { height: 72px; }
.partner-logo--bottigelli { height: 44px; }
.partner-logo--lusi { height: 76px; }
.partner-logo--traent { height: 42px; }
@media (max-width: 760px) {
  .section-partners { padding: 80px 0; }
  .partner-logo--alfano { height: 52px; }
  .partner-logo--bottigelli { height: 32px; }
  .partner-logo--lusi { height: 56px; }
  .partner-logo--traent { height: 30px; }
  .partners-row { gap: 36px 44px; }
}

/* -------------------- Team -------------------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
}
.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.team-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.team-avatar {
  border-radius: 50%;
  margin-bottom: 18px;
  width: 96px;
  height: 96px;
  object-fit: cover;
  object-position: center;
}
.team-role { color: var(--color-accent-text); font-weight: 700; font-size: 0.85rem; margin: 6px 0 12px; }
.team-card p:last-child { color: var(--text-muted); }

.section-subhead { font-size: 1.15rem; font-weight: 800; margin: -8px 0 24px; }

/* -------------------- Timeline -------------------- */
.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  counter-reset: step;
}
.timeline-step {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  border: 1px solid var(--border);
  position: relative;
}
.timeline-number {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  background: var(--color-primary);
  width: 34px; height: 34px;
  line-height: 34px;
  text-align: center;
  border-radius: 50%;
  margin-bottom: 16px;
}
.timeline-step:nth-child(2) .timeline-number,
.timeline-step:nth-child(4) .timeline-number { background: var(--color-accent); color: #0a0a0a; }
.timeline-step h3 { margin-bottom: 8px; }
.timeline-step p { color: var(--text-muted); font-size: 0.95rem; }

/* -------------------- Services -------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.service-icon {
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--bg-alt);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.service-icon svg { width: 24px; height: 24px; }
.service-card h3 { margin-bottom: 10px; }
.service-card p { color: var(--text-muted); font-size: 0.95rem; }
.service-benefit {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  color: var(--text) !important;
}
.service-benefit strong { color: var(--color-accent-text); }

/* -------------------- Analytics -------------------- */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.analytics-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 22px;
  min-height: 148px;
}
.analytics-label { font-size: 0.85rem; font-weight: 700; color: #d4d4d4; }
.analytics-sub { font-size: 0.78rem; color: #9a9a9a; margin-top: 4px; }
.analytics-value {
  font-size: 2.1rem;
  font-weight: 800;
  margin-top: 8px;
  color: #fff;
}

.mini-chart { width: 100%; height: 50px; margin-top: 10px; color: var(--color-accent); }
.mini-chart polyline { stroke-width: 2.4; }
.mini-chart-lg { height: 70px; }

.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 70px; margin-top: 14px; }
.bar-chart span {
  flex: 1;
  height: var(--v);
  background: linear-gradient(180deg, var(--color-accent), #fff1b8);
  border-radius: 6px 6px 2px 2px;
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.8s cubic-bezier(.2,.8,.2,1);
}
.analytics-card.in-view .bar-chart span { transform: scaleY(1); }

.source-list { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.source-list li { display: flex; align-items: center; gap: 10px; font-size: 0.85rem; }
.source-list em {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: rgba(255,255,255,0.1);
  position: relative;
  overflow: hidden;
}
.source-list em::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 0;
  border-radius: 4px;
  background: var(--source-color, var(--color-accent));
  transition: width 1s ease;
}
.analytics-card.in-view .source-list em::after { width: var(--v); }

.source-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot-1 { background: #ffc700; }
.dot-2 { background: #25d366; }
.dot-3 { background: #f2f2f2; }
.dot-4 { background: #7a7a7a; }
.source-list li:nth-child(1) em { --source-color: #ffc700; }
.source-list li:nth-child(2) em { --source-color: #25d366; }
.source-list li:nth-child(3) em { --source-color: #f2f2f2; }
.source-list li:nth-child(4) em { --source-color: #7a7a7a; }

.donut-wrap { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.donut { width: 72px; height: 72px; transform: rotate(-90deg); flex-shrink: 0; }
.donut-bg { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 3.2; }
.donut-seg { fill: none; stroke-width: 3.2; stroke-linecap: round; }
.donut-seg-1 { stroke: #ffc700; }
.donut-seg-2 { stroke: #f2f2f2; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 0.78rem; color: #cfcfcf; }
.donut-legend li { display: flex; align-items: center; gap: 8px; }

.analytics-callout {
  margin-top: 40px;
  background: rgba(255, 199, 0, 0.14);
  border: 1px solid rgba(255, 199, 0, 0.35);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  color: #fff;
  font-size: 1.02rem;
  line-height: 1.55;
}
.analytics-callout svg { width: 30px; height: 30px; color: var(--color-accent); flex-shrink: 0; margin-top: 2px; }
.analytics-callout strong { color: var(--color-accent); }

/* -------------------- Contatti -------------------- */
.contatti-inner {
  max-width: 640px;
  margin: 0 auto;
}
.contact-details { margin: 30px 0 0; display: flex; flex-direction: column; }
.contact-detail {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.contact-detail dt { margin: 0; font-weight: 700; color: var(--text); }
.contact-detail dd { margin: 0; font-weight: 600; color: var(--text-muted); text-align: right; }
.contact-detail dd a:hover { color: var(--color-accent-text); }

.contatti-cta-block { margin-top: 34px; }
.contatti-cta-lead { font-weight: 700; margin-bottom: 16px; }
.contatti-cta { display: flex; gap: 14px; flex-wrap: wrap; }

/* -------------------- Footer -------------------- */
.site-footer { background: var(--color-primary-dark); color: #d8d8d8; padding: 56px 0 0; }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand { max-width: 320px; }
.footer-brand img { margin-bottom: 14px; }
.footer-brand .logo { margin-bottom: 14px; }
.footer-tagline {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 10px;
}
.footer-brand p { font-size: 0.88rem; color: #9a9a9a; }
.footer-nav { display: flex; gap: 22px; flex-wrap: wrap; align-self: center; }
.footer-nav a { font-size: 0.9rem; font-weight: 600; }
.footer-nav a:hover { color: var(--color-accent); }

.footer-contact { align-self: center; }
.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 12px;
}
.footer-contact-list { display: flex; flex-direction: column; gap: 8px; }
.footer-contact-list li { font-size: 0.9rem; }
.footer-contact-list a:hover { color: var(--color-accent); }

.footer-social { display: flex; gap: 12px; align-self: center; }
.footer-social a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
}
.footer-social svg { width: 18px; height: 18px; }
.footer-social a:hover { background: var(--color-accent); border-color: var(--color-accent); color: #0a0a0a; }
.footer-bottom { padding: 20px 0; font-size: 0.8rem; color: #7a7a7a; text-align: center; }

/* -------------------- WhatsApp float -------------------- */
.whatsapp-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 58px; height: 58px;
  background: var(--color-whatsapp);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
  z-index: 90;
  transition: transform 0.2s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }
.whatsapp-float svg { width: 28px; height: 28px; color: #fff; stroke-width: 0; fill: #fff; }

/* -------------------- Scroll reveal -------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
[data-reveal].in-view { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* -------------------- Responsive -------------------- */
@media (max-width: 980px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .analytics-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  .main-nav.open { max-height: 400px; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 10px 24px 20px; }
  .main-nav a { display: block; padding: 12px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }

  .hero { min-height: 560px; }
  .hero-content { max-width: none; }
  .hero-overlay {
    background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.95) 44%, rgba(255, 255, 255, 0.8) 68%, rgba(255, 255, 255, 0.55) 100%);
  }

  .team-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero { padding-top: calc(var(--header-h) + 40px); padding-bottom: 56px; }
  .hero-actions .btn, .contatti-cta .btn { width: 100%; }
  .hero-actions, .contatti-cta { flex-direction: column; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-nav { justify-content: center; }
  .whatsapp-float { right: 16px; bottom: 16px; width: 52px; height: 52px; }
}
