/* =========================================================
   Welab – foglio di stile
   Idea grafica: i quadratini ("pixel") del logo Welab.IT
   come segno ricorrente; petrolio e turchese del logo.
   Tutti i colori sono qui sotto, in :root.
   ========================================================= */
:root {
  --paper: #f2f6f7;        /* sfondo pagina */
  --surface: #ffffff;
  --ink: #0d3540;          /* testo: petrolio scuro, non nero */
  --muted: #4f6a73;
  --rule: #d3e1e5;
  --teal: #0097b2;         /* turchese del logo */
  --teal-dark: #007a91;
  --cyan: #0cc0df;         /* azzurro del logo */
  --deep: #0a4a58;         /* fascia scura "Su misura" */
  --deep-line: #22687a;
  --on-deep: #ffffff;
  --on-deep-muted: #b9dbe3;

  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --max: 1180px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 104px; }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.6;
  color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.06; text-wrap: balance; font-stretch: 112%; letter-spacing: -.02em; }
p { margin: 0; }

.wrap {
  width: 100%; max-width: var(--max); margin: 0 auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Etichetta con i quadratini del logo */
.label {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: .78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .12em; color: var(--teal-dark);
}
.px {
  position: relative; width: 6px; height: 6px; flex: none; margin-right: 12px;
  background: var(--ink);
  box-shadow: 6px 6px 0 var(--teal), 12px 0 0 var(--cyan), 0 12px 0 var(--teal);
  transform: translateY(-3px);
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: 15px 26px; border-radius: 4px;
  background: var(--teal); color: #fff; border: 2px solid var(--teal);
  font: inherit; font-weight: 700; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s;
}
.btn:hover { background: var(--teal-dark); border-color: var(--teal-dark); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--ink); font-family: var(--mono); font-weight: 600; }
.btn--ghost:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn--light { background: #fff; color: var(--deep); border-color: #fff; }
.btn--light:hover { background: var(--cyan); border-color: var(--cyan); color: var(--deep); }
.btn--small { padding: 10px 16px; font-size: .9rem; }
.btn--full { width: 100%; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ---------- Header ---------- */
.header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; height: 92px; gap: 20px; }
.logo img { height: 66px; width: auto; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.nav a:not(.btn):hover { color: var(--teal-dark); }
.nav .btn { color: #fff; }
.burger { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.burger span { display: block; width: 26px; height: 3px; background: var(--ink); margin: 5px 0; transition: transform .25s, opacity .25s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { padding-block: 72px 56px; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 5.2vw, 4.1rem); font-weight: 800; margin-top: 18px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 34em; margin-top: 22px; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__pixels { aspect-ratio: 1 / 1; max-width: 460px; width: 100%; justify-self: end; }
.hero__pixels canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

.facts { list-style: none; margin: 56px 0 0; padding: 26px 0 0; border-top: 1px solid var(--rule); display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.facts li { display: flex; align-items: baseline; gap: 14px; }
.facts strong { font-size: 2.8rem; font-weight: 900; font-stretch: 125%; color: var(--teal); line-height: 1; }
.facts span { color: var(--muted); font-size: .95rem; max-width: 16em; }

/* ---------- Sezioni ---------- */
.section { padding-block: 96px; }
.section--alt { background: var(--surface); border-block: 1px solid var(--rule); }
.section__head { max-width: 720px; margin-bottom: 48px; }
.section__head h2, .about h2, .contact h2 { font-size: clamp(2rem, 3.8vw, 2.9rem); font-weight: 800; margin-top: 16px; }
.section__sub { color: var(--muted); font-size: 1.1rem; margin-top: 16px; }

/* Prodotti */
.products { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.product {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 28px;
  transition: border-color .2s, transform .2s;
}
.product:hover { border-color: var(--teal); transform: translateY(-3px); }
.product__logo { height: 64px; display: flex; align-items: center; margin-bottom: 10px; }
.product__logo img { max-height: 58px; width: auto; max-width: 220px; object-fit: contain; }
.product__sector { font-family: var(--mono); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; color: var(--teal-dark); }
.product h3 { font-size: 1.45rem; font-weight: 800; }
.product p:not(.product__sector) { color: var(--muted); flex: 1; }
.product__link { margin-top: 8px; font-weight: 700; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.product__link::after { content: "↗"; color: var(--teal); transition: transform .15s; }
.product__link:hover::after { transform: translate(2px, -2px); }

.more { margin-top: 28px; display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; padding: 20px 24px; border: 1px dashed var(--rule); border-radius: 6px; }
.more__title { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.more ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.more li { display: flex; align-items: center; gap: 12px; min-width: 0; }
.more li img { height: 26px; width: auto; flex: none; }
.more li > span:last-child { display: flex; flex-direction: column; font-size: .9rem; color: var(--muted); line-height: 1.35; }
.more strong { color: var(--ink); font-size: 1rem; }
.more__px { width: 22px; height: 22px; flex: none; background:
  linear-gradient(var(--teal) 0 0) 0 0 / 11px 11px no-repeat,
  linear-gradient(var(--cyan) 0 0) 11px 11px / 11px 11px no-repeat; }
.more li:has(img) img { height: 22px; }

/* Su misura (fascia scura petrolio) */
.section--deep { background: var(--deep); color: var(--on-deep); }
.section--deep .label { color: var(--cyan); }
.section--deep .px { background: #fff; box-shadow: 6px 6px 0 var(--cyan), 12px 0 0 var(--teal), 0 12px 0 var(--cyan); }
.section--deep .section__sub { color: var(--on-deep-muted); }
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service { border: 1px solid var(--deep-line); border-radius: 6px; padding: 28px; display: flex; flex-direction: column; gap: 12px; }
.service__icon { width: 48px; height: 48px; border-radius: 4px; background: rgba(12, 192, 223, .14); display: grid; place-items: center; }
.service__icon svg { width: 26px; height: 26px; fill: none; stroke: var(--cyan); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.service h3 { font-size: 1.35rem; font-weight: 800; }
.service p { color: var(--on-deep-muted); }
.service ul { list-style: none; margin: 6px 0 0; padding: 14px 0 0; border-top: 1px solid var(--deep-line); display: grid; gap: 8px; }
.service li { position: relative; padding-left: 20px; font-size: .95rem; }
.service li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; background: var(--cyan); }
.deep__cta { margin-top: 48px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 32px; border-top: 1px solid var(--deep-line); }
.deep__cta p { font-size: 1.4rem; font-weight: 700; font-stretch: 112%; }

/* Come lavoriamo: sequenza reale di 4 fasi */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 28px; }
.steps li { padding-top: 22px; border-top: 4px solid var(--rule); position: relative; }
.steps li::before { content: ""; position: absolute; top: -4px; left: 0; width: 40%; height: 4px; background: var(--teal); }
.step__n { font-family: var(--mono); font-weight: 600; color: var(--teal-dark); font-size: .9rem; }
.steps h3 { font-size: 1.35rem; font-weight: 800; margin: 8px 0 8px; }
.steps p { color: var(--muted); }

/* Chi siamo */
.about { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.about__text p:not(.label) { color: var(--muted); font-size: 1.08rem; margin-top: 18px; max-width: 36em; }
.about__stack { background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 28px; }
.about__stack-title { font-family: var(--mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 16px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-family: var(--mono); font-size: .88rem; padding: 6px 12px; border: 1px solid var(--rule); border-radius: 3px; background: var(--surface); }

/* Contatti */
.contact { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: start; }
.offices { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 32px; }
.office__name { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--teal-dark); margin-bottom: 6px; }
.offices p:not(.office__name) { color: var(--muted); }
.contact__list { margin: 28px 0 0; display: grid; }
.contact__list div { padding: 14px 0; border-top: 1px solid var(--rule); }
.contact__list dt { font-family: var(--mono); font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.contact__list dd { margin: 4px 0 0; }
.contact__list a { font-size: 1.35rem; font-weight: 800; font-stretch: 108%; text-decoration: none; overflow-wrap: anywhere; }
.contact__list a:hover { color: var(--teal-dark); }

.form { background: var(--surface); border: 1px solid var(--rule); border-radius: 6px; padding: 30px; display: grid; gap: 18px; position: relative; }
.form::before { content: ""; position: absolute; top: -1px; left: -1px; width: 48px; height: 6px; background: var(--teal); box-shadow: 48px 0 0 var(--cyan); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .9rem; font-weight: 600; min-width: 0; }
.form input, .form select, .form textarea {
  font: inherit; font-weight: 400; width: 100%; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink);
  transition: border-color .15s, background .15s;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--teal); background: #fff; }
.form .is-invalid { border-color: #c8423b; }
.form__check { flex-direction: row !important; align-items: flex-start; gap: 10px !important; font-weight: 400 !important; color: var(--muted); }
.form__check input { width: 18px; height: 18px; margin-top: 3px; flex: none; accent-color: var(--teal); }
.form__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.form__msg { font-size: .92rem; min-height: 1.2em; }
.form__msg.ok { color: #1a7f4b; font-weight: 600; }
.form__msg.err { color: #c8423b; font-weight: 600; }

/* Footer */
.footer { background: var(--surface); border-top: 1px solid var(--rule); padding-block: 32px; font-size: .9rem; color: var(--muted); }
.footer__inner { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.footer__logo { height: 38px; width: auto; }
.footer a { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .product, .btn { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__inner { grid-template-columns: 1fr; gap: 36px; }
  .hero__pixels { justify-self: start; max-width: 360px; }
  .products, .services { grid-template-columns: 1fr; }
  .more { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .about, .contact { grid-template-columns: 1fr; gap: 40px; }
  .footer__inner { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 820px) {
  .burger { display: block; }
  .nav {
    position: fixed; left: 0; right: 0; top: calc(93px + env(safe-area-inset-top, 0px));
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    padding: 8px max(20px, env(safe-area-inset-right, 0px)) 24px max(20px, env(safe-area-inset-left, 0px));
    transform: translateY(-130%); transition: transform .3s ease; z-index: -1;
  }
  .nav.is-open { transform: none; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--rule); }
  .nav .btn { margin-top: 16px; border-bottom: 2px solid var(--teal); }
  .more ul { grid-template-columns: 1fr; gap: 14px; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .hero { padding-block: 44px 40px; }
  .section { padding-block: 64px; }
  .logo img { height: 54px; }
  .facts { grid-template-columns: 1fr; gap: 16px; margin-top: 40px; }
  .steps { grid-template-columns: 1fr; }
  .offices, .form__row { grid-template-columns: 1fr; }
  .hero__cta .btn { flex: 1 1 100%; }
  .form { padding: 22px; }
  .hero__pixels { max-width: 300px; }
}
