:root {
  --bg: #05050c;
  --orb-size: clamp(240px, 48vmin, 580px);
  --edge: clamp(16px, 3vmin, 34px);   /* inset for frame + top bar */
  --line: rgba(214, 206, 255, 0.16);  /* hairline color */
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg);
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  color: #fff;
  font-family: 'Marcellus', 'Times New Roman', serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.stage {
  position: fixed; inset: 0;
  height: 100svh; height: 100dvh;
  display: grid; place-items: center;
  overflow: hidden;
}

/* Generated nebula haze. */
.haze {
  position: absolute; inset: -10%; z-index: 0;
  background:
    radial-gradient(38% 46% at 64% 42%, rgba(122, 78, 220, 0.30), transparent 70%),
    radial-gradient(46% 40% at 30% 64%, rgba(54, 86, 200, 0.22), transparent 72%),
    radial-gradient(34% 34% at 78% 74%, rgba(150, 70, 200, 0.16), transparent 70%),
    radial-gradient(60% 60% at 50% 36%, rgba(40, 30, 90, 0.30), transparent 75%),
    radial-gradient(120% 120% at 50% 50%, #0a0716 0%, #060410 55%, #030206 100%);
  filter: saturate(1.05);
  will-change: transform, opacity;
  animation: haze-drift 42s ease-in-out infinite alternate;
}
@keyframes haze-drift {
  0%   { transform: translate3d(-1.2%, -0.8%, 0) scale(1.02); opacity: 0.92; }
  100% { transform: translate3d(1.2%, 0.8%, 0)  scale(1.06); opacity: 1; }
}

.stars { position: absolute; inset: 0; z-index: 1; display: block; width: 100%; height: 100%; }

.vignette {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: radial-gradient(125% 105% at 50% 47%,
    rgba(5,5,12,0) 36%, rgba(5,5,12,0.38) 75%, rgba(5,5,12,0.85) 100%);
}

.centerpiece {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  will-change: transform;
  transform: translateY(-2vh);
}

/* Soft ambient glow behind the orb — adds presence and fills the center. */
.centerpiece::before {
  content: "";
  position: absolute;
  width: 150%; aspect-ratio: 1;
  top: 38%; left: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle,
    rgba(120, 110, 255, 0.16) 0%,
    rgba(90, 120, 255, 0.07) 32%,
    transparent 62%);
  pointer-events: none;
  z-index: -1;
  animation: halo 8s ease-in-out 1.8s infinite;
}
@keyframes halo {
  0%, 100% { opacity: 0.75; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1;    transform: translate(-50%, -50%) scale(1.06); }
}

.orb {
  width: var(--orb-size); height: var(--orb-size);
  object-fit: contain; user-select: none;
  filter: drop-shadow(0 0 70px rgba(120, 110, 255, 0.45)) drop-shadow(0 0 140px rgba(90, 130, 255, 0.22));
  animation: orb-in 1.8s cubic-bezier(0.22, 1, 0.36, 1) both, breathe 8s ease-in-out 1.8s infinite;
}
@keyframes orb-in { 0% { opacity: 0; transform: translateY(3%) scale(0.86); } 100% { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes breathe { 0%,100% { transform: translateY(0) scale(1); opacity: 0.97; } 50% { transform: translateY(-1.2%) scale(1.035); opacity: 1; } }

/* Orb is clickable — sprays light particles (see starfield.js). */
.orb { cursor: pointer; }
.ardent-spark {
  position: fixed;
  width: 6px; height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 6;
  will-change: transform, opacity;
}

/* === Wordmark: classical roman caps (variant C) === */
.wordmark {
  margin-top: clamp(0rem, 1.5vmin, 1rem);
  font-weight: 400;
  font-size: clamp(2rem, 7.5vmin, 4.25rem);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  color: rgba(255, 255, 255, 0.93);
  text-shadow: 0 0 26px rgba(150, 150, 255, 0.32);
  line-height: 1;
  animation: word-in 2.2s cubic-bezier(0.22, 1, 0.36, 1) 0.7s both;
}
@keyframes word-in {
  0%   { opacity: 0; letter-spacing: 0.42em; text-indent: 0.42em; transform: translateY(8px); }
  100% { opacity: 1; letter-spacing: 0.16em; text-indent: 0.16em; transform: translateY(0); }
}

/* === Inset frame + corner reticle ticks === */
.frame {
  position: absolute;
  inset: var(--edge);
  z-index: 4;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 3px;
  animation: chrome-in 2s ease 1s both;
}
.tick { position: absolute; width: 12px; height: 12px; }
.tick::before, .tick::after {
  content: ""; position: absolute; background: rgba(224, 216, 255, 0.5);
}
.tick::before { width: 12px; height: 1px; top: 0; }   /* horizontal arm */
.tick::after  { width: 1px; height: 12px; left: 0; }  /* vertical arm   */
.tick.tl { top: -1px; left: -1px; }
.tick.tr { top: -1px; right: -1px; }
.tick.tr::before { right: 0; left: auto; }
.tick.tr::after  { right: 0; left: auto; }
.tick.bl { bottom: -1px; left: -1px; }
.tick.bl::before { bottom: 0; top: auto; }
.tick.bl::after  { bottom: 0; top: auto; }
.tick.br { bottom: -1px; right: -1px; }
.tick.br::before { bottom: 0; top: auto; right: 0; left: auto; }
.tick.br::after  { bottom: 0; top: auto; right: 0; left: auto; }

/* === Top bar: monogram + login === */
.topbar {
  position: absolute;
  top: var(--edge); left: var(--edge); right: var(--edge);
  z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.5rem, 1.6vmin, 1rem) clamp(0.75rem, 2vmin, 1.4rem);
  animation: chrome-in 2s ease 1.3s both;
}
.monogram-wrap { position: relative; }
.monogram {
  display: inline-block;
  font-size: clamp(1.1rem, 2.4vmin, 1.5rem);
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 0 18px rgba(150, 150, 255, 0.4);
  user-select: none;
  cursor: default;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}
.monogram-wrap:hover .monogram,
.monogram-wrap:focus-within .monogram {
  color: #fff;
  text-shadow: 0 0 22px rgba(150, 150, 255, 0.6);
}
.monogram:focus-visible { outline: 2px solid rgba(190, 180, 255, 0.8); outline-offset: 4px; border-radius: 2px; }

/* Identity lineage panel — revealed on hover/focus of the monogram. */
.aliases {
  position: absolute;
  top: calc(100% + 14px);
  left: -4px;
  min-width: 196px;
  padding: 16px 18px;
  background: rgba(11, 9, 22, 0.74);
  border: 1px solid var(--line);
  border-radius: 7px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s;
  z-index: 6;
}
.monogram-wrap:hover .aliases,
.monogram-wrap:focus-within .aliases {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.aliases-title {
  display: block;
  font-size: 0.6rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: rgba(214, 206, 255, 0.5);
  margin-bottom: 12px;
}
.aliases-list { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.aliases-list li {
  position: relative; padding-left: 18px;
  font-size: 0.95rem; letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
}
.aliases-list li::before {
  content: ""; position: absolute; left: 0; top: 0.6em;
  width: 6px; height: 1px; background: rgba(214, 206, 255, 0.35);
}
.aliases-list li.current {
  color: #fff; text-shadow: 0 0 16px rgba(150, 150, 255, 0.5);
}
.aliases-list li.current::before { width: 9px; background: rgba(190, 180, 255, 0.9); }
/* Login as a subtle glyph that mirrors the monogram; word reveals on hover. */
.login {
  display: inline-flex; align-items: center; gap: 0.6em;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  padding: 0.3em 0.2em;
  border-radius: 4px;
  transition: color 0.4s ease, text-shadow 0.4s ease;
}
.login-label {
  font-size: clamp(0.66rem, 1.4vmin, 0.85rem);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.login-glyph {
  font-size: clamp(1.1rem, 2.4vmin, 1.5rem);
  line-height: 1;
  transition: transform 0.4s ease;
}
.login:hover, .login:focus-visible {
  color: #fff;
  text-shadow: 0 0 20px rgba(150, 150, 255, 0.55);
  outline: none;
}
.login:hover .login-label, .login:focus-visible .login-label { opacity: 0.9; transform: translateX(0); }
.login:hover .login-glyph, .login:focus-visible .login-glyph { transform: translateX(3px); }
.login:focus-visible { outline: 2px solid rgba(190, 180, 255, 0.8); outline-offset: 4px; }

/* Bottom bar mirrors the top: faint instrument-style micro-labels. */
.botbar {
  position: absolute;
  bottom: var(--edge); left: var(--edge); right: var(--edge);
  z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: clamp(0.5rem, 1.6vmin, 1rem) clamp(0.75rem, 2vmin, 1.4rem);
  animation: chrome-in 2s ease 1.6s both;
}
.meta {
  font-size: clamp(0.58rem, 1.15vmin, 0.74rem);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: rgba(214, 206, 255, 0.42);
  user-select: none;
  white-space: nowrap;
}

/* Faint tilted orbital ring slowly circling the orb. */
.orbit {
  position: absolute;
  top: 38%; left: 50%;
  width: calc(var(--orb-size) * 1.32);
  height: calc(var(--orb-size) * 1.32);
  margin: calc(var(--orb-size) * -0.66) 0 0 calc(var(--orb-size) * -0.66);
  border: 1px solid rgba(190, 180, 255, 0.14);
  border-radius: 50%;
  transform: rotateX(72deg) rotateZ(0deg);
  pointer-events: none;
  z-index: -1;
  animation: orbit-spin 44s linear infinite, chrome-in 2.4s ease 1.2s both;
}
@keyframes orbit-spin {
  0%   { transform: rotateX(72deg) rotateZ(0deg); }
  100% { transform: rotateX(72deg) rotateZ(360deg); }
}

@keyframes chrome-in { 0% { opacity: 0; } 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .haze, .orb, .wordmark, .frame, .topbar, .botbar, .centerpiece::before { animation: none; }
  .orbit { animation: none; }
}
