/* DaVinci Engineering & Innovation — redesign
   Tokens: brand steel blue + slate from the original site, concrete grey,
   one site-safety yellow used only for the Conto Termico offer and focus. */
:root {
  --slate: #1e262e;
  --blue: #385870;
  --blue-deep: #2a4456;
  --concrete: #e4e6e6;
  --concrete-2: #d3d7d8;
  --white: #ffffff;
  --yellow: #f2c230;
  --ink-soft: #55626d;
  --on-dark-soft: #b7c4ce;

  --wide: 125%;
  --gutter: clamp(20px, 4vw, 56px);
  --max: 1320px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--header-h); }
body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--slate);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; font-weight: 800; font-stretch: var(--wide); line-height: 1.02; letter-spacing: -0.01em; }

:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--yellow); color: var(--slate); padding: 10px 16px; font-weight: 700; }
.skip:focus { left: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .6em;
  padding: 1em 1.6em; border: 2px solid currentColor;
  font: inherit; font-weight: 700; font-stretch: 112%; font-size: 1rem; line-height: 1;
  text-decoration: none; cursor: pointer; background: none; color: inherit;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--solid { background: var(--white); border-color: var(--white); color: var(--slate); }
.btn--solid:hover { background: var(--yellow); border-color: var(--yellow); }
.btn--blue { background: var(--blue); border-color: var(--blue); color: var(--white); }
.btn--blue:hover { background: var(--slate); border-color: var(--slate); }
.btn--ghost:hover { background: var(--white); color: var(--slate); border-color: var(--white); }
.btn--dark { background: var(--slate); border-color: var(--slate); color: var(--white); }
.btn--dark:hover { background: var(--white); color: var(--slate); }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  color: var(--white);
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-solid { background: var(--slate); box-shadow: 0 1px 0 rgba(255,255,255,.08); }
.site-header .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: block; width: 168px; }
.brand img { width: 100%; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2vw, 30px); }
.nav a { text-decoration: none; font-size: .95rem; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-color: var(--yellow); }
.nav .btn { padding: .75em 1.2em; border: 2px solid currentColor; }
.nav .btn:hover { border-color: var(--white); }
.menu-toggle { display: none; background: none; border: 0; color: inherit; padding: 8px; cursor: pointer; }
.menu-toggle svg { width: 28px; height: 28px; }

@media (max-width: 960px) {
  .menu-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--slate); padding: 8px var(--gutter) 28px; display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 1.1rem; }
  .nav .btn { margin-top: 18px; justify-content: center; }
  .site-header.menu-open { background: var(--slate); }
}

/* ---------- Hero: the window that opens ---------- */
.hero { position: relative; height: 240vh; background: var(--slate); color: var(--white); }
.hero__stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.hero__frame {
  /* JS sets top/left/width/height + radius: the photo is always framed whole, never a random slice */
  position: absolute; inset: 0; overflow: hidden;
  will-change: top, left, width, height;
}
.hero__frame img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 55%; transform: scale(calc(1.08 - .08 * var(--p, 0))); }
.hero__frame::after { /* darkens the left side once the window is fully open, for text contrast */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(30,38,46,.9) 0%, rgba(30,38,46,.62) 42%, rgba(30,38,46,0) 72%);
  opacity: var(--p, 0);
}
/* Window mullion and transom, drawn on top of the photo; they fade as it opens */
.hero__mullions { position: absolute; pointer-events: none; opacity: calc(1 - var(--p, 0) * 2.2); }
.hero__mullions::before { content: ""; position: absolute; background: var(--slate); }
.hero__mullions::before { left: 50%; top: 0; bottom: 0; width: 10px; transform: translateX(-50%); }

/* Copy block: vertically centred in the space under the header, same axis as the window */
.hero__copy {
  position: absolute; z-index: 2; inset: var(--header-h) 0 0 0;
  display: flex; align-items: center;
}
.hero__copy .wrap { padding-bottom: 2vh; }
.hero__title {
  font-size: clamp(3.2rem, 7.4vw, 7.6rem); line-height: .92; letter-spacing: -0.025em;
  max-width: 8.5ch; margin-bottom: clamp(24px, 3.4vh, 40px);
}
.hero__title span { display: block; }
.hero__sub { font-size: clamp(1.15rem, 1.6vw, 1.4rem); font-weight: 500; max-width: 34ch; margin-bottom: 6px; }
.hero__group { color: var(--on-dark-soft); font-size: .95rem; line-height: 1.5; margin-bottom: clamp(28px, 4.5vh, 48px); }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

@media (max-width: 760px) {
  .hero { height: 200vh; }
  .hero__copy { align-items: flex-end; padding-bottom: 32px; }
  .hero__title { margin-bottom: 18px; }
  .hero__group { margin-bottom: 24px; }
  .hero__frame::after { background: linear-gradient(0deg, rgba(30,38,46,.94) 0%, rgba(30,38,46,.72) 48%, rgba(30,38,46,.15) 80%); }
}
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero__stage { position: relative; height: 100svh; min-height: 620px; }
  .hero { --p: 1; }
  .hero__mullions { display: none; }
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(80px, 12vw, 160px); }
.section--concrete { background: var(--concrete); }
.section--blue { background: var(--blue); color: var(--white); }
.section--slate { background: var(--slate); color: var(--white); }

.kicker { font-weight: 600; font-size: 1rem; color: var(--blue); margin-bottom: 1rem; }
.section--blue .kicker, .section--slate .kicker { color: var(--on-dark-soft); }
.h2 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); margin-bottom: .5em; }
.h3 { font-size: clamp(1.35rem, 2vw, 1.75rem); line-height: 1.12; margin-bottom: .6em; }
.lead { font-size: clamp(1.25rem, 1.9vw, 1.6rem); line-height: 1.45; font-weight: 500; }
.muted { color: var(--ink-soft); }
.section--blue .muted, .section--slate .muted { color: var(--on-dark-soft); }

/* ---------- Chi siamo ---------- */
.about { display: grid; grid-template-columns: 1fr; gap: 48px; }
.about > * { min-width: 0; }
.about__year {
  font-weight: 900; font-stretch: var(--wide); line-height: .8; letter-spacing: -0.04em;
  font-size: clamp(6rem, 24vw, 21rem);
  -webkit-text-stroke: 2px var(--blue); color: transparent;
  margin: 0 0 clamp(32px, 5vw, 64px) -0.04em;
}
.about__text { max-width: 62ch; }
.about__media { position: relative; }
.about__media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.values { display: grid; gap: 32px; margin-top: 56px; padding-top: 40px; border-top: 2px solid var(--slate); }
@media (min-width: 900px) {
  .about { grid-template-columns: 7fr 5fr; gap: 72px; align-items: start; }
  .about__media { margin-top: 8px; }
  .values { grid-template-columns: 1fr 1fr; gap: 56px; }
}

/* ---------- Servizi ---------- */
.services { display: grid; gap: 64px; }
@media (min-width: 900px) { .services { grid-template-columns: 1fr 1fr; gap: 72px; } }
.services__head { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding-bottom: 20px; border-bottom: 2px solid var(--slate); }
.services__head .h3 { margin: 0; }
.services__head a { font-weight: 700; font-size: .95rem; white-space: nowrap; }
.svc-list { list-style: none; margin: 0; padding: 0; }
.svc-list li { padding: 20px 0 20px 40px; border-bottom: 1px solid var(--concrete-2); position: relative; }
.svc-list li::before { /* small square = a plan-view pillar */
  content: ""; position: absolute; left: 4px; top: 29px; width: 10px; height: 10px; background: var(--blue);
}
.chips { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 6px 12px; border: 0; background: var(--white); font-size: .92rem; font-weight: 500; }
.chips li::before { display: none; }

/* ---------- Progetti strip (home) ---------- */
.projects-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; margin-bottom: 40px; }
.projects-head .h2 { margin: 0; }
.strip-controls { display: flex; gap: 8px; }
.strip-controls button {
  width: 52px; height: 52px; border: 2px solid currentColor; background: none; color: inherit; cursor: pointer;
  display: grid; place-items: center;
}
.strip-controls button:hover { background: var(--white); color: var(--slate); }
.strip-controls svg { width: 22px; height: 22px; }
.strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: clamp(270px, 30vw, 420px); gap: 20px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  scroll-padding-inline: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
}
.strip::-webkit-scrollbar { display: none; }
.tile { scroll-snap-align: start; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.tile__img { overflow: hidden; aspect-ratio: 3 / 4; background: var(--blue-deep); }
.tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.2,1); }
.tile:hover .tile__img img { transform: scale(1.04); }
.tile h3 { font-size: 1.3rem; margin: 18px 0 8px; }
.tile p { font-size: .95rem; color: var(--on-dark-soft); margin: 0 0 12px; }
.tile .more { margin-top: auto; font-weight: 700; font-size: .95rem; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }

/* ---------- Infissi ---------- */
.infissi { display: grid; gap: 48px; }
@media (min-width: 900px) { .infissi { grid-template-columns: 5fr 6fr; gap: 80px; align-items: center; } }
.infissi__pair { display: grid; grid-template-columns: 3fr 2fr; gap: 16px; align-items: end; }
.infissi__pair img { width: 100%; object-fit: cover; }
.infissi__pair img:first-child { aspect-ratio: 4 / 3; }
.infissi__pair img:last-child { aspect-ratio: 3 / 4; }
.question { margin-top: clamp(80px, 10vw, 140px); }
.question .h2 { max-width: 18ch; }
.answers { display: grid; gap: 40px; margin-top: 48px; }
@media (min-width: 900px) { .answers { grid-template-columns: repeat(3, 1fr); gap: 48px; } }
.answers p { border-top: 2px solid rgba(255,255,255,.35); padding-top: 22px; margin: 0; }
.answers strong { display: block; font-stretch: var(--wide); font-size: 1.2rem; line-height: 1.2; margin-bottom: 10px; }
.windows-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 64px; }
.windows-row img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
@media (max-width: 700px) { .windows-row { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Offer band (Conto Termico) ---------- */
.offer { background: var(--yellow); color: var(--slate); padding-block: clamp(56px, 8vw, 96px); }
.offer .wrap { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) { .offer .wrap { grid-template-columns: auto 1fr auto; gap: 56px; } }
.offer__big { font-weight: 900; font-stretch: var(--wide); font-size: clamp(4.5rem, 11vw, 9rem); line-height: .85; letter-spacing: -0.04em; }
.offer__big small { display: block; font-size: 1rem; letter-spacing: 0; font-weight: 600; margin-top: 10px; line-height: 1.3; }
.offer__lines { font-weight: 800; font-stretch: var(--wide); font-size: clamp(1.4rem, 2.4vw, 2rem); line-height: 1.15; }
.offer__lines span { display: block; }
.offer__title { font-weight: 600; margin-bottom: 10px; }

/* ---------- Contatti ---------- */
.contact { display: grid; gap: 64px; }
@media (min-width: 960px) { .contact { grid-template-columns: 6fr 5fr; gap: 96px; } }
.form { display: grid; gap: 18px; margin-top: 36px; }
.form .row { display: grid; gap: 18px; }
@media (min-width: 600px) { .form .row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; font: inherit; color: var(--white); background: rgba(255,255,255,.06);
  border: 0; border-bottom: 2px solid rgba(255,255,255,.4); padding: 14px 14px;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--yellow); background: rgba(255,255,255,.1); }
.form .btn { justify-self: start; }
.form__note { font-size: .9rem; color: var(--on-dark-soft); margin: 0; }
.form__status { font-weight: 600; min-height: 1.6em; margin: 0; }

.details { display: grid; gap: 30px; align-content: start; }
.details h3 { font-size: 1rem; font-stretch: 112%; font-weight: 700; color: var(--on-dark-soft); margin-bottom: 8px; }
.details p { margin: 0; }
.details a { text-decoration: none; }
.details a:hover { text-decoration: underline; text-decoration-color: var(--yellow); text-underline-offset: 4px; }
.people { display: grid; gap: 16px; }
.people p span { display: block; color: var(--on-dark-soft); font-size: .92rem; }
.big-mail { font-weight: 800; font-stretch: var(--wide); font-size: clamp(1.4rem, 2.6vw, 2rem); }

/* ---------- Footer ---------- */
.site-footer { background: var(--slate); color: var(--on-dark-soft); font-size: .9rem; padding-block: 40px; border-top: 1px solid rgba(255,255,255,.1); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 16px 40px; align-items: center; justify-content: space-between; }
.site-footer img { width: 130px; opacity: .9; }
.site-footer a { color: var(--white); }

/* ---------- Inner page hero ---------- */
.page-hero { background: var(--slate); color: var(--white); padding: calc(var(--header-h) + clamp(56px, 9vw, 120px)) 0 clamp(56px, 8vw, 100px); }
.page-hero h1 { font-size: clamp(3rem, 9vw, 8rem); line-height: .9; letter-spacing: -0.03em; }
.page-hero .lead { max-width: 40ch; margin-top: 28px; color: var(--on-dark-soft); }
.index-list { list-style: none; padding: 0; margin: 48px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.index-list a { display: inline-block; padding: 10px 16px; border: 1px solid rgba(255,255,255,.3); text-decoration: none; font-weight: 500; }
.index-list a:hover { background: var(--white); color: var(--slate); }

/* ---------- Progetti page ---------- */
.cat { padding-block: clamp(72px, 9vw, 120px); border-bottom: 1px solid var(--concrete-2); }
.cat:nth-of-type(even) { background: var(--concrete); }
.cat__grid { display: grid; gap: 40px; }
@media (min-width: 960px) {
  .cat__grid { grid-template-columns: 4fr 8fr; gap: 64px; align-items: start; }
  .cat__text { position: sticky; top: calc(var(--header-h) + 32px); }
}
.cat__text .h2 { font-size: clamp(2rem, 3.8vw, 3.2rem); }
.cat__count { font-size: .92rem; color: var(--ink-soft); margin-top: 1.4em; }
.gallery { columns: 2 240px; column-gap: 12px; }
.gallery button { display: block; width: 100%; padding: 0; border: 0; margin: 0 0 12px; background: var(--concrete-2); cursor: zoom-in; break-inside: avoid; }
.gallery img { width: 100%; height: auto; }
.gallery button:hover img { opacity: .88; }

/* Lightbox */
.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
.lightbox::backdrop { background: rgba(20,26,32,.94); }
.lightbox__inner { position: relative; width: 100%; height: 100%; display: grid; place-items: center; padding: 64px 72px; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 128px); width: auto; height: auto; }
.lightbox button { position: absolute; background: none; border: 2px solid rgba(255,255,255,.5); color: var(--white); width: 52px; height: 52px; cursor: pointer; display: grid; place-items: center; }
.lightbox button:hover { border-color: var(--white); background: rgba(255,255,255,.1); }
.lightbox button svg { width: 22px; height: 22px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--on-dark-soft); font-size: .9rem; }
@media (max-width: 600px) { .lightbox__inner { padding: 72px 8px; } .lb-prev, .lb-next { top: auto; bottom: 8px; transform: none; } }

/* ---------- Bonus page ---------- */
.prose { max-width: 66ch; }
.prose strong { font-weight: 700; }
.split { display: grid; gap: 48px; }
@media (min-width: 960px) { .split { grid-template-columns: 7fr 5fr; gap: 80px; align-items: center; } }
.split img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.compare { width: 100%; border-collapse: collapse; margin-top: 40px; font-size: 1rem; }
.compare caption { text-align: left; font-weight: 600; color: var(--ink-soft); margin-bottom: 12px; caption-side: bottom; padding-top: 14px; font-size: .9rem; }
.compare th, .compare td { text-align: left; padding: 18px 16px 18px 0; border-bottom: 1px solid var(--concrete-2); vertical-align: top; }
.compare thead th { font-size: .9rem; font-weight: 600; color: var(--ink-soft); border-bottom: 2px solid var(--slate); }
.compare tbody th { font-stretch: var(--wide); font-weight: 800; font-size: 1.1rem; }
.compare .num { font-stretch: var(--wide); font-weight: 800; font-size: 1.5rem; white-space: nowrap; }
.table-scroll { overflow-x: auto; }
.ct-figure { display: flex; align-items: baseline; gap: 18px; flex-wrap: wrap; margin: 8px 0 32px; }
.ct-figure strong { font-weight: 900; font-stretch: var(--wide); font-size: clamp(4.5rem, 12vw, 10rem); line-height: .85; letter-spacing: -0.04em; color: var(--yellow); }
.ct-figure span { font-size: 1.2rem; font-weight: 600; max-width: 16ch; line-height: 1.3; }
.checks { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 14px; }
.checks li { padding-left: 34px; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: .35em; width: 18px; height: 10px; border-left: 3px solid var(--yellow); border-bottom: 3px solid var(--yellow); transform: rotate(-45deg); }
.steps { list-style: none; padding: 0; margin: 48px 0 0; counter-reset: s; display: grid; gap: 0; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 90px 1fr; gap: 24px; padding: 28px 0; border-top: 2px solid var(--slate); }
.steps li::before { content: counter(s); font-weight: 900; font-stretch: var(--wide); font-size: 3.2rem; line-height: .9; color: var(--blue); }
.steps h3 { font-size: 1.35rem; margin-bottom: 8px; }
.steps p { margin: 0; max-width: 60ch; }
@media (min-width: 960px) { .steps { grid-template-columns: 1fr 1fr; column-gap: 64px; } }

/* Anti-spam field: invisible to people, bots fill it in */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__status.is-error { color: var(--yellow); }
.form button[disabled] { opacity: .6; cursor: progress; }
