:root {
  --w: 1633;
  --h: 768;
  --black: #0b0b0b;
  --white: #ffffff;
  --muted: rgba(255, 255, 255, 0.75);
  --muted-dark: rgba(0, 0, 0, 0.75);
  --pad: 72px;
  --gap: 44px;
  --radius: 0px;
  --shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  font-family: var(--font);
  background: #111;
  color: #fff;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* --- VIEWPORT & DECK --- */
.viewport {
  height: 100vh;
  width: 100vw;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  background: #000;
}

.deck {
  width: calc(var(--w) * 1px);
  height: calc(var(--h) * 1px);
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
}

.deck::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.slide {
  width: 100%;
  height: 100%;
  min-height: calc(var(--h) * 1px);
  position: relative;
  scroll-snap-align: start;
  overflow: hidden;
}

.dark {
  background: var(--black);
  color: #fff;
}

.light {
  background: var(--white);
  color: #000;
}

/* --- HERO --- */
.slide-hero {
  background: #000;
}

.slide-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--bg);
  background-size: cover;
  background-position: center;
  filter: grayscale(100%) contrast(105%);
  opacity: 0.95;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    1200px 520px at 70% 40%,
    rgba(0, 0, 0, 0.25),
    rgba(0, 0, 0, 0.75)
  );
}

.hero-center {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 0 32px;
  z-index: 2;
}

.hero-logo {
  width: 100%;
  display: flex;
  justify-content: center;
}

.svg-logo {
  display: block;
  width: min(520px, 78vw);
  height: auto;
  max-width: 100%;
}

.svg-title {
  display: block;
  width: min(620px, 84vw);
  height: auto;
  max-width: 100%;
}

.hero-motto {
  margin: 0;
  font-size: 26px;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.65);
}

/* --- SPLIT SECTIONS (Chi Siamo) --- */
.split {
  height: 100%;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: var(--gap);
  padding: var(--pad);
}

.split-media img {
  width: 100%;
  height: 520px;
  object-fit: cover;
  filter: grayscale(100%) contrast(105%);
}

.split-content h2 {
  margin: 0 0 18px 0;
  font-size: 64px;
  font-weight: 800;
  line-height: 1.05;
}

.split-content p {
  margin: 0 0 16px 0;
  font-size: 20px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
}

/* --- SERVIZI --- */
.services {
  padding: var(--pad);
  height: 100%;
}

.services h2 {
  margin: 0 0 22px 0;
  font-size: 72px;
  font-weight: 800;
}

.services-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--gap);
  align-items: start;
}

.services-media img {
  width: 100%;
  height: 520px;
  object-fit: cover;
}

.services-list .svc {
  margin-bottom: 30px;
}

.services-list h3 {
  margin: 0 0 6px 0;
  font-size: 44px;
  font-weight: 800;
  line-height: 1.06;
}

.services-list p {
  font-size: 20px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
}

/* --- LAVORI --- */
.works {
  padding: 56px var(--pad);
  height: 100%;
}

.works h2 {
  margin: 0;
  font-size: 72px;
  font-weight: 900;
}

.subtitle {
  margin: 10px 0 26px 0;
  font-size: 20px;
  color: rgba(0, 0, 0, 0.7);
}

.cards-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  margin: 0;
  position: relative;
  overflow: hidden;
  background: #000;
}

.card img {
  width: 100%;
  height: 430px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover img {
  transform: scale(1.06);
}

.card figcaption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: #0b0b0b;
  color: #fff;
  padding: 16px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

/* Slider lavori */
.swiper-lavori {
  width: 100%;
  overflow: hidden;
}

.swiper-lavori .swiper-wrapper {
  align-items: stretch;
}

.swiper-lavori .swiper-slide {
  height: auto;
  display: flex;
}

.swiper-lavori .card {
  width: 100%;
}

/* --- CONTATTI --- */
.slide-contacts {
  height: auto;
  min-height: calc(var(--h) * 1px);
  overflow: visible;
}

.contacts {
  padding: var(--pad);
  height: auto;
}

.contacts h2 {
  margin: 0 0 22px 0;
  font-size: 72px;
  font-weight: 900;
}

.contacts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 35px;
  align-items: start;
}

.map iframe {
  width: 100%;
  height: 500px;
  border: 0;
}

.contacts-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  align-items: start;
}

.contacts-right-col {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.contacts-data {
  flex: 1;
}

.clabel {
  font-size: 34px;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}

.cvalue {
  font-size: 22px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 28px;
}

.contacts-social {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-left: -150px;
}

.social-title {
  font-size: 38px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  opacity: 0.75;
  line-height: 1.1;
  margin-bottom: 20px;
}

.social-icon {
  width: 72px;
  height: 72px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: 0.9;
  transition: opacity 0.2s ease, transform 0.2s ease;
  margin-left: 0;
}

.social-icon:hover {
  transform: scale(1.1);
}

.social-icon.ig {
  background-image: url("../img/instagram.png");
}

.social-icon.fb {
  background-image: url("../img/facebook.png");
}

/* --- LOGHI FINALI / FUNDING --- */

.contacts-funding{
  width: 100%;
  margin-top: 14px;
  padding: 2.5px 3px 2.5px 3px;
  background: #fff;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
}

.funding-item{
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 18px;
}

.funding-item img{
  height: 60px;
}

.logo-coesione img{ height: 50px; }
.logo-ue img{ height: 50px; }
.logo-ri img{ height: 50px; }
.logo-puglia img{
  height: 50px;
  position: relative;
  top: -2px;
}

.funding-item + .funding-item::before{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 42px;
  background: rgba(0,0,0,.12);
}
}

/* barretta verticale */
.funding-item + .funding-item{
  padding-left: 28px;
}

.funding-item + .funding-item::before{
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2px;
  height: 42px;
  background: rgba(0,0,0,.14);
}

/* --- BANNER / LOGHI --- */
.slide-banner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.banner-container {
  text-align: center;
  padding: 40px;
}

.banner-container img {
  max-width: 90%;
  height: auto;
  margin: 20px auto;
}

.banner-container h3 {
  color: #666;
  text-transform: uppercase;
  font-size: 1.1rem;
}

/* --- BOTTONI --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 26px;
  padding: 14px 24px;
  font-size: 18px;
  font-weight: 700;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.18);
  transition: transform 0.18s ease;
}

.btn:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.28);
}

.mezzi {
  padding: 56px var(--pad);
  height: 100%;
  color: #000;
}

.mezzi .subtitle {
  color: rgba(0, 0, 0, 0.75);
  font-size: 18px;
  line-height: 1.5;
  margin-bottom: 22px;
}

.mezzi-footer {
  margin: 22px 0 18px 0;
  color: rgba(0, 0, 0, 0.75);
  font-size: 18px;
  line-height: 1.5;
}

.btn-dark {
  border-color: rgba(0, 0, 0, 0.35);
  color: #000;
  background: rgba(0, 0, 0, 0.06);
}

.btn-dark:hover {
  background: rgba(0, 0, 0, 0.1);
}

.mezzi .split-content h2 {
  margin: 0 0 24px 0;
  font-size: 72px;
  font-weight: 900;
  line-height: 1.05;
  color: #000;
}

/* =========================================
    TABLET + MOBILE
   ========================================= */

@media (max-width: 1024px) {
  :root {
    --pad: 32px;
    --gap: 24px;
  }

  .viewport {
    height: auto;
    min-height: 100vh;
    display: block;
    overflow: visible;
  }

  .deck {
    width: 100vw;
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  .slide {
    height: auto;
    min-height: auto;
    overflow: visible;
  }

  .split,
  .services-grid,
  .contacts-grid,
  .contacts-split {
    grid-template-columns: 1fr;
  }

  .split,
  .services,
  .works,
  .contacts,
  .mezzi {
    height: auto;
  }

  .split-media img,
  .services-media img {
    height: 360px;
  }

  .split-content h2,
  .services h2,
  .works h2,
  .contacts h2,
  .mezzi .split-content h2 {
    font-size: 48px;
    line-height: 1.08;
  }

  .split-content p,
  .services-list p,
  .subtitle,
  .mezzi .subtitle,
  .mezzi-footer,
  .cvalue {
    font-size: 18px;
    line-height: 1.5;
  }

  .services-list h3 {
    font-size: 32px;
    line-height: 1.1;
  }

  .card img {
    height: 320px;
  }

  .card figcaption {
    font-size: 20px;
  }

  .map iframe {
    height: 360px;
  }

.contacts-social {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  margin-left: 50px;
  margin-top: 10px;
  flex-wrap: nowrap;
}

  .social-title {
    display: block;
    width: auto;
    font-size: 22px;
    line-height: 1;
    margin: 0 10px 0 0;
    text-align: left;
    white-space: nowrap;
  }

  .social-icon {
    width: 56px;
    height: 56px;
  }

  .contacts-funding {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .funding-item {
    min-height: 50px;
    padding: 4px 8px;
  }

  .funding-item img,
  .logo-coesione img,
  .logo-ue img,
  .logo-ri img,
  .logo-puglia img {
    height: 34px;
    max-width: 100%;
  }

  .funding-item + .funding-item::before {
    display: none;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --pad: 22px;
    --gap: 18px;
  }

  .hero-center {
  bottom: 8px;
  padding: 0 16px;
  gap: 4px;
}

  .svg-logo {
  width: min(220px, 62vw);
  height: auto;
  max-width: 100%;
}

.svg-title {
  width: min(240px, 70vw);
  height: auto;
  max-width: 100%;
}

 .slide-hero {
  height: 55svh;
  min-height: 360px;
  overflow: hidden;
}

.hero-center {
  top: 50%;
  bottom: auto;
  transform: translateY(-50%);
  padding: 0 16px;
  gap: 6px;
}

  .hero-motto {
    font-size: 15px;
    line-height: 1.25;
  }

  .split {
    padding: var(--pad);
  }

  .split-media img,
  .services-media img {
    height: 240px;
  }

  .split-content h2,
  .services h2,
  .works h2,
  .contacts h2,
  .mezzi .split-content h2 {
    font-size: 34px;
    line-height: 1.05;
    margin-bottom: 14px;
  }

  .split-content p,
  .services-list p,
  .subtitle,
  .mezzi .subtitle,
  .mezzi-footer,
  .cvalue {
    font-size: 16px;
    line-height: 1.45;
  }

  .services-list .svc {
    margin-bottom: 24px;
  }

  .services-list h3 {
    font-size: 24px;
    line-height: 1.08;
    margin-bottom: 8px;
  }

  .works {
    padding: 36px var(--pad);
  }

  .cards-3 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card img {
    height: 220px;
  }

  .card figcaption {
    font-size: 17px;
    padding: 12px;
  }

  .clabel {
    font-size: 22px;
    margin-bottom: 4px;
  }

  .cvalue {
    margin-bottom: 18px;
  }

  .contacts-social {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    margin-left: 0;
    margin-top: 10px;
    flex-wrap: nowrap;
  }

  .social-title {
    display: block;
    width: auto;
    font-size: 18px;
    line-height: 1;
    margin: 0 8px 0 0;
    text-align: left;
    white-space: nowrap;
  }

  .social-icon {
    width: 46px;
    height: 46px;
  }

  .map iframe {
    height: 260px;
  }

  .contacts-funding {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px 8px;
    padding: 8px 10px;
    margin-top: 10px;
  }

  .funding-item {
    min-height: 42px;
    padding: 2px 4px;
  }

  .funding-item img,
  .logo-coesione img,
  .logo-ue img,
  .logo-ri img,
  .logo-puglia img {
    height: 30px;
    width: auto;
    max-width: 100%;
  }

  .funding-item + .funding-item::before {
    display: none;
  }

  .btn {
    width: 100%;
    justify-content: center;
    font-size: 15px;
    padding: 12px 16px;
  }
}

/* iPad landscape */
@media (min-width: 1024px) and (max-width: 1366px) {
  .contacts-social {
    margin-left: -120px;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .slide-hero {
    height: 100svh;
    min-height: 320px;
  }

  .svg-logo {
    width: min(180px, 34vw);
  }

  .svg-title {
    width: min(220px, 42vw);
  }

  .hero-motto {
    font-size: 13px;
  }
}

/* FIX iPad / tablet portrait */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
  .slide-hero {
    height: 55svh;
    min-height: 520px;
    overflow: hidden;
  }

  .hero-center {
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    padding: 0 32px;
    gap: 10px;
  }

  .svg-logo {
    width: min(360px, 52vw);
  }

  .svg-title {
    width: min(440px, 62vw);
  }

  .hero-motto {
    font-size: 20px;
    line-height: 1.25;
  }
}

/* FIX DEFINITIVO HERO SU iPad / tablet / split view Safari */
@media (max-width: 1024px) {
  .slide-hero {
    height: 60svh !important;
    min-height: 520px !important;
    position: relative !important;
    overflow: hidden !important;
  }

  .slide-hero::before,
  .hero-overlay {
    position: absolute;
    inset: 0;
  }

  .hero-center {
    position: absolute !important;
    top: 50% !important;
    bottom: auto !important;
    left: 0;
    right: 0;
    transform: translateY(-50%) !important;
    z-index: 2;
  }

  .svg-logo {
    width: min(360px, 52vw) !important;
  }

  .svg-title {
    width: min(440px, 62vw) !important;
  }
}