/* ============================================================ MW Lab */

/* Space Grotesk in locale (licenza OFL, vedi fonts/OFL.txt): niente richieste a server esterni */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/SpaceGrotesk-Regular.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/SpaceGrotesk-Bold.woff2") format("woff2");
}

:root {
  /* Colori MW Lab (immagini/logo/LEGGIMI.txt) */
  --blu: #0B1F3A;            /* Blu notte */
  --blu-2: #112A4D;          /* Blu notte, variante per schede su fondo scuro */
  --blu-3: #071428;          /* Blu notte, variante per il footer */
  --arancio: #D9501D;        /* Arancio, accenti su fondo chiaro (linee, icone) */
  --arancio-testo: #C4461A;  /* Arancio scurito per testo e pulsanti su fondo chiaro: 4.9:1 su bianco (il #D9501D arriva a 4.1:1) */
  --arancio-luce: #FF7A45;   /* Arancio luce, su fondo scuro: 6.4:1 su blu notte */
  --carta: #F6F7F9;          /* Grigio carta */
  --bianco: #FFFFFF;
  --testo: #0B1F3A;
  --testo-2: #4A5568;        /* testo secondario su fondo chiaro: 7.5:1 su bianco */
  --testo-2-scuro: #AEBBD0;  /* testo secondario su fondo scuro: 8.5:1 su blu notte */
  --linea: #D9DEE6;
  --linea-scura: rgba(174, 187, 208, .22);
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1120px;
  --radius: 6px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bianco);
  color: var(--testo);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 700; }
p { margin: 0 0 1rem; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--arancio-testo); color: #fff; padding: .5rem 1rem; text-decoration: none;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--arancio-luce); outline-offset: 2px; }

/* ------------------------------------------------------------ header */
.top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: .7rem clamp(1rem, 4vw, 2.5rem);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}
.top__brand { display: flex; align-items: center; text-decoration: none; }
.top__brand img { width: auto; height: 40px; }
.top__nav { display: flex; align-items: center; gap: 1.4rem; }
.top__nav a {
  font-size: .95rem; font-weight: 700; letter-spacing: .01em;
  text-decoration: none; color: var(--testo);
  padding: .3rem 0; border-bottom: 2px solid transparent;
}
.top__nav a:hover, .top__nav a:focus-visible { border-color: var(--arancio); }
.top__nav a.top__cta {
  background: var(--blu); color: #fff; padding: .5rem 1rem; border-radius: var(--radius); border-bottom: 0;
}
.top__nav a.top__cta:hover, .top__nav a.top__cta:focus-visible { background: var(--arancio-testo); }
.top__toggle {
  display: none; background: none; border: 0; cursor: pointer; padding: .5rem;
  flex-direction: column; gap: 5px;
}
.top__toggle span { display: block; width: 26px; height: 3px; background: var(--blu); border-radius: 2px; }

@media (max-width: 860px) {
  .top__toggle { display: flex; }
  .top__nav {
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bianco); border-bottom: 3px solid var(--arancio);
    box-shadow: 0 12px 24px rgba(11, 31, 58, .12);
    display: none;
  }
  .top__nav.open { display: flex; }
  .top__nav a { padding: 1rem clamp(1rem, 4vw, 2.5rem); border-bottom: 1px solid var(--linea); font-size: 1.05rem; }
  .top__nav a.top__cta { border-radius: 0; margin: .5rem clamp(1rem, 4vw, 2.5rem) 1rem; text-align: center; }
}

/* ------------------------------------------------------------ hero */
.hero {
  background: var(--blu); color: #fff;
  padding: clamp(3.5rem, 9vw, 7rem) 1rem clamp(3.5rem, 8vw, 6rem);
}
.hero__in { max-width: var(--max); margin: 0 auto; }
.hero__logo { width: min(60vw, 260px); height: auto; margin-bottom: 2.5rem; }
.hero h1 {
  font-size: clamp(2rem, 5.2vw, 3.6rem); line-height: 1.08; letter-spacing: -.015em;
  max-width: 20ch;
}
.hero h1 em { font-style: normal; color: var(--arancio-luce); }
.hero__payoff {
  margin: 1.4rem 0 0; font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 700;
  color: var(--testo-2-scuro); letter-spacing: .01em;
}
.hero__text { margin: 1rem 0 0; max-width: 58ch; font-size: 1.1rem; color: var(--testo-2-scuro); }
.hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2.2rem; }

/* ------------------------------------------------------------ bottoni */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .85rem 1.4rem; border: 2px solid var(--blu); border-radius: var(--radius);
  font-family: var(--font); font-size: 1rem; font-weight: 700; line-height: 1.2;
  text-decoration: none; color: var(--blu); background: transparent;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.btn:hover, .btn:focus-visible { background: var(--blu); color: #fff; }
.btn:active { transform: translateY(1px); }

/* su fondo chiaro: arancio scurito con testo bianco */
.btn--primary { background: var(--arancio-testo); border-color: var(--arancio-testo); color: #fff; }
.btn--primary:hover, .btn--primary:focus-visible { background: var(--blu); border-color: var(--blu); color: #fff; }

/* su fondo scuro (hero, casi, contatti): arancio luce con testo blu notte */
.btn--accent { background: var(--arancio-luce); border-color: var(--arancio-luce); color: var(--blu); }
.btn--accent:hover, .btn--accent:focus-visible { background: #fff; border-color: #fff; color: var(--blu); }
.btn--ghost { border-color: rgba(255, 255, 255, .7); color: #fff; }
.btn--ghost:hover, .btn--ghost:focus-visible { background: #fff; border-color: #fff; color: var(--blu); }
.btn--mail { text-transform: none; }

/* ------------------------------------------------------------ sezioni */
.block { scroll-margin-top: 64px; padding: clamp(3.5rem, 8vw, 6.5rem) 1rem; }
.block__in { max-width: var(--max); margin: 0 auto; }
.block--paper { background: var(--carta); }
.block--dark { background: var(--blu); color: #fff; }
.block--dark .kicker { color: var(--arancio-luce); }
.block--dark .kicker::before { background: var(--arancio-luce); }
.block--dark h2 em { color: var(--arancio-luce); }
.block--dark .lead, .block--dark .prose { color: var(--testo-2-scuro); }
.block--dark .prose strong { color: #fff; }

.kicker {
  margin: 0 0 1rem; font-size: .9rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--arancio-testo); display: flex; align-items: center; gap: .8rem;
}
.kicker::before { content: ""; width: 36px; height: 3px; background: var(--arancio); }

h2 {
  font-size: clamp(1.75rem, 3.8vw, 2.6rem); letter-spacing: -.01em; margin-bottom: 1.6rem;
  max-width: 26ch;
}
h2 em { font-style: normal; color: var(--arancio-testo); }

.lead { max-width: 64ch; font-size: 1.15rem; color: var(--testo-2); margin-bottom: 2.5rem; }
.prose { max-width: 62ch; }
.prose p { margin: 0 0 1.1rem; color: var(--testo-2); }
.prose strong { color: var(--testo); }

.cols { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } }

/* punti (perché noi) */
.points { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.points li {
  padding: 1rem 1.2rem 1rem 1.4rem; border-left: 4px solid var(--arancio);
  background: var(--carta); border-radius: 0 var(--radius) var(--radius) 0;
}
.points b { display: block; font-size: 1.05rem; }
.points span { color: var(--testo-2); font-size: .98rem; }

/* schede servizi */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--bianco); border: 1px solid var(--linea); border-radius: var(--radius);
  padding: 1.6rem 1.5rem 1.4rem; display: flex; flex-direction: column;
}
.card__icon { width: 36px; height: 36px; color: var(--arancio); margin-bottom: 1rem; }
.card h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.card p { color: var(--testo-2); margin-bottom: .9rem; }
.card ul { margin: auto 0 0; padding: 0 0 0 1.1rem; color: var(--testo); font-size: .98rem; }
.card li { margin: .3rem 0; }
.card li::marker { color: var(--arancio); }

/* casi reali */
.cases { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.2rem; }
.case {
  background: var(--blu-2); border: 1px solid var(--linea-scura); border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}
.case h3 { font-size: 1.25rem; margin-bottom: 1rem; }
.case dl { margin: 0; }
.case dt {
  font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--arancio-luce); margin-top: .9rem;
}
.case dd { margin: .2rem 0 0; color: var(--testo-2-scuro); }
.case dd:last-child { color: #fff; }

/* metodo */
.steps {
  list-style: none; padding: 0; margin: 0; counter-reset: passo;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.2rem;
}
.steps li { counter-increment: passo; position: relative; padding-top: 3.4rem; }
.steps li::before {
  content: counter(passo, decimal-leading-zero);
  position: absolute; top: 0; left: 0;
  font-size: 2rem; font-weight: 700; color: var(--arancio-testo); line-height: 1;
}
.steps li::after {
  content: ""; position: absolute; top: 2.6rem; left: 0; width: 44px; height: 3px; background: var(--arancio);
}
.steps h3 { font-size: 1.2rem; margin-bottom: .5rem; }
.steps p { margin: 0; color: var(--testo-2); }

/* contatti */
.contact { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: .8rem; }
.contact__note { margin: 1.8rem 0 0; color: var(--testo-2-scuro); max-width: 60ch; }

/* ------------------------------------------------------------ footer */
.foot { background: var(--blu-3); color: var(--testo-2-scuro); padding: 2.5rem 1rem 2rem; font-size: .95rem; }
.foot__in {
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem 2.5rem; align-items: start;
}
.foot img { width: auto; height: 44px; }
.foot__data p { margin: 0 0 .25rem; }
.foot__data b { color: #fff; }
.foot__nav { display: flex; gap: 1.2rem; }
.foot a { color: #fff; }
.foot__copy { grid-column: 1 / -1; margin: .5rem 0 0; padding-top: 1rem; border-top: 1px solid var(--linea-scura); }
@media (max-width: 860px) {
  .foot__in { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ pagine interne (privacy, servizi/*) */
.page { padding: clamp(3rem, 7vw, 5rem) 1rem; }
.page__in { max-width: 760px; margin: 0 auto; }
.page h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 1.5rem; letter-spacing: -.01em; }
.page h2 { font-size: 1.35rem; margin: 2rem 0 .6rem; max-width: none; }
.page p, .page li { color: var(--testo-2); }
.page strong { color: var(--testo); }
.page a { color: var(--arancio-testo); }
.page .back { display: inline-block; margin-top: 2rem; font-weight: 700; text-decoration: none; color: var(--blu); }
.page .back:hover { color: var(--arancio-testo); }

/* ------------------------------------------------------------ comparsa */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* portfolio */
.works { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.4rem; }
.work { background: var(--bianco); border: 1px solid var(--linea); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.work > a { display: block; border-bottom: 1px solid var(--linea); background: var(--carta); }
.work img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform .3s ease; }
.work > a:hover img, .work > a:focus-visible img { transform: scale(1.02); }
@media (prefers-reduced-motion: reduce) { .work img { transition: none; } .work > a:hover img { transform: none; } }
.work__body { padding: 1.2rem 1.3rem 1.3rem; display: flex; flex-direction: column; flex: 1; }
.work h3 { font-size: 1.15rem; margin-bottom: .4rem; }
.work h3 a { text-decoration: none; color: var(--blu); }
.work h3 a:hover, .work h3 a:focus-visible { color: var(--arancio-testo); }
.work__body p { margin: 0 0 .7rem; color: var(--testo-2); font-size: .98rem; }
.work__meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.work__meta span { font-size: .78rem; font-weight: 700; letter-spacing: .04em; color: var(--blu); background: var(--carta); border: 1px solid var(--linea); border-radius: 999px; padding: .15rem .6rem; }
.work__role { margin-top: auto !important; margin-bottom: 0 !important; font-size: .9rem !important; }
