/*
 * Neon spiral-vortex landing page.
 * Dark terminal (tmux-like) background; a fluorescent-green + purple spiral
 * funnels inward to the avatar at the center. Vortex itself is drawn on the
 * canvas (main.js); this file styles the page chrome and the center avatar.
 */

:root {
  --porthole-size: min(38vmin, 260px);
  --green: #39ff14;
  --purple: #b14dff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  /* Dark terminal background (tmux-style), faint center lift so the funnel
     bottom isn't pure flat black. */
  background:
    radial-gradient(circle at 50% 50%, #15151f 0%, #0b0b12 55%, #070709 100%);
  color: #e8e8ff;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

/* Canvas (the spiral vortex) sits behind all content, covering the viewport. */
#space {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: block;
}

/* Centering layer for the avatar. */
.stage {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  place-items: center;
}

/* Gentle bob so the figure feels suspended at the bottom of the funnel. */
.porthole {
  position: relative;
  z-index: 1;
  height: var(--porthole-size);
  width: auto;
  animation: float 7s ease-in-out infinite;
}

/* The figure shown in its natural (cut-out) shape — no circle clip. A neon
   drop-shadow traces john's silhouette (drop-shadow respects transparency). */
.porthole__avatar {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
  filter:
    drop-shadow(0 0 8px rgba(57, 255, 20, 0.75))
    drop-shadow(0 0 18px rgba(177, 77, 255, 0.55));
}

/* Hide the system arrow on real pointers — the neon dot is the cursor. */
@media (pointer: fine) {
  body {
    cursor: none;
  }
}

/* Glowing neon-green dot that tracks the cursor exactly. */
.cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle, #f3e6ff 0%, var(--purple) 45%, transparent 75%);
  box-shadow:
    0 0 10px 2px rgba(177, 77, 255, 0.95),
    0 0 22px 7px rgba(177, 77, 255, 0.5);
  animation: pulse 1.8s ease-in-out infinite;
}

/* fumi pet that orbits the cursor (moved via transform in main.js). */
.cursor-pet {
  position: fixed;
  top: 0;
  left: 0;
  width: min(11vmin, 84px);
  height: auto;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  will-change: transform;
  filter: drop-shadow(0 0 6px rgba(177, 77, 255, 0.7));
}

/* Neon version pill in the bottom-right corner. */
.version {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 3;
  padding: 4px 13px;
  border-radius: 999px;
  background: rgba(10, 12, 10, 0.7);
  border: 1px solid rgba(57, 255, 20, 0.6);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.4);
  user-select: none;
  pointer-events: none;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(-7px);
  }
  50% {
    transform: translateY(7px);
  }
}

@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 0 10px 2px rgba(177, 77, 255, 0.95),
      0 0 22px 7px rgba(177, 77, 255, 0.5);
  }
  50% {
    box-shadow:
      0 0 14px 4px rgba(177, 77, 255, 1),
      0 0 30px 10px rgba(177, 77, 255, 0.65);
  }
}

/* Honor reduced-motion: stop the avatar bob + dot pulse (canvas handled in JS). */
@media (prefers-reduced-motion: reduce) {
  .porthole,
  .cursor-dot {
    animation: none;
  }
}
