:root {
  color-scheme: dark;
  font-family: Tahoma, "Segoe UI", sans-serif;
  background: #070707;
  color: #f7f4ed;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: #f3efe7;
  color: #211f1b;
}

a { color: inherit; }

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
  color: #fff;
  opacity: 1;
  transition: opacity 420ms ease, visibility 420ms ease;
}

#starfield,
#distant-explosion {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.loading-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-shell {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(92vw, 560px);
  padding: 28px;
  text-align: center;
}

.loader-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(86vw, 380px);
  height: min(86vw, 380px);
}

#solar-loader-canvas {
  display: block;
  width: min(86vw, 340px);
  height: min(86vw, 340px);
  cursor: default;
  outline: none;
}

#solar-loader-canvas.is-planet-hover { cursor: pointer; }

#solar-loader-canvas:focus-visible {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .8), 0 0 24px rgba(255, 214, 117, .35);
}

.sun-activity {
  position: absolute;
  inset: 0;
  width: 12.5%;
  height: 12.5%;
  margin: auto;
  pointer-events: none;
  border-radius: 50%;
}

.sun-activity span {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: var(--size);
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(255, 79, 65, .45);
  box-shadow: 0 0 3px 1px rgba(255, 104, 81, .18), 0 0 6px 2px rgba(255, 57, 39, .12);
  opacity: 0;
  animation: sun-highlight var(--duration) ease-in-out forwards;
}

@keyframes sun-highlight {
  0% { transform: scale(.25); opacity: 0; }
  18% { transform: scale(1.15); opacity: .5; }
  65% { transform: scale(1); opacity: .38; }
  100% { transform: scale(.2); opacity: 0; }
}

.loading-label {
  max-width: 470px;
  margin: 0;
  color: #fff;
  font-size: clamp(.86rem, 1.65vw, 1.08rem);
  font-weight: 600;
  line-height: 1.8;
  text-wrap: balance;
}

.loading-source {
  min-height: 1.8em;
  margin: 0;
  color: #a8a8a8;
  font-size: .78rem;
  line-height: 1.8;
}

.admin-link {
  margin-top: -3px;
  color: rgba(255, 255, 255, .5);
  direction: ltr;
  font-size: .7rem;
  line-height: 1.6;
  text-decoration: none;
  transition: color 160ms ease;
}

.admin-link:hover,
.admin-link:focus-visible { color: rgba(255, 255, 255, .86); text-decoration: underline; }

.planet-info {
  position: absolute;
  inset-inline-end: clamp(16px, 4vw, 48px);
  inset-block-end: clamp(16px, 4vw, 48px);
  z-index: 4;
  width: min(330px, calc(100vw - 32px));
  padding: 20px 22px 18px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 18px;
  background: rgba(14, 14, 14, .94);
  box-shadow: 0 16px 50px rgba(0, 0, 0, .45);
  color: #fff;
  text-align: start;
  backdrop-filter: blur(10px);
}

.planet-info[hidden] { display: none; }

.planet-info-close {
  position: absolute;
  inset-inline-end: 10px;
  inset-block-start: 8px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #bdbdbd;
  cursor: pointer;
  font: inherit;
  font-size: 1.35rem;
  line-height: 1;
}

.planet-info-close:hover,
.planet-info-close:focus-visible { background: rgba(255, 255, 255, .12); color: #fff; }

.planet-info-kicker {
  margin: 0 0 8px;
  color: #d7b66e;
  font-size: .72rem;
  line-height: 1.5;
}

.planet-info h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 1.15rem;
  line-height: 1.5;
}

.planet-info-fact,
.planet-info-meta {
  margin: 0;
  color: #e8e8e8;
  font-size: .82rem;
  line-height: 1.9;
}

.planet-info-meta { margin-top: 8px; color: #ababab; font-size: .74rem; }

.meteor-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.meteor {
  position: absolute;
  top: var(--top);
  right: var(--right);
  width: 4px;
  height: 2px;
  border-radius: 0;
  background: rgba(255, 255, 255, .55);
  box-shadow: 0 0 3px 1px rgba(255, 255, 255, .16);
  opacity: 0;
  animation: meteor-flight 24s ease-in-out forwards;
}

.meteor::before {
  position: absolute;
  top: 50%;
  left: 3px;
  width: clamp(90px, 16vw, 180px);
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .15) 42%, rgba(255, 255, 255, .36));
  box-shadow: 0 0 4px 1px rgba(255, 255, 255, .1);
  content: "";
  transform: translateY(-50%) rotate(var(--tail-angle, -30deg));
  transform-origin: left center;
}

.meteor-impact { animation-name: meteor-impact; }

@keyframes meteor-impact {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  8% { opacity: .44; }
  100% { opacity: .5; transform: translate3d(var(--flight-x), var(--flight-y), 0); }
}

@keyframes meteor-flight {
  0% { opacity: 0; transform: translate3d(0, 0, 0); }
  12% { opacity: .44; transform: translate3d(-2vw, 1.2vw, 0); }
  74% { opacity: .32; transform: translate3d(-62vw, 35.8vw, 0); }
  100% { opacity: 0; transform: translate3d(-80vw, 46.2vw, 0); }
}

.ambient-highlights {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.ambient-highlight {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--length);
  height: 1px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent);
  box-shadow: 0 0 4px rgba(255, 255, 255, .12);
  transform: translate(-50%, -50%) rotate(var(--angle));
  animation: ambient-glimmer var(--duration) ease-in-out var(--delay) forwards;
}

@keyframes ambient-glimmer {
  0%, 100% { opacity: 0; }
  40% { opacity: .75; }
  65% { opacity: .36; }
}

.site-page {
  min-height: 100svh;
  padding: 28px clamp(20px, 5vw, 80px) 56px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 500ms ease 120ms, transform 500ms ease 120ms;
}

.site-page.is-ready { opacity: 1; transform: none; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1180px;
  margin: 0 auto;
}

.brand {
  color: #211f1b;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
}

.site-header nav { display: flex; gap: 20px; color: #6c665d; font-size: .85rem; }
.site-header nav a { text-decoration: none; }
.site-header nav a:hover { color: #211f1b; }

.hero {
  max-width: 820px;
  margin: clamp(84px, 16vh, 180px) auto 110px;
  text-align: center;
}

.eyebrow { margin: 0 0 18px; color: #a06335; font-size: .78rem; letter-spacing: .08em; }
.hero h1 { max-width: 760px; margin: 0 auto 24px; font-size: clamp(2rem, 5vw, 4.8rem); line-height: 1.25; letter-spacing: -.04em; }
.hero > p:not(.eyebrow) { max-width: 620px; margin: 0 auto 32px; color: #6c665d; font-size: 1rem; line-height: 2; }
.primary-button { display: inline-flex; padding: 13px 22px; border-radius: 999px; background: #211f1b; color: #fff; text-decoration: none; }

.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 1180px; margin: 0 auto; }
.feature-grid article { min-height: 190px; padding: 24px; border: 1px solid #ddd5c8; border-radius: 20px; background: rgba(255, 255, 255, .45); }
.feature-grid span { color: #a06335; font-size: .8rem; }
.feature-grid h2 { margin: 36px 0 10px; font-size: 1.1rem; }
.feature-grid p { margin: 0; color: #6c665d; font-size: .9rem; line-height: 1.9; }

footer { max-width: 1180px; margin: 84px auto 0; color: #817a70; font-size: .75rem; text-align: center; }

@media (max-width: 700px) {
  .site-header nav { display: none; }
  .hero { margin-top: 110px; margin-bottom: 72px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-grid article { min-height: auto; }
  .feature-grid h2 { margin-top: 24px; }

  .planet-info {
    inset-inline: 16px;
    inset-inline-end: 16px;
    inset-block-end: 16px;
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .meteor { display: none; }
  .sun-activity span { animation: none; opacity: .42; }
}
