/* Space Member System — Space Operations Theme V2
   Professional Deep Space / Orbital Day
   No repeating star-dot grid.
*/
:root{
  --bg:#020611;
  --bg2:#061225;
  --surface:rgba(8,20,40,.88);
  --surface-solid:#09162c;
  --surface-soft:rgba(13,31,58,.76);
  --input:#071329;
  --text:#edf7ff;
  --muted:#91a9c8;
  --border:rgba(101,174,255,.20);
  --primary:#62a8ff;
  --primary-strong:#287ef0;
  --accent:#52ddf7;
  --green:#54dfa8;
  --yellow:#ffd166;
  --red:#ff7185;
  --shadow:0 20px 60px rgba(0,0,0,.38);
  --glow:0 0 32px rgba(82,221,247,.07);
  --radius:18px;
  --radius-sm:11px;
  color-scheme:dark;
}

html[data-theme="light"]{
  --bg:#f3f8fd;
  --bg2:#e2f0fb;
  --surface:rgba(255,255,255,.90);
  --surface-solid:#ffffff;
  --surface-soft:rgba(245,250,255,.90);
  --input:#f7fbff;
  --text:#10243d;
  --muted:#617995;
  --border:rgba(29,102,175,.16);
  --primary:#1769d2;
  --primary-strong:#0959bd;
  --accent:#008eaf;
  --green:#16865f;
  --yellow:#956800;
  --red:#cf4057;
  --shadow:0 18px 50px rgba(48,91,135,.12);
  --glow:0 0 30px rgba(35,136,215,.06);
  color-scheme:light;
}

html{
  background:var(--bg);
  scroll-behavior:smooth;
}

body{
  margin:0;
  color:var(--text);
  background:
    radial-gradient(ellipse at 82% -10%,rgba(48,137,255,.24) 0%,rgba(22,78,158,.10) 26%,transparent 52%),
    radial-gradient(ellipse at -8% 92%,rgba(32,205,231,.09) 0%,transparent 40%),
    linear-gradient(145deg,var(--bg) 0%,var(--bg2) 58%,#020712 100%);
  background-attachment:fixed;
}

/* Orbital Day */
html[data-theme="light"] body{
  background:
    radial-gradient(ellipse at 84% -12%,rgba(74,169,255,.24) 0%,rgba(116,199,255,.10) 32%,transparent 56%),
    radial-gradient(ellipse at -10% 88%,rgba(70,183,224,.10) 0%,transparent 42%),
    linear-gradient(145deg,var(--bg) 0%,var(--bg2) 62%,#f7fbff 100%);
}

/* Existing .stars markup becomes a subtle orbital/atmospheric layer.
   No tiled dots or repeating grid. */
.stars{
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  opacity:1;
  background:none !important;
  overflow:hidden;
}

/* Large orbital arc */
.stars::before{
  content:"";
  position:absolute;
  width:min(1050px,105vw);
  height:min(1050px,105vw);
  right:-32vw;
  top:-63vw;
  border:1px solid rgba(102,184,255,.13);
  border-radius:50%;
  box-shadow:
    0 0 80px rgba(67,151,255,.04),
    inset 0 0 80px rgba(67,151,255,.025);
  transform:rotate(-13deg);
}

/* Secondary trajectory arc */
.stars::after{
  content:"";
  position:absolute;
  width:min(780px,90vw);
  height:min(360px,42vw);
  left:-20vw;
  bottom:-22vw;
  border-top:1px solid rgba(79,222,244,.10);
  border-radius:50%;
  transform:rotate(12deg);
  filter:drop-shadow(0 0 14px rgba(79,222,244,.04));
}

html[data-theme="light"] .stars::before{
  border-color:rgba(24,109,190,.12);
  box-shadow:0 0 70px rgba(54,142,213,.04);
}

html[data-theme="light"] .stars::after{
  border-top-color:rgba(13,133,172,.10);
}

/* Glass controls */
.theme-toggle{
  width:44px;
  height:44px;
  display:inline-grid;
  place-items:center;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface-soft);
  color:var(--text);
  cursor:pointer;
  font-size:18px;
  box-shadow:var(--glow);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  transition:border-color .18s ease,transform .18s ease,background .18s ease;
}

.theme-toggle:hover{
  border-color:var(--primary);
  transform:translateY(-1px);
}

.theme-toggle:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
}

html:not(.theme-ready) *{
  transition:none !important;
}

/* Mobile/tablet: keep orbital decoration quiet and uncluttered. */
@media(max-width:768px){
  body{background-attachment:scroll}
  .stars::before{
    width:115vw;
    height:115vw;
    right:-66vw;
    top:-45vw;
    opacity:.72;
  }
  .stars::after{
    width:115vw;
    height:52vw;
    left:-48vw;
    bottom:-20vw;
    opacity:.62;
  }
}

@media(max-width:480px){
  .stars::before{opacity:.48}
  .stars::after{opacity:.42}
}

@media(prefers-reduced-motion:reduce){
  .theme-toggle{transition:none}
}
