*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg-deep: #06080f;
  --bg-mid: #0c1220;
  --accent: #3d8bfd;
  --accent-soft: rgba(61, 139, 253, 0.22);
  --accent-glow-a: rgba(61, 139, 253, 0.18);
  --accent-glow-b: rgba(120, 160, 255, 0.08);
  --text: #e8ecf4;
  --text-muted: rgba(232, 236, 244, 0.58);
  --edge: rgba(255, 255, 255, 0.06);
  --grid-line: rgba(255, 255, 255, 0.075);
  --note-muted: rgba(232, 236, 244, 0.45);
  --footnote-muted: rgba(232, 236, 244, 0.32);
  --domain-muted: rgba(61, 139, 253, 0.55);
  --horizon-tint: rgba(12, 18, 32, 0.45);
  --logo-shadow: rgba(0, 0, 0, 0.45);
  --theme-color: #06080f;
  --splash-outer-pad: clamp(10px, 2.5vw, 16px);
  --splash-panel-w: 390px;
  --splash-panel-h: 780px;
  --splash-glow-beyond: 2.88;
  /* Radial glow mask: JS sets px stops — clear center → peak at first ring → fade out. */
  --splash-glow-mask-0: 0px;
  --splash-glow-mask-rise: 34px;
  --splash-glow-mask-peak: 76px;
  --splash-glow-mask-midout: 108px;
  --splash-glow-mask-out: 520px;
}

html.splash-page,
body.splash-page {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body.splash-page {
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

.splash {
  position: relative;
  box-sizing: border-box;
  --glow-cx: 50%;
  --glow-cy: 35%;
  min-height: 100dvh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 100svh;
  height: 100svh;
  max-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--splash-outer-pad);
  overflow: hidden;
}

.splash__grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at center, var(--grid-line) 1px, transparent 1.15px);
  background-size: 20px 20px;
  mask-image: radial-gradient(ellipse 92% 85% at 50% 28%, black 0%, black 22%, transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.splash__horizon {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42vh;
  background: linear-gradient(to top, var(--horizon-tint), transparent 88%);
  pointer-events: none;
  z-index: 0;
}

.splash__panel {
  position: relative;
  z-index: 2;
  width: min(var(--splash-panel-w), calc(100vw - 2 * var(--splash-outer-pad)));
  height: min(var(--splash-panel-h), 100%);
  max-height: 100%;
  min-height: 0;
  flex-shrink: 1;
  padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.35rem) clamp(1rem, 3vw, 1.25rem);
  border: 2px solid var(--accent);
  border-radius: clamp(22px, 5vw, 32px);
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
}

.splash__content {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  text-align: center;
  width: 100%;
}

.splash__hero {
  position: relative;
  display: flex;
  justify-content: center;
  width: 100%;
  margin: 0.25rem auto clamp(1.25rem, 4vw, 1.75rem);
}

.splash__glow {
  position: absolute;
  left: var(--glow-cx, 50%);
  top: var(--glow-cy, 35%);
  transform: translate(-50%, -50%);
  width: calc(var(--splash-glow-beyond) * min(var(--splash-panel-w), 100vw - 2 * var(--splash-outer-pad)));
  height: calc(var(--splash-glow-beyond) * min(var(--splash-panel-w), 100vw - 2 * var(--splash-outer-pad)));
  aspect-ratio: 1;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 52% 50% at 50% 50%, var(--accent-glow-a), transparent 62%),
    radial-gradient(ellipse 48% 46% at 50% 50%, var(--accent-soft), transparent 58%),
    radial-gradient(ellipse 42% 40% at 50% 50%, var(--accent-glow-b), transparent 56%);
  /*
    Luminance mask: clear at center → build to peak at first radar ring (.splash__ring--c, 56% dia)
    → dissipate outward. White = show glow; transparent = hide.
  */
  -webkit-mask-image: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0) var(--splash-glow-mask-0, 0px),
    rgba(255, 255, 255, 0.28) var(--splash-glow-mask-rise, 34px),
    #fff var(--splash-glow-mask-peak, 76px),
    rgba(255, 255, 255, 0.42) var(--splash-glow-mask-midout, 108px),
    rgba(255, 255, 255, 0) var(--splash-glow-mask-out, 520px)
  );
  mask-image: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0) var(--splash-glow-mask-0, 0px),
    rgba(255, 255, 255, 0.28) var(--splash-glow-mask-rise, 34px),
    #fff var(--splash-glow-mask-peak, 76px),
    rgba(255, 255, 255, 0.42) var(--splash-glow-mask-midout, 108px),
    rgba(255, 255, 255, 0) var(--splash-glow-mask-out, 520px)
  );
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

.splash__radar {
  position: relative;
  z-index: 1;
  width: min(260px, 84%);
  aspect-ratio: 1;
  margin: 0;
}

.splash__rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.splash__ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--accent);
  box-sizing: border-box;
}

.splash__ring--a {
  width: 100%;
  height: 100%;
  opacity: 0.28;
}

.splash__ring--b {
  width: 78%;
  height: 78%;
  opacity: 0.52;
}

.splash__ring--c {
  width: 56%;
  height: 56%;
  opacity: 0.9;
}

.splash__radar-core {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 44%;
  height: 44%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash__radar-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 24px var(--logo-shadow));
}

.splash__headline {
  margin: 0 0 1rem;
  font-size: clamp(1.5rem, 4.2vw, 1.95rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text);
}

.splash__headline--hero {
  color: var(--accent);
  font-size: clamp(1.65rem, 5.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.splash__lead {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 0.98rem;
  color: var(--text-muted);
  text-align: center;
  text-wrap: pretty;
}

.splash__strong {
  color: var(--text);
  font-weight: 600;
}

.splash__grow {
  flex: 1 1 auto;
  min-height: 1rem;
}

.splash__footer-tag {
  flex-shrink: 0;
  padding-top: 0.5rem;
}

.splash__dashed-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.45rem;
  border-radius: 50%;
  border: 2px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  opacity: 0.95;
}

.splash__dashed-icon img {
  width: 68%;
  height: 68%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px var(--logo-shadow));
}

.splash__tagline {
  margin: 0 0 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--note-muted);
}

.splash__footnote {
  margin: 0;
  font-size: 0.75rem;
  color: var(--footnote-muted);
}

.splash__domain {
  color: var(--domain-muted);
}

@media (max-width: 640px) {
  .splash {
    min-height: 100dvh;
    height: 100dvh;
    max-height: 100dvh;
    min-height: 100svh;
    height: 100svh;
    max-height: 100svh;
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px))
      max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    align-items: stretch;
    justify-content: stretch;
  }

  .splash__panel {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    max-height: none;
    border: 2px solid var(--accent);
    border-radius: clamp(18px, 4vw, 26px);
    padding: clamp(1.25rem, 4vw, 1.75rem) clamp(1rem, 4vw, 1.35rem) clamp(1rem, 3vw, 1.25rem);
  }

  .splash__radar {
    width: min(280px, 78vw);
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash__radar-logo,
  .splash__dashed-icon img {
    filter: drop-shadow(0 2px 10px var(--logo-shadow));
  }
}
