/* EW Engineering Works — foglio di stile */
:root {
  --paper: #f7f4ef;
  --paper-2: #efe9e0;
  --white: #ffffff;
  --ink: #26292a;
  --ink-2: #4a4f4c;
  --muted: #6f736f;
  --line: #ddd6cb;
  --brand: #d2733a;
  --brand-dark: #b35d27;
  --wood: #c99a62;
  --dark: #1e2122;
  --radius: 4px;
  --wrap: 1180px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.65 var(--font);
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 .5em; font-weight: 600; letter-spacing: -.015em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -.03em; }
h2 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); letter-spacing: -.025em; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--white); padding: 8px 12px; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--brand-dark); margin-bottom: 18px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--brand); }
.lead { font-size: 1.2rem; color: var(--ink-2); max-width: 46em; }

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 24px;
  background: var(--brand); color: var(--white); text-decoration: none;
  font-weight: 600; font-size: .95rem; border-radius: var(--radius); border: 2px solid var(--brand);
  transition: background .2s, border-color .2s, color .2s; cursor: pointer; font-family: inherit;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.6); }
.btn--ghost:hover { background: var(--white); color: var(--ink); border-color: var(--white); }
.btn--line { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }
.arrow::after { content: "→"; display: inline-block; margin-left: 10px; transition: transform .2s; }
.btn:hover .arrow::after, a:hover > .arrow::after { transform: translateX(3px); }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50; background: rgba(247,244,239,.94);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 24px; }
.logo img { height: 40px; width: auto; }
.nav { display: flex; align-items: center; gap: 30px; }
.nav a { text-decoration: none; font-weight: 500; font-size: .96rem; color: var(--ink-2); position: relative; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--brand); }
.nav .btn { padding: 10px 18px; color: var(--white); }
.nav .btn::after { display: none; }
.lang { display: flex; gap: 2px; font-size: .82rem; font-weight: 600; }
.lang a, .lang span { padding: 4px 7px; text-decoration: none; border-radius: 3px; color: var(--muted); }
.lang span { background: var(--ink); color: var(--white); }
.menu-btn { display: none; background: none; border: 0; padding: 10px; cursor: pointer; }
.menu-btn span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; transition: transform .25s, opacity .25s; }

/* Hero */
.hero { position: relative; color: var(--white); background: var(--dark); overflow: hidden; }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(20,22,23,.92) 0%, rgba(20,22,23,.55) 55%, rgba(20,22,23,.15) 100%); }
.hero__img--brand { opacity: 1; object-position: 70% center; }
.hero:has(.hero__img--brand)::after { background: linear-gradient(100deg, rgba(20,24,30,.85) 0%, rgba(20,24,30,.45) 45%, rgba(20,24,30,0) 70%); }
.hero .wrap { position: relative; z-index: 1; padding-top: 140px; padding-bottom: 120px; }
.hero h1 { max-width: 13em; }
.hero .lead { color: rgba(255,255,255,.82); margin-bottom: 36px; max-width: 36em; }
.hero .eyebrow { color: #f0a77a; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 14px; }
.page-hero { background: var(--dark); color: var(--white); position: relative; overflow: hidden; }
.page-hero .wrap { position: relative; z-index: 1; padding-top: 96px; padding-bottom: 72px; }
.page-hero .lead { color: rgba(255,255,255,.8); }
.page-hero .eyebrow { color: #f0a77a; }
.page-hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .28; }

/* Cifre */
.facts { background: var(--white); border-bottom: 1px solid var(--line); }
.facts .wrap { display: grid; grid-template-columns: repeat(4, 1fr); }
.fact { padding: 34px 24px 34px 0; border-right: 1px solid var(--line); }
.fact + .fact { padding-left: 28px; }
.fact:last-child { border-right: 0; }
.fact strong { display: block; font-size: 2rem; font-weight: 600; letter-spacing: -.03em; color: var(--ink); line-height: 1.1; }
.fact span { color: var(--muted); font-size: .92rem; }

/* Sezioni */
.section { padding: 110px 0; }
.section--white { background: var(--white); }
.section--dark { background: var(--dark); color: var(--white); }
.section--dark .lead, .section--dark p { color: rgba(255,255,255,.78); }
.section__head { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 56px; }
.section__head h2 { max-width: 16em; margin: 0; }
.section__head p { max-width: 30em; margin: 0; color: var(--ink-2); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.split__img { position: relative; }
.split__img img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.split__img::before { content: ""; position: absolute; left: -18px; bottom: -18px; width: 45%; height: 45%; border-left: 3px solid var(--brand); border-bottom: 3px solid var(--brand); }

/* Servizi */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.service { background: var(--white); padding: 38px 34px; transition: background .2s; }
.service:hover { background: var(--paper); }
.service:last-child:nth-child(3n+1) { grid-column: 1 / -1; }
.service__num { font-size: .8rem; font-weight: 600; letter-spacing: .12em; color: var(--brand-dark); margin-bottom: 22px; display: block; }
.service h3 { margin-bottom: 10px; }
.service p { color: var(--muted); font-size: .96rem; margin: 0; }
.service ul { list-style: none; padding: 0; margin: 14px 0 0; font-size: .95rem; color: var(--ink-2); }
.service li { padding: 7px 0; border-top: 1px solid var(--paper-2); }

/* Referenze */
.projects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.project { background: var(--white); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); }
.project__img { aspect-ratio: 3/2; overflow: hidden; background: var(--paper-2); }
.project__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.project:hover .project__img img { transform: scale(1.04); }
.project__body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.project__meta { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.project__meta .flag { color: var(--brand-dark); }
.project h3 { font-size: 1.08rem; margin: 0; }
.project p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.project__foot { margin-top: auto; padding-top: 12px; font-size: .85rem; color: var(--muted); border-top: 1px solid var(--paper-2); }
.project__ph {
  width: 100%; height: 100%; display: flex; align-items: flex-end; padding: 20px 24px;
  background: linear-gradient(135deg, rgba(210,115,58,.9), rgba(30,33,34,.95));
  color: var(--white); font-size: 1.3rem; font-weight: 600; letter-spacing: -.01em;
}
.country-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin-top: -36px; position: relative; z-index: 2; }
.country-tabs a {
  display: flex; align-items: center; gap: 14px; padding: 22px 26px; background: var(--white);
  text-decoration: none; font-weight: 600; border: 1px solid var(--line); border-bottom: 3px solid var(--brand);
  transition: background .2s;
}
.country-tabs a:hover { background: var(--paper); }
.country-tabs .flag { background: var(--ink); color: var(--white); font-size: .78rem; padding: 4px 8px; border-radius: 3px; letter-spacing: .08em; }
.downloads { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; }
.filters button { font: inherit; font-size: .9rem; font-weight: 500; padding: 9px 18px; border: 1px solid var(--line); background: var(--white); border-radius: 30px; cursor: pointer; color: var(--ink-2); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* Partner */
.partners-band { background: var(--paper-2); }
.partners { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.partner {
  background: var(--white); border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  padding: 18px 16px; height: 104px; box-shadow: 0 1px 2px rgba(30,33,34,.06);
}
.partner img { max-height: 56px; max-width: 100%; width: auto; object-fit: contain; }

/* Team */
.team { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.person { background: var(--white); border: 1px solid var(--line); padding: 38px; border-radius: var(--radius); }
.person h3 { font-size: 1.45rem; margin-bottom: 4px; }
.person__role { color: var(--brand-dark); font-weight: 600; font-size: .9rem; margin-bottom: 20px; display: block; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { padding: 9px 0 9px 28px; position: relative; border-top: 1px solid var(--paper-2); font-size: .96rem; color: var(--ink-2); }
.checks li::before { content: ""; position: absolute; left: 2px; top: 17px; width: 12px; height: 7px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }

.staff__group { font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 16px; }
.staff__group:not(:first-of-type) { margin-top: 44px; }
.staff { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.member { display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.member__avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--white); font-weight: 600; font-size: .9rem; letter-spacing: .04em;
}
.member strong { display: block; font-weight: 600; line-height: 1.3; }
.member span:not(.member__avatar) { font-size: .85rem; color: var(--muted); }

/* Valori */
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; }
.value h3 { color: var(--white); }
.value__n { font-size: 2.6rem; font-weight: 300; color: var(--brand); line-height: 1; margin-bottom: 18px; display: block; }

/* Contatti */
.offices { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.office { background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--brand); padding: 36px; border-radius: var(--radius); }
.office h3 { font-size: 1.35rem; }
.office__tag { font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 12px; }
.office dl { margin: 18px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; font-size: .97rem; }
.office dt { color: var(--muted); }
.office dd { margin: 0; }
.office a { text-decoration: none; border-bottom: 1px solid var(--line); }
.office a:hover { border-color: var(--brand); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form .full { grid-column: 1 / -1; }
.form label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.form input, .form select, .form textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 13px 14px; border: 1px solid var(--line);
  background: var(--white); border-radius: var(--radius); color: var(--ink);
}
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
.form textarea { min-height: 150px; resize: vertical; }
.form .consent { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--ink-2); font-weight: 400; }
.form .consent input { width: auto; margin-top: 5px; }
.hp { position: absolute; left: -5000px; }
.notice { padding: 16px 20px; border-radius: var(--radius); margin-bottom: 24px; font-weight: 500; display: none; }
.notice--ok { background: #e6f2e8; color: #23592f; }
.notice--err { background: #f8e5e1; color: #8a2b19; }
.notice.show { display: block; }

/* CTA */
.cta {
  position: relative; color: var(--ink);
  background: #fbf3e8 url("../img/casco-chiaro.jpg") no-repeat right center / cover;
}
.cta::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(251,243,232,.95) 0%, rgba(251,243,232,.75) 45%, rgba(251,243,232,0) 75%); }
.cta .wrap { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 28px; padding-top: 110px; padding-bottom: 110px; }
.cta h2 { margin: 0; max-width: 14em; }
.brochure-band { background: var(--paper-2); }

/* Footer */
.footer { background: var(--dark); color: rgba(255,255,255,.7); font-size: .93rem; }
.footer .wrap { padding-top: 70px; padding-bottom: 30px; }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 50px; border-bottom: 1px solid rgba(255,255,255,.12); }
.footer h4 { color: var(--white); font-size: .82rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 16px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--white); }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 3px 0; }
.footer__logo { display: inline-block; margin-bottom: 20px; }
.footer__logo img { height: 36px; width: auto; }
.footer__bottom { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding-top: 24px; font-size: .84rem; }

.prose { max-width: 760px; }
.prose h2 { font-size: 1.45rem; margin-top: 2em; }

/* Responsive */
@media (max-width: 1020px) {
  .services, .projects { grid-template-columns: repeat(2, 1fr); }
  .service:last-child:nth-child(3n+1) { grid-column: auto; }
  .staff { grid-template-columns: repeat(2, 1fr); }
  .partners { grid-template-columns: repeat(4, 1fr); }
  .split { gap: 50px; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .values { gap: 36px; }
}
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav {
    position: fixed; top: 78px; left: 0; right: 0; bottom: 0; background: var(--paper);
    flex-direction: column; align-items: flex-start; gap: 0; padding: 20px 24px;
    opacity: 0; visibility: hidden; transform: translateY(-10px);
    transition: opacity .25s, transform .25s, visibility .25s; overflow-y: auto;
  }
  .nav.open { opacity: 1; visibility: visible; transform: none; }
  .nav a { font-size: 1.3rem; padding: 14px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .nav a[aria-current="page"]::after { display: none; }
  .nav .btn { margin-top: 24px; width: auto; border-bottom: 0; font-size: 1rem; padding: 14px 22px; }
  .nav .lang { margin-top: 20px; }
  .nav .lang a, .nav .lang span { font-size: 1rem; width: auto; border: 0; padding: 6px 12px; }
  .menu-open .menu-btn span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .menu-open .menu-btn span:nth-child(2) { opacity: 0; }
  .menu-open .menu-btn span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .split, .team, .offices, .values { grid-template-columns: 1fr; }
  .split__img { order: -1; }
  .facts .wrap { grid-template-columns: 1fr 1fr; }
  .fact { padding: 24px 16px 24px 0 !important; border-right: 0; border-bottom: 1px solid var(--line); }
  .fact:nth-child(even) { padding-left: 16px !important; border-left: 1px solid var(--line); }
  .section__head { flex-direction: column; align-items: start; gap: 18px; }
  .cta .wrap { flex-direction: column; align-items: start; padding-top: 80px; padding-bottom: 80px; }
  .cta::before { background: rgba(251,243,232,.82); }
  .hero:has(.hero__img--brand)::after { background: rgba(20,24,30,.62); }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .section { padding: 72px 0; }
  .services, .projects, .form, .country-tabs, .staff { grid-template-columns: 1fr; }
  .country-tabs { margin-top: 0; padding-top: 24px; }
  .partners { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .partner { height: 76px; padding: 10px; }
  .partner img { max-height: 40px; }
  .hero .wrap { padding-top: 90px; padding-bottom: 80px; }
  .footer__grid { grid-template-columns: 1fr; }
  .fact strong { font-size: 1.6rem; }
  .service, .person, .office { padding: 28px 22px; }
  .split__img::before { left: -10px; bottom: -10px; }
  .office dl { grid-template-columns: 1fr; gap: 2px; }
  .office dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
