/* ============================================================
   Zampa Design — Custom CSS (complementary to Tailwind CDN)
   UI UX Pro Max Refactor — Premium Agency Standard
   ============================================================ */

/* ── Fonts — Bricolage Grotesque (display, variable) + Sora (body) ── */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=Sora:wght@300;400;500;600;700&display=swap');

/* ── CSS Custom Properties ── */
:root {
  --color-primary:   #0F172A;
  --color-accent:    #6366F1;
  --color-accent-h:  #4F46E5;
  --color-accent-glow: rgba(99,102,241,0.25);
  --color-surface:   #F8FAFC;
  --color-muted:     #64748B;
  --color-border:    #E2E8F0;
  --font-body:         'Sora', system-ui, sans-serif;
  --font-display:      'Bricolage Grotesque', system-ui, sans-serif;
  --radius:            0.75rem;
  --radius-lg:         1rem;
  --transition:        0.20s cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out-expo:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quint:    cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  font-family: var(--font-body);
  color: var(--color-primary);
  background: #ffffff;
  line-height: 1.65;
  margin: 0;
}

/* ── Typography — gerarchia premium ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

h2 { letter-spacing: -0.025em; }
h3 { letter-spacing: -0.02em; font-weight: 700; }

/* Numeri statistici — tabular-nums per allineamento preciso */
[data-count], .stat-number {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

/* ── Focus Accessibility ── */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ── Skip Link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--color-accent);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 9999;
  transition: top var(--transition);
}
.skip-link:focus { top: 1rem; }

/* ── Navigation ── */
.nav-scrolled {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(15,23,42,0.9) !important;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06);
}

/* ── Hero gradient backdrop ── */
.hero-bg {
  background: #0F172A;
  position: relative;
  overflow: hidden;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 65% 35%, rgba(99,102,241,0.18) 0%, transparent 65%),
    radial-gradient(ellipse 40% 35% at 5% 85%,  rgba(79,70,229,0.10) 0%, transparent 65%);
  pointer-events: none;
}

/* Rimosso: gradient-text AI-slop (818CF8→C4B5FD)
   Sostituito con: accent-word — una parola chiave in colore solido */
.accent-word {
  color: var(--color-accent);
}

/* ── CTA Button — spring transition, no shimmer generico ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--color-accent);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 0.95rem 2rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition:
    background  0.20s cubic-bezier(0.4, 0, 0.2, 1),
    transform   0.22s var(--ease-out-expo),
    box-shadow  0.20s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  white-space: nowrap;
  will-change: transform;
}
.btn-primary:hover {
  background: var(--color-accent-h);
  transform: translateY(-2px);
  box-shadow:
    0 8px 24px rgba(99,102,241,0.32),
    0 0 0 1px rgba(99,102,241,0.35);
}
.btn-primary:active {
  transform: scale(0.97);
  transition:
    transform   0.15s cubic-bezier(0.4, 0, 0.2, 1),
    background  0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  color: #E2E8F0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.95rem 2rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.18);
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
  text-decoration: none;
}
.btn-secondary:hover {
  border-color: rgba(99,102,241,0.6);
  background: rgba(99,102,241,0.08);
  color: #fff;
}

/* ── Cards — hover con border accent invece di solo shadow ── */
.card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition:
    transform   0.22s var(--ease-out-expo),
    box-shadow  0.22s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.20s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
  border-color: rgba(99,102,241,0.28);
}

/* ── Stats badge ── */
.stat-badge {
  background: linear-gradient(145deg, #4F46E5, #6366F1);
  color: #fff;
  border-radius: var(--radius-lg);
}

/* ── Testimonial card ── */
.testimonial-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
  transition:
    transform   0.22s var(--ease-out-expo),
    box-shadow  0.22s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.20s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
  border-color: rgba(99,102,241,0.22);
}
.testimonial-card::before {
  content: '\201C';
  font-size: 4.5rem;
  line-height: 1;
  color: var(--color-accent);
  opacity: 0.12;
  position: absolute;
  top: 0.75rem;
  left: 1.25rem;
  font-family: Georgia, serif;
  pointer-events: none;
}

/* ── Testimonianza in evidenza ── */
.testimonial-featured {
  border-color: rgba(99,102,241,0.3);
  background: linear-gradient(145deg, #ffffff, #F8F9FF);
}

/* ── Section label ── */
.section-label {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* ── Hamburger menu ── */
#mobile-menu { transition: max-height 0.35s ease, opacity 0.35s ease; }

/* ── Lazy load fade-in ── */
img[loading="lazy"] { opacity: 0; transition: opacity 0.5s ease; }
img[loading="lazy"].loaded { opacity: 1; }

/* ── Problem cards ── */
.problem-icon {
  width: 3rem;
  height: 3rem;
  background: #FEF2F2;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #EF4444;
  flex-shrink: 0;
  transition: transform var(--spring);
}
.card:hover .problem-icon { transform: scale(1.08); }

/* ── Process step — numero grande come sfondo decorativo ── */
.step-number {
  width: 2.75rem;
  height: 2.75rem;
  background: var(--color-accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* Step connector line (desktop) */
.step-connector {
  display: none;
}
@media (min-width: 1024px) {
  .step-connector {
    display: block;
    position: absolute;
    top: 1.375rem;
    left: calc(100% - 0.5rem);
    width: calc(100% - 3rem);
    height: 1px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    opacity: 0.25;
    pointer-events: none;
    z-index: 0;
  }
}

/* ── Portfolio card hover overlay ── */
.portfolio-card { position: relative; overflow: hidden; }
.portfolio-card .portfolio-overlay {
  position: absolute;
  inset: 0;
  background: rgba(79, 70, 229, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.28s cubic-bezier(0.4,0,0.2,1);
}
.portfolio-card:hover .portfolio-overlay { opacity: 1; }
.portfolio-overlay-text {
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(6px);
  transition: transform 0.28s cubic-bezier(0.34,1.56,0.64,1);
}
.portfolio-card:hover .portfolio-overlay-text { transform: translateY(0); }

/* ── Form inputs ── */
.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-primary);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-input::placeholder { color: #94A3B8; }

textarea.form-input { resize: vertical; min-height: 120px; }

/* ── Footer ── */
.footer-bg { background: var(--color-primary); }

/* ── Scroll animation — scale(0.97) entrance per feel più naturale ── */
.fade-up {
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition:
    opacity   0.60s var(--ease-out-quint),
    transform 0.60s var(--ease-out-expo);
}
.fade-up.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Floating mobile CTA ── */
#mobile-cta {
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Hero CTA — glow statico, nessuna animazione perpetua ── */
.hero-bg .btn-primary {
  box-shadow: 0 4px 24px rgba(99,102,241,0.28);
}

/* ── Project reel (hero visual) ── */
.project-reel-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  cursor: default;
  transition: border-color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-reel-entry:hover {
  border-color: rgba(99,102,241,0.35);
}
.project-reel-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: #e2e8f0;
  letter-spacing: -0.02em;
  transition: color 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}
.project-reel-entry:hover .project-reel-title {
  color: #ffffff;
}
.project-reel-arrow {
  opacity: 0;
  transform: translateX(-6px);
  transition:
    opacity  0.18s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s var(--ease-out-expo);
  color: var(--color-accent);
}
.project-reel-entry:hover .project-reel-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ── Big stat number (sezione agitazione) ── */
.big-stat {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.5rem, 5vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* ── Mobile ── */
@media (max-width: 767px) {
  .btn-primary, .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
  }
  body { padding-bottom: 60px; }
}

/* ── Respect prefers-reduced-motion (WCAG AA) ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fade-up { opacity: 1; transform: none; }
  #mobile-cta { transform: none; }
}
