:root {
  --night-0: #050818;
  --night-1: #0a0f2c;
  --night-2: #151b45;
  --violet: #2b2466;
  --gold: #f5d38a;
  --gold-2: #e5b35a;
  --rose: #f4a9c4;
  --moon: #fff4d6;
  --text: #eef0ff;
  --muted: #a6abd4;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.13);
  --paper: #fbf5e9;
  --ink: #2d2744;
  --radius: 18px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  color: var(--text);
  font-family: 'Quicksand', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: radial-gradient(ellipse 120% 80% at 50% -10%, #2f2870 0%, #171d4a 42%, #0a0f2c 72%, #050818 100%) fixed;
  background-color: var(--night-1);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ---------- moon ---------- */
.moon {
  --size: 140px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  position: relative;
  flex: none;
  background: radial-gradient(circle at 34% 32%, #fffdf0 0%, #fff2cc 40%, #f0d897 74%, #d7b56c 100%);
  box-shadow:
    0 0 calc(var(--size) * 0.3) calc(var(--size) * 0.07) rgba(255, 236, 180, 0.35),
    0 0 calc(var(--size) * 0.9) calc(var(--size) * 0.25) rgba(245, 211, 138, 0.14),
    inset calc(var(--size) * -0.09) calc(var(--size) * -0.07) calc(var(--size) * 0.2) rgba(160, 120, 50, 0.35);
  animation: moonFloat 7s ease-in-out infinite, moonGlow 5s ease-in-out infinite;
}
.moon::before, .moon::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(190, 150, 80, 0.22);
}
.moon::before { width: 22%; height: 22%; top: 20%; left: 54%; }
.moon::after {
  width: 13%; height: 13%; top: 58%; left: 28%;
  box-shadow: calc(var(--size) * 0.34) calc(var(--size) * 0.06) 0 calc(var(--size) * -0.015) rgba(190, 150, 80, 0.18),
              calc(var(--size) * 0.1) calc(var(--size) * -0.3) 0 calc(var(--size) * -0.04) rgba(190, 150, 80, 0.16);
}

.moon.crescent {
  background: transparent;
  box-shadow: inset calc(var(--size) * -0.26) calc(var(--size) * 0.04) 0 0 #fff0c4,
              0 0 0 0 transparent;
  filter: drop-shadow(0 0 calc(var(--size) * 0.18) rgba(255, 230, 170, 0.55));
  animation: moonFloat 7s ease-in-out infinite;
}
.moon.crescent::before, .moon.crescent::after { display: none; }

@keyframes moonFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes moonGlow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

/* ---------- buttons ---------- */
.btn {
  appearance: none;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  padding: 0.7em 1.2em;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, #ffe6a8 0%, var(--gold) 45%, var(--gold-2) 100%);
  color: #2a2046;
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(245, 211, 138, 0.3);
}
.btn-primary:hover { background: linear-gradient(135deg, #fff0c7 0%, #f8dc9d 45%, #eabd6a 100%); box-shadow: 0 10px 38px rgba(245, 211, 138, 0.45); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
