/* =========================================================
   B GROUP SRL — design tokens
   ========================================================= */
:root{
  --navy-950:#06212F;
  --navy-900:#0B3A5C;
  --navy-800:#103F63;
  --navy-700:#155080;
  --navy-600:#2C6A93;
  --cream:#F6F4EF;
  --white:#FFFFFF;
  --terracotta:#C2693E;
  --terracotta-dark:#A2532F;
  --ink:#16222C;
  --stone:#5E6B77;
  --mist:#E1E6EA;
  --mist-strong:#CBD3D9;

  --font-display:'Space Grotesk', sans-serif;
  --font-body:'Inter', sans-serif;
  --font-mono:'IBM Plex Mono', monospace;

  --container:1200px;
  --gap:24px;
  --radius:4px;
  --shadow-soft:0 12px 32px -8px rgba(6,33,47,0.18);
  --shadow-deep:0 24px 60px -12px rgba(6,33,47,0.35);
}

*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto;}
  *,*::before,*::after{animation-duration:0.001ms !important; transition-duration:0.001ms !important;}
}

body{
  margin:0;
  font-family:var(--font-body);
  color:var(--ink);
  background:var(--white);
  -webkit-font-smoothing:antialiased;
  line-height:1.55;
}

img{max-width:100%; display:block;}
a{color:inherit; text-decoration:none;}
ul{margin:0; padding:0; list-style:none;}
h1,h2,h3{font-family:var(--font-display); margin:0 0 .5em; line-height:1.12; letter-spacing:-0.01em; font-weight:600;}
p{margin:0 0 1em;}
button{font-family:inherit;}

.container{
  width:100%;
  max-width:var(--container);
  margin:0 auto;
  padding:0 28px;
}

.eyebrow{
  font-family:var(--font-mono);
  font-size:0.78rem;
  letter-spacing:0.09em;
  text-transform:uppercase;
  color:var(--terracotta-dark);
  margin:0 0 1em;
  display:block;
}
.eyebrow-light{color:#CBD9E3;}

.section{padding:108px 0;}
.section-alt{background:var(--cream);}
.section-intro{max-width:560px; color:var(--stone); font-size:1.05rem;}

/* buttons */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5em;
  padding:14px 28px;
  border-radius:2px;
  font-weight:600;
  font-size:0.98rem;
  border:1.5px solid transparent;
  cursor:pointer;
  transition:transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}
.btn:active{transform:translateY(1px);}
.btn-accent{background:var(--terracotta); color:var(--white);}
.btn-accent:hover{background:var(--terracotta-dark);}
.btn-ghost-light{border-color:rgba(255,255,255,0.55); color:var(--white);}
.btn-ghost-light:hover{background:rgba(255,255,255,0.12); border-color:#fff;}
.btn-full{width:100%;}

/* =========================================================
   HEADER
   ========================================================= */
.site-header{
  position:fixed; top:0; left:0; right:0; z-index:100;
  background:transparent;
  transition:background .25s ease, box-shadow .25s ease, padding .25s ease;
  padding:18px 0;
}
.site-header.is-scrolled{
  background:rgba(246,244,239,0.96);
  box-shadow:0 2px 18px rgba(6,33,47,0.10);
  padding:10px 0;
}
.header-inner{
  max-width:var(--container);
  margin:0 auto;
  padding:0 28px;
  display:flex;
  align-items:center;
  gap:28px;
}
.brand{display:flex; align-items:center;}
.brand-logo{height:42px; width:auto; transition:height .25s ease;}
.site-header.is-scrolled .brand-logo{height:36px;}
.main-nav{
  display:flex; gap:30px; margin-left:auto;
  font-size:0.95rem; font-weight:500;
}
.main-nav a{
  color:var(--white);
  position:relative;
  padding:4px 0;
}
.site-header.is-scrolled .main-nav a{color:var(--ink);}
.main-nav a::after{
  content:""; position:absolute; left:0; right:100%; bottom:-2px; height:2px;
  background:var(--terracotta); transition:right .2s ease;
}
.main-nav a:hover::after{right:0;}
.btn-header{margin-left:8px; padding:11px 22px; font-size:0.92rem;}
.nav-toggle{
  display:none; flex-direction:column; justify-content:center; gap:5px;
  width:38px; height:38px; border:none; background:none; cursor:pointer; margin-left:auto;
}
.nav-toggle span{display:block; width:24px; height:2px; background:var(--white); transition:background .2s ease;}
.site-header.is-scrolled .nav-toggle span{background:var(--ink);}

@media (max-width:880px){
  .main-nav{
    position:fixed; top:0; right:0; height:100vh; width:min(78vw,320px);
    background:var(--navy-950); flex-direction:column; gap:0;
    padding:100px 32px 32px; transform:translateX(100%);
    transition:transform .3s ease; z-index:90;
  }
  .main-nav.is-open{transform:translateX(0);}
  .main-nav a{color:var(--white) !important; padding:16px 0; border-bottom:1px solid rgba(255,255,255,0.1); font-size:1.1rem;}
  .btn-header{display:none;}
  .nav-toggle{display:flex;}
}

/* =========================================================
   HERO
   ========================================================= */
.hero{
  position:relative;
  min-height:94vh;
  display:flex;
  align-items:center;
  overflow:hidden;
  color:var(--white);
}
.hero-bg{position:absolute; inset:0; z-index:0;}
.hero-bg img{width:100%; height:100%; object-fit:cover;}
.hero-overlay{
  position:absolute; inset:0;
  background:linear-gradient(190deg, rgba(6,28,42,.62) 0%, rgba(6,28,42,.78) 55%, rgba(6,28,42,.92) 100%);
}
.hero-grid{
  position:absolute; inset:0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 80px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.07) 0 1px, transparent 1px 80px);
  mix-blend-mode:overlay;
  opacity:.5;
}
.hero-content{
  position:relative; z-index:1;
  max-width:760px;
  padding:160px 28px 80px;
  margin:0 auto;
  width:100%;
}
.hero h1{
  font-size:clamp(2.3rem, 5vw, 3.6rem);
  color:var(--white);
}
.hero-sub{
  max-width:560px; font-size:1.08rem; color:#E4ECF1; margin-bottom:2em;
}
.hero-actions{display:flex; gap:16px; flex-wrap:wrap; margin-bottom:64px;}
.hero-stats{
  display:flex; gap:36px; flex-wrap:wrap;
  border-top:1px solid rgba(255,255,255,0.25); padding-top:28px;
}
.hero-stats li{display:flex; flex-direction:column;}
.hero-stats .num{font-family:var(--font-mono); font-size:1.7rem; font-weight:500; color:var(--white);}
.hero-stats .label{font-size:0.82rem; color:#BFD0DB; margin-top:2px;}

@media (max-width:600px){
  .hero-content{padding:140px 22px 56px;}
  .hero-actions .btn{flex:1 1 auto; text-align:center;}
  .hero-stats{gap:22px;}
}

/* =========================================================
   CHI SIAMO — split layout
   ========================================================= */
.split{display:grid; grid-template-columns:1.15fr 0.85fr; gap:64px; align-items:start;}
.split-reverse{grid-template-columns:0.95fr 1.05fr;}
.split-text h2{font-size:clamp(1.8rem,3vw,2.4rem);}
.split-text p{color:var(--stone); max-width:540px;}
.split-stats{display:flex; flex-direction:column; gap:18px;}
.about-photo{width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:var(--radius); box-shadow:var(--shadow-soft);}
.stat-card-grid{display:grid; grid-template-columns:1fr 1fr; gap:18px;}
.stat-card{
  background:var(--cream); border:1px solid var(--mist);
  padding:26px 22px; border-radius:var(--radius);
}
.stat-num{display:block; font-family:var(--font-mono); font-size:1.5rem; color:var(--navy-900); margin-bottom:8px;}
.stat-label{font-size:0.88rem; color:var(--stone);}

@media (max-width:880px){
  .split, .split-reverse{grid-template-columns:1fr; gap:40px;}
}
@media (max-width:480px){
  .stat-card-grid{grid-template-columns:1fr 1fr;}
  .stat-card{padding:20px 16px;}
}

/* =========================================================
   SERVIZI
   ========================================================= */
.services-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:1px;
  background:var(--mist); border:1px solid var(--mist); margin-top:48px;
}
.service-card{
  background:var(--white); padding:38px 32px;
  transition:background .2s ease;
}
.service-card:hover{background:var(--cream);}
.service-icon{width:40px; height:40px; color:var(--navy-900); margin-bottom:22px;}
.service-card h3{font-size:1.15rem; margin-bottom:.4em;}
.service-card p{color:var(--stone); font-size:0.95rem; margin:0;}

@media (max-width:880px){.services-grid{grid-template-columns:repeat(2,1fr);}}
@media (max-width:560px){.services-grid{grid-template-columns:1fr;}}

/* =========================================================
   LAVORI / BEFORE-AFTER SLIDER
   ========================================================= */
.ba-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:36px 28px;
  margin-top:48px;
}
.ba-card figcaption h3{font-size:1.05rem; margin:18px 0 .3em;}
.ba-card figcaption p{color:var(--stone); font-size:0.92rem; margin:0;}

.ba-slider{
  position:relative; overflow:hidden; border-radius:var(--radius);
  background:var(--mist); cursor:ew-resize; touch-action:pan-y;
  box-shadow:var(--shadow-soft);
  --pos:50%;
}
.ba-slider img{
  position:absolute; inset:0; width:100%; height:100%; object-fit:cover;
  -webkit-user-select:none; user-select:none; pointer-events:none;
}
.ba-img-before{clip-path:inset(0 calc(100% - var(--pos)) 0 0);}
.ba-handle{
  position:absolute; top:0; bottom:0; left:var(--pos);
  width:0; transform:translateX(-50%); pointer-events:none;
}
.ba-handle::before{
  content:""; position:absolute; top:0; bottom:0; left:50%;
  width:2px; background:rgba(255,255,255,0.85); transform:translateX(-50%);
}
.ba-grip{
  position:absolute; top:50%; left:50%; transform:translate(-50%,-50%);
  width:42px; height:42px; border-radius:50%;
  background:var(--white); box-shadow:var(--shadow-soft);
  display:flex; align-items:center; justify-content:center;
}
.ba-grip svg{width:18px; height:18px; color:var(--navy-900);}
.ba-tag{
  position:absolute; top:14px; font-family:var(--font-mono); font-size:0.7rem;
  letter-spacing:0.08em; text-transform:uppercase; color:#fff;
  background:rgba(6,33,47,0.55); padding:5px 10px; border-radius:2px;
  pointer-events:none;
}
.ba-tag-before{left:14px;}
.ba-tag-after{right:14px;}

.gallery-heading{margin-top:88px;}
.gallery-heading h3{font-size:1.4rem;}
.gallery-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:20px; margin-top:32px;
}
.gallery-item{position:relative; overflow:hidden; border-radius:var(--radius); aspect-ratio:3/4;}
.gallery-item img{width:100%; height:100%; object-fit:cover; transition:transform .4s ease;}
.gallery-item:hover img{transform:scale(1.06);}
.gallery-item figcaption{
  position:absolute; left:0; right:0; bottom:0;
  background:linear-gradient(0deg, rgba(6,33,47,0.78), transparent);
  color:#fff; font-size:0.85rem; padding:28px 14px 12px;
}

@media (max-width:980px){
  .ba-grid{grid-template-columns:repeat(2,1fr);}
  .gallery-grid{grid-template-columns:repeat(3,1fr);}
}
@media (max-width:680px){
  .ba-grid{grid-template-columns:1fr;}
  .gallery-grid{grid-template-columns:repeat(2,1fr);}
}

/* =========================================================
   PREVENTIVO FORM
   ========================================================= */
.section-quote{background:var(--navy-950); color:var(--white);}
.section-quote .eyebrow{color:#E2A079;}
.section-quote .split-text p{color:#C6D3DB;}
.quote-points{margin:22px 0; display:flex; flex-direction:column; gap:10px;}
.quote-points li{
  padding-left:26px; position:relative; font-size:0.96rem; color:#DCE6EB;
}
.quote-points li::before{
  content:""; position:absolute; left:0; top:7px; width:10px; height:10px;
  border:2px solid var(--terracotta); border-radius:50%;
}
.quote-direct a{color:var(--terracotta); border-bottom:1px solid rgba(194,105,62,0.5);}
.quote-direct a:hover{border-color:var(--terracotta);}

.quote-form{
  background:var(--white); color:var(--ink);
  padding:40px; border-radius:6px; box-shadow:var(--shadow-deep);
}
.form-row{margin-bottom:18px; display:flex; flex-direction:column; gap:6px;}
.form-row-half{flex-direction:row; gap:18px;}
.form-row-half > div{flex:1; display:flex; flex-direction:column; gap:6px;}
label{font-size:0.85rem; font-weight:600; color:var(--navy-900);}
input, select, textarea{
  font-family:var(--font-body); font-size:0.98rem; padding:12px 14px;
  border:1.5px solid var(--mist-strong); border-radius:3px; background:var(--white); color:var(--ink);
  width:100%;
}
input:focus, select:focus, textarea:focus{
  outline:none; border-color:var(--navy-700); box-shadow:0 0 0 3px rgba(21,80,128,0.15);
}
textarea{resize:vertical;}
.checkbox-row{
  display:flex; align-items:flex-start; gap:10px; margin:8px 0 22px;
  font-size:0.85rem; color:var(--stone); cursor:pointer;
}
.checkbox-row input{width:18px; height:18px; margin-top:2px; flex:none;}
.form-note{font-size:0.8rem; color:var(--stone); margin:14px 0 0; text-align:center;}

@media (max-width:560px){
  .quote-form{padding:26px;}
  .form-row-half{flex-direction:column; gap:18px;}
}

/* focus visibility */
a:focus-visible, button:focus-visible, .ba-slider:focus-visible{
  outline:3px solid var(--terracotta); outline-offset:2px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer{background:var(--navy-900); color:#D7E2E9; padding:80px 0 0;}
.footer-grid{
  display:grid; grid-template-columns:1.2fr 0.9fr 0.9fr 1fr; gap:40px;
  padding-bottom:56px; border-bottom:1px solid rgba(255,255,255,0.12);
}
.footer-logo{height:46px; margin-bottom:18px;}
.footer-brand p{color:#AFC2CD; max-width:260px;}
.social-row{display:flex; flex-direction:column; gap:8px; margin-top:14px;}
.social-pill{
  font-family:var(--font-mono); font-size:0.74rem; color:#9FB3BF;
  border:1px solid rgba(255,255,255,0.18); padding:6px 12px; border-radius:20px; width:fit-content;
}
.footer-col p{color:#C6D3DB; font-size:0.94rem;}
.footer-col a:hover{color:var(--terracotta);}
.footer-map iframe{
  width:100%; height:160px; border:0; border-radius:4px; filter:grayscale(.15) contrast(1.05);
}
.footer-bottom{padding:22px 28px; font-size:0.8rem; color:#8FA3AF;}

@media (max-width:980px){
  .footer-grid{grid-template-columns:1fr 1fr; gap:36px 28px;}
}
@media (max-width:560px){
  .footer-grid{grid-template-columns:1fr;}
}

/* =========================================================
   SCROLL REVEAL
   ========================================================= */
.reveal{opacity:0; transform:translateY(18px); transition:opacity .6s ease, transform .6s ease;}
.reveal.is-visible{opacity:1; transform:translateY(0);}
