/* ===================================================================
   Clovis World — Hub
=================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; width: 100%; overflow: hidden; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #050608;
  color: #e8e4d8;
  -webkit-font-smoothing: antialiased;
}

/* ====================== BACKGROUND FX (permanent) ====================== */
.bg-fx {
  position: fixed; inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg, #02040a);
  pointer-events: none;
}

.bg-fx .bg-blue-corona {
  position: absolute; inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  z-index: 2;
}
.bg-fx .bg-stars-far,
.bg-fx .bg-stars-near,
.bg-fx .bg-nebula,
.bg-fx .bg-dust { z-index: 1; }

/* — Starfield — */
.bg-stars-far, .bg-stars-near {
  position: absolute; inset: 0;
}
.bg-stars-far {
  background-image:
    radial-gradient(0.5px 0.5px at 12% 71%, rgba(255,255,255,.55), transparent),
    radial-gradient(0.5px 0.5px at 54% 16%, rgba(255,255,255,.5),  transparent),
    radial-gradient(0.5px 0.5px at 83% 57%, rgba(255,255,255,.55), transparent),
    radial-gradient(0.5px 0.5px at 27% 92%, rgba(255,255,255,.45), transparent),
    radial-gradient(0.5px 0.5px at 76% 19%, rgba(255,255,255,.5),  transparent),
    radial-gradient(0.5px 0.5px at 39% 47%, rgba(255,255,255,.4),  transparent),
    radial-gradient(0.5px 0.5px at 91% 81%, rgba(255,255,255,.5),  transparent),
    radial-gradient(0.5px 0.5px at  6% 36%, rgba(255,255,255,.4),  transparent),
    radial-gradient(0.5px 0.5px at 64% 74%, rgba(255,255,255,.4),  transparent),
    radial-gradient(0.5px 0.5px at 19% 11%, rgba(255,255,255,.5),  transparent),
    radial-gradient(0.5px 0.5px at 48% 84%, rgba(255,255,255,.4),  transparent),
    radial-gradient(0.5px 0.5px at 86%  6%, rgba(255,255,255,.4),  transparent);
  opacity: 0.6;
  animation: twinkle 11s ease-in-out infinite alternate;
}
.bg-stars-near {
  background-image:
    radial-gradient(1px 1px at 17% 23%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 33% 78%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 62% 12%, #fff, transparent),
    radial-gradient(1px 1px at 88% 44%, #fff, transparent),
    radial-gradient(1px 1px at  8% 67%, #fff, transparent),
    radial-gradient(1.4px 1.4px at 47% 53%, #fff, transparent),
    radial-gradient(1px 1px at 71% 88%, #fff, transparent),
    radial-gradient(1px 1px at 23% 41%, #ffd7a0, transparent),
    radial-gradient(1px 1px at 55% 28%, #cfe1ff, transparent),
    radial-gradient(1.2px 1.2px at 92% 18%, #fff, transparent),
    radial-gradient(1px 1px at 14% 89%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 79% 32%, #fff, transparent),
    radial-gradient(1px 1px at  4% 18%, #fff, transparent),
    radial-gradient(1px 1px at 38%  8%, #ffa860, transparent),
    radial-gradient(1px 1px at 66% 65%, #fff, transparent),
    radial-gradient(1px 1px at 41% 96%, #fff, transparent);
  opacity: 0.78;
  animation: twinkle 7s ease-in-out infinite alternate;
}
@keyframes twinkle {
  0%   { opacity: 0.35; }
  100% { opacity: 0.95; }
}

/* — Interstellar nebulae positioned OUTSIDE the orbit (top-right warm, bottom-left cool) — */
.bg-fx .bg-nebula {
  position: absolute; inset: -20%;
  filter: blur(70px);
  mix-blend-mode: screen;
  animation: cosmic-drift 140s linear infinite;
}
.bg-fx .bg-nebula-warm {
  background:
    radial-gradient(ellipse 36% 26% at 88% 14%, rgba(220, 130, 50, 0.32) 0%, rgba(180, 80, 30, 0.16) 38%, transparent 72%);
}
.bg-fx .bg-nebula-cool {
  background:
    radial-gradient(ellipse 34% 30% at 10% 90%, rgba(40, 90, 160, 0.34) 0%, rgba(30, 60, 130, 0.18) 40%, transparent 75%);
  animation-duration: 180s;
  animation-direction: reverse;
}
.bg-fx .bg-dust {
  position: absolute; inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(180,210,255,0.022) 30%, transparent 60%),
    linear-gradient(60deg, transparent 0%, rgba(120,160,220,0.022) 40%, transparent 70%);
  mix-blend-mode: screen;
  animation: drift-x 80s ease-in-out infinite alternate;
}
@keyframes cosmic-drift {
  0%   { transform: rotate(0deg) scale(1); }
  100% { transform: rotate(360deg) scale(1); }
}
@keyframes drift-x {
  0%   { transform: translate3d(-3%, 0, 0); }
  100% { transform: translate3d(3%, 0, 0); }
}

/* — Blue corona halo (always on) — */
.bg-fx .bc-corona {
  position: absolute;
  width:  calc(var(--orbit-r, 370px) * 1.4);
  height: calc(var(--orbit-r, 370px) * 1.4);
  border-radius: 50%;
  background:
    radial-gradient(circle,
      rgba(220, 245, 255, 0.50) 0%,
      rgba(140, 210, 255, 0.40) 14%,
      rgba(80, 170, 255, 0.28) 32%,
      rgba(40, 110, 230, 0.16) 55%,
      rgba(20, 50, 140, 0.06) 75%,
      transparent 92%);
  filter: blur(20px);
  mix-blend-mode: screen;
  animation: bc-corona-breath 7s ease-in-out infinite;
}
@keyframes bc-corona-breath {
  0%, 100% { transform: scale(0.92); opacity: 0.78; }
  50%      { transform: scale(1.04); opacity: 1; }
}
.bg-fx .bc-glow {
  position: absolute;
  width:  calc(var(--orbit-r, 370px) * 0.8);
  height: calc(var(--orbit-r, 370px) * 0.8);
  border-radius: 50%;
  background:
    radial-gradient(circle,
      rgba(255, 255, 255, 0.42) 0%,
      rgba(180, 230, 255, 0.32) 25%,
      rgba(100, 180, 255, 0.18) 55%,
      transparent 85%);
  filter: blur(12px);
  mix-blend-mode: screen;
  animation: bc-glow-breath 4.5s ease-in-out infinite;
}
@keyframes bc-glow-breath {
  0%, 100% { transform: scale(1);    opacity: 0.85; }
  50%      { transform: scale(1.1);  opacity: 1; }
}

/* Halo wrappers — host the collapse-transition so it composes with the
   breath animation running on the inner element (no abrupt snap). */
.bg-fx .bc-corona-wrap,
.bg-fx .bc-glow-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform 1.6s cubic-bezier(.55,.06,.32,1);
  will-change: transform;
}

/* — When the hub is collapsed (logo alone): the flare wrappers shrink to 0
     in the same gesture as the central halo. The "deep" class is added
     ~1.5s after `cw-collapsed` so satellites fully retract first. */

/* Expand path — halo overshoots out to the satellites' radius then
   settles back, with a slower return so it feels like it's drifting in. */
body.cw-expanding .bg-fx .bc-corona-wrap {
  animation: halo-reach-out 2.6s cubic-bezier(.4,.0,.2,1) 0s 1;
}
body.cw-expanding .bg-fx .bc-glow-wrap {
  animation: halo-reach-out 2.6s cubic-bezier(.4,.0,.2,1) 0.1s 1;
}
@keyframes halo-reach-out {
  0%   { transform: scale(0.7); }
  38%  { transform: scale(1.95); }
  100% { transform: scale(1); }
}
.bg-fx .bc-flare {
  transition: opacity 0.9s ease 0.55s;
}

/* ====================== SHOOTING STAR ====================== */
.shooting-stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.shooting-star {
  position: absolute;
  top: var(--top, 10%);
  left: var(--left, 10%);
  width: var(--len, 280px);
  height: 1.5px;
  transform: rotate(var(--angle, 22deg)) translate3d(0, 0, 0);
  transform-origin: 0 50%;
  opacity: 0;
  background: linear-gradient(
    to right,
    hsla(var(--hue, 210), 90%, 95%, 0) 0%,
    hsla(var(--hue, 210), 90%, 92%, 0.35) 35%,
    hsla(var(--hue, 210), 95%, 98%, 1)   90%,
    #ffffff 100%
  );
  filter: drop-shadow(0 0 6px hsla(var(--hue, 210), 95%, 92%, 0.95))
          drop-shadow(0 0 12px hsla(var(--hue, 210), 95%, 80%, 0.55));
  border-radius: 999px;
  animation: shoot var(--dur, 1.3s) cubic-bezier(.22,.61,.36,1) forwards;
}
.shooting-star::after {
  content: '';
  position: absolute;
  right: -3px; top: 50%;
  width: 5px; height: 5px;
  transform: translateY(-50%);
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 14px 3px hsla(var(--hue, 210), 100%, 95%, 0.9);
}
@keyframes shoot {
  0%   { opacity: 0;   transform: rotate(var(--angle, 22deg)) translate3d(0, 0, 0)               scaleX(0.4); }
  12%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { opacity: 0;   transform: rotate(var(--angle, 22deg)) translate3d(var(--dist, 100vmax), 0, 0) scaleX(1); }
}

/* ====================== BRAND-MARK "o" (sliding door) ====================== */
.header .brand-mark .brand-o {
  all: unset;
  position: relative;
  display: inline-block;
  vertical-align: baseline;
  cursor: default;
  pointer-events: auto;        /* override .header pointer-events:none */
  /* color, font, letter-spacing inherited from .brand-mark via `all: unset` */
}
.header .brand-mark .brand-o-sr {
  /* Invisible layout glyph — gives the button the natural width/height of an "o" */
  visibility: hidden;
}
.header .brand-mark .brand-o-half {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  display: inline-block;
  color: inherit;
  transition: transform 0.55s cubic-bezier(.6,.05,.2,1);
  pointer-events: none;        /* clicks go to the button, not the halves */
  will-change: transform;
}
.header .brand-mark .brand-o-half-l {
  clip-path: inset(0 50% 0 0);
  -webkit-clip-path: inset(0 50% 0 0);
}
.header .brand-mark .brand-o-half-r {
  clip-path: inset(0 0 0 50%);
  -webkit-clip-path: inset(0 0 0 50%);
}
/* Door opens at hover (only when the hub is collapsed) or while the popup is open */
.header .brand-mark .brand-o.unlocked { cursor: pointer; }
.header .brand-mark .brand-o.unlocked:hover .brand-o-half-l,
.header .brand-mark .brand-o.opened .brand-o-half-l { transform: translateX(-55%); }
.header .brand-mark .brand-o.unlocked:hover .brand-o-half-r,
.header .brand-mark .brand-o.opened .brand-o-half-r { transform: translateX(55%); }

/* Gold "shine" revealed through the opening doors */
.header .brand-mark .brand-o::after {
  content: '';
  position: absolute;
  inset: 18% 22%;
  border-radius: 2px;
  background: radial-gradient(ellipse,
    rgba(255, 235, 175, 0.95) 0%,
    rgba(220, 180, 95, 0.55) 40%,
    rgba(201, 163, 90, 0) 75%);
  filter: blur(0.5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
}
.header .brand-mark .brand-o.unlocked:hover::after,
.header .brand-mark .brand-o.opened::after { opacity: 1; }

/* ====================== LOGIN POPUP ====================== */
.login-portal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(8,16,40,0.55), rgba(2,4,10,0.85));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.login-portal.open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0s linear 0s;
}

/* The two sliding doors split apart to reveal the card */
.login-door {
  position: absolute;
  top: 0; bottom: 0;
  width: 50%;
  background:
    linear-gradient(180deg, rgba(8,18,46,0.92), rgba(2,6,18,0.92)),
    radial-gradient(circle at 50% 50%, rgba(120,170,255,0.08), transparent 60%);
  border: 1px solid rgba(140,180,255,0.18);
  box-shadow: inset 0 0 80px rgba(60,110,220,0.18);
  transition: transform 0.85s cubic-bezier(.7,.0,.2,1);
  pointer-events: none;
}
.login-door-left  { left: 0;  transform: translateX(0); }
.login-door-right { right: 0; transform: translateX(0); }
.login-portal.open .login-door-left  { transform: translateX(-100%); }
.login-portal.open .login-door-right { transform: translateX(100%); }

.login-card {
  position: relative;
  width: min(420px, 88vw);
  padding: 44px 38px 36px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% -10%, rgba(120,180,255,0.18), transparent 55%),
    linear-gradient(180deg, rgba(14,22,46,0.96), rgba(6,10,24,0.96));
  border: 1px solid rgba(150,190,255,0.22);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 30px 90px rgba(0,0,0,0.55),
    0 0 80px rgba(80,140,240,0.25);
  color: #e8eefc;
  transform: scale(0.7) translateY(20px);
  opacity: 0;
  transition: transform 0.65s cubic-bezier(.2,.9,.25,1.15) 0.25s,
              opacity 0.5s ease 0.25s;
  text-align: center;
}
.login-portal.open .login-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.login-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: #e8eefc;
  font-size: 18px; line-height: 1;
  cursor: pointer;
  transition: background .2s ease, transform .2s ease;
}
.login-close:hover { background: rgba(255,255,255,0.12); transform: rotate(90deg); }

.login-logo-ring {
  width: 96px; height: 96px;
  margin: 0 auto 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 50% 50%, rgba(120,180,255,0.32), transparent 65%);
  box-shadow:
    0 0 0 1px rgba(180,210,255,0.25) inset,
    0 0 38px rgba(100,160,240,0.45);
  animation: gentle-float 8s ease-in-out infinite;
}
.login-logo { width: 72%; height: 72%; object-fit: contain; filter: drop-shadow(0 0 14px rgba(180,210,255,0.5)); }

.login-title {
  font-family: 'Orbitron', 'Audiowide', system-ui, sans-serif;
  font-size: 22px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold, #c9a35a);
  text-shadow: 0 0 18px rgba(201,163,90,0.32);
}
.login-title .dot {
  display: inline-block;
  width: 5px; height: 5px;
  margin: 0 8px 2px;
  border-radius: 50%;
  background: var(--gold, #c9a35a);
  box-shadow: 0 0 10px rgba(201,163,90,0.6);
  vertical-align: middle;
}
.login-title em {
  font-style: normal;
  opacity: 0.7;
  letter-spacing: 0.36em;
}
.login-sub {
  margin: 6px 0 26px;
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(200,215,240,0.6);
}

.login-form { display: flex; flex-direction: column; gap: 14px; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field > span {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(200,215,240,0.7);
}
.login-field input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(150,190,255,0.18);
  border-radius: 10px;
  padding: 12px 14px;
  color: #f0f4ff;
  font-size: 14px;
  outline: none;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.login-field input::placeholder { color: rgba(200,215,240,0.35); }
.login-field input:focus {
  border-color: rgba(180,210,255,0.55);
  background: rgba(255,255,255,0.07);
  box-shadow: 0 0 0 3px rgba(120,170,255,0.16);
}
.login-submit {
  margin-top: 10px;
  padding: 13px 18px;
  border-radius: 10px;
  border: 1px solid rgba(201,163,90,0.55);
  background: linear-gradient(180deg, rgba(201,163,90,0.18), rgba(201,163,90,0.08));
  color: #f7e5b8;
  font-family: 'Orbitron', system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, transform .15s ease, box-shadow .25s ease;
}
.login-submit:hover {
  background: linear-gradient(180deg, rgba(201,163,90,0.32), rgba(201,163,90,0.14));
  box-shadow: 0 0 22px rgba(201,163,90,0.28);
}
.login-submit:active { transform: translateY(1px); }

.login-error {
  margin-top: 4px;
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(255, 90, 90, 0.10);
  border: 1px solid rgba(255, 120, 120, 0.30);
  color: #ffc8c8;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-align: center;
}

/* — Tongue eruptions: slow, rare, plasma fingers from center — */
/* Wrapper holds the angle + collapse scale; the inner element runs the erupt animation. */
.bg-fx .bc-flare-wrap {
  position: absolute;
  bottom: 50%;
  left: 50%;
  width: 0; height: 0;
  transform: rotate(var(--angle, 0deg)) scale(1);
  transform-origin: 0 0;
  transition: transform 1.6s cubic-bezier(.55,.06,.32,1);
  will-change: transform;
  pointer-events: none;
}
body.cw-collapsed-deep .bg-fx .bc-corona-wrap,
body.cw-collapsed-deep .bg-fx .bc-glow-wrap {
  transform: scale(0.7);
}
body.cw-collapsed-deep .bg-fx .bc-flare-wrap {
  transform: rotate(var(--angle, 0deg)) scale(0);
}
.bg-fx .bc-flare {
  position: absolute;
  width:  calc(var(--orbit-r, 370px) * 0.55);
  height: calc(var(--orbit-r, 370px) * 0.95);
  bottom: 0;
  left: 0;
  transform-origin: 50% 100%;
  transform: translate(-50%, 0) scale(0);
  border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%;
  filter: blur(14px);
  mix-blend-mode: screen;
  opacity: 0;
  animation: bc-flare-erupt var(--dur) ease-out infinite;
  animation-delay: var(--delay);
  pointer-events: none;
}
.bg-fx .bc-flare-1 {
  background: radial-gradient(ellipse at 50% 100%,
    rgba(220, 245, 255, 0.70) 0%,
    rgba(140, 210, 255, 0.50) 25%,
    rgba(70, 160, 255, 0.30) 50%,
    transparent 78%);
}
.bg-fx .bc-flare-2 {
  background: radial-gradient(ellipse at 50% 100%,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(170, 220, 255, 0.45) 20%,
    rgba(90, 180, 255, 0.28) 50%,
    transparent 80%);
}
.bg-fx .bc-flare-3 {
  background: radial-gradient(ellipse at 50% 100%,
    rgba(200, 235, 255, 0.58) 0%,
    rgba(120, 195, 255, 0.42) 28%,
    rgba(50, 130, 230, 0.25) 55%,
    transparent 80%);
}
@keyframes bc-flare-erupt {
  0%   { transform: translate(-50%, 0) scale(0);                                opacity: 0; }
  22%  { transform: translate(-50%, 0) scale(calc(var(--peak, 1) * 0.7));      opacity: 0.85; }
  48%  { transform: translate(-50%, 0) rotate(3deg)  scale(var(--peak, 1));    opacity: 1; }
  78%  { transform: translate(-50%, 0) rotate(-2deg) scale(calc(var(--peak, 1) * 0.8)); opacity: 0.4; }
  100% { transform: translate(-50%, 0) scale(0);                                opacity: 0; }
}

/* — Arc halos: wide diffuse base tapering to a fine point, follows a
     curved path whose tip falls back toward the center, delayed fade. — */
.bg-fx .bc-arc {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  transform: rotate(var(--angle));
  transform-origin: 0 0;
  pointer-events: none;
}
.bg-fx .bc-arc-comet {
  position: absolute;
  /* Wide diffuse halo — triangular clip carves a soft cone (wide tail → fine point) */
  width: 280px;
  height: 56px;
  /* Two-axis cone: linear-gradient adds left→right fade, radial softens vertical edges */
  background:
    radial-gradient(ellipse 60% 50% at 30% 50%,
      rgba(220, 240, 255, 0.55) 0%,
      rgba(150, 210, 255, 0.30) 45%,
      rgba(90, 180, 255, 0.10) 78%,
      transparent 100%);
  /* Triangular clip — base at left edge (full height), point at right edge */
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  filter:
    blur(10px)
    drop-shadow(0 0 22px rgba(160, 220, 255, 0.45))
    drop-shadow(0 0 48px rgba(90, 180, 255, 0.22));
  mix-blend-mode: screen;
  offset-distance: 0%;
  offset-rotate: auto;
  -webkit-offset-distance: 0%;
  -webkit-offset-rotate: auto;
  opacity: 0;
  animation: bc-arc-flow var(--dur) cubic-bezier(.3,.05,.4,1) infinite;
  animation-delay: var(--delay);
}
@keyframes bc-arc-flow {
  0%   { offset-distance: 0%;   -webkit-offset-distance: 0%;   opacity: 0; }
  10%  { opacity: 0.85; }
  45%  { offset-distance: 50%;  -webkit-offset-distance: 50%;  opacity: 1; }
  72%  { offset-distance: 85%;  -webkit-offset-distance: 85%;  opacity: 0.7; }
  /* delayed fade — sit at the path end for a moment then fade slowly */
  88%  { offset-distance: 100%; -webkit-offset-distance: 100%; opacity: 0.4; }
  100% { offset-distance: 100%; -webkit-offset-distance: 100%; opacity: 0; }
}


/* ====================== HUB LAYOUT ====================== */
.stage {
  position: relative;
  width: 100vw; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}

.orbit-ring {
  position: relative;
  width:  var(--orbit-size, 740px);
  height: var(--orbit-size, 740px);
  border-radius: 50%;
}
.orbit-ring::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(255,255,255,0.04);
}
.orbit-ring.paused .orbit-arm,
.orbit-ring.paused .arm-counter { animation-play-state: paused; }

/* ---- ORBIT ARM (rotation only) ---- */
.orbit-arm {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  transform: rotate(var(--angle, 0deg));
  animation: arm-rot var(--orbit-duration, 90s) linear infinite;
  will-change: transform;
}
@keyframes arm-rot {
  from { transform: rotate(var(--angle, 0deg)); }
  to   { transform: rotate(calc(var(--angle, 0deg) + 360deg)); }
}

/* ---- SATELLITE (translation along the arm) ---- */
.satellite {
  position: absolute;
  top: 0; left: 0;
  width:  var(--sat-size, 130px);
  height: var(--sat-size, 130px);
  margin: calc(var(--sat-size, 130px) * -0.5) 0 0 calc(var(--sat-size, 130px) * -0.5);
  transform: translate(var(--orbit-r, 370px), 0) scale(1);
  opacity: 1;
  transition:
    transform 1.15s cubic-bezier(.55,.06,.32,1),
    opacity 0.95s ease;
  will-change: transform, opacity;
}

/* ---- ARM-COUNTER (cancels arm rotation so sphere stays upright) ---- */
.arm-counter {
  position: absolute;
  inset: 0;
  transform: rotate(calc(var(--angle, 0deg) * -1));
  animation: arm-counter var(--orbit-duration, 90s) linear infinite;
}
@keyframes arm-counter {
  from { transform: rotate(calc(var(--angle, 0deg) * -1)); }
  to   { transform: rotate(calc((var(--angle, 0deg) + 360deg) * -1)); }
}

.orbit-ring.hover-focus .orbit-arm,
.orbit-ring.hover-focus .arm-counter {
  animation-play-state: paused;
}

/* ---- COLLAPSED — satellites recede toward the logo & hide behind it ---- */
.orbit-ring.collapsed .orbit-arm,
.orbit-ring.collapsed .arm-counter {
  animation-play-state: paused;
}
.orbit-ring.collapsed .satellite {
  transform: translate(0, 0) scale(0.04);
  opacity: 0;
  pointer-events: none;
  /* Closer indices retract first — sense of depth */
  transition-delay: var(--collapse-delay-in, 0s);
}
/* When expanding back, reverse the stagger so outer ones arrive last */
.orbit-ring:not(.collapsed) .satellite {
  transition-delay: var(--collapse-delay-out, 0s);
}

.sphere {
  position: relative;
  width: 100%; height: 100%;
  display: block;
  cursor: pointer;
  filter:
    drop-shadow(0 14px 26px rgba(0,0,0,0.55))
    drop-shadow(0 0 22px rgba(255,255,255,0.05));
  transition: filter 0.45s ease, transform 0.45s cubic-bezier(.2,.7,.2,1);
  border: 0; background: transparent; padding: 0;
}
.sphere img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  animation: sphere-bob var(--self-spin, 26s) ease-in-out infinite;
  transition: transform 0.45s cubic-bezier(.2,.7,.2,1);
  border-radius: 50%;
}
@keyframes sphere-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
.sphere:hover,
.sphere:focus-visible {
  filter:
    drop-shadow(0 24px 40px rgba(0,0,0,0.7))
    drop-shadow(0 0 36px var(--accent, rgba(255,255,255,0.35)));
  transform: scale(1.14);
  outline: none;
}
.sphere:hover img,
.sphere:focus-visible img {
  animation-play-state: paused;
}

/* ====================== CENTER ====================== */
.center {
  position: absolute;
  width: 30%;
  max-width: 260px;
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 5; /* above orbit-ring so retracted satellites hide behind */
  pointer-events: none;
}
.center-logo-btn {
  all: unset;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  transition: filter .35s ease;
}
.center-logo-btn:focus-visible {
  outline: 2px solid rgba(180,210,255,0.55);
  outline-offset: 6px;
  border-radius: 50%;
}
.center-logo-btn:hover .center-logo {
  filter: drop-shadow(0 0 64px rgba(180,210,255,0.28));
}
.center-logo-btn.is-collapsed .center-logo {
  filter: drop-shadow(0 0 72px rgba(160,200,255,0.32));
}
.center-logo {
  width: 100%; height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 48px rgba(255,255,255,0.12));
  animation: gentle-float 11s ease-in-out infinite;
  transition: opacity .5s ease, transform .6s cubic-bezier(.2,.7,.2,1), filter .45s ease;
  user-select: none;
}
@keyframes gentle-float {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-8px) scale(1.02); }
}
.stage.previewing .center-logo {
  opacity: 0.18;
  transform: scale(0.92);
}

/* ====================== HEADER / BRAND ====================== */
.header {
  position: fixed; top: 24px; left: 30px;
  z-index: 30;
  pointer-events: none;
  display: flex; align-items: center; gap: 14px;
}
.header .brand-mark {
  font-family: 'Orbitron', 'Audiowide', system-ui, sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.94);
  line-height: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  text-shadow: 0 0 22px rgba(201,163,90,0.18);
}
.header .brand-mark .dot {
  display: inline-block;
  width: 5px; height: 5px;
  background: #c9a35a;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(201,163,90,0.6);
}
.header .brand-mark em {
  font-style: normal;
  opacity: 0.62;
  font-weight: 500;
  font-size: 16px;
  letter-spacing: 0.42em;
  color: #c9a35a;
}

/* ====================== TOP-RIGHT CONTROLS ====================== */
.top-right {
  position: fixed;
  top: 24px; right: 30px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
}
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 99px;
  padding: 3px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-family: 'Orbitron', system-ui, sans-serif;
}
.lang-btn {
  background: transparent;
  border: 0;
  color: rgba(255,255,255,0.55);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 6px 11px;
  border-radius: 99px;
  cursor: pointer;
  transition: color .22s, background .22s;
  line-height: 1;
}
.lang-btn:hover { color: rgba(255,255,255,0.9); }
.lang-btn.active {
  color: #c9a35a;
  background: rgba(201,163,90,0.12);
  box-shadow: inset 0 0 0 1px rgba(201,163,90,0.28);
}

/* ====================== AUDIO TOGGLE ====================== */
.audio-btn {
  z-index: 30;
  width: 38px; height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background .25s, border-color .25s, color .25s, transform .25s;
  backdrop-filter: blur(8px);
}
.audio-btn:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.25);
  color: #fff;
}
.audio-btn.on {
  color: #c9a35a;
  border-color: rgba(201,163,90,0.4);
}
.audio-btn svg { width: 18px; height: 18px; }

/* ====================== PREVIEW PANEL ====================== */
.preview-panel {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  width: min(820px, 80vw);
  aspect-ratio: 16/10;
  z-index: 50;
  border-radius: 18px;
  background: #0a0c10;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow:
    0 40px 90px rgba(0,0,0,0.75),
    0 0 0 1px rgba(255,255,255,0.04),
    0 0 80px var(--panel-glow, rgba(255,255,255,0.10)),
    0 0 130px rgba(140, 210, 255, 0.22),
    0 0 220px rgba(80, 170, 255, 0.14),
    0 0 320px rgba(50, 140, 240, 0.08);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(.2,.7,.2,1), box-shadow 0.5s;
}
.preview-panel.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  animation: panel-halo 6s ease-in-out infinite;
}
@keyframes panel-halo {
  0%, 100% {
    box-shadow:
      0 40px 90px rgba(0,0,0,0.75),
      0 0 0 1px rgba(255,255,255,0.04),
      0 0 80px var(--panel-glow, rgba(255,255,255,0.10)),
      0 0 130px rgba(140, 210, 255, 0.22),
      0 0 220px rgba(80, 170, 255, 0.14),
      0 0 320px rgba(50, 140, 240, 0.08);
  }
  50% {
    box-shadow:
      0 40px 90px rgba(0,0,0,0.75),
      0 0 0 1px rgba(255,255,255,0.04),
      0 0 95px var(--panel-glow, rgba(255,255,255,0.14)),
      0 0 170px rgba(160, 220, 255, 0.32),
      0 0 280px rgba(100, 190, 255, 0.22),
      0 0 400px rgba(70, 170, 255, 0.13);
  }
}
.preview-panel:focus-visible {
  outline: 2px solid rgba(201,163,90,0.5);
  outline-offset: 4px;
}

/* ====================== PREVIEW CARD ====================== */
.pc-stage {
  position: relative;
  width: 100%; height: 100%;
  overflow: hidden;
  display: flex;
}
.pc-bg {
  position: absolute; inset: 0;
  z-index: 0;
}
.pc-content {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  align-items: center;
  padding: 38px 44px;
  gap: 32px;
}
.pc-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  width: 100%;
}
.pc-logo {
  width: min(72%, 240px);
  height: auto;
  display: block;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.45));
}
.pc-text {
  display: flex; flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}
.pc-kicker {
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
}
.pc-title {
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.pc-desc {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
  max-width: 460px;
  font-weight: 400;
}
.pc-cta {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  padding: 11px 18px;
  border-radius: 2px;
  font-weight: 600;
}
.pc-arrow { font-size: 14px; transform: translateY(-1px); }

/* — VOYAGES — */
.preview-voyages .pc-bg {
  background:
    radial-gradient(ellipse at 70% 30%, rgba(255,230,170,0.35) 0%, transparent 55%),
    linear-gradient(160deg, #1a5d8c 0%, #2a7fb0 45%, #4ea8c8 100%);
}
.preview-voyages .pc-kicker { color: #ffd16a; }
.preview-voyages .pc-title {
  font-family: 'Playfair Display', 'Cormorant Garamond', serif;
  color: #fff;
  font-style: italic;
  text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}
.preview-voyages .pc-title em {
  font-family: 'Caveat', cursive;
  color: #ffb547;
  font-style: normal;
  font-size: 1.1em;
}
.preview-voyages .pc-desc { color: rgba(255,255,255,0.92); }
.preview-voyages .pc-cta {
  background: #ffb547; color: #1a3a52;
  box-shadow: 0 8px 22px rgba(0,0,0,0.25);
}

/* — ART — */
.preview-art .pc-bg {
  background:
    radial-gradient(ellipse at 70% 55%, rgba(218,120,60,0.18) 0%, transparent 55%),
    radial-gradient(ellipse at 30% 30%, rgba(80,40,30,0.08) 0%, transparent 60%),
    linear-gradient(180deg, #f4ede1 0%, #ebe0cf 100%);
}
.preview-art .pc-kicker {
  color: #6e5c4a;
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  letter-spacing: 0.18em;
  text-transform: none;
  font-size: 16px;
}
.preview-art .pc-title {
  font-family: 'Cormorant Garamond', serif;
  color: #1a1816;
  font-weight: 400;
  font-size: 52px;
  letter-spacing: -0.015em;
  font-style: italic;
}
.preview-art .pc-desc { color: #3a3128; }
.preview-art .pc-cta { background: #1a1816; color: #f4ede1; }

/* — CODE — */
.preview-code .pc-bg {
  background:
    radial-gradient(ellipse at 70% 50%, rgba(46,163,255,0.20) 0%, transparent 55%),
    linear-gradient(180deg, #0a1628 0%, #061224 100%);
}
.preview-code .pc-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(46,163,255,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46,163,255,0.08) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.6;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
.preview-code .pc-kicker { color: #2ea3ff; }
.preview-code .pc-title {
  font-family: 'Inter', sans-serif;
  color: #fff;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.preview-code .pc-title em {
  font-style: normal;
  color: #2ea3ff;
}
.preview-code .pc-desc { color: rgba(255,255,255,0.74); }
.preview-code .pc-cta {
  background: #2ea3ff; color: #061224;
  box-shadow: 0 8px 22px rgba(46,163,255,0.4);
}

/* — EDUCATION — */
.preview-education .pc-bg {
  background:
    radial-gradient(ellipse at 75% 45%, rgba(219,163,45,0.18) 0%, transparent 60%),
    linear-gradient(180deg, #14213d 0%, #0c1730 100%);
}
.preview-education .pc-kicker { color: #dba32d; letter-spacing: 0.32em; }
.preview-education .pc-title {
  font-family: 'Playfair Display', serif;
  color: #f6efdf;
  font-weight: 600;
  font-size: 44px;
}
.preview-education .pc-title em {
  font-family: 'Caveat', cursive;
  color: #dba32d;
  font-style: normal;
  font-size: 1.05em;
  font-weight: 500;
}
.preview-education .pc-desc { color: rgba(246,239,223,0.78); }
.preview-education .pc-cta { background: #dba32d; color: #14213d; }

/* — CARE — */
.preview-care .pc-bg {
  background:
    radial-gradient(ellipse at 50% 50%, #f5e8d4 0%, #e9d6b8 60%, #d8c098 100%);
}
.preview-care .pc-kicker { color: #a87545; letter-spacing: 0.32em; font-size: 10.5px; }
.preview-care .pc-title {
  font-family: 'Cormorant Garamond', serif;
  color: #3e2a1d;
  font-weight: 500;
  font-size: 44px;
  font-style: italic;
}
.preview-care .pc-desc { color: #5b4530; }
.preview-care .pc-cta { background: #a87545; color: #f5e8d4; }

/* — FOOD — */
.preview-food .pc-bg {
  background: linear-gradient(135deg, #f9efd9 0%, #fde3c5 100%);
}
.preview-food .pc-kicker { color: #1c5030; letter-spacing: 0.28em; }
.preview-food .pc-kicker::before {
  content: '\2022';
  color: #e8632c;
  margin-right: 8px;
  vertical-align: middle;
}
.preview-food .pc-title {
  font-family: 'Playfair Display', serif;
  color: #1c5030;
  font-weight: 700;
  font-size: 50px;
  letter-spacing: -0.01em;
  line-height: 1;
}
.preview-food .pc-title em {
  font-family: 'Playfair Display', serif;
  color: #e8632c;
  font-style: italic;
  font-weight: 700;
}
.preview-food .pc-desc { color: #2d3a30; }
.preview-food .pc-cta { background: #1c5030; color: #f9efd9; }

/* — GAMES — */
.preview-games .pc-bg {
  background:
    radial-gradient(ellipse at 50% 50%, #1a1208 0%, #0a0805 60%, #050402 100%);
}
.preview-games .pc-bg::after {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 18% 30%, rgba(201,163,90,0.6), transparent),
    radial-gradient(1px 1px at 76% 24%, rgba(201,163,90,0.5), transparent),
    radial-gradient(1.2px 1.2px at 42% 78%, rgba(201,163,90,0.55), transparent),
    radial-gradient(1px 1px at 88% 64%, rgba(201,163,90,0.5), transparent),
    radial-gradient(1px 1px at 28% 58%, rgba(201,163,90,0.45), transparent),
    radial-gradient(1.5px 1.5px at 58% 12%, rgba(255,230,170,0.7), transparent);
}
.preview-games .pc-kicker {
  color: #c9a35a;
  font-family: 'Cinzel', serif;
  letter-spacing: 0.32em;
  font-size: 10.5px;
}
.preview-games .pc-title {
  font-family: 'Cinzel', serif;
  color: #f4ede1;
  font-weight: 600;
  font-size: 38px;
  letter-spacing: 0.04em;
}
.preview-games .pc-title em {
  font-style: normal;
  background: linear-gradient(180deg, #e6c785 0%, #c9a35a 50%, #8a6f3c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.preview-games .pc-desc {
  color: rgba(244,237,225,0.7);
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 17px;
}
.preview-games .pc-cta {
  background: linear-gradient(180deg, #c9a35a 0%, #8a6f3c 100%);
  color: #0a0805;
  font-family: 'Cinzel', serif;
}

/* ====================== RESPONSIVE ====================== */
@media (max-width: 768px) {
  :root {
    --orbit-size: 420px;
    --sat-size: 90px;
  }
  .center { width: 42%; }
  .preview-panel { width: 90vw; }
}
