/* ═══════════════════════════════════════════════════════════════
   Perihelion X — Entry Screen
   ═══════════════════════════════════════════════════════════════ */

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg);
  color: var(--white);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Canvas ──────────────────────────────────────────────────── */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
  pointer-events: none;
}

/* ── Vignette ────────────────────────────────────────────────── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(4, 4, 10, 0.55) 70%,
    rgba(2, 2, 8, 0.88) 100%
  );
}

/* ── Flash overlay ───────────────────────────────────────────── */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

/* ── Entry content ───────────────────────────────────────────── */
.entry-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  text-align: center;
  padding: 2rem;
  gap: 0;
}

/* ── Title ───────────────────────────────────────────────────── */
.entry-title {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--white);
  text-transform: uppercase;
  line-height: 1;
  opacity: 0;
  transform: translateY(20px);

  /* Subtle text glow */
  text-shadow:
    0 0 40px rgba(255, 255, 255, 0.12),
    0 0 80px rgba(255, 255, 255, 0.06);
}

/* ── Tagline ─────────────────────────────────────────────────── */
.entry-tagline {
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--white);
  opacity: 0;
  transform: translateY(16px);
  margin-top: 1.25rem;
  max-width: 480px;
  line-height: 1.6;
}

/* ── CTA Button ──────────────────────────────────────────────── */
.entry-begin {
  margin-top: 3rem;
  padding: 0.85rem 3rem;
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--white);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.7);
  cursor: pointer;
  opacity: 0;
  transform: translateY(14px);
  transition:
    background-color 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  outline-offset: 4px;
}

.entry-begin:hover {
  background-color: var(--white);
  color: var(--bg);
  border-color: var(--white);
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.15);
}

.entry-begin:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 6px;
}

.entry-begin:active {
  transform: translateY(1px);
}

/* ── Footer credits ─────────────────────────────────────────── */
.entry-footer {
  position: fixed;
  bottom: 1.75rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
}

.entry-footer.visible,
.entry-footer[style*="opacity: 1"] {
  pointer-events: auto;
}

.entry-footer-link {
  font-size: 0.6rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  text-decoration: none;
  transition: color 0.2s ease;
}

.entry-footer-link:hover {
  color: rgba(255, 255, 255, 0.7);
}

.entry-footer-sep {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.15);
}

/* ── Sound note ──────────────────────────────────────────────── */
.entry-sound-note {
  margin-top: 1.5rem;
  font-size: 0.65rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.8);
  opacity: 0;
  max-width: 340px;
  line-height: 1.6;
  text-align: center;
}

/* ── Mute toggle ─────────────────────────────────────────────── */
.mute-toggle {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  right: auto;
  z-index: 50;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  transition:
    color 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.mute-toggle:hover {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
  background-color: rgba(255, 255, 255, 0.05);
}

.mute-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 4px;
}

.mute-icon {
  width: 18px;
  height: 18px;
  position: absolute;
  transition: opacity 0.2s ease;
}

.mute-icon.mute-off {
  opacity: 0;
}

.mute-toggle[aria-pressed="true"] .mute-icon.mute-on  { opacity: 0; }
.mute-toggle[aria-pressed="true"] .mute-icon.mute-off { opacity: 1; }

/* ── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .entry-title,
  .entry-tagline,
  .entry-begin {
    transition: none;
    animation: none;
  }

  /* Skip the parallax animation entirely — stars still render, no movement */
  #starfield {
    --parallax-disabled: true;
  }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .entry-title {
    font-size: clamp(1.4rem, 7vw, 2.25rem);
    letter-spacing: 0.15em;
    white-space: nowrap;
  }

  .entry-tagline {
    font-size: 0.8rem;
  }

  .entry-begin {
    padding: 0.8rem 2.25rem;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
  }
}
