/* ===== Tokens ===== */
:root {
  --bg-core: #050208;
  --bg-mid: #0a0514;
  --bg-outer: #12091f;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, 0.5);
  --violet: #b478ff;
  --magenta: #ff3cb4;
  --cyan: #28dcf0;
  --accent-type: #e8d4ff;
  --scale: 1;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg-core);
  color: var(--fg);
  font-family: 'Cormorant Garamond', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body {
  position: relative;
  background:
    radial-gradient(ellipse at center, var(--bg-outer) 0%, var(--bg-mid) 40%, var(--bg-core) 75%, #000 100%);
  min-height: 100vh;
  overflow: hidden;
}

/* ===== Starfield (3 layers of radial-gradients) ===== */
.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.8), transparent 40%),
    radial-gradient(1px 1px at 40px 70px, rgba(255,255,255,0.5), transparent 40%),
    radial-gradient(1px 1px at 50px 160px, rgba(255,255,255,0.9), transparent 40%),
    radial-gradient(2px 2px at 90px 40px, rgba(255,255,255,0.7), transparent 40%),
    radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(1px 1px at 160px 120px, rgba(255,255,255,0.8), transparent 40%),
    radial-gradient(1px 1px at 180px 200px, rgba(255,255,255,0.6), transparent 40%),
    radial-gradient(1px 1px at 210px 60px, rgba(255,255,255,0.9), transparent 40%),
    radial-gradient(1px 1px at 240px 140px, rgba(255,255,255,0.5), transparent 40%),
    radial-gradient(1.5px 1.5px at 60px 220px, rgba(255,255,255,0.8), transparent 40%),
    radial-gradient(1px 1px at 100px 280px, rgba(255,255,255,0.6), transparent 40%),
    radial-gradient(1px 1px at 170px 320px, rgba(255,255,255,0.4), transparent 40%),
    radial-gradient(2px 2px at 200px 380px, rgba(255,255,255,0.9), transparent 40%),
    radial-gradient(1px 1px at 30px 400px, rgba(255,255,255,0.5), transparent 40%),
    radial-gradient(1px 1px at 220px 450px, rgba(255,255,255,0.7), transparent 40%);
  background-repeat: repeat;
  background-size: 260px 500px, 360px 600px, 500px 800px;
}

/* ===== Nebula glow (breathing) ===== */
.nebula {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 900px;
  height: 700px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse 60% 40% at 50% 50%,
      rgba(180, 120, 255, 0.45) 0%,
      rgba(255, 80, 180, 0.2) 40%,
      transparent 70%);
  filter: blur(20px);
  animation: breathe 8s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(0.95); opacity: 0.85; }
  50%      { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
}

/* ===== Galaxy layout ===== */
.galaxy {
  position: relative;
  z-index: 2;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.center {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 16px;
}

.wordmark {
  margin: 0;
  font-weight: 300;
  font-size: clamp(44px, 6vw, 72px);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--fg);
}

.wordmark em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-type);
}

.tagline {
  margin: 12px 0 0;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: var(--muted);
}

.center-pinpoint {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--fg);
  margin: 14px auto 0;
  box-shadow: 0 0 8px var(--fg), 0 0 16px rgba(232, 212, 255, 0.6);
}

/* ===== Orbital system ===== */
.orbits {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ring {
  position: absolute;
  width: calc(var(--radius) * 2 * var(--scale));
  height: calc(var(--radius) * 2 * var(--scale));
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  pointer-events: none;
}

.ring-1 { border-color: rgba(180, 120, 255, 0.22); }
.ring-2 { border-color: rgba(255, 100, 200, 0.18); }
.ring-3 { border-color: rgba(100, 200, 255, 0.14); }
.ring-4 { border-color: rgba(255, 255, 255, 0.1); }
.ring-5 { border-style: dashed; border-color: rgba(255, 255, 255, 0.08); }

/* The orbit wrapper rotates; the planet counter-rotates to stay upright */
.orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--radius) * 2 * var(--scale));
  height: calc(var(--radius) * 2 * var(--scale));
  transform: translate(-50%, -50%);
  animation: orbit var(--duration) linear infinite;
  animation-direction: var(--direction, normal);
  animation-delay: var(--delay, 0s);
  pointer-events: none;
}

@keyframes orbit {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes planet-counter {
  from { transform: rotate(0deg); }
  to   { transform: rotate(-360deg); }
}

.planet {
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--fg);
  pointer-events: auto;
  cursor: pointer;
  animation: planet-counter var(--duration) linear infinite;
  animation-direction: var(--direction, normal);
  animation-delay: var(--delay, 0s);
  transition: transform 0.2s ease;
}

.planet-inner {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(20, 10, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.planet .ico { width: 22px; height: 22px; }

/* Per-platform brand-color glow */
.p-spotify    .planet-inner { box-shadow: 0 0 16px rgba(29, 185, 84, 0.55); }
.p-apple      .planet-inner { box-shadow: 0 0 16px rgba(255, 80, 120, 0.55); }
.p-soundcloud .planet-inner { box-shadow: 0 0 16px rgba(255, 112, 0, 0.55); }
.p-deezer     .planet-inner { box-shadow: 0 0 16px rgba(162, 56, 255, 0.55); }
.p-tiktok     .planet-inner { box-shadow: 0 0 16px rgba(37, 244, 238, 0.55); }

.planet:hover .planet-inner,
.planet:focus-visible .planet-inner {
  transform: scale(1.15);
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.8);
}

.planet:focus-visible { outline: none; }
.planet:focus-visible .planet-inner {
  border-color: var(--fg);
}

/* ===== Labels ===== */
.label {
  position: absolute;
  top: 50%;
  left: calc(100% + 10px);
  transform: translateY(-50%);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(10, 5, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.planet:hover .label,
.planet:focus-visible .label {
  opacity: 1;
}

/* Intro state: first 3s all labels are visible */
body.labels-intro .label {
  opacity: 1;
  transition: opacity 0.4s ease;
}

body.labels-intro.labels-intro-hide .label {
  opacity: 0;
}

/* ===== Shooting star ===== */
.shooting-star {
  position: fixed;
  top: var(--start-y, -10%);
  left: var(--start-x, -10%);
  width: 2px;
  height: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 8px #fff, 0 0 20px rgba(255,255,255,0.6);
  pointer-events: none;
  z-index: 3;
  opacity: 0;
}

.shooting-star.flash {
  animation: shoot 1.6s ease-out forwards;
}

@keyframes shoot {
  0%   { opacity: 0; transform: translate(0, 0); }
  10%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx, 600px), var(--dy, 400px)); }
}

/* ===== Footer ===== */
.site-footer {
  position: fixed;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 5;
}

.email {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.email:hover { color: var(--fg); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  :root { --scale: 0.85; }
}

@media (max-width: 600px) {
  :root { --scale: 0.62; }
  .nebula { width: 600px; height: 500px; }
}

@media (max-width: 360px) {
  :root { --scale: 0.55; }
}

@media (max-height: 600px) {
  :root { --scale: 0.55; }
}

/* ===== Reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  .nebula,
  .orbit,
  .planet,
  .shooting-star {
    animation: none !important;
  }
  .label {
    opacity: 1 !important;
    position: static;
    transform: none;
    display: inline-block;
    margin-top: 6px;
  }
}
