:root{
  --bg:#070712;
  --panel:#0d0d1c;
  --text:#e9ebff;
  --muted:#a9aed6;
  --stroke:rgba(255,255,255,.08);
  --stroke-soft:rgba(255,255,255,.04);
  --glow:rgba(120,170,255,.25);
  --glow-strong:rgba(120,170,255,.34);
  --max:1100px;
  --r:18px;

  --topbar-up-h:48px;
  --topbar-h:64px;
}

*{
  box-sizing:border-box;
}

html,
body{
  height:100%;
  background-color:var(--bg);
}

body{
  margin:0;
  padding:0;
  font-family:ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  position:relative;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;

  background-color:var(--bg);
  background-image:
    radial-gradient(120% 80% at 18% 12%, rgba(120,170,255,.14), transparent 58%),
    radial-gradient(90% 70% at 78% 18%, rgba(255,255,255,.04), transparent 56%),
    linear-gradient(180deg, rgba(8,10,26,.16), rgba(7,7,18,0) 26%);
  background-repeat:no-repeat;
  background-size:100% 100%, 100% 100%, 100% 100%;
  background-attachment:scroll;
}

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

a{
  color:inherit;
}

.wrap{
  max-width:var(--max);
  margin:0 auto;
  padding:0 18px;
}

.header-shell{
  position:relative;
}

/* spazio iniziale totale header */
.header-spacer{
  height:calc(var(--topbar-up-h) + var(--topbar-h));
  transition:height .22s ease;
}

body.scrolled .header-spacer{
  height:var(--topbar-h);
}

/* barra sopra */
.topbar-up{
  position:fixed;
  top:0;
  left:0;
  right:0;
  height:var(--topbar-up-h);
  z-index:1001;
  background:rgba(2,2,9,.99);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-bottom:1px solid var(--stroke-soft);
  transition:
    transform .22s ease,
    opacity .22s ease;
}

.topbar-up-inner{
  height:100%;
  display:flex;
  align-items:center;
  justify-content:flex-end;
}

body.scrolled .topbar-up{
  transform:translateY(calc(-1 * var(--topbar-up-h)));
  opacity:0;
  pointer-events:none;
}

/* navbar principale */
.topbar{
  position:fixed;
  top:var(--topbar-up-h);
  left:0;
  right:0;
  z-index:1000;
  min-height:var(--topbar-h);
  background:rgba(7,7,18,.9);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  border-bottom:1px solid var(--stroke-soft);
  transition:top .22s ease;
}

body.scrolled .topbar{
  top:0;
}

.topbar-inner{
  min-height:var(--topbar-h);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
}

/* brand */
.brand{
  display:inline-flex;
  align-items:center;
  gap:14px;
  text-decoration:none;
  color:inherit;
  min-width:0;
}

.brand-logo3d{
  position:relative;
  width:84px;
  height:64px;
  flex:0 0 84px;
}

#brandPlaceholder,
#brandScene{
  position:absolute;
  inset:0;
  width:84px;
  height:64px;
}

#brandPlaceholder{
  object-fit:contain;
}

#brandScene{
  visibility:hidden;
}

#brandScene.is-ready{
  visibility:visible;
}

#brandPlaceholder.is-hidden{
  display:none;
}

.brand-name{
  font-weight:700;
  letter-spacing:.3px;
  white-space:nowrap;
}

/* nav */
.nav{
  display:none;
  align-items:center;
  gap:18px;
}

.nav a{
  color:var(--muted);
  text-decoration:none;
  transition:color .15s ease;
}

.nav a:hover{
  color:var(--text);
}

/* actions */
.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.capture-btn{
  appearance:none;
  border:none;
  border-radius:999px;
  padding:8px 14px;
  font:inherit;
  line-height:1;
  cursor:pointer;
  color:#eaf6ff;
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
  transition:transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.capture-btn:hover{
  background:rgba(255,255,255,.14);
  transform:translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,.12),
    0 0 20px rgba(120,170,255,.10);
}

.capture-btn:active{
  transform:translateY(0);
}

.lang{
  display:flex;
  gap:10px;
}

.lang a{
  color:var(--muted);
  text-decoration:none;
  padding:6px 10px;
  border:1px solid var(--stroke);
  border-radius:999px;
  transition:color .15s ease, border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.lang a:hover{
  color:var(--text);
  border-color:rgba(255,255,255,.12);
}

.lang a.active{
  color:var(--text);
  box-shadow:0 0 20px var(--glow);
}

/* Hero */
.hero{
  position:relative;
  min-height:640px;
  display:flex;
  align-items:center;
  overflow:hidden;
  background:transparent;
  border-bottom:1px solid var(--stroke-soft);
}

.hero-inner{
  position:relative;
  z-index:1;
  width:100%;
  padding:72px 0 56px;
}

.hero-slider{
  position:relative;
  width:100%;
}

.hero-slides{
  position:relative;
  width:100%;
  height:460px;
}

.hero-slide{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateX(18px);
  transition:
    opacity .35s ease,
    transform .35s ease,
    visibility .35s ease;
  overflow:hidden;
  border-radius:30px;
  background:
    linear-gradient(90deg, rgba(30,42,84,.55) 0%, rgba(14,20,44,.26) 50%, rgba(7,7,18,0) 100%);
}

.hero-slide.is-active{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateX(0);
}

.hero-slide-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
}

.hero-slide-content{
  position:relative;
  z-index:2;
  width:100%;
  max-width:980px;
  height:100%;
  padding:42px 32px 34px;
  display:flex;
  flex-direction:column;
  justify-content:flex-start;
}

.hero-slide-content::before{
  content:"";
  position:absolute;
  top:16px;
  left:16px;
  bottom:16px;
  width:min(760px, calc(100% - 32px));
  border-radius:28px;
  background:
    linear-gradient(90deg, rgba(18,26,56,.56) 0%, rgba(18,26,56,.32) 60%, rgba(18,26,56,0) 100%);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
  z-index:-1;
}

.hero-slide h1{
  margin:0 0 14px;
 /* max-width:12ch;*/
  font-size:clamp(2.4rem, 5vw, 4.6rem);
  line-height:1.04;
  letter-spacing:-.035em;
  text-wrap:balance;
  text-shadow:0 2px 18px rgba(0,0,0,.22);
}

.hero-dots {
  padding-left: 30px;
}

.lead{
  /*max-width:60ch;*/
  margin:0 0 20px;
  color:var(--text);
  opacity:.86;
  font-size:1.08rem;
  line-height:1.65;
  text-shadow:0 1px 10px rgba(0,0,0,.18);
}

.hero-text{
 /* max-width:62ch;*/
  margin:0 0 24px;
  color:var(--text);
  opacity:.8;
  line-height:1.75;
  text-shadow:0 1px 10px rgba(0,0,0,.18);
}

.cta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:auto;
  padding-top:8px;
  position:relative;
  z-index:3;
}

.hero-arrow{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  z-index:3;
  width:46px;
  height:46px;
  border:none;
  border-radius:999px;
  cursor:pointer;
  font-size:2rem;
  line-height:1;
  color:var(--text);
  background:rgba(255,255,255,.08);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.08);
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
  transition:background .15s ease, transform .15s ease;
}

.hero-arrow:hover{
  background:rgba(255,255,255,.14);
}

.hero-arrow-prev{
  left:-16px;
}

.hero-arrow-next{
  right:-16px;
}

.hero-dots{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:20px;
}

.hero-dot{
  width:10px;
  height:10px;
  border:none;
  border-radius:999px;
  cursor:pointer;
  background:rgba(255,255,255,.22);
  transition:transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.hero-dot:hover{
  background:rgba(255,255,255,.36);
}

.hero-dot.is-active{
  background:var(--text);
  box-shadow:0 0 18px var(--glow);
  transform:scale(1.15);
}

@media (max-width: 859px){
  .hero{
    min-height:580px;
  }

  .hero-inner{
    padding:44px 0 40px;
  }

  .hero-slides{
    height:480px;
  }

  .hero-slide-content{
    padding:26px 18px 24px;
  }

  .hero-slide-content::before{
    top:10px;
    left:10px;
    right:10px;
    bottom:10px;
    width:auto;
  }

  .hero-slide h1{
    /*max-width:12ch;*/
    font-size:clamp(2rem, 8vw, 3.2rem);
  }

  .hero-arrow{
    display:none;
  }
}

h1{
  margin:0 0 14px;
  font-size:clamp(2rem, 4vw, 3.25rem);
  line-height:1.08;
  letter-spacing:-.02em;
}

.lead{
  /*max-width:60ch;*/
  margin:0 0 22px;
  color:var(--muted);
  font-size:1.05rem;
  line-height:1.6;
}

.cta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border-radius:999px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.12);
}

.btn.primary{
  background:linear-gradient(135deg, rgba(122,176,255,.25), rgba(255,255,255,.06));
  box-shadow:0 0 26px var(--glow);
}

.notice{
  margin-top:18px;
  max-width:60ch;
  padding:12px 14px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
}

.notice.ok{
  box-shadow:0 0 22px rgba(120,255,170,.12);
}

.notice.err{
  box-shadow:0 0 22px rgba(255,120,120,.12);
}

/* Sections */
.section{
  position:relative;
  z-index:1;
  padding:56px 0;
  background:transparent;
}

h2{
  margin:0 0 12px;
  font-size:1.6rem;
  line-height:1.15;
}

.text{
  max-width:75ch;
  color:var(--muted);
  line-height:1.7;
}

.grid{
  margin-top:18px;
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.card{
  padding:18px 16px;
  border-radius:var(--r);
  border:1px solid var(--stroke);
  background:rgba(255,255,255,.03);
  box-shadow:0 0 0 1px rgba(255,255,255,.01) inset;
}

.card h3{
  margin:0 0 8px;
  font-size:1.05rem;
}

.card p{
  margin:0;
  color:var(--muted);
  line-height:1.6;
}

/* Form */
.form{
  margin-top:18px;
  max-width:640px;
  display:grid;
  gap:12px;
}

label{
  display:grid;
  gap:8px;
}

input,
textarea{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--stroke);
  background:rgba(7,7,18,.6);
  color:var(--text);
  outline:none;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

input::placeholder,
textarea::placeholder{
  color:rgba(169,174,214,.72);
}

input:focus,
textarea:focus{
  border-color:rgba(122,176,255,.28);
  box-shadow:0 0 0 3px rgba(122,176,255,.18);
}

textarea{
  resize:vertical;
  min-height:120px;
}

/* Footer */
.footer{
  position:relative;
  z-index:1;
  padding:30px 0;
  background:transparent;
  border-top:1px solid var(--stroke-soft);
}

.muted{
  color:var(--muted);
}

/* Responsive */
@media (min-width:860px){
  .nav{
    display:flex;
  }
  .hamburger{
    display:none !important;
  }

  .mobile-menu{
    display:none !important;
  }
  .grid{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width:859px){
  .header-spacer{
    height:calc(var(--topbar-up-h) + var(--topbar-h));
  }

  body.scrolled .header-spacer{
    height:var(--topbar-h);
  }

  .topbar-up{
    height:auto;
    min-height:var(--topbar-up-h);
  }

  .topbar-up-inner{
    justify-content:flex-end;
    padding-top:8px;
    padding-bottom:8px;
  }

  .topbar-inner{
    gap:14px;
  }

  .brand{
    gap:10px;
  }

  .brand-name{
    font-size:1rem;
  }
  .nav{
    display:none;
  }

   .hamburger{
    display:block !important;
    margin-left:auto;
  }
  .topbar-actions{
    flex-wrap:wrap;
  }
}


.hamburger{
  display:none;
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
  width:48px;
  height:48px;
  border-radius:12px;
  padding:0;
  cursor:pointer;
  position:relative;
  z-index:1102;
  flex:0 0 48px;
}

.hamburger span{
  position:absolute;
  left:50%;
  width:22px;
  height:2px;
  background:#ffffff;
  border-radius:999px;
  transform:translateX(-50%);
  transition:transform .2s ease, opacity .2s ease, top .2s ease;
}

.hamburger span:nth-child(1){
  top:16px;
}

.hamburger span:nth-child(2){
  top:23px;
}

.hamburger span:nth-child(3){
  top:30px;
}

.hamburger.is-open span:nth-child(1){
  top:23px;
  transform:translateX(-50%) rotate(45deg);
}

.hamburger.is-open span:nth-child(2){
  opacity:0;
}

.hamburger.is-open span:nth-child(3){
  top:23px;
  transform:translateX(-50%) rotate(-45deg);
}

.mobile-menu{
  position:fixed;
  top:calc(var(--topbar-up-h) + var(--topbar-h));
  left:0;
  right:0;
  z-index:999;
  background:rgba(3,3,9,.97);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  border-bottom:1px solid var(--stroke-soft);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translateY(-10px);
  transition:
    opacity .2s ease,
    transform .2s ease,
    visibility .2s ease;
}

body.scrolled .mobile-menu{
  top:var(--topbar-h);
}

.mobile-menu.is-open{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform:translateY(0);
}

.mobile-menu-inner{
  display:flex;
  flex-direction:column;
  padding-top:14px;
  padding-bottom:14px;
  text-align: center;
}

.mobile-menu a{
  display:block;
  padding:14px 0;
  color:var(--text);
  text-decoration:none;
  border-bottom:1px solid var(--stroke-soft);
}

.mobile-menu a:last-child{
  border-bottom:none;
}

body.menu-open{
  overflow:hidden;
}



#about,
#services,
#portfolio,
#technologies,
#location,
#contacts{
  scroll-margin-top:calc( var(--topbar-h) + 14px);
}


html{
  scroll-behavior:smooth;
}



body.modal-open {
  overflow: hidden;
}

.modal-backdrop[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  width: min(900px, 100%);
  max-height: 85vh;
  overflow-y: auto;

  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);

  padding: 28px 24px 24px;
}

.modal-content h2 {
  margin-top: 0;
  margin-bottom: 18px;
}

.modal-content p {
  line-height: 1.65;
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.88);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;

  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;

  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-link-btn {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  text-decoration: underline;
  font: inherit;
}