:root {
  --bg:       #ffffff;
  --bg-soft:  #f7f7f5;
  --bg-card:  #f3f3f0;
  --line:     rgba(0,0,0,0.07);
  --line2:    rgba(0,0,0,0.13);
  --text:     #0f0f0f;
  --text-2:   #5a5a5a;
  --text-3:   #767676;
  --blue:     #1a56ff;
  --blue-bg:  #eff3ff;
  --green:    #18a36a;
  --fd: 'Syne', system-ui, sans-serif;
  --fb: 'Instrument Sans', system-ui, sans-serif;
  --max: 1080px;
  --r: 12px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 4px;
}
body { font-family: var(--fb); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 310;
  height: 56px; display: flex; align-items: center;
  padding: 0 clamp(28px,6vw,96px);
  transition: background .35s, box-shadow .35s;
}
nav.scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 var(--line);
}
.nav-inner {
  width: 100%; max-width: var(--max); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--fd); font-weight: 700; font-size: .95rem;
  color: var(--text); text-decoration: none; letter-spacing: -.01em;
  position: relative; z-index: 302;
}
.nav-links { display: flex; gap: 6px; list-style: none; align-items: center; }
.nav-links a {
  font-size: .82rem; font-weight: 400; color: var(--text-2);
  text-decoration: none; padding: 6px 14px; border-radius: 8px;
  transition: background .2s, color .2s;
}
.nav-links a:hover { background: var(--bg-card); color: var(--text); }
.nav-links .nav-cta {
  background: var(--text); color: var(--bg);
  padding: 7px 18px; border-radius: 100px; font-weight: 500;
}
.nav-links .nav-cta:hover { background: #333; }

/* HAMBURGER */
.hamburger {
  display: none; cursor: pointer;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line2);
  background: var(--bg);
  transition: background .2s, border-color .2s;
  position: relative; z-index: 302; flex-shrink: 0;
}
.hamburger:hover { background: var(--bg-card); }
.hb-icon {
  width: 18px; height: 12px;
  display: flex; flex-direction: column; justify-content: space-between;
  pointer-events: none;
}
.hb-icon span {
  display: block; height: 1.5px; background: var(--text);
  border-radius: 2px; transform-origin: center;
  transition: transform .38s cubic-bezier(.77,0,.175,1), opacity .25s, width .3s;
}
.hb-icon span:nth-child(2) { width: 70%; }
.hamburger.open .hb-icon span:nth-child(1) { transform: translateY(5.25px) rotate(45deg); }
.hamburger.open .hb-icon span:nth-child(2) { opacity: 0; width: 0; }
.hamburger.open .hb-icon span:nth-child(3) { transform: translateY(-5.25px) rotate(-45deg); }

/* FULLSCREEN OVERLAY */
.menu-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start;
  padding: 80px clamp(28px,8vw,64px) 100px;
  pointer-events: none; opacity: 0;
  transition: opacity .3s ease;
}
.menu-overlay.open { opacity: 1; pointer-events: all; }
.overlay-links { list-style: none; width: 100%; }
.overlay-links a {
  display: block;
  font-family: var(--fd);
  font-size: clamp(2.4rem, 9vw, 4rem);
  font-weight: 800; letter-spacing: -.03em;
  color: var(--text); text-decoration: none; line-height: 1.2;
  padding: 10px 0; border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(28px);
  transition: opacity .4s ease, transform .4s ease, color .2s;
}
.overlay-links li:last-child a { border-bottom: none; }
.overlay-links a:hover { color: var(--blue); }
.menu-overlay.open .overlay-links li:nth-child(1) a { opacity:1; transform:none; transition-delay:.06s; }
.menu-overlay.open .overlay-links li:nth-child(2) a { opacity:1; transform:none; transition-delay:.12s; }
.menu-overlay.open .overlay-links li:nth-child(3) a { opacity:1; transform:none; transition-delay:.18s; }
.menu-overlay.open .overlay-links li:nth-child(4) a { opacity:1; transform:none; transition-delay:.24s; }
.overlay-footer {
  position: absolute; bottom: 36px;
  left: clamp(28px,8vw,64px); right: clamp(28px,8vw,64px);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  opacity: 0; transform: translateY(10px);
  transition: opacity .4s ease .3s, transform .4s ease .3s;
}
.menu-overlay.open .overlay-footer { opacity: 1; transform: none; }
.overlay-social { display: flex; gap: 20px; }
.overlay-social a {
  font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); text-decoration: none; transition: color .2s;
}
.overlay-social a:hover { color: var(--text); }
.overlay-loc { font-size: .75rem; color: var(--text-3); }

/* HERO */
.hero {
  min-height: 100svh; display: flex; flex-direction: column; justify-content: center;
  padding: 100px clamp(28px,6vw,96px) 80px;
  position: relative; overflow: hidden;
}
.hero-inner { max-width: var(--max); margin: 0 auto; width: 100%; position: relative; z-index: 2; }
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none;
  animation: bfloat 8s ease-in-out infinite;
}
.blob-1 { width:520px; height:520px; background:radial-gradient(circle,rgba(26,86,255,.08) 0%,transparent 70%); top:-120px; right:-80px; }
.blob-2 { width:380px; height:380px; background:radial-gradient(circle,rgba(24,163,106,.07) 0%,transparent 70%); bottom:0; left:-60px; animation-delay:-3s; }
.blob-3 { width:260px; height:260px; background:radial-gradient(circle,rgba(26,86,255,.05) 0%,transparent 70%); top:50%; left:50%; animation-delay:-5s; }
@keyframes bfloat {
  0%,100% { transform:translate(0,0) scale(1); }
  33%      { transform:translate(20px,-30px) scale(1.05); }
  66%      { transform:translate(-15px,20px) scale(.96); }
}
.hero-grid {
  position: absolute; inset: 0; z-index: 1;
  background-image: linear-gradient(rgba(0,0,0,.025) 1px,transparent 1px), linear-gradient(90deg,rgba(0,0,0,.025) 1px,transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 60% 100% at 80% 50%,black 0%,transparent 80%);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--blue-bg); color: var(--blue);
  font-size: .72rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 100px; margin-bottom: 28px;
  border: 1px solid rgba(26,86,255,.12);
}
.hero-tag::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--blue); }
h1.hero-title {
  font-family: var(--fd); font-weight: 800;
  font-size: clamp(3rem, 6.5vw, 6rem);
  line-height: 1.0; letter-spacing: -.035em;
  color: var(--text); margin-bottom: 28px; max-width: 9em;
}
h1.hero-title .ia { font-style: italic; font-weight: 600; color: var(--blue); }
.hero-sub {
  font-size: clamp(.95rem,1.4vw,1.1rem); font-weight: 300; line-height: 1.7;
  color: var(--text-2); max-width: 500px; margin-bottom: 44px;
}
.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--fb); font-size: .85rem; font-weight: 500;
  text-decoration: none; border-radius: 100px; padding: 13px 26px;
  transition: transform .2s, box-shadow .2s, background .2s;
  cursor: pointer; border: none;
}
.btn:hover { transform: translateY(-2px); }

/* BACK TO TOP */
#backTop {
  position: fixed; bottom: 28px; right: 28px; z-index: 400;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--text); color: var(--bg);
  border: none; border-radius: 12px; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(12px);
  transition: opacity .3s ease, transform .3s ease, box-shadow .2s;
  pointer-events: none;
}
#backTop.visible { opacity: 1; transform: translateY(0); pointer-events: all; }
#backTop:hover { box-shadow: 0 8px 28px rgba(0,0,0,.3); transform: translateY(-2px); }
#backTop svg { width: 16px; height: 16px; stroke: var(--bg); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn-dark { background: var(--text); color: var(--bg); box-shadow: 0 2px 16px rgba(0,0,0,.18); }
.btn-dark:hover { box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.btn-outline { background: transparent; color: var(--text-2); box-shadow: 0 0 0 1px var(--line2); }
.btn-outline:hover { color: var(--text); box-shadow: 0 0 0 1px rgba(0,0,0,.22); }
.btn-contact { font-size: .9rem; padding: 15px 32px; }
.hero-metrics {
  display: flex; gap: clamp(24px,4vw,52px); flex-wrap: wrap;
  margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--line);
}
.metric-n {
  font-family: var(--fd); font-size: clamp(2rem,3.5vw,3rem);
  font-weight: 800; letter-spacing: -.03em; color: var(--text); line-height: 1; margin-bottom: 4px;
}
.metric-l { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* SHARED SECTION */
section { padding: clamp(72px,9vh,108px) clamp(28px,6vw,96px); }
.section-inner { max-width: var(--max); margin: 0 auto; }
.eyebrow {
  font-size: .7rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 16px;
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content:''; width:18px; height:1.5px; background:var(--line2); }
h2.sec-title {
  font-family: var(--fd); font-size: clamp(1.9rem,3.5vw,3rem);
  font-weight: 700; letter-spacing: -.03em; color: var(--text); line-height: 1.1; margin-bottom: 12px;
}
h2.sec-title em { font-style: italic; font-weight: 600; color: var(--blue); }

/* ABOUT */
#about { background: var(--bg-soft); }
.about-body { max-width: 640px; margin-top: 52px; }
.about-body p {
  font-size: clamp(.93rem,1.3vw,1.05rem); font-weight: 300; line-height: 1.8;
  color: var(--text-2); margin-bottom: 18px;
}
.about-body p strong { color: var(--text); font-weight: 500; }
.about-body p:last-child { margin-bottom: 0; }

/* SKILLS */
#skills { background: var(--bg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.skills-grid {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; margin-top: 48px;
}
.sk-card { background: var(--bg); padding: clamp(22px,3vw,36px); transition: background .25s; }
.sk-card:hover { background: var(--bg-soft); }
.sk-icon {
  width: 34px; height: 34px; background: var(--bg-soft); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; margin-bottom: 16px; border: 1px solid var(--line);
}
.sk-title { font-size: .9rem; font-weight: 500; color: var(--text); margin-bottom: 8px; }
.sk-desc { font-size: .8rem; color: var(--text-3); line-height: 1.65; }

/* TOOLS STRIP */
.tools-strip { background: var(--bg-card); padding: 28px clamp(28px,6vw,96px); border-bottom: 1px solid var(--line); }
.tools-strip-inner { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.tstrip-label {
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-2); white-space: nowrap; padding-right: 24px;
}
.tstrip-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.tool-pill {
  font-size: .75rem; color: var(--text-2); background: var(--bg); border: 1px solid var(--line);
  padding: 5px 12px; border-radius: 100px; transition: border-color .2s, color .2s;
}
.tool-pill:hover { border-color: var(--line2); color: var(--text); }

/* HUB */
#explore { background: var(--bg); }
.hub-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 44px; }
.hub-card {
  position: relative; background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 18px; padding: 36px 30px;
  text-decoration: none; color: inherit; overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), box-shadow .3s;
}
.hub-card:hover { transform: translateY(-5px); box-shadow: 0 12px 40px rgba(0,0,0,.1); }
.hub-card::before {
  content:''; position:absolute; border-radius:50%; filter:blur(40px);
  pointer-events:none; transition:opacity .3s; opacity:0;
}
.hub-card:hover::before { opacity:1; }
.card-blue::before   { width:200px; height:200px; background:radial-gradient(circle,rgba(26,86,255,.12) 0%,transparent 70%); bottom:-40px; right:-40px; }
.card-green::before  { width:200px; height:200px; background:radial-gradient(circle,rgba(24,163,106,.1) 0%,transparent 70%); bottom:-40px; right:-40px; }
.card-purple::before { width:200px; height:200px; background:radial-gradient(circle,rgba(139,92,246,.1) 0%,transparent 70%); bottom:-40px; right:-40px; }
.hc-number {
  font-family: var(--fd); font-size: 3.5rem; font-weight: 800; letter-spacing: -.04em;
  line-height: 1; margin-bottom: 20px;
}
.card-blue .hc-number   { color: var(--blue); opacity: .12; }
.card-green .hc-number  { color: var(--green); opacity: .12; }
.card-purple .hc-number { color: #8b5cf6; opacity: .12; }
.hc-title { font-family: var(--fd); font-size: 1.2rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); margin-bottom: 10px; }
.hc-desc { font-size: .82rem; font-weight: 300; line-height: 1.7; color: var(--text-2); flex: 1; margin-bottom: 24px; }
.hc-link { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.card-blue   .hc-link { color: var(--blue); }
.card-green  .hc-link { color: var(--green); }
.card-purple .hc-link { color: #8b5cf6; }

/* CONTACT */
#contact { background: var(--bg-soft); border-top: 1px solid var(--line); }
.contact-inner {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; max-width: 640px; margin: 0 auto;
}
.contact-inner h2 {
  font-family: var(--fd); font-size: clamp(2rem,4vw,3.4rem);
  font-weight: 800; letter-spacing: -.035em;
  color: var(--text); line-height: 1.05; margin-bottom: 18px;
}
.contact-inner h2 em { font-style: italic; font-weight: 600; color: var(--blue); }
.contact-inner p {
  font-size: .95rem; font-weight: 300; color: var(--text-2); line-height: 1.7; margin-bottom: 40px;
}

/* FOOTER */
footer { background: var(--bg); border-top: 1px solid var(--line); padding: 36px clamp(28px,6vw,96px) 28px; }
.footer-inner { max-width: var(--max); margin: 0 auto; }
.footer-top {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.footer-name { font-family: var(--fd); font-size: .85rem; color: var(--text-3); font-weight: 600; }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); text-decoration: none; transition: color .2s; }
.footer-links a:hover { color: var(--text); }
.footer-bottom {
  display: flex; align-items: center;
  gap: 16px; flex-wrap: wrap; padding-top: 18px;
}
.footer-copy { font-size: .72rem; color: var(--text-3); }
.footer-copy a { color: var(--text-3); text-decoration: none; transition: color .2s; }
.footer-copy a:hover { color: var(--text); }

/* MODAL */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,.45); backdrop-filter: blur(6px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: clamp(16px,4vw,40px);
  opacity: 0; pointer-events: none;
  transition: opacity .3s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg); border-radius: 16px;
  width: 100%; max-width: 640px; max-height: 80vh;
  display: flex; flex-direction: column;
  transform: translateY(24px);
  transition: transform .35s cubic-bezier(.22,1,.36,1);
  overflow: hidden;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 28px 20px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.modal-title { font-family: var(--fd); font-size: 1rem; font-weight: 700; color: var(--text); }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--bg-card); border: none; border-radius: 8px; cursor: pointer;
  transition: background .2s;
}
.modal-close:hover { background: var(--line2); }
.modal-close svg { width: 14px; height: 14px; stroke: var(--text-2); stroke-width: 2; fill: none; stroke-linecap: round; }
.modal-body {
  overflow-y: auto; padding: 28px; flex: 1;
  font-size: .82rem; color: var(--text-2); line-height: 1.75;
}
.modal-body h3 {
  font-family: var(--fd); font-size: .82rem; font-weight: 700;
  color: var(--text); margin: 20px 0 6px; letter-spacing: .03em; text-transform: uppercase;
}
.modal-body h3:first-child { margin-top: 0; }
.modal-body p { margin-bottom: 10px; }
.modal-body a { color: var(--blue); text-decoration: none; }
.modal-body a:hover { text-decoration: underline; }

/* SKIP LINK */
.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 9999;
  background: var(--text); color: var(--bg); padding: 10px 20px;
  border-radius: 0 0 8px 8px; font-size: .85rem; font-weight: 500;
  text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 0; }

/* COOKIE BANNER */
.cookie-banner {
  display: none;
  position: fixed; bottom: 28px; left: clamp(28px,6vw,96px); z-index: 450;
  background: var(--bg); border: 1px solid var(--line2);
  border-radius: 16px; padding: 20px 24px;
  max-width: 440px; box-shadow: 0 8px 40px rgba(0,0,0,.16);
  flex-direction: column; gap: 14px;
}
.cookie-msg { font-size: .82rem; color: var(--text-2); line-height: 1.6; }
.cookie-link {
  background: none; border: none; color: var(--blue); cursor: pointer;
  font-size: .82rem; padding: 0; text-decoration: underline; font-family: inherit;
}
.cookie-actions { display: flex; gap: 10px; }
.cookie-btn { font-size: .78rem; padding: 9px 20px; }

/* FADE */
.fade { opacity: 0; transform: translateY(20px); transition: opacity .65s ease, transform .65s ease; }
.fade.in { opacity: 1; transform: none; }

/* RESPONSIVE */
@media (max-width: 860px) {
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .hub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links { display: none !important; }
  .hamburger { display: inline-flex; }
  .skills-grid { grid-template-columns: 1fr; }
  .hero-metrics { gap: 24px; }
  .cookie-banner { left: 16px; right: 16px; max-width: none; bottom: 16px; }
}
@media (max-width: 400px) {
  h1.hero-title { font-size: 2.6rem; }
}

/* LARGE SCREENS — font scala su grandi schermi, max-width em-based mantiene 4 righe */
@media (min-width: 1920px) {
  .hero-inner { max-width: 1440px; }
  h1.hero-title { font-size: 7rem; }
}
@media (min-width: 2560px) {
  .hero-inner { max-width: 1920px; }
  h1.hero-title { font-size: 9rem; }
}
