:root {
  --bg: #05060a;
  --bg-soft: #0a0d16;
  --line: rgba(255, 255, 255, 0.08);
  --text: #e7e9ee;
  --text-dim: #8b90a0;
  --accent: #ff8a3d;
  --accent-dim: #b8632a;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: var(--accent); color: #05060a; }

/* Preloader */
#preloader {
  position: fixed; inset: 0; z-index: 1000;
  background: #000000;
  display: flex; align-items: center; justify-content: center;
}
#preloader-anim {
  width: min(70vw, 420px);
  height: min(70vw, 420px);
}

/* Header */
#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 48px;
  mix-blend-mode: difference;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.logo-mark {
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 1px;
  transform: rotate(45deg);
}
#main-nav {
  display: flex; align-items: center; gap: 40px;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
}
#main-nav a { position: relative; padding: 4px 0; }
#main-nav a:not(.nav-cta)::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--accent);
  transition: width .3s ease;
}
#main-nav a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  border: 1px solid var(--text);
  padding: 8px 18px;
  border-radius: 999px;
  transition: background .3s, color .3s, border-color .3s;
}
.nav-cta:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #05060a;
}
#nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  gap: 5px;
  width: 32px; height: 32px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 210;
}
#nav-toggle span {
  display: block;
  height: 1.5px;
  background: var(--text);
  border-radius: 1px;
  transition: transform .3s ease, opacity .3s ease, width .3s ease;
  width: 24px;
}
#nav-toggle span:nth-child(2) { width: 16px; }
#nav-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); width: 24px; }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); width: 24px; }

#mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 36px;
  transform: translateY(-100%);
  transition: transform .45s cubic-bezier(.65,0,.35,1);
}
#mobile-menu.open { transform: translateY(0); }
#mobile-menu a {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text);
}
#mobile-menu a:hover { color: var(--accent); }

@media (max-width: 768px) {
  #site-header { padding: 20px 24px; }
  #main-nav { display: none; }
  #nav-toggle { display: flex; }
}

/* Background canvas */
#bg-canvas {
  position: fixed; inset: 0;
  z-index: 0;
  display: block;
}

main { position: relative; z-index: 1; }

/* Hero */
#hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 48px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: 32px;
  width: 100%;
  max-width: 1400px;
}
.hero-inner { max-width: 700px; min-width: 0; }
.hero-3d {
  position: relative;
  height: 560px;
  min-width: 0;
  pointer-events: none;
}
.hero-3d spline-viewer {
  width: 100%;
  height: 100%;
  pointer-events: auto;
  display: block;
}
.spline-cover {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 160px;
  height: 46px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--text);
  z-index: 5;
  pointer-events: none;
}
.spline-cover .logo-mark { flex-shrink: 0; }
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-inner { max-width: 100%; }
  .hero-3d { height: 380px; order: -1; margin-bottom: 8px; }
}
@media (max-width: 640px) {
  .hero-3d { height: 280px; }
}
@media (max-width: 768px) {
  .hero-3d {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: min(58vh, 440px);
    margin: 0;
  }
  .hero-3d::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 35%, var(--bg) 82%);
    pointer-events: none;
  }
  .hero-inner {
    position: relative;
    z-index: 2;
    padding-top: calc(min(58vh, 440px) + 28px);
  }
}
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 24px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.2rem, 5.4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  .hero-title { font-size: clamp(2.6rem, 9vw, 5.6rem); }
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title em { font-style: normal; color: var(--accent); }
.hero-title-staggered .line-indent-1 { margin-left: 0.9em; }
.hero-title-staggered .line-indent-2 { margin-left: 1.8em; color: var(--text-dim); -webkit-text-stroke: 1px var(--text); color: transparent; }
@media (max-width: 768px) {
  .hero-title-staggered .line-indent-1 { margin-left: 0.3em; }
  .hero-title-staggered .line-indent-2 { margin-left: 0.6em; }
}
.hero-sub {
  margin-top: 28px;
  max-width: 480px;
  font-size: 1.05rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.btn-magnetic {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 40px;
  padding: 18px 36px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  color: var(--accent);
  background: transparent;
  cursor: pointer;
  transition: background .3s, color .3s;
}
.btn-magnetic:hover { background: var(--accent); color: #05060a; }
.btn-magnetic span { pointer-events: none; }

.hero-scroll-hint {
  position: absolute;
  bottom: 40px; left: 48px;
  display: flex; align-items: center; gap: 14px;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.scroll-line {
  width: 1px; height: 40px;
  background: linear-gradient(var(--accent), transparent);
}
@media (max-width: 768px) {
  #hero { padding: 0 24px; }
  .hero-scroll-hint { display: none; }
}

/* Section headers */
section { position: relative; padding: 140px 48px; }
.section-head {
  display: flex; align-items: baseline; gap: 20px;
  margin-bottom: 64px;
}
.section-num {
  font-family: var(--font-display);
  color: var(--accent-dim);
  font-size: 0.9rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  letter-spacing: -0.01em;
}
@media (max-width: 768px) { section { padding: 90px 24px; } }

/* Approccio */
.approccio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.approccio-item {
  padding: 32px 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-soft);
  opacity: 0;
  filter: blur(10px);
  transform: translateY(24px) scale(0.94);
  transition: border-color .3s ease, transform .3s ease;
}
.approccio-item:hover {
  border-color: var(--accent-dim);
  transform: translateY(-4px);
}
.approccio-icon {
  width: 48px; height: 48px;
  margin-bottom: 20px;
}
.approccio-icon svg { width: 100%; height: 100%; }
.approccio-index {
  display: block;
  font-family: var(--font-display);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 16px;
}
.approccio-item h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 12px;
}
.approccio-item p { color: var(--text-dim); line-height: 1.6; font-size: 0.95rem; }
.approccio-illustration {
  display: block;
  width: 100%;
  max-width: 160px;
  height: auto;
  margin-top: 28px;
  padding: 14px;
  box-sizing: content-box;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  opacity: 1;
}
@media (max-width: 900px) { .approccio-grid { grid-template-columns: 1fr; } }

/* Servizi */
.servizi-list { border-top: 1px solid var(--line); }
.servizio-row {
  display: grid;
  grid-template-columns: 60px 1fr 1.4fr;
  align-items: center;
  gap: 32px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
  opacity: 0; transform: translateY(30px);
  transition: padding-left .4s ease;
}
.servizio-row:hover { padding-left: 12px; }
.servizio-index { font-family: var(--font-display); color: var(--accent-dim); }
.servizio-title { display: flex; align-items: center; gap: 16px; }
.servizio-icon { width: 30px; height: 30px; flex-shrink: 0; }
.servizio-row h3 { font-family: var(--font-display); font-size: 1.4rem; }
.servizio-row p { color: var(--text-dim); font-size: 0.95rem; line-height: 1.6; }
@media (max-width: 900px) {
  .servizio-row { grid-template-columns: 40px 1fr; }
  .servizio-row p { grid-column: 2; }
}

/* Lavori */
.lavori-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.lavoro-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 32px;
  opacity: 0; transform: translateY(30px);
  transition: border-color .3s, background .3s;
}
.lavoro-card:hover { border-color: var(--accent); background: rgba(255,138,61,0.04); }
.lavoro-tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent-dim);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 20px;
}
.lavoro-card h3 { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: 10px; }
.lavoro-card p { color: var(--text-dim); font-size: 0.9rem; }
.lavoro-result {
  display: block;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--text);
}
@media (max-width: 900px) { .lavori-grid { grid-template-columns: 1fr; } }

/* Stats band */
.stats-band {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  padding: 90px 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat-item {
  text-align: center;
  opacity: 0; transform: translateY(30px);
}
.stat-number {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 5vw, 4rem);
  color: var(--accent);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.stat-label {
  display: block;
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 260px;
  margin: 0 auto;
  line-height: 1.5;
}
@media (max-width: 900px) {
  .stats-band { grid-template-columns: 1fr; padding: 60px 24px; gap: 48px; }
}

/* Contatti */
.contatti-inner { max-width: 560px; }
.contatti-lead {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 48px;
  line-height: 1.3;
}
.form-row { margin-bottom: 24px; }
.form-row label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}
.form-row input, .form-row textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 10px 0;
  resize: vertical;
  transition: border-color .3s;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--accent);
}
#contact-form button { margin-top: 8px; border: 1px solid var(--accent); background: var(--accent); color: #05060a; }
#contact-form button:disabled { opacity: 0.6; cursor: default; }
.form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { margin-top: 16px; font-size: 0.85rem; min-height: 1.2em; }
.form-status-ok { color: var(--accent); }
.form-status-error { color: #ff6b6b; }

/* Footer */
#site-footer {
  position: relative; z-index: 1;
  padding: 80px 48px 40px;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 60px;
  font-size: 0.9rem;
}
.footer-social { display: flex; gap: 28px; color: var(--text-dim); }
.footer-social a:hover { color: var(--accent); }
.footer-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 12vw, 9rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  margin-bottom: 40px;
}
.footer-bottom {
  display: flex; justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}
@media (max-width: 768px) {
  #site-footer { padding: 60px 24px 30px; }
  .footer-top { flex-direction: column; align-items: flex-start; gap: 16px; }
}
