:root {
  --text: #f7f8fc;
  --muted: rgba(247, 248, 252, 0.82);
  --accent: #f2f7ff;
  --panel: rgba(255,255,255,0.05);
  --panel-border: rgba(255,255,255,0.12);
  --sky-top: #010103;
  --sky-mid: #04050a;
  --sky-bottom: #090b12;
}

body.day {
  --sky-top: #1a6db5;
  --sky-mid: #5ba3d0;
  --sky-bottom: #a8d4f0;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  overflow: hidden;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 48%, var(--sky-bottom) 100%);
}

.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  isolation: isolate;
}

.stars,
.stars::before,
.stars::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.95) 0 1.2px, transparent 1.4px),
    radial-gradient(circle at 24% 42%, rgba(255,255,255,.72) 0 1px, transparent 1.2px),
    radial-gradient(circle at 68% 22%, rgba(255,255,255,.88) 0 1.1px, transparent 1.3px),
    radial-gradient(circle at 82% 34%, rgba(255,255,255,.7) 0 1px, transparent 1.2px),
    radial-gradient(circle at 55% 12%, rgba(255,255,255,.9) 0 1.2px, transparent 1.4px),
    radial-gradient(circle at 91% 14%, rgba(255,255,255,.78) 0 1px, transparent 1.2px),
    radial-gradient(circle at 37% 26%, rgba(255,255,255,.8) 0 1px, transparent 1.2px),
    radial-gradient(circle at 6% 32%, rgba(255,255,255,.65) 0 .9px, transparent 1.1px),
    radial-gradient(circle at 44% 8%, rgba(255,255,255,.82) 0 1px, transparent 1.2px),
    radial-gradient(circle at 77% 44%, rgba(255,255,255,.6) 0 .9px, transparent 1.1px),
    radial-gradient(circle at 18% 52%, rgba(255,255,255,.5) 0 .8px, transparent 1px),
    radial-gradient(circle at 60% 36%, rgba(255,255,255,.7) 0 1px, transparent 1.2px),
    radial-gradient(circle at 33% 14%, rgba(255,255,255,.85) 0 1.1px, transparent 1.3px),
    radial-gradient(circle at 88% 28%, rgba(255,255,255,.6) 0 .9px, transparent 1.1px);
  z-index: -4;
  opacity: .9;
}

.stars::before { transform: scale(1.1); opacity: .55; filter: blur(.2px); }
.stars::after  { transform: scale(1.25); opacity: .35; filter: blur(.4px); }

body.day .stars,
body.day .stars::before,
body.day .stars::after { display: none; }

.mountains,
.mountains::before,
.mountains::after {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  content: "";
  z-index: -3;
}

.mountains {
  height: 36vh;
  background: #020203;
  clip-path: polygon(
    0 100%, 0 70%,
    4% 62%, 8% 52%, 11% 40%, 13% 32%, 15% 24%, 17% 32%, 19% 44%,
    22% 34%, 25% 20%, 27% 14%, 29% 20%, 32% 34%,
    35% 22%, 38% 10%, 40% 4%, 42% 10%, 45% 24%,
    48% 14%, 51% 6%, 53% 2%, 55% 6%, 58% 20%,
    62% 10%, 65% 4%, 67% 10%, 70% 24%,
    73% 14%, 76% 8%, 79% 14%, 82% 26%,
    86% 16%, 89% 10%, 92% 16%, 95% 28%,
    98% 22%, 100% 28%, 100% 100%
  );
  opacity: .95;
}

.mountains::before {
  height: 30vh;
  background: #06070a;
  clip-path: polygon(
    0 100%, 0 76%,
    4% 66%, 8% 54%, 12% 44%, 15% 36%, 17% 28%, 19% 36%, 22% 48%,
    25% 38%, 28% 24%, 30% 16%, 32% 24%, 35% 38%,
    38% 26%, 41% 14%, 44% 6%, 46% 14%, 49% 28%,
    53% 16%, 56% 8%, 59% 14%, 62% 28%,
    66% 16%, 69% 10%, 72% 16%, 75% 30%,
    79% 20%, 83% 12%, 86% 20%, 89% 34%,
    93% 24%, 97% 18%, 100% 24%, 100% 100%
  );
  opacity: .9;
}

.mountains::after {
  height: 22vh;
  background: #0b0d13;
  clip-path: polygon(
    0 100%, 0 82%,
    4% 74%, 8% 64%, 12% 54%, 16% 44%, 19% 36%, 21% 44%, 24% 56%,
    27% 44%, 30% 32%, 33% 22%, 35% 32%, 38% 46%,
    42% 34%, 45% 20%, 48% 10%, 50% 20%, 53% 36%,
    57% 24%, 61% 12%, 64% 20%, 67% 36%,
    71% 24%, 75% 14%, 78% 24%, 81% 38%,
    85% 26%, 89% 16%, 93% 26%, 96% 38%,
    100% 32%, 100% 100%
  );
  opacity: .75;
}

body.day .mountains {
  background: linear-gradient(180deg, #8BA8B4 0%, #6A8A96 100%);
  opacity: 0.88;
}
body.day .mountains::before {
  background: linear-gradient(180deg, #4A6B40 0%, #354E2C 100%);
  opacity: 0.95;
}
body.day .mountains::after {
  background: linear-gradient(180deg, #2D4220 0%, #1C2C14 100%);
  opacity: 1;
}

.sun {
  position: absolute;
  top: 8%;
  right: 8%;
  width: clamp(55px, 7vw, 100px);
  height: clamp(55px, 7vw, 100px);
  border-radius: 50%;
  background: radial-gradient(circle, #fffde0 0%, #ffe566 30%, #ffb700 60%, transparent 78%);
  box-shadow:
    0 0 clamp(30px,4vw,55px) clamp(14px,2vw,28px) rgba(255,205,50,.38),
    0 0 clamp(70px,9vw,120px) clamp(35px,5vw,65px) rgba(255,165,0,.16);
  display: none;
  z-index: -1;
}
body.day .sun { display: block; }

#star-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -2;
}
body.day #star-canvas { display: none; }

.card {
  max-width: 760px;
  text-align: center;
  padding: 40px 28px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,.45);
}

body.day .card {
  --panel: rgba(10,30,80,0.32);
  --panel-border: rgba(255,255,255,0.22);
  box-shadow: 0 18px 60px rgba(0,15,60,.28);
}

.eyebrow {
  margin: 0 0 14px;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1.08;
  font-weight: 700;
  text-shadow: 0 6px 34px rgba(0,0,0,.6);
}

.message {
  margin: 18px auto 0;
  max-width: 32ch;
  font-size: clamp(1rem, 2.3vw, 1.25rem);
  color: var(--muted);
  line-height: 1.7;
}

.soon {
  margin-top: 28px;
  display: inline-block;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: .95rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.18);
  box-shadow: 0 0 18px rgba(255,255,255,.06) inset;
}

/* Navigation */
.nav {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 100;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  backdrop-filter: blur(8px);
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(247,248,252,.88);
  border-radius: 999px;
  transition: transform .22s ease, opacity .2s ease;
  transform-origin: center;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 160px;
  background: rgba(255,255,255,.07);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}

.nav-menu.open {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.nav-link {
  display: block;
  padding: 10px 14px;
  color: rgba(247,248,252,.82);
  text-decoration: none;
  font-size: 14px;
  border-radius: 8px;
  letter-spacing: .02em;
  transition: background .14s, color .14s;
}

.nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav-link.active { background: rgba(255,255,255,.12); color: #fff; }

/* Theme toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  color: rgba(247,248,252,.88);
  transition: background .15s, border-color .15s;
}

.theme-toggle:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.25); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: block; }

body.day .theme-toggle { background: rgba(10,30,80,.1); border-color: rgba(10,30,80,.18); color: rgba(10,30,80,.75); }
body.day .theme-toggle:hover { background: rgba(10,30,80,.16); }
body.day .theme-toggle .icon-sun  { display: block; }
body.day .theme-toggle .icon-moon { display: none; }

/* Entrance animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.nav  { animation: fadeUp .4s cubic-bezier(.22,.68,0,1.2) both; }
.card { animation: fadeUp .65s cubic-bezier(.22,.68,0,1.2) .12s both; }

@media (prefers-reduced-motion: reduce) {
  .nav, .card { animation: none; }
}

@media (max-width: 640px) {
  .card { padding: 28px 20px; border-radius: 20px; }
  .message { max-width: 26ch; }
  .mountains { height: 30vh; }
  .mountains::before { height: 24vh; }
  .mountains::after { height: 18vh; }
}
