html.intro-lock,
html.intro-lock body {
  overflow: hidden;
}

html.skip-intro #site-intro,
html.skip-intro .site-intro {
  display: none !important;
}

/* Intro home — universo → stella → Welcome BiTeck nel cerchio */
.site-intro {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, #1a2740 0%, #050810 55%, #000 100%);
  color: #fff;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.55s ease;
}

.site-intro.is-done {
  opacity: 0;
  pointer-events: none;
}

/* Attesa click */
.site-intro.is-waiting .site-intro__planet,
.site-intro.is-waiting .site-intro__orb,
.site-intro.is-waiting .site-intro__bitino {
  animation: none !important;
  opacity: 0;
  pointer-events: none;
}

.site-intro.is-waiting .site-intro__skip {
  display: none;
}

.site-intro:not(.is-waiting) .site-intro__start {
  display: none;
}

.site-intro.is-playing .site-intro__planet {
  animation: intro-approach 1.35s cubic-bezier(0.22, 0.8, 0.28, 1) forwards;
}

.site-intro.is-playing .site-intro__orb {
  animation: intro-orb 1s ease 1.05s forwards;
}

.site-intro.is-playing .site-intro__core {
  animation: intro-reveal 0.75s ease 1.35s forwards;
}

.site-intro.is-playing .site-intro__bitino {
  animation: intro-bitino 0.7s ease 1.55s forwards;
}

.site-intro__start {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  padding: 0.85rem 1.6rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 28px rgba(180, 210, 255, 0.25);
  animation: intro-pulse 1.8s ease-in-out infinite;
}

.site-intro__start:hover {
  background: rgba(255, 255, 255, 0.18);
}

.site-intro__start-hint {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.75;
  text-transform: uppercase;
}

@keyframes intro-pulse {
  0%, 100% { box-shadow: 0 0 18px rgba(180, 210, 255, 0.2); }
  50% { box-shadow: 0 0 36px rgba(180, 210, 255, 0.45); }
}

.site-intro__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.9) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 44% 32%, rgba(255,255,255,.95) 50%, transparent 51%),
    radial-gradient(1px 1px at 61% 58%, rgba(255,255,255,.65) 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 22%, rgba(255,255,255,.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 86% 81%, rgba(255,255,255,.75) 50%, transparent 51%),
    radial-gradient(1px 1px at 8% 88%, rgba(255,255,255,.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 52% 8%, rgba(255,255,255,.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 33% 48%, rgba(255,255,255,.5) 50%, transparent 51%),
    radial-gradient(1px 1px at 70% 40%, rgba(255,255,255,.85) 50%, transparent 51%);
  opacity: 0.85;
  animation: intro-twinkle 2.4s ease-in-out infinite alternate;
}

.site-intro__planet {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffffff 0%, #e8f0ff 40%, #a8c4ff 75%, #6a8fd4 100%);
  box-shadow:
    0 0 12px 4px rgba(255, 255, 255, 0.85),
    0 0 40px 12px rgba(180, 210, 255, 0.45);
  transform: translate(42vw, -28vh) scale(0.35);
  opacity: 0.4;
  z-index: 1;
}

/* Cerchio + Bitino in colonna (sempre visibile anche su smartphone) */
.site-intro__stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(420px, 88vw);
  max-height: min(92vh, 720px);
}

.site-intro__orb {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 1;
  height: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: clamp(1rem, 3.5vw, 2rem);
  background:
    radial-gradient(circle at 40% 32%, rgba(255, 255, 255, 0.55) 0%, rgba(220, 235, 255, 0.28) 35%, rgba(120, 160, 220, 0.12) 65%, rgba(20, 35, 60, 0.35) 100%);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 0 1px rgba(180, 210, 255, 0.35),
    0 0 40px 12px rgba(180, 210, 255, 0.45),
    0 0 90px 28px rgba(120, 160, 230, 0.28),
    inset 0 0 40px rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: scale(0.35);
}

/* Bitino: ~1/3 della stella, appena sopra come in atterraggio */
.site-intro__bitino {
  position: relative;
  z-index: 3;
  width: 33%;
  max-width: 140px;
  height: auto;
  margin: 0 0 -0.35rem;
  opacity: 0;
  transform: translateY(-18px) scale(0.88);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 16px rgba(255, 140, 40, 0.35));
  pointer-events: none;
}

.site-intro__core {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 88%;
  text-align: center;
  opacity: 0;
  transform: scale(0.85);
}

.site-intro__logo {
  width: min(140px, 38%);
  height: auto;
  margin: 0 auto 0.85rem;
  display: block;
  filter: brightness(1.12) drop-shadow(0 0 14px rgba(255, 255, 255, 0.5));
  background: rgba(255, 255, 255, 0.94);
  border-radius: 12px;
  padding: 0.45rem 0.65rem;
}

.site-intro__title {
  margin: 0;
  font-family: "Segoe UI", Candara, sans-serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 3.2vw, 1.65rem);
  letter-spacing: 0.04em;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 0 16px rgba(255, 255, 255, 0.55), 0 1px 2px rgba(0, 0, 0, 0.35);
}

.site-intro__tag {
  margin: 0.45rem 0 0;
  font-size: clamp(0.8rem, 2vw, 1rem);
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.95);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.35), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.site-intro__skip {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
}

.site-intro__skip:hover {
  background: rgba(255, 255, 255, 0.15);
}

@keyframes intro-approach {
  0% {
    transform: translate(42vw, -28vh) scale(0.25);
    opacity: 0.25;
  }
  70% {
    opacity: 1;
  }
  100% {
    transform: translate(0, 0) scale(3.2);
    opacity: 0;
  }
}

@keyframes intro-orb {
  0% {
    opacity: 0;
    transform: scale(0.35);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes intro-reveal {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes intro-bitino {
  from {
    opacity: 0;
    transform: translateY(-36px) scale(0.82);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes intro-twinkle {
  from { opacity: 0.55; }
  to { opacity: 0.95; }
}

@media (prefers-reduced-motion: reduce) {
  .site-intro__planet { display: none; }
  .site-intro__stars { animation: none; }
  .site-intro.is-playing .site-intro__orb,
  .site-intro.is-playing .site-intro__core,
  .site-intro.is-playing .site-intro__bitino {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {
  .site-intro__stage {
    width: min(300px, 86vw);
    max-height: 88vh;
  }

  .site-intro__bitino {
    width: 30%;
    max-width: 96px;
    margin-bottom: -0.25rem;
  }

  .site-intro__orb {
    padding: 0.85rem;
  }

  .site-intro__logo {
    width: min(100px, 34%);
    margin-bottom: 0.45rem;
    padding: 0.35rem 0.5rem;
  }

  .site-intro__title {
    font-size: clamp(0.95rem, 4vw, 1.25rem);
  }

  .site-intro__tag {
    font-size: clamp(0.72rem, 3vw, 0.9rem);
  }
}

@media (max-width: 420px) {
  .site-intro__stage {
    width: min(280px, 88vw);
  }

  .site-intro__bitino {
    width: 28%;
    max-width: 84px;
  }
}
