/* The entrance: a full screen scene over the room until the viewer tunes in. */

#intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #030306;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.75s ease;
}
#intro.out { opacity: 0; pointer-events: none; }

#intro-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#intro-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

/* sized by intro.js to sit exactly on the big set's glass */
#intro-ui {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--sw, 60vw);
  height: var(--sh, 40vh);
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--sh, 40vh) * 0.05);
  text-align: center;
  font-family: 'Jersey 15', 'Archivo', sans-serif;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}
#intro-ui.show { opacity: 1; }
#intro.entering #intro-ui { transition: none; }

.in-title {
  font-size: calc(var(--sh, 40vh) * 0.16);
  letter-spacing: 0.08em;
  line-height: 1;
  color: #dfe6f2;
  white-space: nowrap;
  text-shadow: 0 0 0.35em rgba(150, 190, 255, 0.55);
}
.in-title span { color: #ffb54a; text-shadow: 0 0 0.35em rgba(255, 181, 74, 0.55); }

.in-sub {
  font-size: calc(var(--sh, 40vh) * 0.062);
  letter-spacing: 0.22em;
  color: #9fb4ff;
  white-space: nowrap;
}

#intro-enter {
  pointer-events: auto;
  margin-top: calc(var(--sh, 40vh) * 0.035);
  padding: 0.3em 1.1em 0.22em;
  font: inherit;
  font-size: calc(var(--sh, 40vh) * 0.09);
  letter-spacing: 0.2em;
  color: #46ff7c;
  background: rgba(0, 20, 8, 0.35);
  border: 2px solid rgba(70, 255, 124, 0.75);
  border-radius: 4px;
  text-shadow: 0 0 0.4em rgba(70, 255, 124, 0.8);
  box-shadow: 0 0 1.2em rgba(70, 255, 124, 0.25), inset 0 0 0.8em rgba(70, 255, 124, 0.15);
  cursor: pointer;
  animation: inglow 1.8s ease-in-out infinite;
}
@keyframes inglow {
  0%, 100% { box-shadow: 0 0 1.2em rgba(70, 255, 124, 0.25), inset 0 0 0.8em rgba(70, 255, 124, 0.15); }
  50% { box-shadow: 0 0 2em rgba(70, 255, 124, 0.45), inset 0 0 1.1em rgba(70, 255, 124, 0.25); }
}

.in-hint {
  font-family: 'Archivo', system-ui, sans-serif;
  font-weight: 700;
  font-size: max(9px, calc(var(--sh, 40vh) * 0.042));
  letter-spacing: 0.18em;
  color: rgba(210, 220, 240, 0.55);
  white-space: nowrap;
}

#intro-skip {
  position: absolute;
  right: calc(env(safe-area-inset-right, 0px) + 18px);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  padding: 8px 12px;
  border: 1px solid rgba(220, 225, 235, 0.25);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(220, 225, 235, 0.65);
  font: 700 12px 'Archivo', system-ui, sans-serif;
  letter-spacing: 0.16em;
  cursor: pointer;
}
#intro-skip:hover { color: #fff; border-color: rgba(255, 255, 255, 0.5); }

/* no WebGL2: a glowing card that still says the same thing */
#intro.nogl {
  background:
    radial-gradient(40% 45% at 50% 50%, rgba(80, 120, 255, 0.18), transparent 70%),
    linear-gradient(180deg, #06060c, #020204);
}
#intro.nogl #intro-ui { --sw: min(84vw, 640px); --sh: min(46vh, 380px); }

@media (prefers-reduced-motion: reduce) {
  #intro-enter { animation: none; }
}
