/* Layout: notte polare (hero, mito, contatti) alternata a neve (servizi, metodo, progetti);
   un solo gesto forte, il lupo-cristallo vivo nell'hero, tutto il resto fermo e tipografico. */
:root {
  color-scheme: dark;
  --night: #07101A;
  --night-2: #0D1A28;
  --ice: #CDEFF6;
  --glacier: #5CCBE0;
  --glacier-deep: #0B6F85;
  --aurora: #7DF0C3;
  --snow: #F1F5F8;
  --paper: #FFFFFF;
  --ink: #0A1420;
  --slate: #50606E;
  --mist: #94A9B9;
  --line-dark: rgba(205, 239, 246, .14);
  --line-light: rgba(10, 20, 32, .12);
  --display: "Sora", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --syll: "Noto Sans Canadian Aboriginal", "Euphemia UCAS", "Gadugi", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ice);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; }
:focus-visible { outline: 2px solid var(--aurora); outline-offset: 3px; border-radius: 4px; }

.wrap {
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.label {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.band { padding-block: clamp(72px, 10vw, 136px); }
.band--snow { background: var(--snow); color: var(--ink); }
.band--paper { background: var(--paper); color: var(--ink); }
.band--snow .label, .band--paper .label { color: var(--glacier-deep); }
.band--night .label { color: var(--glacier); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; overflow: clip; background: var(--night); isolation: isolate; }
.aurora { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(90px); opacity: .5;
  animation: drift 22s ease-in-out infinite alternate;
}
.aurora i:nth-child(1) { width: 55vw; height: 30vw; right: -8vw; top: -6vw; background: #0E5F78; }
.aurora i:nth-child(2) { width: 34vw; height: 22vw; right: 14vw; top: 16vw; background: #17806E; opacity: .32; animation-duration: 29s; animation-direction: alternate-reverse; }
.aurora i:nth-child(3) { width: 40vw; height: 26vw; left: -14vw; bottom: -12vw; background: #123A63; opacity: .45; animation-duration: 34s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-5vw, 3vw, 0) scale(1.18); }
}

.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 26px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--paper); }
.brand svg { width: 34px; height: 34px; color: var(--ice); flex: none; }
.wordmark { font-family: var(--display); font-size: 1.05rem; letter-spacing: .09em; font-weight: 700; }
.wordmark span { font-weight: 300; color: var(--glacier); }
.nav-links { display: flex; align-items: center; gap: 34px; }
.nav-links a { text-decoration: none; font-size: .93rem; color: var(--mist); transition: color .2s; }
.nav-links a:hover { color: var(--paper); }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--body); font-weight: 600; font-size: .95rem;
  padding: 13px 22px; border-radius: 999px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s, background .2s, border-color .2s, color .2s;
}
.btn--solid { background: var(--ice); color: var(--night); }
.btn--solid:hover { background: var(--paper); transform: translateY(-1px); }
.btn--ghost { border-color: var(--line-dark); color: var(--ice); background: transparent; }
.btn--ghost:hover { border-color: var(--glacier); color: var(--paper); }
.btn--small { padding: 9px 18px; font-size: .88rem; }

.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center; gap: clamp(24px, 4vw, 64px);
  padding-block: clamp(36px, 6vw, 84px) clamp(48px, 7vw, 96px);
}
.hero-copy { display: flex; flex-direction: column; gap: 28px; min-width: 0; }
.hero .label { color: var(--aurora); display: inline-flex; align-items: center; gap: 10px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--aurora); box-shadow: 0 0 0 0 rgba(125, 240, 195, .6); animation: ping 2.4s ease-out infinite; }
@keyframes ping { to { box-shadow: 0 0 0 12px rgba(125, 240, 195, 0); } }
.hero h1 {
  font-size: clamp(2.5rem, 6.1vw, 5.1rem);
  line-height: 1.02; letter-spacing: -.035em; font-weight: 700; color: var(--paper);
}
.hero h1 em { display: block; font-style: normal; font-weight: 300; color: var(--glacier); }
.lede { font-size: clamp(1.05rem, 1.5vw, 1.22rem); color: var(--mist); max-width: 34em; }
.lede strong { color: var(--ice); font-weight: 500; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.stage { position: relative; aspect-ratio: 1; width: 100%; max-width: 560px; justify-self: center; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line-dark); }
.facts div { padding: 26px 24px 34px 0; display: flex; flex-direction: column; gap: 6px; }
.facts div + div { padding-left: 24px; border-left: 1px solid var(--line-dark); }
.facts b { font-family: var(--display); font-weight: 600; font-size: 1.15rem; color: var(--paper); }
.facts span { color: var(--mist); font-size: .95rem; }

/* ---------- Cosa facciamo ---------- */
.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.split-head { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 40px; }
.split-head h2, .section-head h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); line-height: 1.08; letter-spacing: -.03em; font-weight: 600; }
.split-head p { color: var(--slate); max-width: 26em; }
.offers { display: flex; flex-direction: column; }
.offer {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  padding-block: 34px; border-top: 1px solid var(--line-light);
  transition: padding-left .3s ease;
}
.offer:last-child { border-bottom: 1px solid var(--line-light); }
.offer:hover { padding-left: 14px; }
.offer h3 { font-size: clamp(1.35rem, 2.2vw, 1.8rem); font-weight: 600; letter-spacing: -.02em; }
.offer p { color: var(--slate); max-width: 38em; }
.tags { display: flex; flex-wrap: wrap; gap: 8px 18px; font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--glacier-deep); }

/* ---------- Mito ---------- */
.myth { background: var(--night-2); position: relative; overflow: hidden; }
.myth-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(28px, 6vw, 96px); align-items: center; }
.syll { font-family: var(--syll); font-size: clamp(3.4rem, 9vw, 7.5rem); line-height: 1; color: transparent; -webkit-text-stroke: 1px var(--glacier); letter-spacing: .04em; }
.syll-cap { display: block; margin-top: 14px; }
.myth-copy { display: flex; flex-direction: column; gap: 22px; }
.myth blockquote { margin: 0; font-family: var(--display); font-weight: 300; font-size: clamp(1.5rem, 3vw, 2.5rem); line-height: 1.22; letter-spacing: -.02em; color: var(--paper); text-wrap: balance; }
.myth blockquote b { font-weight: 600; color: var(--ice); }
.myth p { color: var(--mist); max-width: 40em; }

/* ---------- Metodo ---------- */
.section-head { display: flex; flex-direction: column; gap: 16px; margin-bottom: clamp(36px, 5vw, 64px); max-width: 720px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: step; list-style: none; margin: 0; padding: 0; }
.steps li { counter-increment: step; padding: 28px 26px 8px 0; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 12px; position: relative; }
.steps li + li { padding-left: 26px; }
.steps li::before { content: "0" counter(step); font-family: var(--mono); font-size: .78rem; letter-spacing: .12em; color: var(--glacier-deep); }
.steps h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; }
.steps p { color: var(--slate); font-size: .98rem; }

/* ---------- Progetti ---------- */
.section-head p { color: var(--slate); max-width: 38em; }
.projects { display: flex; flex-direction: column; gap: 16px; }
.project {
  background: var(--night); color: var(--ice); border-radius: 24px;
  padding: clamp(28px, 4vw, 44px);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 390px); gap: clamp(24px, 5vw, 72px); align-items: center;
  position: relative; overflow: hidden;
  background-image: radial-gradient(50% 120% at 100% 0%, rgba(23, 128, 110, .32), transparent 70%), radial-gradient(40% 110% at 0% 100%, rgba(14, 95, 120, .38), transparent 70%);
}
.project-copy { display: flex; flex-direction: column; gap: 14px; }
.project .label { color: var(--aurora); }
.project h3 { font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.15; letter-spacing: -.02em; font-weight: 600; color: var(--paper); }
.project p { color: var(--mist); max-width: 44em; }
.project-meta { display: flex; flex-direction: column; font-family: var(--mono); font-size: .8rem; }
.project-meta div:last-child { border-bottom: 1px solid var(--line-dark); }
.project-meta div { display: flex; justify-content: space-between; gap: 16px; padding-block: 12px; border-top: 1px solid var(--line-dark); color: var(--mist); }
.project-meta div b { font-weight: 500; color: var(--ice); text-align: right; }
.projects-foot { margin-top: clamp(28px, 4vw, 44px); }
.projects-foot .btn--solid { background: var(--ink); color: var(--paper); }
.projects-foot .btn--solid:hover { background: var(--glacier-deep); }
.btn--line { border-color: var(--line-light); color: var(--ink); background: transparent; }
.btn--line:hover { border-color: var(--ink); }

/* ---------- Torna su ---------- */
.to-top {
  position: fixed; z-index: 50;
  right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px));
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  background: var(--night); color: var(--ice); border: 1px solid rgba(205, 239, 246, .28);
  box-shadow: 0 8px 24px rgba(7, 16, 26, .28);
  opacity: 0; visibility: hidden; transform: translateY(10px);
  transition: opacity .25s, transform .25s, visibility .25s, border-color .2s, color .2s;
}
.to-top svg { width: 20px; height: 20px; }
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { border-color: var(--glacier); color: var(--paper); }

/* ---------- Testo lungo (privacy) ---------- */
.prose { max-width: 46em; color: var(--ink); }
.prose h2 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 600; letter-spacing: -.015em; margin: 2.2em 0 .6em; }
.prose h2:first-child { margin-top: 0; }
.prose p, .prose ul { color: var(--slate); margin: 0 0 1em; }
.prose ul { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--glacier-deep); text-underline-offset: 3px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose .updated { font-family: var(--mono); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--glacier-deep); }

/* ---------- Pagina Progetti ---------- */
.nav-links a[aria-current="page"] { color: var(--paper); }
.page-head { display: flex; flex-direction: column; gap: 22px; padding-block: clamp(32px, 6vw, 72px) clamp(56px, 8vw, 104px); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); line-height: 1.04; letter-spacing: -.035em; font-weight: 700; color: var(--paper); max-width: 15em; }
.page-head h1 em { font-style: normal; font-weight: 300; color: var(--glacier); }
.group + .group { margin-top: clamp(56px, 8vw, 104px); }
.group-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 24px; padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.group-head h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 600; letter-spacing: -.02em; }
.group-head .label { color: var(--glacier-deep); }

/* ---------- Contatti ---------- */
.contact { background: var(--night); }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(36px, 6vw, 88px); align-items: start; }
.contact-intro { display: flex; flex-direction: column; gap: 28px; }
.contact-intro p { color: var(--mist); max-width: 30em; }
.contact h2 { font-size: clamp(2.2rem, 4.6vw, 4rem); line-height: 1.03; letter-spacing: -.035em; font-weight: 700; color: var(--paper); max-width: 14em; }
.mail-alt { display: flex; flex-direction: column; gap: 12px; }
.mail-alt .label { color: var(--mist); }

/* Form di contatto */
.form {
  display: grid; gap: 18px;
  background: var(--night-2); border: 1px solid var(--line-dark); border-radius: 24px;
  padding: clamp(24px, 4vw, 40px);
}
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mist); }
.field label small { font-size: inherit; letter-spacing: inherit; text-transform: none; opacity: .75; }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--paper);
  background: var(--night); border: 1px solid rgba(205, 239, 246, .2); border-radius: 12px;
  padding: 12px 14px; width: 100%; transition: border-color .2s;
}
.field textarea { min-height: 150px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: rgba(205, 239, 246, .35); }
.field input:focus, .field textarea:focus { border-color: var(--glacier); outline: none; box-shadow: 0 0 0 3px rgba(92, 203, 224, .18); }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: .92rem; color: var(--mist); }
.check input { width: 18px; height: 18px; margin: 3px 0 0; flex: none; accent-color: var(--aurora); }
.check a { color: var(--ice); text-underline-offset: 3px; }
.form-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; }
.form-foot .btn[disabled] { opacity: .6; cursor: progress; transform: none; }
.form-status { font-size: .95rem; margin: 0; }
.form-status.is-ok { color: var(--aurora); }
.form-status.is-error { color: #FFB4A8; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact h2 em { font-style: normal; font-weight: 300; color: var(--glacier); }
.mail { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.mail code { font-family: var(--mono); font-size: clamp(1.05rem, 2.4vw, 1.5rem); color: var(--ice); overflow-wrap: anywhere; transition: color .2s; }
.mail-link { text-decoration: underline; text-decoration-color: var(--line-dark); text-underline-offset: 6px; transition: text-decoration-color .2s; }
.mail-link:hover { text-decoration-color: var(--glacier); }
.mail-link:hover code { color: var(--paper); }
.legal {
  margin-top: clamp(48px, 8vw, 96px); padding-block: 26px 34px; border-top: 1px solid var(--line-dark);
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 16px 32px;
  font-size: .85rem; color: var(--mist);
}
.legal-company { line-height: 1.5; }
.legal .brand svg { width: 26px; height: 26px; }
.legal .wordmark { font-size: .9rem; }
.legal a:not(.brand) { color: var(--mist); text-underline-offset: 3px; }
.legal a:not(.brand):hover { color: var(--paper); }
.todo { border-bottom: 1px dashed var(--glacier); color: var(--ice); }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .stage { max-width: 420px; order: -1; margin-bottom: -24px; }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split-head { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 28px; }
  .steps li:nth-child(odd) { padding-left: 0; }
  .myth-grid { grid-template-columns: minmax(0, 1fr); }
  .project { grid-template-columns: minmax(0, 1fr); }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: minmax(0, 1fr); }
}
.nav-toggle { display: none; }
@media (max-width: 760px) {
  .nav { flex-wrap: wrap; padding-block: 20px; gap: 12px; }
  .nav:not(.has-menu) .nav-links { width: 100%; flex-wrap: wrap; gap: 10px 20px; padding-top: 8px; border-top: 1px solid var(--line-dark); }
  .nav.has-menu .nav-toggle {
    display: inline-grid; place-items: center;
    width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
    background: transparent; color: var(--ice); border: 1px solid var(--line-dark);
    transition: border-color .2s, color .2s, background .2s;
  }
  .nav.has-menu .nav-toggle:hover,
  .nav.has-menu .nav-toggle[aria-expanded="true"] { border-color: var(--glacier); color: var(--paper); background: var(--night-2); }
  .nav.has-menu .nav-toggle svg { width: 20px; height: 20px; }
  .nav.has-menu .nav-toggle .i-close { display: none; }
  .nav.has-menu .nav-toggle[aria-expanded="true"] .i-open { display: none; }
  .nav.has-menu .nav-toggle[aria-expanded="true"] .i-close { display: block; }
  .nav.has-menu .nav-links {
    display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0;
    margin-top: 8px; padding: 10px 18px 18px;
    background: var(--night-2); border: 1px solid var(--line-dark); border-radius: 20px;
  }
  .nav.has-menu.is-open .nav-links { display: flex; }
  .nav.has-menu .nav-links a:not(.btn) {
    padding: 13px 2px; font-size: 1rem; color: var(--ice);
    border-bottom: 1px solid var(--line-dark);
  }
  .nav.has-menu .nav-links a:not(.btn):hover { color: var(--paper); }
  .nav.has-menu .nav-links .btn { margin-top: 14px; justify-content: center; padding: 12px 20px; font-size: .95rem; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts div, .facts div + div { padding: 18px 0; border-left: 0; }
  .facts div + div { border-top: 1px solid var(--line-dark); }
  .legal { flex-direction: column; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps li, .steps li + li { padding-left: 0; }
  .stage { max-width: 320px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .aurora i, .pulse { animation: none; }
  .offer, .btn, .to-top { transition: none; }
}
