@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/orbitron.woff2") format("woff2");
}

:root {
  --black: #020409;
  --land: #030611;
  --navy: #071a3a;
  --blue: #1f6cff;
  --electric: #4aa3ff;
  --ice: #a9dcff;
  --white: #eaf6ff;
  --name-size: clamp(2.3rem, 11vw, 8rem);
  --role-size: clamp(0.72rem, 2.6vw, 1.6rem);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--black);
  color: var(--ice);
  font-family: "Orbitron", "Segoe UI", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#map {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}
#map.ready { opacity: 1; }

/* ---------- hero ---------- */
.hero {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 4vw;
  pointer-events: none;
  z-index: 2;
  transform: translateZ(0); /* livello proprio: le lettere non ridipingono il canvas */
}
.hero::before {
  /* pozza scura dietro il testo per la leggibilità */
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: min(120vw, 1200px);
  height: min(60vh, 520px);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center,
    rgba(2, 4, 9, 0.88) 0%,
    rgba(2, 4, 9, 0.6) 40%,
    rgba(2, 4, 9, 0) 72%);
  z-index: -1;
}

.name {
  margin: 0;
  font-size: var(--name-size);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.08em;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 0.45em;
}
.role {
  margin: 0.7em 0 0;
  font-size: var(--role-size);
  font-weight: 400;
  letter-spacing: 0.48em;
  padding-left: 0.48em; /* compensa l'ultimo letter-spacing per centrare */
}
.w { white-space: nowrap; }

/* singola lettera */
.l {
  display: inline-block;
  color: rgba(70, 120, 200, 0.28);
  -webkit-text-stroke: 1px rgba(90, 160, 255, 0.45);
  transition: color 0.35s ease, text-shadow 0.45s ease, -webkit-text-stroke-color 0.35s ease;
}
.role .l { -webkit-text-stroke-width: 0.5px; }
.l.sp { width: 0.5em; }

.l.on {
  color: var(--white);
  -webkit-text-stroke-color: rgba(233, 246, 255, 0.9);
  text-shadow:
    0 0 6px var(--ice),
    0 0 22px var(--electric);
  transition-duration: 0.06s;
}
.l.half {
  color: rgba(150, 200, 255, 0.75);
  text-shadow: 0 0 8px rgba(74, 163, 255, 0.55), 0 0 22px rgba(31, 108, 255, 0.35);
}

/* ---------- HUD ---------- */
.hud {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem calc(0.9rem + env(safe-area-inset-left)) calc(0.75rem + env(safe-area-inset-bottom)) calc(0.9rem + env(safe-area-inset-right));
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: rgba(120, 170, 235, 0.55);
  z-index: 3;
}
.hud a {
  color: rgba(150, 195, 255, 0.75);
  text-decoration: none;
  pointer-events: auto;
}
.hud a:focus-visible { outline: 1px solid var(--electric); outline-offset: 3px; }

@media (max-width: 480px) {
  .hud { font-size: 0.5rem; letter-spacing: 0.1em; flex-direction: column; gap: 0.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  #map { transition: none; }
  .l { transition: none; }
}
