/* =========================================================
   Safra Costruzioni — foglio di stile
   Idea: il sito come una tavola di progetto.
   ========================================================= */

@font-face { font-family: "Archivo"; src: url("../fonts/archivo.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../fonts/archivo-italic.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-style: italic; font-display: swap; }
@font-face { font-family: "Mono"; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }

:root {
  --paper: #e8e5df;      /* calcestruzzo chiaro */
  --paper-2: #dcd8d0;
  --ink: #151413;
  --ink-2: #4a4743;
  --steel: #85807a;
  --line: rgba(21, 20, 19, .16);
  --night: #121110;
  --night-2: #1c1b19;
  --red: #d8261c;        /* dal logo */
  --orange: #f0701e;
  --gutter: clamp(16px, 4vw, 56px);
  --wide: 125%;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; position: relative;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/1.55 "Archivo", system-ui, sans-serif;
  font-stretch: 100%;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
figure { margin: 0; }
::selection { background: var(--orange); color: var(--ink); }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--ink); color: var(--paper); padding: 8px 14px; }
.skip:focus { left: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Griglia da tavola sullo sfondo chiaro */
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 100%; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 120px 120px;
  opacity: .35;
}

/* ---------- Elementi ricorrenti ---------- */
.tag {
  font: 500 12px/1 "Mono", ui-monospace, monospace;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2);
  display: flex; gap: 14px; align-items: center;
  margin: 0 0 28px;
}
.tag span { color: var(--red); }
.tag::after { content: ""; flex: 0 0 48px; height: 1px; background: currentColor; opacity: .5; }

.h2 {
  font-stretch: var(--wide);
  font-weight: 800;
  font-size: clamp(34px, 5.6vw, 84px);
  line-height: .95;
  letter-spacing: -.02em;
  margin: 0;
}
.sec-head { padding: 0 var(--gutter); margin-bottom: clamp(40px, 7vw, 96px); }

/* Linea di quota */
.dim { display: flex; align-items: center; gap: 14px; margin-top: 56px; font: 400 11px/1 "Mono", monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--steel); }
.dim i { flex: 1; height: 1px; background: currentColor; position: relative; transform-origin: left; }
.dim i:last-child { transform-origin: right; }
.dim i::before { content: ""; position: absolute; top: -6px; width: 1px; height: 13px; background: currentColor; }
.dim i:first-child::before { left: 0; }
.dim i:last-child::before { right: 0; }

/* ---------- Quota laterale ---------- */
.quota { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 40; display: none; mix-blend-mode: difference; color: #fff; pointer-events: none; }
.quota__rule { width: 1px; height: 38vh; background: rgba(255,255,255,.35); margin-left: auto; position: relative;
  background-image: repeating-linear-gradient(to top, #fff 0 1px, transparent 1px 12px); background-size: 7px 100%; background-repeat: no-repeat; background-position: right; width: 7px; }
.quota__fill { position: absolute; bottom: 0; right: 0; width: 2px; height: 0; background: #fff; }
.quota__read { font: 500 11px/1.2 "Mono", monospace; text-align: right; margin-top: 12px; display: grid; }
.quota__lbl { opacity: .6; text-transform: uppercase; letter-spacing: .08em; }
.quota__val { font-size: 15px; }
.quota__unit { opacity: .6; }
@media (min-width: 1000px) { .quota { display: block; } }

/* ---------- Mirino ---------- */
.cross { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .2s; }
.cross.is-on { opacity: 1; }
.cross__x, .cross__y { position: absolute; background: #fff; mix-blend-mode: difference; }
.cross__x { width: 28px; height: 1px; left: -14px; top: 0; }
.cross__y { width: 1px; height: 28px; left: 0; top: -14px; }
.cross__read { position: absolute; left: 14px; top: 10px; font: 500 10px/1 "Mono", monospace; color: #fff; white-space: nowrap; letter-spacing: .04em; text-shadow: 0 0 6px rgba(0,0,0,.6); }
@media (hover: hover) and (pointer: fine) { [data-cross] { cursor: none; } }

/* ---------- Header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px var(--gutter);
  color: #fff;
  transition: background .4s var(--ease), color .4s, padding .4s, transform .5s var(--ease);
}
.top.is-solid { background: rgba(232, 229, 223, .97); color: var(--ink); padding-block: 12px; border-bottom: 1px solid var(--line); }
.top.is-hidden { transform: translateY(-100%); }
.brand { text-decoration: none; display: flex; align-items: baseline; gap: 10px; }
.brand { align-items: center; }
.brand__mark { display: block; height: 36px; width: auto; filter: drop-shadow(0 1px 6px rgba(0,0,0,.45)); transition: height .4s var(--ease), filter .4s; }
.top.is-solid .brand__mark { height: 30px; filter: none; }
@media (max-width: 560px) { .brand__sub { display: none; } }
.brand__sub { font: 500 10px/1 "Mono", monospace; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.nav { display: none; gap: 30px; align-items: center; font-size: 15px; }
.nav a { text-decoration: none; position: relative; }
.nav a:not(.nav__cta)::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease); }
.nav a:not(.nav__cta):hover::after { transform: scaleX(1); transform-origin: left; }
.nav__cta { border: 1px solid currentColor; padding: 9px 16px; transition: background .3s, color .3s; }
.nav__cta:hover { background: var(--orange); border-color: var(--orange); color: var(--ink); }
.burger { width: 44px; height: 44px; border: 0; background: none; color: inherit; display: grid; place-content: center; gap: 6px; cursor: pointer; padding: 0; }
.burger > span:not(.sr) { display: block; width: 26px; height: 2px; background: currentColor; transition: transform .3s; }
.burger[aria-expanded="true"] > span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] > span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
@media (min-width: 900px) { .nav { display: flex; } .burger { display: none; } }

.menu { position: fixed; inset: 0; z-index: 45; background: var(--night); color: var(--paper); display: flex; flex-direction: column; justify-content: center; padding: var(--gutter); gap: 8px; }
.menu[hidden] { display: none; }
.menu a { font-stretch: var(--wide); font-weight: 800; font-size: clamp(34px, 10vw, 56px); text-decoration: none; line-height: 1.1; }
.menu a:hover { color: var(--orange); }
body.menu-open .top { color: var(--paper); background: transparent; border-color: transparent; backdrop-filter: none; }

/* ---------- Hero ---------- */
.hero { position: relative; height: 100svh; min-height: 560px; color: #fff; overflow: hidden; background: var(--night); }
.hero__media { position: absolute; inset: 0; }
.hero__video { width: 100%; height: 100%; object-fit: cover; pointer-events: none; background: #111 url("../img/hero-poster.webp?v=3") center / cover no-repeat; }
@media (max-aspect-ratio: 4/5) { .hero__video { background-image: url("../img/hero-poster-m.webp?v=3"); } }
.hero__video::-webkit-media-controls, .hero__video::-webkit-media-controls-start-playback-button, .hero__video::-webkit-media-controls-overlay-play-button { display: none !important; -webkit-appearance: none; }
.hero__shade { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,.15) 28%, rgba(0,0,0,.45) 55%, rgba(0,0,0,.88) 100%),
  linear-gradient(90deg, rgba(0,0,0,.45) 0%, rgba(0,0,0,0) 70%); }
.hero__inner { position: relative; text-shadow: 0 2px 24px rgba(0,0,0,.45); height: 100%; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--gutter) clamp(28px, 6vh, 64px); }
.hero__tag { color: rgba(255,255,255,.8); }
.hero__tag span { color: var(--orange); }
.hero__title { margin: 0 0 clamp(24px, 4vh, 44px); font-stretch: var(--wide); font-weight: 900; font-size: clamp(46px, 11.5vw, 188px); line-height: .86; letter-spacing: -.035em; }
.hero__title .line { display: block; overflow: hidden; padding-bottom: .04em; }
.hero__title .line > span { display: inline-block; }
.hero__title em { font-style: italic; font-weight: 300; font-stretch: 100%; color: var(--orange); letter-spacing: -.02em; }
.hero__foot { display: grid; gap: 22px; align-items: end; border-top: 1px solid rgba(255,255,255,.3); padding-top: 22px; }
.hero__lead { margin: 0; max-width: 46ch; font-size: clamp(16px, 1.4vw, 19px); color: #fff; font-weight: 500; }
.hero__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 14px 36px; font: 400 12px/1.4 "Mono", monospace; letter-spacing: .04em; }
.hero__meta dt { opacity: .75; text-transform: uppercase; font-size: 10px; margin-bottom: 4px; }
.hero__meta dd { margin: 0; }
@media (min-width: 900px) { .hero__foot { grid-template-columns: 1fr auto; } }
.hero__down { position: absolute; right: var(--gutter); top: 50%; display: none; flex-direction: column; align-items: center; gap: 10px; color: #fff; text-decoration: none; font: 500 10px/1 "Mono", monospace; letter-spacing: .15em; text-transform: uppercase; writing-mode: vertical-rl; }
.hero__down i { width: 1px; height: 60px; background: linear-gradient(#fff, transparent); animation: drip 2.2s var(--ease) infinite; }
@keyframes drip { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@media (min-width: 1000px) { .hero__down { display: none; } }

/* ---------- Manifesto ---------- */
.manifesto { padding: clamp(96px, 16vw, 220px) var(--gutter) clamp(80px, 12vw, 160px); max-width: 1500px; }
.manifesto__text { margin: 0; font-stretch: 110%; font-weight: 600; font-size: clamp(24px, 3.7vw, 56px); line-height: 1.08; letter-spacing: -.02em; }
.manifesto__text .w { opacity: .14; transition: opacity .15s linear; }
.no-js .manifesto__text .w, html:not(.js) .manifesto__text .w { opacity: 1; }

/* ---------- Sequenza drone ---------- */
.orbit { position: relative; height: 320vh; background: var(--night); }
@media (max-width: 899px) { .orbit { height: 240vh; } }
.orbit__stage { position: sticky; top: 0; height: 100svh; overflow: hidden; color: #fff; }
.orbit__canvas, .orbit__fallback { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.orbit__fallback { z-index: 0; transition: opacity .4s; }
.orbit__canvas { z-index: 1; will-change: contents; }
.orbit__shade { position: absolute; inset: 0; z-index: 2; background: linear-gradient(0deg, rgba(0,0,0,.85) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 70%), linear-gradient(90deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 60%); }
.orbit__steps { text-shadow: 0 2px 18px rgba(0,0,0,.5); }
.orbit__steps { position: absolute; z-index: 3; left: var(--gutter); bottom: clamp(48px, 12vh, 120px); width: min(520px, calc(100% - 2 * var(--gutter))); height: 300px; }
.step { position: absolute; inset: auto 0 0 0; opacity: 0; transform: translateY(24px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.step.is-on { opacity: 1; transform: none; }
.step__n { font: 500 12px/1 "Mono", monospace; color: var(--orange); letter-spacing: .1em; margin: 0 0 18px; }
.step h2 { margin: 0 0 14px; font-stretch: var(--wide); font-weight: 800; font-size: clamp(30px, 4.4vw, 60px); line-height: .98; letter-spacing: -.02em; }
.step p { margin: 0; color: rgba(255,255,255,.82); max-width: 40ch; }
.orbit__bar { position: absolute; z-index: 3; left: var(--gutter); right: var(--gutter); bottom: 24px; height: 1px; background: rgba(255,255,255,.2); }
.orbit__bar span { position: absolute; inset: 0; background: var(--orange); transform: scaleX(0); transform-origin: left; }
html:not(.js) .orbit { height: auto; }
html:not(.js) .orbit__stage { position: relative; }
html:not(.js) .step { position: relative; opacity: 1; transform: none; margin-top: 30px; }
html:not(.js) .orbit__steps { height: auto; position: relative; padding: 30vh 0 60px; }

/* ---------- Lavorazioni ---------- */
.works { background: var(--paper); padding: clamp(96px, 12vw, 160px) 0; }
.works__head { padding: 0 var(--gutter); margin-bottom: 48px; }
.works__track { display: grid; gap: 56px; padding: 0 var(--gutter); }
.card__img { overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); }
.card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.card:hover .card__img img { transform: scale(1.04); }
.card__txt { display: grid; grid-template-columns: 48px 1fr; column-gap: 12px; padding-top: 18px; border-top: 1px solid var(--ink); margin-top: 16px; }
.card__n { font: 500 13px/1.6 "Mono", monospace; color: var(--red); grid-row: span 2; }
.card h3 { margin: 0 0 8px; font-stretch: 112%; font-weight: 700; font-size: 24px; line-height: 1.1; }
.card p { margin: 0; color: var(--ink-2); max-width: 38ch; }

.works__bar { display: none; }
@media (min-width: 900px) { .js .works__bar { display: block; }}
.works__bar { height: 2px; margin: 4svh var(--gutter) 0; background: var(--line); position: relative; overflow: hidden; }
.js .works__bar i { position: absolute; inset: 0; background: var(--orange); transform: scaleX(0); transform-origin: left; }
@media (min-width: 900px) {
  .works { padding: 0; }
  .works__pin { height: 100svh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; padding-top: 64px; }
  .works__head { margin-bottom: 4vh; display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; }
  .works__head .tag { margin: 0; order: 2; }
  .works__head .h2 { font-size: clamp(34px, 4.4vw, 70px); }
  .works__track { display: flex; gap: 3vw; width: max-content; padding-right: 12vw; }
  .card { width: min(36vw, 560px); }
  .card:nth-child(even) { margin-top: 7vh; }
  .card__img { aspect-ratio: 5 / 4; height: auto; max-height: 50vh; }
  html:not(.js) .works__pin { height: auto; overflow-x: auto; padding: 120px 0; }
}
/* Senza animazioni: le schede si scorrono col dito */
.still .works__pin { height: auto; overflow-x: auto; padding: 100px 0; scroll-snap-type: x mandatory; }
.still .card { scroll-snap-align: start; }
.still .works__bar { display: none; }

/* ---------- Cantieri ---------- */
.sites { padding: clamp(100px, 14vw, 200px) 0 clamp(80px, 10vw, 140px); background: var(--paper); border-top: 1px solid var(--line); }
.site { display: grid; gap: 18px; padding: 0 var(--gutter); margin-bottom: clamp(56px, 10vw, 140px); }
.site__img { overflow: hidden; background: var(--paper-2); }
.site__img img { width: 100%; height: 100%; object-fit: cover; }
.site--big .site__img { aspect-ratio: 16 / 9; }
.site--right .site__img { aspect-ratio: 4 / 3; }
.site__cap { display: grid; grid-template-columns: auto 1fr; column-gap: 20px; align-items: baseline; }
.site__year { font: 500 13px/1 "Mono", monospace; color: var(--red); grid-row: span 2; padding-top: 10px; }
.site__cap h3 { margin: 0; font-stretch: var(--wide); font-weight: 800; font-size: clamp(30px, 4vw, 58px); line-height: 1; letter-spacing: -.02em; }
.site__cap p { margin: 6px 0 0; color: var(--ink-2); }
@media (min-width: 900px) {
  .site--big { grid-template-columns: 1fr 320px; align-items: end; gap: 40px; }
  .site--right { grid-template-columns: 320px minmax(0, 860px); justify-content: end; align-items: end; gap: 40px; }
  .site--right .site__cap { order: -1; text-align: right; grid-template-columns: 1fr auto; }
  .site--right .site__cap h3, .site--right .site__cap p { grid-column: 1; }
  .site--right .site__year { grid-column: 2; grid-row: 1 / span 2; }
}

.strip { display: grid; gap: 16px; padding: 0 var(--gutter); margin-bottom: clamp(80px, 12vw, 160px); }
.strip figure { overflow: hidden; position: relative; background: var(--paper-2); }
.strip img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4 / 3; }
.strip figcaption, .stairs__note { font: 400 12px/1.5 "Mono", monospace; color: var(--ink-2); letter-spacing: .02em; }
.strip figcaption { padding-top: 10px; }
@media (min-width: 900px) {
  .strip { grid-template-columns: 1.3fr 1fr 1fr; align-items: start; gap: 2vw; }
  .strip__a img { aspect-ratio: 4 / 5; }
  .strip__b { margin-top: 14vh; }
  .strip__c { margin-top: 5vh; }
}

.stairs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 0 var(--gutter); }
.stairs figure { overflow: hidden; background: var(--paper-2); }
.stairs img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }
.stairs__note { grid-column: 1 / -1; margin: 0 0 8px; }
@media (min-width: 900px) {
  .stairs { grid-template-columns: 1fr 1fr 1fr 1fr; gap: 2vw; align-items: end; }
  .stairs__note { grid-column: auto; align-self: start; }
  .stairs figure:nth-of-type(2) img { aspect-ratio: 3 / 5; }
}

.reveal { clip-path: inset(0 0 0 0); }

/* ---------- Clienti ---------- */
.link-line { font-stretch: 112%; font-weight: 600; font-size: 18px; text-decoration: none; border-bottom: 2px solid var(--orange); padding-bottom: 4px; }

/* ---------- Video ---------- */
.film { background: var(--night); color: var(--paper); padding: clamp(100px, 14vw, 200px) 0; }
.sec-head--light .tag { color: rgba(232,229,223,.7); }
.film__frame { position: relative; margin: 0 var(--gutter); aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.film__frame iframe, .film__frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.film__play { all: unset; position: absolute; inset: 0; cursor: pointer; }
.film__play img { width: 100%; height: 100%; object-fit: cover; opacity: .7; transition: opacity .5s, transform 1.4s var(--ease); }
.film__play:hover img { opacity: .85; transform: scale(1.03); }
.film__btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 16px; font: 500 12px/1 "Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: #fff; }
.film__btn svg { width: 74px; height: 74px; padding: 22px; border-radius: 50%; background: var(--orange); fill: var(--ink); transition: transform .4s var(--ease); }
.film__play:hover .film__btn svg { transform: scale(1.1); }
.film__play:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.film__note { padding: 14px var(--gutter) 0; margin: 0; font: 400 11px/1.4 "Mono", monospace; color: rgba(232,229,223,.5); }

/* ---------- Chi siamo ---------- */
.about { display: grid; gap: 56px; padding: clamp(100px, 14vw, 200px) var(--gutter); }
.about__txt p:not(.tag) { max-width: 52ch; color: var(--ink-2); font-size: 18px; }
.about__txt .h2 { margin-bottom: 36px; font-size: clamp(32px, 4.2vw, 64px); }
.facts { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.facts li { padding: 18px 12px 0 0; display: grid; gap: 6px; }
.facts b { font-stretch: var(--wide); font-weight: 800; font-size: clamp(30px, 3.6vw, 52px); line-height: 1; color: var(--red); }
.facts span { font: 400 11px/1.4 "Mono", monospace; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.about__img { position: relative; min-height: 420px; }
.about__img figure { overflow: hidden; position: absolute; }
.about__img img { width: 100%; height: 100%; object-fit: cover; }
.about__a { inset: 0 18% 22% 0; }
.about__b { inset: 48% 0 0 40%; border: 10px solid var(--paper); }
@media (min-width: 900px) { .about { grid-template-columns: 1fr 1fr; gap: 6vw; align-items: center; } .about__img { min-height: 620px; } }

/* ---------- Contatti ---------- */
.contact { display: grid; gap: 64px; padding: clamp(100px, 14vw, 180px) var(--gutter); background: var(--night); color: var(--paper); }
.contact .tag { color: rgba(232,229,223,.7); }
.contact__side > p { color: rgba(232,229,223,.75); max-width: 40ch; margin: 28px 0 44px; }
.contact__list { margin: 0; display: grid; gap: 0; }
.contact__list > div { display: grid; grid-template-columns: 110px 1fr; padding: 14px 0; border-top: 1px solid rgba(232,229,223,.15); }
.contact__list dt { font: 400 11px/1.6 "Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: rgba(232,229,223,.5); }
.contact__list dd { margin: 0; word-break: break-word; }
.contact__list a { text-decoration: none; }
.contact__list a:hover { color: var(--orange); }
@media (min-width: 900px) { .contact { grid-template-columns: 5fr 6fr; gap: 7vw; } }

.form { display: grid; gap: 26px; align-content: start; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; }
.field label, .field legend { font: 400 11px/1 "Mono", monospace; text-transform: uppercase; letter-spacing: .08em; color: rgba(232,229,223,.6); padding: 0; }
.field small { text-transform: none; letter-spacing: 0; }
.field input, .field textarea {
  font: inherit; color: var(--paper); background: transparent; border: 0; border-bottom: 1px solid rgba(232,229,223,.3);
  padding: 10px 0; border-radius: 0; outline: none; transition: border-color .3s; width: 100%;
}
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field textarea:focus { border-color: var(--orange); }
.field [aria-invalid="true"] { border-color: var(--red); }
.field--chips { display: flex; flex-wrap: wrap; gap: 8px; }
.field--chips legend { margin-bottom: 12px; width: 100%; }
.field--chips label { cursor: pointer; text-transform: none; letter-spacing: 0; font: inherit; }
.field--chips label { position: relative; }
.field--chips input { position: absolute; opacity: 0; width: 1px; height: 1px; left: 0; top: 0; }
.field--chips span { display: inline-block; padding: 9px 14px; border: 1px solid rgba(232,229,223,.3); font-size: 14px; color: var(--paper); transition: all .25s; }
.field--chips input:checked + span { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.field--chips input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.hp { position: absolute; left: -9999px; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 12px; font-size: 14px; color: rgba(232,229,223,.75); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--orange); margin: 2px 0 0; }
.btn { justify-self: start; display: inline-flex; align-items: center; gap: 18px; font: 700 16px/1 "Archivo", sans-serif; font-stretch: 112%; background: var(--orange); color: var(--ink); border: 0; padding: 20px 26px; cursor: pointer; transition: background .3s, gap .3s var(--ease); }
.btn:hover { background: var(--paper); gap: 26px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.form__msg { margin: 0; min-height: 1.5em; font-size: 15px; }
.form__msg.ok { color: #9fd39a; }
.form__msg.err { color: #ff8a7a; }

/* ---------- Chiusura ---------- */
.end { background: var(--night); color: var(--paper); padding: clamp(80px, 12vw, 160px) var(--gutter) 28px; overflow: hidden; position: relative; border-top: 1px solid rgba(232,229,223,.12); }
@media (min-width: 1000px) { .end__top, .end__cols { padding-right: 56px; } }
.end__cols .end__mail { grid-column: 1 / -1; }
@media (min-width: 900px) { .end__cols .end__mail { grid-column: auto; } }
.end__top { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-end; justify-content: space-between; padding-bottom: clamp(48px, 7vw, 96px); border-bottom: 1px solid rgba(232,229,223,.15); }
.end__claim { margin: 0; font-stretch: var(--wide); font-weight: 900; font-size: clamp(44px, 8vw, 128px); line-height: .9; letter-spacing: -.035em; }
.end__claim em { font-style: italic; font-weight: 300; font-stretch: 100%; color: var(--orange); }
.end__up { display: inline-flex; align-items: center; gap: 18px; text-decoration: none; color: var(--paper); }
.end__up-ring { width: clamp(84px, 9vw, 120px); aspect-ratio: 1; border-radius: 50%; background: var(--orange); display: grid; place-items: center; transition: transform .5s var(--ease), background .3s; }
.end__up-ring svg { width: 40%; fill: var(--ink); transition: transform .5s var(--ease); }
.end__up:hover .end__up-ring { transform: translateY(-6px); background: var(--paper); }
.end__up:hover .end__up-ring svg { transform: translateY(-3px); }
.end__up-txt { display: grid; font-stretch: 112%; font-weight: 700; font-size: 22px; line-height: 1.1; }
.end__up-txt small { font: 400 11px/1.6 "Mono", monospace; letter-spacing: .08em; text-transform: uppercase; color: rgba(232,229,223,.55); }
.end__up:focus-visible .end__up-ring { outline: 2px solid var(--paper); outline-offset: 4px; }
.end__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 36px 24px; padding: clamp(40px, 6vw, 72px) 0; }
.end__cols div { display: grid; gap: 8px; align-content: start; min-width: 0; }
.end__cols h4 { margin: 0 0 6px; font: 500 11px/1 "Mono", monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--orange); }
.end__cols a, .end__cols span { text-decoration: none; color: rgba(232,229,223,.85); overflow-wrap: anywhere; font-size: 16px; }
.end__cols span { font-size: 13px; color: rgba(232,229,223,.5); }
.end__cols a:hover { color: var(--orange); }
@media (min-width: 900px) { .end__cols { grid-template-columns: repeat(4, 1fr); } }
.end__mark { margin: 0 auto clamp(32px, 5vw, 56px); max-width: 860px; padding-top: 8px; }
.end__mark img { display: block; width: 100%; height: auto; }
.end__legal { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 20px; font: 400 11px/1.5 "Mono", monospace; color: rgba(232,229,223,.5); letter-spacing: .02em; }
.end__legal a { color: rgba(232,229,223,.8); }

/* Pulsante flottante "torna su" */
.fab-up { position: fixed; right: 16px; bottom: 16px; z-index: 55; width: 52px; height: 52px; border-radius: 50%; background: var(--orange); display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.25); transform: translateY(90px); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
.fab-up svg { width: 22px; fill: var(--ink); }
.fab-up.is-on { transform: none; opacity: 1; }
.fab-up.is-hidden { transform: translateY(90px); opacity: 0; }
@media (min-width: 1000px) { .fab-up { right: 24px; bottom: 24px; } }

/* ---------- Settori ---------- */
.sectors { padding: clamp(40px, 6vw, 80px) var(--gutter) clamp(100px, 12vw, 160px); }
.sectors__list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.sectors__list li { display: grid; grid-template-columns: 40px 1fr; gap: 6px 16px; padding: 26px 0; border-bottom: 1px solid var(--line); }
.sectors__n { font: 500 13px/1.9 "Mono", monospace; color: var(--red); grid-row: span 2; }
.sectors__list h3 { margin: 0; font-stretch: var(--wide); font-weight: 800; font-size: clamp(24px, 3.4vw, 48px); line-height: 1; letter-spacing: -.02em; }
.sectors__list p { margin: 0; color: var(--ink-2); max-width: 60ch; }
@media (min-width: 900px) {
  .sectors__list li { grid-template-columns: 60px 1.3fr 1fr; align-items: baseline; padding: 36px 0; }
  .sectors__n { grid-row: auto; }
  .sectors__list li { transition: padding .5s var(--ease); }
  .sectors__list li:hover { padding-left: 16px; }
  .sectors__list li:hover h3 { color: var(--red); }
}

/* ---------- Nastro mezzi e attrezzature ---------- */
.kit { background: var(--orange); color: var(--ink); padding: 22px 0 26px; overflow: hidden; }
.kit__lbl { margin: 0 var(--gutter) 14px; font: 500 11px/1 "Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.kit__belt { display: flex; width: max-content; animation: belt 48s linear infinite; }
.kit__row { list-style: none; margin: 0; padding: 0; display: flex; }
.kit__row li { white-space: nowrap; font-stretch: 112%; font-weight: 600; font-size: clamp(18px, 2vw, 26px); padding: 0 28px; border-left: 1px solid rgba(21,20,19,.35); }
.kit__row b { font-stretch: var(--wide); font-weight: 900; margin-right: 6px; }
@keyframes belt { to { transform: translate3d(-50%, 0, 0); } }
.kit:hover .kit__belt { animation-play-state: paused; }

.certs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px !important; }
.certs span { font: 500 12px/1 "Mono", monospace; letter-spacing: .06em; border: 1px solid var(--ink); padding: 9px 12px; color: var(--ink); }

/* ---------- Voce di menu della pagina aperta ---------- */
.nav a[aria-current="page"]:not(.nav__cta)::after { transform: scaleX(1); }
.menu a[aria-current="page"] { color: var(--orange); }

/* ---------- Oltre il cantiere ---------- */
.beyond { display: grid; gap: 48px; padding: clamp(100px, 14vw, 180px) var(--gutter); background: var(--paper-2); border-top: 1px solid var(--line); }
.beyond .h2 em { font-style: italic; font-weight: 300; color: var(--red); }
.beyond__txt p:not(.tag) { max-width: 54ch; color: var(--ink-2); font-size: 18px; }
.beyond__txt .h2 { margin-bottom: 32px; font-size: clamp(32px, 4.6vw, 70px); }
.beyond__quote { font-stretch: 112%; font-weight: 600; color: var(--ink) !important; border-left: 3px solid var(--orange); padding-left: 18px; margin-top: 28px; }
.beyond__logos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; align-self: center; }
.beyond__logos li { background: #fff; aspect-ratio: 1; display: grid; place-items: center; padding: 10%; box-shadow: 0 1px 0 var(--line); overflow: hidden; }
.beyond__logos img { display: block; width: 100%; height: auto; transition: transform .5s var(--ease); }
@media (hover: hover) { .beyond__logos li:hover img { transform: scale(1.04); } }
@media (min-width: 900px) { .beyond { grid-template-columns: 1.1fr 1fr; gap: 6vw; align-items: center; } .beyond__logos { gap: 18px; } }

/* ---------- Testata delle pagine interne ---------- */
.phero { background: var(--night); color: var(--paper); padding: clamp(130px, 18vw, 220px) var(--gutter) clamp(56px, 7vw, 90px); position: relative; overflow: hidden; }
.phero::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(232,229,223,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(232,229,223,.05) 1px, transparent 1px); background-size: 60px 60px; pointer-events: none; }
.phero > * { position: relative; }
.phero .tag { color: rgba(232,229,223,.7); }
.phero__title { margin: 0; font-stretch: var(--wide); font-weight: 800; font-size: clamp(42px, 8.4vw, 128px); line-height: .92; letter-spacing: -.03em; }
.phero__title em { font-style: italic; font-weight: 300; color: var(--orange); }
.phero__foot { display: grid; gap: 32px; margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid rgba(232,229,223,.2); }
.phero__foot > p { margin: 0; max-width: 52ch; color: rgba(232,229,223,.85); font-size: 18px; }
.phero__meta { margin: 0; display: flex; flex-wrap: wrap; gap: 20px 44px; }
.phero__meta dt { font: 400 11px/1.4 "Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: rgba(232,229,223,.55); }
.phero__meta dd { margin: 4px 0 0; font-stretch: var(--wide); font-weight: 800; font-size: clamp(22px, 2.4vw, 32px); color: var(--orange); }
@media (min-width: 900px) { .phero__foot { grid-template-columns: 1fr auto; align-items: end; } }

/* ---------- Pagina Lavori ---------- */
.jobs { padding: 0 var(--gutter) clamp(60px, 8vw, 120px); }
.jobs__filter { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 14px 0; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter); background: rgba(232,229,223,.97); border-bottom: 1px solid var(--line); }
.jobs__filter::-webkit-scrollbar { display: none; }
.jobs__filter button { flex: none; font: 500 12px/1 "Mono", monospace; letter-spacing: .05em; text-transform: uppercase; background: none; border: 1px solid var(--ink); color: var(--ink); padding: 11px 14px; cursor: pointer; transition: background .3s, color .3s; }
.jobs__filter button:hover { background: var(--paper-2); }
.jobs__filter button.is-on { background: var(--ink); color: var(--paper); }
.jobs__group { padding-top: clamp(64px, 9vw, 120px); }
.jobs__group[hidden] { display: none; }
.jobs__head { margin-bottom: clamp(28px, 4vw, 48px); }
.jobs__head .h2 { font-size: clamp(30px, 4.4vw, 64px); }
.jobs__head > p:last-child { margin: 14px 0 0; color: var(--ink-2); max-width: 52ch; }
.job { display: grid; gap: 18px; padding: 28px 0 40px; border-top: 1px solid var(--ink); }
.job__id { display: flex; justify-content: space-between; align-items: baseline; font: 500 13px/1 "Mono", monospace; }
.job__n { color: var(--red); font-size: 14px; }
.job__year { color: var(--ink-2); }
.job__txt h3 { margin: 0; font-stretch: var(--wide); font-weight: 800; font-size: clamp(24px, 2.6vw, 38px); line-height: 1.02; letter-spacing: -.015em; }
.job__place { margin: 8px 0 16px; font: 500 12px/1.4 "Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.job__txt p:not([class]) { margin: 0; color: var(--ink-2); max-width: 56ch; }
.job__client { margin: 18px 0 0; display: grid; gap: 4px; font-stretch: 112%; font-weight: 600; }
.job__client span { font: 400 11px/1 "Mono", monospace; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); }
.job__gallery { display: grid; gap: 8px; }
.job__main, .job__thumbs button { all: unset; display: block; overflow: hidden; cursor: zoom-in; background: var(--paper-2); }
.job__main { aspect-ratio: 4 / 3; }
.job__main img, .job__thumbs img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.job__main:hover img, .job__thumbs button:hover img { transform: scale(1.05); }
.job__main:focus-visible, .job__thumbs button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.job__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.job__thumbs button { aspect-ratio: 1; }
.job__thumbs .job__more { aspect-ratio: 1; display: grid; place-items: center; font: 600 15px/1 "Mono", monospace; background: var(--ink); color: var(--paper); cursor: zoom-in; transition: background .3s; }
.job__thumbs .job__more:hover { background: var(--orange); color: var(--ink); }
.job__count { margin: 14px 0 0; font: 500 11px/1 "Mono", monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--red); }
.job__ph { aspect-ratio: 4 / 3; display: grid; place-items: center; border: 1px solid var(--line);
  background: repeating-linear-gradient(-45deg, transparent 0 10px, rgba(21,20,19,.06) 10px 11px); }
.job__ph span { font: 500 11px/1 "Mono", monospace; text-transform: uppercase; letter-spacing: .1em; color: var(--steel); background: var(--paper); padding: 8px 10px; }
@media (min-width: 900px) {
  .job { grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.15fr); gap: 3vw; padding: 36px 0 56px; }
  .job__id { flex-direction: column; justify-content: flex-start; gap: 10px; }
  .job__n { font-size: 15px; }
}
.cta-band { display: grid; gap: 32px; padding: clamp(80px, 11vw, 150px) var(--gutter); background: var(--night); color: var(--paper); }
@media (min-width: 900px) { .cta-band { grid-template-columns: 1fr auto; align-items: end; } }

/* Foto a schermo intero */
.lb { border: 0; padding: 0; margin: 0; max-width: none; max-height: none; width: 100vw; height: 100dvh; background: rgba(12,11,10,.96); color: var(--paper); }
.lb::backdrop { background: rgba(12,11,10,.9); }
.lb[open] { display: grid; place-items: center; }
.lb img { max-width: calc(100vw - 32px); max-height: calc(100dvh - 120px); object-fit: contain; }
.lb button { position: absolute; background: none; border: 1px solid rgba(232,229,223,.35); color: var(--paper); width: 52px; height: 52px; font-size: 22px; cursor: pointer; transition: background .3s, color .3s; }
.lb button:hover { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.lb__x { top: 16px; right: 16px; font-size: 30px !important; }
.lb__prev { left: 16px; bottom: 16px; }
.lb__next { left: 76px; bottom: 16px; }
.lb__count { position: absolute; right: 16px; bottom: 30px; margin: 0; font: 500 12px/1 "Mono", monospace; letter-spacing: .08em; color: rgba(232,229,223,.7); }
.lb.is-single .lb__prev, .lb.is-single .lb__next, .lb.is-single .lb__count { display: none; }

/* ---------- Pagina Contatti ---------- */
.contact--page { padding-top: clamp(130px, 16vw, 200px); }
.contact--page h1.h2 { font-size: clamp(40px, 6.4vw, 96px); }
.visit { display: grid; gap: 40px; padding: clamp(90px, 12vw, 160px) var(--gutter); }
.visit__txt p:not(.tag) { color: var(--ink-2); font-size: 18px; max-width: 44ch; margin: 24px 0 32px; }
.visit__txt .h2 { font-size: clamp(30px, 4.2vw, 60px); }
.visit__img { margin: 0; overflow: hidden; aspect-ratio: 4 / 3; background: var(--paper-2); }
.visit__img img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .visit { grid-template-columns: 1fr 1.2fr; gap: 6vw; align-items: center; } }

/* ---------- Movimento ridotto ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero__down i { animation: none; }
  .manifesto__text .w { opacity: 1 !important; }
}
@media (min-width: 900px) { .job__main, .job__ph { aspect-ratio: 3 / 2; } }
