/* ===== Font locali (self-hosted, nessun dato inviato a terzi) ===== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../assets/fonts/inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../assets/fonts/inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/inter-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../assets/fonts/sora-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../assets/fonts/sora-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../assets/fonts/sora-800.woff2') format('woff2');
}

/* ===== Variabili & Reset ===== */
:root {
  --yellow: #F4C83A;
  --light: #C9CBD0;
  --mid: #9EA1A8;
  --dark: #3C3E45;
  --black: #15161A;

  --font-head: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;

  --container: 1120px;
  --header-h: 96px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--black);
  color: var(--light);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--font-head);
  color: #fff;
  line-height: 1.15;
  margin: 0 0 1rem;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1rem; color: var(--light); }

a { color: inherit; text-decoration: none; }

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

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

.eyebrow {
  font-family: var(--font-head);
  color: var(--yellow);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
  font-weight: 700;
  margin: 0 0 .75rem;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--yellow);
  color: var(--black);
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  transition: background .35s ease, height .35s ease, box-shadow .35s ease;
}

.site-header.scrolled {
  background: rgba(21, 22, 26, 0.92);
  backdrop-filter: blur(8px);
  height: 72px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo img { height: 68px; width: auto; transition: height .35s ease; }
.site-header.scrolled .logo img { height: 48px; }

.logo-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.logo-name {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
}

.logo-email {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: .82rem;
  color: var(--mid);
}

.footer-brand .logo-email a { color: inherit; transition: color .2s ease; }
.footer-brand .logo-email a:hover { color: var(--yellow); }

@media (max-width: 720px) {
  .logo-brand { display: none; }
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 10px 16px;
  font-weight: 600;
  font-size: .95rem;
  color: var(--light);
  position: relative;
  transition: color .25s ease;
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  background: var(--yellow);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s ease;
}

.nav-link:hover,
.nav-link.active { color: #fff; }
.nav-link:hover::after,
.nav-link.active::after { transform: scaleX(1); }

.nav-cta {
  background: var(--yellow);
  color: var(--black) !important;
  border-radius: 999px;
  padding: 10px 20px;
}
.nav-cta::after { display: none; }
.nav-cta:hover { filter: brightness(1.08); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease;
}
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: 0;
  filter: grayscale(.3) brightness(.8) contrast(1.05);
  transition: opacity 1.6s ease;
}

.hero-slide.is-active {
  opacity: 0.9;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(244,200,58,.18), transparent 45%),
    radial-gradient(circle at 85% 75%, rgba(201,203,208,.08), transparent 50%),
    linear-gradient(160deg, rgba(21,22,26,.74) 0%, rgba(60,62,69,.67) 100%);
  background-size: 140% 140%;
  animation: heroDrift 18s ease-in-out infinite alternate;
}

@keyframes heroDrift {
  0%   { background-position: 0% 0%; }
  100% { background-position: 100% 100%; }
}

.hero-inner { position: relative; z-index: 1; padding-top: var(--header-h); }

.hero-inner .eyebrow,
.hero-inner h1,
.hero-inner .hero-sub {
  text-shadow: 0 2px 16px rgba(0,0,0,.5);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr auto;
  align-items: center;
  gap: 56px;
}

.hero-copy { min-width: 0; }

.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 40px 44px;
  background: linear-gradient(160deg, rgba(255,255,255,.06), rgba(255,255,255,.015));
  border: 1px solid rgba(244,200,58,.28);
  border-radius: 24px;
  backdrop-filter: blur(6px);
  box-shadow: 0 30px 70px rgba(0,0,0,.4);
}

.hero-brand img { width: 220px; height: auto; }

.hero-brand-tag {
  margin: 0;
  text-align: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  color: var(--light);
  letter-spacing: .01em;
}

.hero-brand-tag strong { color: var(--yellow); display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-brand { order: -1; margin: 0 auto; padding: 28px 32px; }
  .hero-brand img { width: 168px; }
}

.rotator {
  display: grid;
}
.rotator-item {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.rotator-item.is-active {
  opacity: 1;
  transform: translateY(0);
}

.hero-sub {
  max-width: 560px;
  font-size: 1.1rem;
  color: var(--light);
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-family: var(--font-head);
  transition: transform .25s ease, filter .25s ease, background .25s ease;
}
.btn-primary {
  background: var(--yellow);
  color: var(--black);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }

.btn-ghost {
  border: 1.5px solid var(--mid);
  color: var(--light);
}
.btn-ghost:hover { border-color: var(--yellow); color: #fff; transform: translateY(-2px); }

.scroll-cue {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid var(--mid);
  border-radius: 14px;
}
.scroll-cue span {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--yellow);
  border-radius: 2px;
  animation: scrollCue 1.8s ease-in-out infinite;
}
@keyframes scrollCue {
  0%   { opacity: 1; top: 6px; }
  70%  { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 20px; }
}

/* ===== Sections ===== */
.section {
  padding: 110px 0;
}
.section-alt {
  background: var(--dark);
}

/* Chi sono */
.about-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 64px;
  align-items: center;
}
.about-stats {
  display: grid;
  gap: 20px;
}
.stat-card {
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 16px;
  padding: 28px;
}
.stat-card:hover {
  transform: translateY(-6px);
  border-color: rgba(244,200,58,.4);
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
}
.about-stats .stat-card:nth-child(2) { transition-delay: .12s; }
.stat-number {
  display: block;
  font-family: var(--font-head);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--yellow);
}
.stat-label {
  color: var(--mid);
  font-size: .95rem;
}

/* Mission */
.mission-grid { max-width: 760px; }
.mission-text {
  font-size: 1.2rem;
  color: var(--light);
}

/* Servizi */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 2.5rem;
}
.service-card {
  background: var(--dark);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 18px;
  padding: 32px;
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
}
.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(244,200,58,.4);
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
}
.service-icon {
  width: 48px;
  height: 48px;
  color: var(--yellow);
  margin-bottom: 1.25rem;
  transition: transform .3s ease;
}
.service-icon svg { width: 100%; height: 100%; }
.service-card:hover .service-icon { transform: scale(1.12) rotate(-4deg); }
.service-card p { color: var(--mid); margin-bottom: 0; }

.services-grid .service-card:nth-child(2) { transition-delay: .12s; }
.services-grid .service-card:nth-child(3) { transition-delay: .24s; }

/* Contatti */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.contact-card {
  background: var(--black);
  border: 1px solid rgba(244,200,58,.25);
  border-radius: 18px;
  padding: 36px;
  text-align: center;
}
.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,.35);
}
.contact-email {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--yellow);
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color .25s ease;
  word-break: break-word;
}
.contact-email:hover { border-color: var(--yellow); }

/* Footer */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand { display: flex; align-items: center; gap: 16px; }
.footer-logo { height: 56px; width: auto; }
.site-footer p { color: var(--mid); font-size: .85rem; margin: 0; }

.footer-legal {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,.06);
}
.footer-legal nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}
.footer-legal a,
.footer-legal-btn {
  font-size: .85rem;
  color: var(--mid);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: var(--font-body);
  transition: color .2s ease;
}
.footer-legal a:hover,
.footer-legal-btn:hover { color: var(--yellow); }

/* ===== Cookie banner & preferenze ===== */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--dark);
  border-top: 1px solid rgba(244,200,58,.3);
  box-shadow: 0 -8px 30px rgba(0,0,0,.4);
  padding: 20px 24px;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cookie-banner-text {
  flex: 1 1 420px;
  color: var(--light);
  font-size: .92rem;
  margin: 0;
}
.cookie-banner-text a { color: var(--yellow); text-decoration: underline; }
.cookie-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cookie-btn {
  font-family: var(--font-body);
  font-size: .88rem;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,.2);
  background: transparent;
  color: var(--light);
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.cookie-btn:hover { transform: translateY(-2px); }
.cookie-btn-primary {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}
.cookie-btn-primary:hover { background: #ffd65c; }
.cookie-btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }

.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(10,10,12,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cookie-modal-overlay[hidden] { display: none; }
.cookie-modal {
  background: var(--dark);
  border: 1px solid rgba(244,200,58,.25);
  border-radius: 18px;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
}
.cookie-modal h2 {
  font-size: 1.3rem;
  margin-bottom: 6px;
}
.cookie-modal > p {
  color: var(--mid);
  font-size: .9rem;
  margin-bottom: 24px;
}
.cookie-category {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 0;
}
.cookie-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cookie-category-head h3 {
  font-size: 1rem;
  margin: 0;
  color: #fff;
}
.cookie-category p {
  color: var(--mid);
  font-size: .85rem;
  margin: 8px 0 0;
}
.cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.15);
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s ease;
}
.cookie-toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s ease;
}
.cookie-toggle input:checked + .cookie-toggle-slider { background: var(--yellow); }
.cookie-toggle input:checked + .cookie-toggle-slider::before { transform: translateX(20px); }
.cookie-toggle input:disabled + .cookie-toggle-slider {
  background: rgba(244,200,58,.4);
  cursor: not-allowed;
}
.cookie-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}
.cookie-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: none;
  border: none;
  color: var(--mid);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.cookie-modal-close:hover { color: var(--yellow); }
.cookie-modal { position: relative; }

@media (max-width: 640px) {
  .cookie-banner-actions { width: 100%; }
  .cookie-btn { flex: 1 1 auto; text-align: center; }
}

/* ===== Pagine legali (Privacy / Cookie Policy) ===== */
.legal-page {
  padding: 160px 0 100px;
}
.legal-page .container { max-width: 820px; }
.legal-updated {
  color: var(--mid);
  font-size: .85rem;
  margin-bottom: 40px;
}
.legal-page h2 {
  font-size: 1.4rem;
  margin-top: 44px;
}
.legal-page h3 {
  font-size: 1.05rem;
  color: var(--yellow);
  margin: 28px 0 8px;
}
.legal-page p, .legal-page li { color: var(--light); }
.legal-page ul { padding-left: 22px; margin: 0 0 1rem; }
.legal-page li { margin-bottom: 6px; }
.legal-page strong { color: #fff; }
.legal-page a { color: var(--yellow); text-decoration: underline; }
.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: .88rem;
}
.legal-table th, .legal-table td {
  border: 1px solid rgba(255,255,255,.12);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.legal-table th { color: #fff; background: rgba(255,255,255,.04); }
.legal-cta-btn {
  font-family: var(--font-body);
  font-size: .9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--yellow);
  background: transparent;
  color: var(--yellow);
  cursor: pointer;
}
.legal-cta-btn:hover { background: var(--yellow); color: var(--black); }

/* ===== Reveal on scroll ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Card con reveal + hover: un'unica transition che copre entrambi gli usi,
   così l'entrata a scroll e il sollevamento al passaggio del mouse non si sovrascrivono */
.service-card.reveal,
.stat-card.reveal,
.contact-card.reveal {
  transition: opacity .7s ease, transform .4s ease, border-color .3s ease, box-shadow .3s ease;
}

.service-card:hover,
.stat-card:hover,
.contact-card:hover {
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg { animation: none; }
  .reveal, .rotator-item, .service-card, .stat-card, .contact-card, .service-icon, .btn, .contact-email, .nav-link {
    transition: none !important;
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .about-grid, .contact-grid { grid-template-columns: 1fr; }
  .services-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: rgba(21,22,26,.98);
    backdrop-filter: blur(8px);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .main-nav.is-open { max-height: 400px; }
  .main-nav ul {
    flex-direction: column;
    padding: 16px 24px 24px;
    gap: 4px;
  }
  .nav-cta { display: inline-block; width: fit-content; }
  .nav-toggle { display: flex; }
  .services-grid { grid-template-columns: 1fr; }
  .section { padding: 80px 0; }
}
