:root {
  --ink: #0a0a0a;
  --blood: #e10600;
  --green: #70e236; /* verde del logo sui pantaloncini, schiarito per leggersi sul nero */
  --bone: #f3ece0;
  --bone-rgb: 243, 236, 224;
  --ink-rgb: 10, 10, 10;
  --ease: cubic-bezier(0.165, 0.84, 0.44, 1);
  --display: 'Anton', 'Bebas Neue', Impact, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html,
body {
  background: var(--ink);
  color: var(--bone);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

::selection {
  background: var(--blood);
  color: #fff;
}

ul {
  list-style: none;
}

/* Mentre la pagina si prepara il contenuto resta nascosto (l'animazione d'ingresso lo mostra) */
.is-loading [data-intro] {
  visibility: hidden;
}

/* ─── Scena ─────────────────────────────────────────────── */
.page {
  position: relative;
  height: 100svh;
  min-height: 600px;
  width: 100%;
  overflow: hidden;
}

.scene-fallback,
.layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.scene-fallback {
  display: none;
  object-fit: cover;
  object-position: 38% 50%;
  user-select: none;
}

.no-webgl .scene-fallback {
  display: block;
}

.layer {
  display: block;
  pointer-events: none;
}

/* ordine dei livelli: sfondo → ombra alta → nome → fighter → ombra bassa → interfaccia */
.layer--bg {
  z-index: 0;
}
.shade--top {
  z-index: 1;
}
.title {
  z-index: 2;
}
.layer--fg {
  z-index: 3;
}
.shade--bottom {
  z-index: 4;
}

.shade {
  position: absolute;
  inset-inline: 0;
  pointer-events: none;
}

.shade--top {
  top: 0;
  height: 33%;
  background: linear-gradient(to bottom, rgba(var(--ink-rgb), 0.8), transparent);
}

.shade--bottom {
  bottom: 0;
  height: 66%;
  background: linear-gradient(to top, var(--ink), rgba(var(--ink-rgb), 0.6) 50%, transparent);
}

/* ─── Contenuto ─────────────────────────────────────────── */
.content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: max(1.5rem, env(safe-area-inset-top)) 20px max(2rem, env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: var(--green);
}

.hint {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(var(--bone-rgb), 0.5);
}

.gyro-btn {
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--bone);
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(var(--bone-rgb), 0.3);
  background: rgba(var(--ink-rgb), 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}

.bottom {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

/* il nome sta TRA lo sfondo e i fighter: i fighter gli passano davanti */
.title {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 16svh;
  pointer-events: none;
}

.name {
  font-family: var(--display);
  font-weight: 400;
  font-size: 26vw;
  line-height: 0.85;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  color: var(--bone);
  margin-left: -0.04em;
}

.tagline {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  color: rgba(var(--bone-rgb), 0.7);
}

.tagline span {
  color: var(--green);
}

/* ─── Link ──────────────────────────────────────────────── */
.links {
  width: 100%;
}

.links ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  overflow: hidden;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(var(--bone-rgb), 0.15);
  background: rgba(var(--ink-rgb), 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--bone);
  text-decoration: none;
  transition: border-color 0.3s, color 0.3s;
  -webkit-tap-highlight-color: transparent;
}

/* riempimento verde che entra da sinistra; testo e icone diventano neri */
.link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--green);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease);
}

.link > * {
  position: relative;
}

.link svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.link__icon {
  width: 22px;
  height: 22px;
  color: var(--green);
  transition: color 0.3s;
}

.link__text {
  flex: 1;
  min-width: 0;
}

.link__title {
  display: block;
  font-family: var(--display);
  font-size: 20px;
  line-height: 1;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.link__desc {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(var(--bone-rgb), 0.55);
  transition: color 0.3s;
}

.link__arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.3s, color 0.3s;
}

.link:focus-visible {
  outline: none;
}

.link:focus-visible,
.link:active {
  border-color: var(--green);
  color: var(--ink);
}

.link:focus-visible::before,
.link:active::before {
  transform: scaleX(1);
}

.link:focus-visible .link__icon,
.link:active .link__icon {
  color: var(--ink);
}

.link:focus-visible .link__desc,
.link:active .link__desc {
  color: rgba(var(--ink-rgb), 0.7);
}

@media (hover: hover) {
  .link:hover {
    border-color: var(--green);
    color: var(--ink);
  }
  .link:hover::before {
    transform: scaleX(1);
  }
  .link:hover .link__icon {
    color: var(--ink);
  }
  .link:hover .link__desc {
    color: rgba(var(--ink-rgb), 0.7);
  }
  .link:hover .link__arrow {
    transform: translate(2px, -2px);
  }
}

.copyright {
  margin-top: 24px;
  text-align: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  color: rgba(var(--bone-rgb), 0.35);
}

/* ─── Effetti ───────────────────────────────────────────── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.07;
  mix-blend-mode: overlay;
  background-size: 256px 256px;
}

.sparks {
  position: fixed;
  inset: 0;
  z-index: 95;
  pointer-events: none;
}

/* ─── Desktop ───────────────────────────────────────────── */
@media (min-width: 768px) {
  .content {
    padding: 40px 40px 48px;
  }
  .shade--bottom {
    height: 50%;
    background: linear-gradient(to top, var(--ink), rgba(var(--ink-rgb), 0.4) 50%, transparent);
  }
  .bottom {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
  }
  .title {
    left: 40px;
    top: 11%;
  }
  .name {
    font-size: min(16vw, 17rem);
  }
  .links {
    max-width: 24rem;
  }
  .copyright {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  .link::before,
  .link__arrow,
  .link__icon {
    transition: none;
  }
}
