:root {
  color-scheme: light dark;
  --background-color: #ffffff;
  --foreground-color: #050505;
  --splash-background-color: #020608;
  --splash-muted-color: rgba(255, 255, 255, 0.18);
  --splash-accent-color: rgba(255, 255, 255, 0.84);
  --gate-card-color: rgba(5, 5, 5, 0.04);
  --gate-border-color: rgba(5, 5, 5, 0.12);
  --gate-muted-text-color: rgba(5, 5, 5, 0.58);
  --store-button-color: #050505;
  --store-button-text-color: #ffffff;
  --selection-background-color: rgba(5, 5, 5, 0.12);
}

@media (prefers-color-scheme: dark) {
  :root {
    --background-color: #020608;
    --foreground-color: rgba(255, 255, 255, 0.9);
    --gate-card-color: rgba(255, 255, 255, 0.06);
    --gate-border-color: rgba(255, 255, 255, 0.14);
    --gate-muted-text-color: rgba(255, 255, 255, 0.58);
    --store-button-color: rgba(255, 255, 255, 0.92);
    --store-button-text-color: #020608;
    --selection-background-color: rgba(140, 205, 235, 0.24);
  }
}

* {
  box-sizing: border-box;
}

::selection {
  background: var(--selection-background-color);
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--splash-background-color);
}

body {
  min-height: 100vh;
  color: var(--foreground-color);
}

#splash-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--splash-background-color);
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease-out, visibility 180ms ease-out;
  z-index: 9999;
}

#splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  display: grid;
  justify-items: center;
  gap: 20px;
}

.splash-icon {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.splash-spinner {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid var(--splash-muted-color);
  border-top-color: var(--splash-accent-color);
  animation: splash-spin 900ms linear infinite;
}

#install-gate {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  overflow: auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 18%, rgba(140, 205, 235, 0.2), transparent 34%),
    var(--background-color);
  color: var(--foreground-color);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  z-index: 10000;
}

#install-gate.visible {
  display: grid;
}

.install-card {
  width: min(390px, 100%);
  position: relative;
  display: grid;
  justify-items: center;
  gap: 24px;
  margin: auto;
  padding: 42px clamp(18px, 5vw, 34px) 26px;
  border: 1px solid var(--gate-border-color);
  border-radius: 32px;
  background: var(--gate-card-color);
  box-shadow:
    0 18px 34px rgba(2, 6, 8, 0.12),
    0 6px 14px rgba(2, 6, 8, 0.08);
  text-align: center;
  backdrop-filter: blur(20px);
}

@media (prefers-color-scheme: dark) {
  .install-card {
    box-shadow:
      0 22px 54px rgba(0, 0, 0, 0.44),
      0 8px 18px rgba(0, 0, 0, 0.28);
  }
}

.install-logo-corner {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 64px;
  height: 64px;
}

.install-brand {
  display: grid;
  justify-items: center;
  padding-top: 20px;
}

.brand-logo {
  width: 64px;
  height: 64px;
}

.brand-logo-dark {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .brand-logo-light {
    display: none;
  }

  .brand-logo-dark {
    display: block;
  }
}

.install-copy {
  display: grid;
  justify-items: center;
  max-width: 320px;
  width: 100%;
}

.install-title {
  margin: 0;
  color: var(--foreground-color);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.install-subtitle {
  margin: 0;
  color: var(--foreground-color);
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 680;
  line-height: 1.16;
  letter-spacing: -0.025em;
  text-align: center;
  white-space: nowrap;
}

.store-actions {
  width: 100%;
  display: grid;
  gap: 12px;
  justify-items: center;
}

.store-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.store-badge {
  width: auto;
  height: 54px;
  display: block;
  object-fit: contain;
}

.google-play-badge {
  height: 65px;
  margin: -5.5px 0;
}

.browser-button {
  border: 0;
  padding: 4px 8px;
  color: var(--gate-muted-text-color);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 650;
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.2em;
}

.browser-button:active,
.store-link:active {
  transform: translateY(1px);
}

@keyframes splash-spin {
  to {
    transform: rotate(360deg);
  }
}
