:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #080915;
  color: #fff5ee;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 72% 25%, #20153e 0%, transparent 57%),
    radial-gradient(ellipse at 22% 84%, #261332 0%, transparent 52%),
    #080915;
}
.space {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.space::before, .space::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 31%, #fff 0 1px, transparent 1.5px),
    radial-gradient(circle at 61% 76%, #d1ccff 0 1px, transparent 1.7px),
    radial-gradient(circle at 86% 12%, #bbb4ff 0 .7px, transparent 1.3px),
    radial-gradient(circle at 40% 57%, #fff 0 .6px, transparent 1.2px);
  background-size: 191px 197px, 263px 249px, 137px 143px, 111px 127px;
}
.space::after {
  background-position: 37px 91px, 117px 31px, 9px 51px, 71px 79px;
  opacity: .42;
}
.meteor {
  z-index: 2;
  --duration: 7s;
  position: absolute;
  top: 5%;
  left: 12%;
  width: clamp(4.5rem, 15vw, 10rem);
  height: 2px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, #9c9cff 75%, white);
  border-radius: 999px;
  filter: drop-shadow(0 0 5px #bab5ff);
  animation: meteor-flight var(--duration) linear infinite;
  animation-delay: -.5s;
}
.meteor:nth-of-type(2) { top: 16%; left: 59%; --duration: 9s; animation-delay: 2s; }
.meteor:nth-of-type(3) { top: 51%; left: 5%; --duration: 11s; animation-delay: 4s; }
@keyframes meteor-flight {
  0% { transform: translate(0, 0) rotate(32deg); opacity: 0; }
  5% { opacity: .95; }
  21%, 100% { transform: translate(42vw, 26vw) rotate(32deg); opacity: 0; }
}
.scene {
  position: relative;
  width: min(100vw, 152svh, 76rem);
  container-type: inline-size;
}
.black-hole {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 760 / 344;
  pointer-events: none;
}

.site-date {
  position: fixed;
  inset-inline: 0;
  bottom: max(1rem, env(safe-area-inset-bottom));
  color: #fff;
  font-size: .875rem;
  text-align: center;
}

/* Konumlar karadelik.js içindeki ışık halkasından hesaplanır. */
.planet {
  --size: clamp(1.05rem, 2.6cqw, 1.95rem);
  --center-x: clamp(1.5rem, var(--planet-x, 50) * 1cqw, 100cqw - 1.5rem);
  position: absolute;
  top: var(--planet-y, 50%);
  left: var(--center-x);
  width: max(44px, calc(var(--size) * var(--scale)));
  aspect-ratio: 1;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff5ee;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.planet-sphere {
  position: relative;
  width: calc(var(--size) * var(--scale));
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(var(--light-angle, 90deg), transparent 48%,
      color-mix(in srgb, var(--light) 50%, transparent) 86%, var(--light) 100%),
    var(--surface);
  box-shadow: 0 0 .75rem var(--glow), 0 0 0 1px color-mix(in srgb, var(--light) 45%, transparent);
  transition: transform .2s ease, box-shadow .2s ease;
}
.planet-sphere::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse 75% 110% at -5% 50%, #040310ee 30%, var(--shade) 60%, transparent 100%);
  transform: rotate(calc(var(--light-angle, 90deg) - 90deg));
  pointer-events: none;
}
.planet:is(:hover, :focus-visible) .planet-sphere {
  transform: scale(1.12);
  box-shadow: 0 0 1.1rem var(--glow), 0 0 0 1px var(--light);
}
.planet:focus-visible { outline: 2px solid var(--light); outline-offset: 6px; }
.planet:is(:hover, :focus-visible) { z-index: 2; }
.planet:is(:hover, :focus-visible)::after {
  content: attr(aria-label);
  position: absolute;
  top: calc(100% + .65rem);
  left: calc(50% + clamp(3.5rem, var(--center-x), 100cqw - 3.5rem) - var(--center-x));
  translate: -50% 0;
  padding: .35rem .65rem;
  border: 1px solid var(--glow);
  border-radius: 999px;
  background: #100c20;
  font-size: .875rem;
  white-space: nowrap;
  pointer-events: none;
}
.planet--blue {
  --scale: .96;
  --light: #9feeff;
  --shade: #071237;
  --glow: #39aaff99;
  --surface: repeating-linear-gradient(24deg, #193e92 0% 9%, #39acd7 12% 17%, #236ab3 22% 32%, #73e2f1 37% 40%);
}
.planet--pink {
  --scale: .78;
  --light: #ffe2ed;
  --shade: #39102f;
  --glow: #f461ac99;
  --surface: radial-gradient(ellipse at 31% 65%, #a12f63 2%, transparent 45%),
    radial-gradient(ellipse at 70% 30%, #83356c, #fd8abd 45%, #fdb4c5 72%);
}
.planet--gold {
  --scale: 1;
  --light: #ffedba;
  --shade: #452414;
  --glow: #ecab6088;
  --surface: repeating-linear-gradient(150deg, #d8924a 0% 11%, #f3c887 14% 23%, #a8623c 30% 36%, #ffe1a0 42% 43%);
}
.planet--gold .planet-sphere::before {
  content: "";
  position: absolute;
  inset: 35% -27%;
  z-index: 1;
  border: 1px solid #f1be7e80;
  border-top-color: transparent;
  border-radius: 50%;
  transform: rotate(-23deg);
  box-shadow: 0 .1rem .15rem #ffbc7a51;
  pointer-events: none;
}
.planet--green {
  --scale: .7;
  --light: #b8ffe0;
  --shade: #092824;
  --glow: #66edbb80;
  --surface: radial-gradient(ellipse at 58% 35%, #216462 7%, transparent 48%),
    repeating-linear-gradient(128deg, #66dfa8 0% 13%, #31847f 18% 26%, #3cbd8e 32% 40%);
}
.planet--violet {
  --scale: .86;
  --light: #e1ccff;
  --shade: #200d45;
  --glow: #b88cff8c;
  --surface: repeating-linear-gradient(-19deg, #643998 0% 7%, #ae7cdd 12% 22%, #7852ac 26% 33%, #c8a4ff 40% 45%);
}

.planet-gate {
  --gate-accent: #e1ccff;
  width: min(25rem, calc(100% - 2rem));
  max-height: calc(100% - 2rem);
  padding: clamp(1.25rem, 5vw, 1.85rem);
  border: 1px solid color-mix(in srgb, var(--gate-accent), transparent 56%);
  border-radius: 1.3rem;
  background:
    radial-gradient(ellipse at 16% 0%, color-mix(in srgb, var(--gate-accent), transparent 88%), transparent 66%),
    #171128;
  box-shadow: 0 1.2rem 4rem #05030cbb;
  color: #fff5ee;
}
.planet-gate::backdrop {
  background: #080612be;
  backdrop-filter: blur(4px);
}
.planet-gate h2 {
  margin: 0 0 1.2rem;
  color: var(--gate-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 5vw, 2rem);
  font-weight: 400;
  line-height: 1.15;
}
.planet-gate-form {
  display: grid;
  gap: .45rem;
}
.planet-gate-form label { font-size: .94rem; }
.planet-gate input {
  width: 100%;
  min-height: 46px;
  padding: .65rem .8rem;
  border: 1px solid #c3abd362;
  border-radius: .65rem;
  background: #0f0a1d;
  color: inherit;
  letter-spacing: .2em;
  font: inherit;
}
.planet-gate input[aria-invalid="true"] { border-color: #fbaabc; }
.planet-gate-error {
  min-height: 1.25em;
  margin: 0;
  color: #ffc4d0;
  font-size: .875rem;
}
.planet-gate-message {
  margin: 0 0 1rem;
  line-height: 1.5;
}
.planet-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .65rem;
  margin-top: .65rem;
}
.planet-gate-actions button {
  min-height: 44px;
  padding: .55rem .95rem;
  border: 1px solid #c3abd362;
  border-radius: .65rem;
  background: #201633;
  color: #fff5ee;
  font: inherit;
  cursor: pointer;
}
.planet-gate-actions button[type="submit"] {
  border-color: var(--gate-accent);
  background: var(--gate-accent);
  color: #21142f;
  font-weight: 600;
}
.planet-gate-actions button:hover { filter: brightness(1.14); }
.planet-gate :focus-visible { outline: 2px solid var(--gate-accent); outline-offset: 3px; }
.planet-gate [hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .meteor { animation: none; }
  .planet-sphere { transition: none; }
}
