:root{
  --brand:#0a66c2;
  --brand-2:#1c7ed6;
  --brand-dark:#002473;
  --ink:#0f2747;
  --text:#334155;
  --muted:#64748b;
  --line:rgba(10,102,194,.14);
  --line-strong:rgba(10,102,194,.24);
  --surface:rgba(255,255,255,.78);
  --surface-strong:rgba(255,255,255,.92);
  --surface-soft:rgba(238,246,255,.78);
  --shadow:0 18px 60px rgba(0,36,115,.12);
  --shadow-hover:0 26px 70px rgba(0,36,115,.18);
  --radius-xl:28px;
  --radius-lg:22px;
  --radius-md:16px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
html,body{margin:0;padding:0}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  color:var(--text);
  line-height:1.65;
  background:
    radial-gradient(circle at top left, rgba(28,126,214,.14), transparent 30%),
    radial-gradient(circle at top right, rgba(0,36,115,.10), transparent 24%),
    linear-gradient(180deg, #eef6ff 0%, #f8fbff 38%, #edf5ff 100%);
  min-height:100vh;
  position:relative;
}
body::before,
body::after{
  content:"";
  position:fixed;
  z-index:-2;
  border-radius:999px;
  filter:blur(18px);
  opacity:.75;
}
body::before{
  width:340px;height:340px;left:-90px;top:70px;
  background:rgba(28,126,214,.15);
}
body::after{
  width:420px;height:420px;right:-120px;top:120px;
  background:rgba(0,36,115,.10);
}

a{color:inherit}
img{max-width:100%}

header{
  position:sticky;
  top:0;
  z-index:50;
  width:min(1280px, calc(100% - 24px));
  margin:16px auto 0;
  padding:14px 20px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  background:rgba(255,255,255,.78);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  border:1px solid rgba(255,255,255,.65);
  box-shadow:0 10px 30px rgba(15,39,71,.08);
  border-radius:24px;
}

.logo img{
  display:block;
  height:64px;
  width:auto;
}

.menu-toggle{
  display:none;
  width:52px;
  height:52px;
  padding:0;
  border-radius:16px;
  border:1px solid rgba(10,102,194,.16);
  background:rgba(255,255,255,.9);
  box-shadow:0 10px 24px rgba(15,39,71,.10);
}
.menu-toggle span{
  display:block;
  width:22px;
  height:2px;
  margin:4px auto;
  background:var(--brand-dark);
  border-radius:999px;
  transition:transform .25s ease, opacity .25s ease;
}
header.menu-open .menu-toggle span:nth-child(1){transform:translateY(6px) rotate(45deg)}
header.menu-open .menu-toggle span:nth-child(2){opacity:0}
header.menu-open .menu-toggle span:nth-child(3){transform:translateY(-6px) rotate(-45deg)}

nav{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
nav a{
  text-decoration:none;
  font-weight:700;
  color:var(--ink);
  padding:11px 16px;
  border-radius:999px;
  transition:transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
}
nav a:hover{
  background:rgba(10,102,194,.08);
  color:var(--brand-dark);
  transform:translateY(-1px);
}
nav a.active{
  color:var(--brand);
  background:linear-gradient(180deg, rgba(188,223,255,.85), rgba(226,241,255,.95));
  box-shadow:inset 0 0 0 1px rgba(10,102,194,.18), 0 6px 18px rgba(10,102,194,.10);
}

main, .content, .portfolio, .services, .contact, .intro, .intro2, .grid, .map{
  width:min(1200px, calc(100% - 24px));
  margin:0 auto;
  padding:34px 28px;
}
section{
  background:var(--surface);
  border:1px solid rgba(255,255,255,.72);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow);
  margin:26px auto;
  position:relative;
  overflow:hidden;
}
section::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:1px;
  background:linear-gradient(90deg, transparent, rgba(255,255,255,.95), transparent);
}

.hero,
.hero.small{
  width:min(1280px, calc(100% - 24px));
  margin:18px auto 24px;
  padding:88px 30px 74px;
  border-radius:36px;
  text-align:center;
  border:1px solid rgba(255,255,255,.55);
  background:
    linear-gradient(135deg, rgba(0,36,115,.82), rgba(10,102,194,.68) 44%, rgba(197,228,255,.92) 100%),
    url('../images/sfondo.png') center/cover no-repeat;
  color:#fff;
  box-shadow:0 28px 80px rgba(0,36,115,.22);
}
.hero::after{
  content:"";
  position:absolute;
  inset:auto -10% -28% auto;
  width:320px;
  height:320px;
  border-radius:50%;
  background:radial-gradient(circle, rgba(255,255,255,.32), rgba(255,255,255,0) 66%);
}
.hero.small{
  padding:70px 26px 56px;
}
.hero-text{
  max-width:980px;
  margin:0 auto;
  color:#fff;
  position:relative;
  z-index:1;
}
.hero-big h1,
.hero-text h1{
  margin:0;
  font-size:clamp(34px, 6vw, 68px);
  line-height:1.06;
  letter-spacing:-.03em;
  text-transform:uppercase;
  font-weight:300;
  color:#fff;
  text-wrap:balance;
}
.hero-big h1 strong,
.hero-text h1 strong{
  font-weight:800;
  color:#ffffff;
}
.hero-sub,
.hero-text p{
  max-width:760px;
  margin:18px auto 0;
  font-size:clamp(17px, 2vw, 21px);
  color:rgba(255,255,255,.88);
}
.anim-line{
  display:inline-block;
  opacity:0;
  transform:translateY(18px);
  animation:fadeLift .8s ease forwards;
}

@keyframes fadeLift{
  to{opacity:1;transform:translateY(0)}
}

.btn,
button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  background:linear-gradient(135deg, var(--brand-dark), var(--brand));
  color:#fff;
  padding:12px 20px;
  border:none;
  border-radius:999px;
  text-decoration:none;
  font-weight:700;
  transition:transform .25s ease, box-shadow .25s ease, filter .25s ease;
  box-shadow:0 12px 28px rgba(0,36,115,.20);
  cursor:pointer;
}
.btn:hover,
button:hover{
  transform:translateY(-2px);
  box-shadow:0 18px 32px rgba(0,36,115,.22);
  filter:saturate(1.05);
}
button[disabled]{opacity:.5;cursor:not-allowed;box-shadow:none}

.intro,
.intro2,
.content,
.map{
  background:var(--surface-strong);
}
.intro h2,
.intro2 h2,
.content h2,
.map h2{
  margin:0 0 12px;
}
.intro p,
.intro2 p,
.content p{
  max-width:920px;
  color:var(--text);
}
.intro2{text-align:center}

.grid,
.portfolio,
.services{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:24px;
  background:transparent;
  box-shadow:none;
  border:none;
  padding-left:0;
  padding-right:0;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.grid::before,
.portfolio::before,
.services::before{display:none}

.grid-item,
.project,
.service,
.team-member,
.partner-box,
.contact-info,
.contact-form{
  position:relative;
  background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(245,250,255,.92));
  border:1px solid rgba(255,255,255,.85);
  border-radius:24px;
  box-shadow:var(--shadow);
  overflow:hidden;
  transition:transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.grid-item::after,
.project::after,
.service::after,
.team-member::after,
.partner-box::after,
.contact-info::after,
.contact-form::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(135deg, rgba(255,255,255,.28), transparent 45%, rgba(10,102,194,.03));
  pointer-events:none;
}
.grid-item:hover,
.project:hover,
.service:hover,
.team-member:hover,
.partner-box:hover,
.contact-info:hover,
.contact-form:hover{
  transform:translateY(-8px);
  box-shadow:var(--shadow-hover);
  border-color:rgba(10,102,194,.18);
}

.grid-item img,
.service img,
.project img,
.fullwidth{
  width:100%;
  display:block;
  object-fit:cover;
}
.grid-item img,
.service img{height:232px}
.project img{height:240px}
.fullwidth{
  height:380px;
  margin:18px 0 8px;
  border-radius:22px;
}
.grid-item h3,
.project h3,
.service h3{
  margin:18px 20px 8px;
}
.grid-item p,
.project p,
.service p{
  margin:0 20px 20px;
  color:var(--muted);
}

.project{
  background:
    linear-gradient(180deg, rgba(255,255,255,.94), rgba(240,247,255,.90)),
    url('../images/sfondo_blocchi_lavori.png') center/cover no-repeat;
  cursor:pointer;
}
.project h3{
  color:var(--brand-dark);
  padding-right:12px;
}
.project ul{
  margin:0 20px 20px 36px;
  padding:0 0 0 2px;
  color:var(--text);
}
.project li{margin-bottom:7px}

.team-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(250px,1fr));
  gap:24px;
  margin-top:28px;
}
.team-member{
  padding:24px;
  text-align:center;
}
.team-member img{
  width:168px;
  height:168px;
  object-fit:cover;
  border-radius:50%;
  margin-bottom:14px;
  border:4px solid rgba(255,255,255,.92);
  box-shadow:0 16px 34px rgba(10,102,194,.18);
}
.team-member h3{margin:8px 0 6px}
.team-member p{margin:0;color:var(--text)}

.partners-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:20px;
  margin-top:24px;
}
.partner-box{
  padding:22px 18px;
  text-align:center;
  font-weight:700;
  font-size:18px;
  color:var(--brand-dark);
}

.values{
  columns:2;
  gap:32px;
  padding-left:20px;
}
.values li{margin-bottom:10px}

.contact{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:24px;
  background:transparent;
  box-shadow:none;
  border:none;
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
}
.contact::before{display:none}
.contact-info,
.contact-form{
  padding:26px;
}
.contact-form{
  display:flex;
  flex-direction:column;
  gap:14px;
}
.contact-form input,
.contact-form textarea{
  width:100%;
  padding:14px 16px;
  border:1px solid rgba(10,102,194,.12);
  border-radius:16px;
  font-size:16px;
  background:rgba(255,255,255,.92);
  color:var(--ink);
  outline:none;
  transition:border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}
.contact-form input:focus,
.contact-form textarea:focus{
  border-color:rgba(10,102,194,.38);
  box-shadow:0 0 0 5px rgba(10,102,194,.10);
  transform:translateY(-1px);
}
.privacy-check{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:14px;
  margin:6px 0 8px;
  color:var(--brand-dark);
}
.privacy-check input[type="checkbox"]{
  width:18px;
  height:18px;
}

.map-container{
  overflow:hidden;
  border-radius:22px;
  box-shadow:var(--shadow);
  border:1px solid rgba(255,255,255,.9);
}
.map iframe{display:block}

.gallery{
  position:relative;
  max-width:920px;
  margin:0 auto;
  overflow:hidden;
  border-radius:22px;
  border:1px solid rgba(10,102,194,.10);
  box-shadow:0 14px 34px rgba(0,36,115,.12);
  background:#fff;
}
.gallery-track{
  display:flex;
  transition:transform .4s ease;
}
.gallery-track img{
  width:100%;
  height:auto;
  flex-shrink:0;
  border-radius:0;
}
.gallery button{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:46px;
  height:46px;
  border-radius:50%;
  padding:0;
  border:1px solid rgba(255,255,255,.3);
  background:rgba(0,36,115,.55);
  color:#fff;
  font-size:24px;
  box-shadow:none;
}
.gallery button:hover{
  background:rgba(10,102,194,.82);
  transform:translateY(-50%) scale(1.04);
}
.gallery .prev{left:14px}
.gallery .next{right:14px}

.modal{
  display:none;
  position:fixed;
  z-index:9999;
  inset:0;
  width:100%;
  height:100vh;
  padding:24px 18px;
  overflow-y:auto;
  overscroll-behavior:contain;
  align-items:center;
  justify-content:center;
  background:rgba(4,19,50,.62);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.modal.is-open{display:flex}
.modal-content{
  width:min(860px,100%);
  max-height:min(86vh,980px);
  margin:auto;
  padding:26px 24px;
  overflow-y:auto;
  scrollbar-gutter:stable;
  border-radius:30px;
  border:1px solid rgba(255,255,255,.68);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(242,248,255,.94)),
    url('../images/sfondo_popup.png') center/cover no-repeat;
  box-shadow:0 26px 80px rgba(0,0,0,.22);
}
.close{
  float:right;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border-radius:50%;
  font-size:28px;
  cursor:pointer;
  color:var(--brand-dark);
  background:rgba(10,102,194,.08);
  transition:transform .2s ease, background .2s ease, color .2s ease;
}
.close:hover{
  color:#fff;
  background:var(--brand);
  transform:rotate(90deg);
}
.modal h2{
  margin:8px 0 18px;
  padding-right:56px;
}
.modal-img{
  width:100%;
  border-radius:18px;
  margin-top:16px;
}

.info-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin:22px 0 0;
  font-size:16px;
}
.info-table tr{background:transparent}
.info-table th,
.info-table td{
  padding:14px 8px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid var(--line);
}
.info-table th{
  width:160px;
  font-weight:800;
  color:var(--brand-dark);
}
.info-table td{color:var(--text)}
.info-table tr:last-child th,
.info-table tr:last-child td{border-bottom:none}

.page-background{
  position:fixed;
  inset:0;
  z-index:-3;
  pointer-events:none;
  overflow:hidden;
}
.rect1,.rect2,.rect3{
  position:absolute;
  border-radius:40px;
  background:linear-gradient(135deg, rgba(188,223,255,.38), rgba(255,255,255,.12));
  border:1px solid rgba(255,255,255,.32);
  filter:blur(.2px);
}
.rect1{width:320px;height:320px;left:8%;top:32%}
.rect2{width:220px;height:220px;right:10%;top:28%}
.rect3{width:180px;height:180px;left:50%;bottom:8%}

h1,h2,h3{color:var(--brand-dark);margin-top:0;letter-spacing:-.02em}
h2{font-size:clamp(24px, 3.5vw, 34px)}
h3{font-size:clamp(19px, 2.4vw, 23px)}
p, li{font-size:16px}

footer{
  width:min(1200px, calc(100% - 24px));
  margin:6px auto 26px;
  text-align:center;
  color:rgba(15,39,71,.72);
  padding:14px 20px 30px;
}

@media (max-width:1024px){
  .grid,.portfolio,.services{grid-template-columns:repeat(2,minmax(0,1fr))}
  .hero,.hero.small{padding:72px 24px 58px}
}

@media (max-width:768px){
  header{
    width:calc(100% - 16px);
    margin-top:10px;
    padding:14px 16px;
    border-radius:22px;
    flex-wrap:wrap;
  }
  .menu-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    margin-left:auto;
  }
  nav{
    display:none;
    width:100%;
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    padding-top:14px;
  }
  header.menu-open nav{display:flex}
  nav a{
    padding:12px 14px;
    text-align:center;
  }
  .hero,
  .hero.small,
  main,.content,.portfolio,.services,.contact,.intro,.intro2,.grid,.map,
  footer{
    width:calc(100% - 16px);
  }
  .grid,.portfolio,.services,.contact,.team-grid{grid-template-columns:1fr}
  .values{columns:1}
  section{padding:28px 20px;border-radius:24px}
  .hero,.hero.small{padding:58px 18px 48px;border-radius:28px}
  .hero-big h1,.hero-text h1{font-size:clamp(30px, 9vw, 46px)}
  .fullwidth{height:250px}
  .modal{padding:12px}
  .modal-content{padding:20px 16px;max-height:90vh;border-radius:24px}
  .info-table th,.info-table td{display:block;width:100%;padding-left:0;padding-right:0}
  .info-table th{padding-bottom:4px;border-bottom:none}
  .info-table td{padding-top:0}
  .gallery .prev{left:10px}
  .gallery .next{right:10px}
}

/* Disattiva animazioni e movimenti delle immagini su mobile */
@media (max-width:768px){
  .anim-line{
    opacity:1;
    transform:none;
    animation:none !important;
  }

  .hero img,
  .grid-item img,
  .service img,
  .project img,
  .fullwidth,
  .gallery-track,
  .gallery-track img{
    animation:none !important;
    transition:none !important;
    transform:none !important;
  }

  .grid-item:hover,
  .project:hover,
  .service:hover,
  .team-member:hover,
  .partner-box:hover,
  .contact-info:hover,
  .contact-form:hover,
  .gallery button:hover,
  .btn:hover,
  button:hover,
  nav a:hover{
    transform:none !important;
    box-shadow:var(--shadow) !important;
    filter:none !important;
  }
}
