/* =========================================================
   Motorline s.r.l. — mobile first
   Idea: il sito come una scheda di misura d'officina.
   Linee di quota, righelli, cartiglio. Il rosso è il segno
   di vernice che si mette sul bullone serrato.
   ========================================================= */
:root {
  --ink: #121212;
  --ink-2: #1c1c1c;
  --paper: #ebe9e3;
  --paper-2: #f5f4f0;
  --line: rgba(18, 18, 18, .16);
  --line-dark: rgba(255, 255, 255, .14);
  --muted: #6b6a66;
  --muted-dark: #9c9b96;
  --red: #d7141a;
  --wa: #25d366;

  --f: 'Archivo', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;

  --gut: 20px;
  --dock-h: 68px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--f);
  font-stretch: 100%;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  padding-bottom: calc(var(--dock-h) + var(--safe-b) + 16px);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
p { margin: 0 0 1em; }
.wrap { padding-inline: var(--gut); max-width: 1240px; margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Titoli: condensato, corsivo e pesante come il logo */
.display, h1, h2 {
  font-family: var(--f);
  font-stretch: 62%;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
  line-height: .9;
  letter-spacing: -.01em;
  margin: 0;
}
h1 { font-size: clamp(56px, 17vw, 132px); }
h2 { font-size: clamp(44px, 12vw, 96px); }
h3 { font-stretch: 75%; font-weight: 700; font-size: 24px; line-height: 1.1; margin: 0 0 .3em; }

.mono, .label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.label { color: var(--muted); display: block; }
.on-ink .label { color: var(--muted-dark); }
.red { color: var(--red); }

/* Numero di sezione, come il riferimento di un foglio */
.sheet {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 18px;
}
.sheet::after { content: ''; flex: 1; height: 1px; background: currentColor; opacity: .35; }
.sheet b { color: var(--red); font-weight: 600; }
.on-ink .sheet { color: var(--muted-dark); }

/* Linea di quota |<——>| */
.dim {
  position: relative; display: block; height: 14px; margin: 10px 0 0;
  border-inline: 1.5px solid currentColor;
}
.dim::before {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: currentColor;
}
.dim span {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--bg, var(--paper)); padding: 0 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .06em; white-space: nowrap;
}

/* ---------- Barra in alto: solo logo ---------- */
.top {
  position: absolute; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px var(--gut);
}
.top .logo img { height: 40px; width: auto; }
.top nav { display: none; }
.top .tel { font-family: var(--mono); font-size: 12px; color: var(--muted-dark); text-decoration: none; letter-spacing: .04em; }

/* ---------- Dock in basso (pollice) ---------- */
.dock {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
  height: calc(var(--dock-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(18, 18, 18, .96);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-dark);
}
.dock a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  color: #d8d7d2; text-decoration: none;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase;
}
.dock svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.dock a:active { color: #fff; background: rgba(255,255,255,.05); }
.dock a[aria-current] { color: #fff; }
.dock a[aria-current] svg { stroke: var(--red); }
.dock .wa svg { stroke: var(--wa); }
.dock .only-lg { display: none; }

/* ---------- HERO ---------- */
.hero {
  background: var(--ink); color: #fff;
  padding-top: 76px; position: relative; overflow: hidden;
  display: flex; flex-direction: column;
}
.hero-left { display: contents; }
.hero-text { order: 1; }
.hero-figure { order: 2; }
.hero .code { order: 3; }
.hero-text { padding: 18px var(--gut) 8px; }
.hero h1 .q { position: relative; display: inline-block; color: var(--red); }
.hero-sub { color: #c9c8c3; font-size: 17px; max-width: 30em; margin: 22px 0 0; }
.hero-figure { margin: 22px 0 0; position: relative; --bg: var(--ink); }
.hero-figure svg { width: 100%; height: auto; display: block; }
.hero-figure .ann-box { fill: var(--ink); }
.hero-figure .ann-t { font: italic 800 38px var(--f); font-stretch: 62%; fill: #fff; text-transform: uppercase; }
.hero-figure .ann-s { font: 400 24px var(--mono); fill: #d2d1cb; }
.hero-figure .ann-n { font: 600 21px var(--mono); fill: var(--red); }
.hero-figure .ann-line { stroke: var(--red); stroke-width: 3; fill: none; }
.hero-figure .ann-dot { fill: var(--red); }
.hero-figure .ann-ring { fill: none; stroke: var(--red); stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: ring 2.4s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.6); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.ann { opacity: 0; animation: ann-in .6s ease-out forwards; }
.ann:nth-of-type(2) { animation-delay: .25s; }
.ann:nth-of-type(3) { animation-delay: .5s; }
.ann:nth-of-type(4) { animation-delay: .75s; }
@keyframes ann-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Campo codice: grande, da pollice */
.code {
  padding: 26px var(--gut) 34px;
  background: var(--ink); color: #fff;
}
.code label { display: block; margin-bottom: 10px; }
.code-field {
  display: flex; align-items: stretch;
  border-bottom: 2px solid #fff;
}
.code-field input {
  flex: 1; min-width: 0; background: transparent; border: 0; color: #fff;
  font-family: var(--mono); font-size: 20px; letter-spacing: .04em; text-transform: uppercase;
  padding: 14px 0; outline: none;
}
.code-field input::placeholder { color: #67665f; text-transform: none; letter-spacing: 0; }
.code-field button {
  border: 0; background: none; color: #fff; padding: 0 0 0 16px; cursor: pointer;
  display: flex; align-items: center;
}
.code-field button svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.code-field:focus-within { border-color: var(--red); }
.code small { display: block; margin-top: 12px; color: var(--muted-dark); font-size: 14px; }
.code small a { color: #fff; }

/* ---------- Sezioni ---------- */
.sec { padding: 72px 0; }
.sec-intro { font-size: 18px; color: #3d3c39; max-width: 34em; margin-top: 20px; }
.on-ink { background: var(--ink); color: #fff; --bg: var(--ink); }
.on-ink .sec-intro { color: #c9c8c3; }

/* Processo lungo un righello */
.ruler { list-style: none; margin: 40px 0 0; padding: 0 0 0 46px; position: relative; counter-reset: s; }
.ruler::before {
  /* tacche ogni 8px, tacca lunga ogni 40px */
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 22px;
  background:
    repeating-linear-gradient(to bottom, var(--ink) 0 1.5px, transparent 1.5px 40px) left / 22px 100% no-repeat,
    repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 8px) left / 11px 100% no-repeat;
  border-left: 1.5px solid var(--ink);
  opacity: .55;
}
.ruler li { position: relative; padding: 0 0 34px; counter-increment: s; }
.ruler li:last-child { padding-bottom: 0; }
.ruler li::before {
  content: '0' counter(s); position: absolute; left: -46px; top: 2px;
  width: 30px; height: 22px; display: grid; place-items: center;
  background: var(--paper); color: var(--red);
  font-family: var(--mono); font-size: 12px; font-weight: 600;
}
.ruler h3 { font-size: 26px; }
.ruler p { margin: 0; color: #4a4945; }

/* ---------- Scaffale motori (swipe) ---------- */
.rack-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.rack-count { font-family: var(--mono); font-size: 13px; color: var(--muted-dark); white-space: nowrap; }
.rack-count b { color: #fff; font-weight: 600; }
.rack {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 30px var(--gut) 8px; margin-top: 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-padding-inline: var(--gut);
}
.rack::-webkit-scrollbar { display: none; }
.eng {
  position: relative; flex: 0 0 78vw; max-width: 360px; scroll-snap-align: start;
  background: #fff; overflow: hidden; margin: 0;
}
.eng img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.eng figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: end; gap: 10px;
  padding: 48px 14px 14px;
  background: linear-gradient(to top, rgba(18,18,18,.92), rgba(18,18,18,0));
  color: #fff;
}
.eng .ref { font-family: var(--mono); font-size: 13px; font-weight: 600; letter-spacing: .06em; }
.eng .ref small { display: block; font-weight: 400; color: #c9c8c3; letter-spacing: .02em; text-transform: none; font-size: 12px; margin-top: 2px; }
.eng .ask {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  text-decoration: none; color: #fff; border-bottom: 2px solid var(--red); padding-bottom: 2px; white-space: nowrap;
}
.eng .zoom { position: absolute; inset: 0 0 60px; border: 0; background: none; cursor: zoom-in; }
/* Righello di scorrimento: una tacca per motore */
.scrub { display: flex; gap: 0; padding: 18px var(--gut) 0; height: 44px; align-items: end; }
.scrub button {
  flex: 1; height: 26px; border: 0; background: none; padding: 0; cursor: pointer; position: relative;
}
.scrub button::after {
  content: ''; position: absolute; left: 50%; bottom: 0; width: 1.5px; height: 10px; background: #5f5e59; transition: height .2s, background .2s;
}
.scrub button[aria-current="true"]::after { height: 24px; background: var(--red); width: 3px; }
.scrub-line { height: 1.5px; background: #5f5e59; margin: 0 var(--gut); }

/* ---------- Reparti ---------- */
.dept { border-top: 1.5px solid var(--ink); }
.dept:last-of-type { border-bottom: 1.5px solid var(--ink); }
.dept summary {
  list-style: none; cursor: pointer; padding: 22px 0 18px;
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 12px;
}
.dept summary::-webkit-details-marker { display: none; }
.dept summary .display { font-size: clamp(46px, 13vw, 104px); }
.dept summary .label { grid-column: 1 / -1; order: -1; }
.dept .plus {
  width: 38px; height: 38px; border: 1.5px solid var(--ink); border-radius: 50%;
  display: grid; place-items: center; margin-bottom: 6px; transition: transform .25s, background .25s;
}
.dept .plus svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; }
.dept[open] .plus { transform: rotate(45deg); background: var(--ink); color: #fff; }
.ops { list-style: none; margin: 0; padding: 0 0 26px; }
.ops li {
  display: grid; grid-template-columns: 1fr; gap: 2px;
  padding: 14px 0; border-top: 1px dashed var(--line);
}
.ops strong { font-weight: 700; font-stretch: 85%; font-size: 19px; }
.ops span { font-size: 15px; color: var(--muted); }
.dept .go {
  display: inline-block; margin: 0 0 28px; font-family: var(--mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase;
  text-decoration: none; border-bottom: 2px solid var(--red); padding-bottom: 3px;
}

/* ---------- Completo / semicompleto ---------- */
.switch {
  display: grid; grid-template-columns: 1fr 1fr; margin-top: 34px;
  border: 1.5px solid var(--ink); border-radius: 999px; padding: 4px; position: relative;
}
.switch button {
  position: relative; z-index: 1; border: 0; background: none; cursor: pointer;
  padding: 12px 8px; border-radius: 999px;
  font-stretch: 75%; font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .02em;
  transition: color .25s;
}
.switch button[aria-pressed="true"] { color: #fff; }
.switch .knob {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  background: var(--ink); border-radius: 999px; transition: transform .3s cubic-bezier(.3,.7,.2,1);
}
.switch[data-v="completo"] .knob { transform: translateX(100%); }
.parts { list-style: none; margin: 24px 0 0; padding: 0; }
.parts li {
  display: flex; justify-content: space-between; align-items: center; gap: 14px;
  padding: 15px 0; border-bottom: 1px solid var(--line);
  transition: opacity .3s;
}
.parts .st {
  flex: none; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 8px; border: 1.5px solid currentColor; border-radius: 3px;
}
.parts li.in .st { color: var(--red); }
.parts li.out { opacity: .38; }
.parts li.out .st { border-style: dashed; }
.parts-note { font-size: 14px; color: var(--muted); margin-top: 16px; }

/* ---------- FAQ ---------- */
.faq { margin-top: 34px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 20px 40px 20px 0; position: relative;
  font-stretch: 85%; font-weight: 700; font-size: 20px; line-height: 1.25;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 4px; top: 50%; width: 12px; height: 12px; margin-top: -9px;
  border-right: 2px solid var(--red); border-bottom: 2px solid var(--red); transform: rotate(45deg); transition: transform .25s;
}
.faq details[open] summary::after { transform: rotate(-135deg); margin-top: -3px; }
.faq details > p { color: #3d3c39; padding-bottom: 20px; margin: 0; max-width: 40em; }

/* ---------- Contatti ---------- */
.call {
  display: block; text-decoration: none; margin-top: 30px;
  font-family: var(--mono); font-size: clamp(28px, 8.4vw, 56px); font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
}
.call small { display: block; font-size: 12px; letter-spacing: .08em; color: var(--muted-dark); font-weight: 400; margin-bottom: 8px; }
.links { margin-top: 26px; display: grid; gap: 0; }
.links a, .links div {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line-dark); text-decoration: none; font-size: 17px;
}
.links a::after { content: '→'; color: var(--red); font-family: var(--mono); }
.links .label { margin: 0; }
.stars { color: #f2b500; letter-spacing: 1px; margin-right: 4px; }
.hours { margin: 0; width: 100%; }
.hours div { display: flex; justify-content: space-between; padding: 4px 0; border: 0 !important; }
.hours dt { color: var(--muted-dark); }
.hours dd { margin: 0; font-family: var(--mono); font-size: 14px; }

/* ---------- Cartiglio (footer) ---------- */
.cartiglio {
  margin: 0 var(--gut) 24px; border: 1.5px solid var(--ink); overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; font-size: 14px;
}
.cartiglio > div {
  padding: 10px 12px; min-width: 0;
  border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
  margin: 0 -1px -1px 0;
}
.cartiglio .wide { grid-column: 1 / -1; display: flex; align-items: center; background: var(--ink); color: #fff; }
.cartiglio .wide img { height: 38px; width: auto; }
.cartiglio .label { font-size: 10px; margin-bottom: 2px; }
.cartiglio b { font-weight: 600; overflow-wrap: anywhere; }
.cartiglio a { text-decoration: none; }

/* ---------- Pagine interne ---------- */
.page-top { background: var(--ink); color: #fff; padding: 84px 0 40px; }
.crumb { font-family: var(--mono); font-size: 12px; color: var(--muted-dark); margin-bottom: 26px; }
.crumb a { color: #fff; text-decoration: none; }
.page-top h1 { font-size: clamp(48px, 13vw, 112px); }
.page-top .lead { color: #c9c8c3; font-size: 18px; margin: 22px 0 0; max-width: 34em; }

.article { padding-top: 48px; }
.article h2 { font-size: clamp(38px, 10vw, 72px); margin: 64px 0 18px; }
.article > p, .article .p { font-size: 18px; color: #2d2c29; max-width: 36em; }

.diagram { margin: 30px calc(var(--gut) * -1) 0; background: var(--paper-2); padding: 20px var(--gut); border-block: 1px solid var(--line); }
.diagram svg { width: 100%; height: auto; display: block; max-width: 760px; margin: 0 auto; }
.diagram figcaption { font-size: 14px; color: var(--muted); margin-top: 12px; max-width: 760px; margin-inline: auto; }

/* Righe marca con il codice quotato */
.brand-row { padding: 26px 0; border-top: 1.5px solid var(--ink); }
.brand-row:last-of-type { border-bottom: 1.5px solid var(--ink); }
.brand-row h3 { font-stretch: 62%; font-style: italic; font-weight: 800; text-transform: uppercase; font-size: 40px; line-height: 1; margin-bottom: 16px; }
.codes { display: flex; flex-wrap: wrap; gap: 18px 28px; margin-bottom: 14px; }
.cq { display: inline-flex; gap: 6px; font-family: var(--mono); font-size: clamp(20px, 6vw, 28px); font-weight: 600; letter-spacing: .02em; }
.cq > span { display: flex; flex-direction: column; align-items: stretch; }
.cq > span > i {
  font-style: normal; position: relative; height: 12px; margin-top: 6px;
  border-inline: 1.5px solid var(--red);
}
.cq > span > i::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1.5px; background: var(--red); }
.cq > span > em {
  font-style: normal; font-weight: 400; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  text-align: center; margin-top: 4px; white-space: nowrap;
}
.cq .sep { color: var(--muted); }
.brand-row p { margin: 0; color: #3d3c39; font-size: 16px; max-width: 36em; }

.check { margin-top: 26px; }
.check .code { margin: 0 calc(var(--gut) * -1); }
.check-out { font-family: var(--mono); font-size: 13px; color: var(--muted-dark); margin: 12px 0 0; min-height: 1.5em; }
.check-out.ok { color: #6fe39d; }

/* Azioni testuali (niente pulsantoni) */
.actions { margin-top: 36px; border-top: 1.5px solid var(--ink); }
.actions a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 20px 0; border-bottom: 1px solid var(--line); text-decoration: none;
  font-stretch: 75%; font-weight: 700; font-size: 24px; text-transform: uppercase;
}
.actions a small { display: block; font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 400; letter-spacing: .05em; text-transform: none; font-stretch: 100%; margin-top: 2px; }
.actions a svg { width: 26px; height: 26px; flex: none; stroke: var(--red); fill: none; stroke-width: 1.8; }
.actions a.wa svg { stroke: #18a84f; }

/* ---------- Preventivo a passaggi ---------- */
.steps-bar { display: flex; gap: 6px; margin: 0 0 6px; }
.steps-bar span { flex: 1; height: 4px; background: rgba(255,255,255,.18); }
.steps-bar span.on { background: var(--red); }
.q-form { padding: 34px 0 20px; }
.q-step { display: none; }
.q-step.on { display: block; animation: ann-in .35s ease-out; }
.q-step h2 { font-size: clamp(40px, 11vw, 72px); margin-bottom: 8px; }
.q-step .hint { color: var(--muted); margin-bottom: 26px; }
.pick { display: grid; gap: 0; border-top: 1.5px solid var(--ink); }
.pick label {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 2px; border-bottom: 1px solid var(--line); cursor: pointer;
}
.pick label b { display: block; font-stretch: 75%; font-weight: 700; font-size: 26px; text-transform: uppercase; line-height: 1; }
.pick label small { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick .dot { flex: none; width: 24px; height: 24px; border: 1.5px solid var(--ink); border-radius: 50%; position: relative; }
.pick label:has(input:checked) .dot::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--red); }
.pick label:has(input:focus-visible) { outline: 2px solid var(--red); outline-offset: -2px; }
.fld { display: block; margin-bottom: 22px; }
.fld .label { margin-bottom: 4px; }
.fld input, .fld textarea {
  width: 100%; border: 0; border-bottom: 1.5px solid var(--ink); background: transparent; border-radius: 0;
  font: inherit; font-size: 20px; padding: 10px 0; color: var(--ink); outline: none;
}
.fld textarea { min-height: 90px; resize: vertical; font-size: 17px; }
.fld input:focus, .fld textarea:focus { border-color: var(--red); }
.fld .upper { font-family: var(--mono); text-transform: uppercase; letter-spacing: .03em; }
.consent { display: flex; gap: 12px; font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.consent input { width: 20px; height: 20px; accent-color: var(--red); flex: none; margin-top: 1px; }
.q-err { color: var(--red); font-size: 14px; min-height: 1.4em; margin: 10px 0 0; }

.q-nav {
  position: fixed; z-index: 60; left: 0; right: 0; bottom: 0;
  padding: 10px var(--gut) calc(10px + var(--safe-b));
  background: var(--paper); border-top: 1px solid var(--line);
  display: flex; gap: 10px;
}
.q-nav button {
  border: 1.5px solid var(--ink); background: transparent; cursor: pointer;
  height: 54px; padding: 0 18px; border-radius: 999px;
  font-stretch: 75%; font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .02em;
}
.q-nav .next { flex: 1; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; gap: 10px; }
.q-nav .next.send { background: #18a84f; border-color: #18a84f; }
.q-nav .next svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.q-nav .back[hidden] { display: none; }
.q-alt { font-size: 14px; color: var(--muted); text-align: center; margin-top: 18px; }
.q-alt a { color: var(--ink); }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; }
.lightbox::backdrop { background: rgba(10,10,10,.92); }
.lightbox img { max-width: 100vw; max-height: 86vh; object-fit: contain; }
.lb-close {
  position: fixed; top: 14px; right: 14px; width: 46px; height: 46px; border: 1.5px solid #fff; border-radius: 50%;
  background: transparent; color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}

/* =========================================================
   Da tablet in su
   ========================================================= */
@media (min-width: 760px) {
  :root { --gut: 40px; }
  .eng { flex-basis: 300px; }
  .ops { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
  .cartiglio { grid-template-columns: 1.6fr repeat(4, 1fr); }
  .cartiglio .wide { grid-column: 1; grid-row: span 2; justify-content: center; }
  .cartiglio .wide img { height: 54px; }
}

/* Desktop: la dock diventa una pillola centrata, in alto compare il menu testuale */
@media (min-width: 1000px) {
  body { font-size: 18px; padding-bottom: 104px; }
  .top { padding-block: 22px; }
  .top .logo img { height: 52px; }
  .top nav { display: flex; gap: 30px; }
  .top nav a {
    font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
    color: #d8d7d2; text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent;
  }
  .top nav a:hover, .top nav a[aria-current] { color: #fff; border-color: var(--red); }
  .top .tel { display: none; }

  .dock {
    left: 50%; right: auto; bottom: 22px; transform: translateX(-50%);
    width: 440px; height: 62px; padding: 0; border-radius: 999px;
    border: 1px solid var(--line-dark); box-shadow: 0 14px 40px rgba(0,0,0,.28);
  }
  .dock a { flex-direction: row; gap: 8px; font-size: 11px; }
  .dock svg { width: 20px; height: 20px; }
  .dock .hide-lg { display: none; }
  .dock .only-lg { display: flex; }
  .dock { grid-template-columns: repeat(3, 1fr); }

  .hero { padding-top: 0; min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
  .hero-left { display: flex; order: 0; flex-direction: column; justify-content: center; padding: 120px 0 60px; }
  .hero-text { padding: 0 var(--gut) 0 max(var(--gut), calc((100vw - 1240px) / 2 + var(--gut))); }
  .hero-figure { margin: 0; display: flex; align-items: center; justify-content: center; padding: 100px 40px 40px 0; }
  .hero-figure svg { max-height: calc(100vh - 140px); width: auto; max-width: 100%; }
  .code { padding: 40px var(--gut) 0 max(var(--gut), calc((100vw - 1240px) / 2 + var(--gut))); max-width: 720px; background: none; }

  .sec { padding: 120px 0; }
  .split { display: grid; grid-template-columns: 5fr 7fr; gap: 80px; align-items: start; }
  .split > :first-child { position: sticky; top: 40px; }
  .ruler { margin-top: 0; }
  .ruler h3 { font-size: 30px; }

  .rack { padding-inline: max(var(--gut), calc((100vw - 1240px) / 2 + var(--gut))); scroll-padding-inline: max(var(--gut), calc((100vw - 1240px) / 2 + var(--gut))); }
  .scrub { max-width: 1240px; margin: 0 auto; }
  .scrub-line { max-width: calc(1240px - 2 * var(--gut)); margin: 0 auto; }

  .contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: end; }

  .article { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 80px; }
  .article-main { min-width: 0; }
  .toc { position: sticky; top: 40px; align-self: start; margin-top: 64px; border-left: 2px solid var(--red); padding-left: 18px; }
  .toc a { display: block; text-decoration: none; padding: 6px 0; font-size: 15px; }
  .toc a:hover { color: var(--red); }
  .diagram { margin-inline: 0; border: 1px solid var(--line); }

  .q-wrap { max-width: 680px; }
  .q-nav { position: static; background: none; border: 0; padding: 30px 0 0; }
}
@media (max-width: 999px) { .toc { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .ann { opacity: 1; }
  html { scroll-behavior: auto; }
}
