:root {
  --bg: #072033;
  --bg-2: #0b3a58;
  --text: #f3f8fc;
  --muted: #9ec4dc;
  --line: rgba(186, 230, 253, 0.28);
  --glass: rgba(186, 230, 253, 0.1);
  --glass-2: rgba(224, 242, 254, 0.16);
  --azure: #38bdf8;
  --azure-2: #7dd3fc;
  --cta: #38bdf8;
  --cta-ink: #072033;
  --hover: rgba(56, 189, 248, 0.14);
  --shadow: 0 20px 40px -20px rgba(2, 40, 72, 0.55);
  --ring: #38bdf8;
}

[data-theme="light"] {
  --bg: #eaf5fd;
  --bg-2: #cfe8fa;
  --text: #0a3656;
  --muted: #215a7d;
  --line: rgba(2, 99, 163, 0.18);
  --glass: rgba(255, 255, 255, 0.55);
  --glass-2: rgba(255, 255, 255, 0.78);
  --azure: #0278bd;
  --azure-2: #0369a1;
  --cta: #0278bd;
  --cta-ink: #f7fbff;
  --hover: rgba(2, 120, 189, 0.1);
  --shadow: 0 16px 32px -18px rgba(14, 116, 176, 0.28);
  --ring: #0278bd;
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
}

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  overflow-x: hidden;
}

body.menu-open {
  overflow: hidden;
}

font {
  font: inherit !important;
  color: inherit !important;
  vertical-align: baseline !important;
  line-height: inherit !important;
}

.gt-host {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.skiptranslate,
.goog-te-banner-frame,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
iframe.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}

body {
  top: 0 !important;
  position: static !important;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
}

select {
  cursor: pointer;
}

h1,
h2,
h3,
p,
dl {
  margin: 0;
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -48px;
  z-index: 60;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--glass-2);
}

.skip-link:focus {
  top: 16px;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(56, 189, 248, 0.28), transparent 60%),
    radial-gradient(720px 480px at 92% 8%, rgba(14, 165, 233, 0.22), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 48%, var(--bg) 100%);
}

[data-theme="light"] .bg {
  background:
    radial-gradient(900px 520px at 12% -8%, rgba(56, 189, 248, 0.22), transparent 60%),
    radial-gradient(720px 480px at 92% 8%, rgba(125, 211, 252, 0.35), transparent 58%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 48%, var(--bg) 100%);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin-inline: auto;
}

.site-header,
main,
footer {
  position: relative;
  z-index: 1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 16px 0;
}

.glass {
  background: linear-gradient(165deg, var(--glass-2), var(--glass));
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  white-space: nowrap;
}

.mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8, #0369a1);
}

.mark svg {
  display: block;
  width: 32px;
  height: 32px;
  padding: 7px;
}

.links {
  display: flex;
  gap: 8px;
}

.links a,
.drawer-card a:not(.btn) {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
}

.links a:hover,
.drawer-card a:not(.btn):hover {
  color: var(--text);
  background: var(--hover);
}

.tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
}

.lang:hover {
  background: var(--hover);
}

.lang select {
  min-width: 52px;
  min-height: 44px;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--hover);
}

.icon-btn:active,
.btn:active {
  transform: scale(0.97);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.icon-moon,
.icon-close,
.menu-btn {
  display: none;
}

[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.menu-btn[aria-expanded="true"] .icon-menu { display: none; }
.menu-btn[aria-expanded="true"] .icon-close { display: block; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  background: var(--cta);
  color: var(--cta-ink);
  cursor: pointer;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
  filter: none;
}

.btn.ghost:hover {
  background: var(--hover);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 88px 16px 16px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(16px);
}

.drawer-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 24px;
}

.hero {
  padding: 48px 0 64px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 32px;
  padding: 8px;
  border-radius: 24px;
}

.stats div {
  padding: 16px;
}

.stats div:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.stats div:nth-child(n+3) {
  border-top: 1px solid var(--line);
}

h1,
h2 {
  font-family: Outfit, sans-serif;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

h1 {
  max-width: 18ch;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 1.12;
}

h1 em,
h2 em {
  font-style: normal;
  color: var(--azure);
}

h2 {
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.15;
}

.lede {
  max-width: 62ch;
  margin-top: 16px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  text-wrap: pretty;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.stats dt {
  font-family: Outfit, sans-serif;
  font-weight: 700;
}

.stats dd {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

section {
  padding: 64px 0;
  scroll-margin-top: 88px;
}

.kicker {
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--azure-2);
}

.grid {
  display: grid;
  gap: 16px;
  margin-top: 32px;
}
.three { grid-template-columns: 1fr 1fr 1fr; }

.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 24px;
  border-radius: 24px;
}

.card:hover {
  transform: translateY(-2px);
}

.ico {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--azure);
  background: var(--hover);
}

.ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h3 {
  font-family: Outfit, sans-serif;
  font-size: 20px;
  font-weight: 700;
}

.card p {
  margin-top: 8px;
  color: var(--muted);
}

.tag {
  margin-bottom: 8px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
  color: var(--azure-2);
}

footer {
  padding: 32px 0 48px;
}

.foot {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  padding: 32px;
  border-radius: 24px;
}

.foot-brand p {
  max-width: 360px;
  margin-top: 16px;
  color: var(--muted);
}

.social {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.social a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.social a:hover {
  color: var(--text);
  background: var(--hover);
}

.foot-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.foot-cols h4 {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foot-cols a {
  display: flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
}

.foot-cols a:hover {
  color: var(--text);
}

.foot-end {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  grid-column: 1 / -1;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 900px) {
  .links,
  .nav-cta {
    display: none;
  }

  .menu-btn {
    display: inline-flex;
  }


  .stats,
  .three,
  .foot,
  .foot-cols,
  .foot-end {
    grid-template-columns: 1fr;
    display: grid;
  }

  .stats div:nth-child(odd),
  .stats div:nth-child(n+3) {
    border: 0;
  }

  .stats div + div {
    border-top: 1px solid var(--line);
  }

  h1 {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== 3D viewer (additive: reuses the existing glass / btn / icon-btn look) ===== */
.viewer {
  position: relative;
  height: min(72vh, 680px);
  min-height: 360px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: 24px;
  /* fondale: centro luminoso, angoli profondi -> il modello stacca sempre */
  background:
    radial-gradient(130% 100% at 50% 35%, rgba(56, 189, 248, 0.16) 0%, rgba(56, 189, 248, 0.04) 45%, rgba(2, 20, 40, 0.38) 100%),
    linear-gradient(165deg, var(--glass-2), var(--glass));
}

[data-theme="light"] .viewer {
  background:
    radial-gradient(130% 100% at 50% 35%, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.1) 45%, rgba(3, 105, 161, 0.24) 100%),
    linear-gradient(165deg, var(--glass-2), var(--glass));
}

.viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.v-tools {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: calc(100% - 24px);
  padding: 4px;
  border-radius: 999px;
}

.v-tools .icon-btn[aria-pressed="true"] {
  background: var(--cta);
  color: var(--cta-ink);
}

.v-hint {
  position: absolute;
  right: 16px;
  bottom: 18px;
  margin: 0;
  color: var(--muted);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 12px;
}

.v-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  pointer-events: none;
}

.v-status strong {
  font-family: Outfit, sans-serif;
  font-size: 20px;
  color: var(--text);
}

.v-bar {
  width: 160px;
  height: 4px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--line);
}

.v-bar i {
  display: block;
  width: 0;
  height: 100%;
  background: var(--azure);
}

.v-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

@media (max-width: 900px) {
  .v-hint { display: none; }
}
