:root {
  --bg: #030109;
  --bg-deep: #090114;
  --magenta: #ff5ce7;
  --violet: #9948ff;
  --blue: #68bfff;
  --gold: #ffb770;
  --white: #fff7ff;
  --line: rgba(255, 255, 255, 0.18);
  --glass: rgba(14, 8, 27, 0.2);
  --shadow: 0 0 120px rgba(192, 93, 255, 0.4);
  --frame-width: min(70vw, 880px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  background: linear-gradient(180deg, #020107 0%, #04010d 45%, #020107 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::after {
  background:
    radial-gradient(circle at center, transparent 30%, rgba(2, 1, 7, 0.66) 84%),
    linear-gradient(180deg, rgba(2, 1, 7, 0.22) 0%, rgba(2, 1, 7, 0.46) 100%);
}

.scene {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
}

.background-photo-shell {
  position: fixed;
  inset: 0;
  z-index: -3;
  display: grid;
  place-items: center;
}

.background-photo-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(5, 2, 13, 0.14) 0%, rgba(5, 2, 13, 0.76) 78%),
    linear-gradient(180deg, rgba(2, 1, 7, 0.34) 0%, rgba(2, 1, 7, 0.62) 100%);
}

.background-photo {
  width: var(--frame-width);
  max-width: none;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  opacity: 0.86;
  filter: saturate(1.06) contrast(1.04);
}

.top-hud {
  position: fixed;
  top: clamp(2.8rem, 7vh, 5.4rem);
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
}

.hud-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  flex-wrap: wrap;
  pointer-events: auto;
}

.portal {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.portal-stage {
  position: relative;
  width: var(--frame-width);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.figure-link {
  display: block;
  width: 100%;
  text-decoration: none;
  cursor: pointer;
}

.figure-shell {
  position: relative;
  width: 100%;
  transition:
    opacity 1100ms ease,
    transform 1600ms cubic-bezier(0.2, 0.8, 0.16, 1),
    filter 1400ms ease;
  filter:
    drop-shadow(0 0 24px rgba(255, 92, 231, 0.6))
    drop-shadow(0 0 90px rgba(153, 72, 255, 0.38));
}

.figure-link:hover .figure-shell,
.figure-link:focus-visible .figure-shell {
  filter:
    drop-shadow(0 0 30px rgba(255, 92, 231, 0.75))
    drop-shadow(0 0 120px rgba(153, 72, 255, 0.5));
}

.figure-shell::before,
.figure-shell::after {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  pointer-events: none;
}

.figure-shell::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.24) 0%, transparent 54%);
  filter: blur(40px);
}

.figure-shell::after {
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.95) 0 1px, transparent 1.5px),
    radial-gradient(circle at 30% 60%, rgba(104, 191, 255, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 30%, rgba(255, 92, 231, 0.8) 0 1px, transparent 1.6px);
  background-size: 14px 14px, 24px 24px, 20px 20px;
  opacity: 0;
  transform: scale(0.86);
  transition:
    opacity 1000ms ease,
    transform 1600ms ease;
}

.figure-video {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  object-fit: cover;
  mask-image: radial-gradient(circle at center, black 52%, transparent 94%);
  -webkit-mask-image: radial-gradient(circle at center, black 52%, transparent 94%);
}

.sigil {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 4.2rem;
  min-height: 4.2rem;
  padding: 0.9rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.32), transparent 30%),
    rgba(7, 3, 18, 0.56);
  backdrop-filter: blur(16px);
  color: var(--white);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition:
    transform 260ms ease,
    box-shadow 260ms ease;
  pointer-events: auto;
}

.sigil span {
  font: 700 clamp(1rem, 2.4vw, 1.35rem) / 1 sans-serif;
  letter-spacing: 0.08em;
}

.sigil:hover,
.sigil:focus-visible {
  box-shadow: 0 0 150px rgba(255, 92, 231, 0.58);
  outline: none;
}

.sigil-ca {
  cursor: pointer;
}

.ca-readout {
  position: absolute;
  left: 50%;
  bottom: -2.8rem;
  width: min(78vw, 920px);
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1rem;
  background: rgba(7, 3, 18, 0.52);
  backdrop-filter: blur(18px);
  box-shadow: 0 0 80px rgba(153, 72, 255, 0.24);
  color: rgba(255, 247, 255, 0.94);
  font: 600 clamp(0.76rem, 1.6vw, 1rem) / 1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  user-select: text;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease,
    background-color 220ms ease,
    opacity 700ms ease,
    transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}

.ca-readout.is-copied {
  border-color: rgba(255, 255, 255, 0.38);
  background: rgba(28, 10, 44, 0.82);
  box-shadow:
    0 0 120px rgba(255, 92, 231, 0.34),
    0 0 36px rgba(104, 191, 255, 0.24);
  transform: translateX(-50%) scale(1.018);
}

@media (max-width: 860px) {
  :root {
    --frame-width: min(84vw, 680px);
  }

  .portal-stage {
    aspect-ratio: 1 / 1;
  }

  .top-hud {
    top: clamp(2rem, 5vh, 3.8rem);
  }

  .ca-readout {
    bottom: -4.6rem;
    width: min(90vw, 680px);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
  }
}
