:root {
  --bg: #020413;
  --surface: #101222;
  --surface-light: #202841;
  --brand: #3a91f6;
  --brand-dark: #0d53a5;
  --text: #fff;
  --text-secondary: #9f9cb0;
  --divider: rgb(255 255 255 / 8%);
  --radius: 16px;
}

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

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

body {
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

[hidden] {
  display: none !important;
}

/* Buttons */

.install-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 36px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  background: var(--brand);
  box-shadow: 0 3px 0 var(--brand-dark);
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.install-button:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--brand-dark);
}

.install-button:disabled {
  color: var(--text-secondary);
  background: var(--surface-light);
  box-shadow: none;
  cursor: default;
}

.install-button--small {
  min-width: 72px;
  height: 30px;
  padding: 0 16px;
  font-size: 14px;
}

.install-button--wide {
  width: 100%;
  height: 48px;
  font-size: 16px;
}

/* Landing */

.landing {
  max-width: 720px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 32px);
  background: radial-gradient(120% 360px at 50% -80px, rgb(58 145 246 / 28%), transparent 70%);
}

.topbar {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 20px 10px;
  border-bottom: 1px solid var(--divider);
  background: rgb(2 4 19 / 80%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.topbar--visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.topbar__icon {
  border-radius: 8px;
}

.topbar__name {
  flex: 1;
  font-weight: 600;
}

.hero {
  display: flex;
  gap: 18px;
  align-items: center;
}

.hero__icon {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: 27px;
  box-shadow: 0 0 0 1px var(--divider), 0 12px 40px rgb(58 145 246 / 35%);
}

.hero__info {
  min-width: 0;
}

.hero__title {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.hero__subtitle {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 15px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-top: 14px;
}

.hero__note {
  color: var(--text-secondary);
  font-size: 12px;
}

.installed-hint {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  color: #8ee02e;
  font-size: 14px;
  background: rgb(125 217 52 / 12%);
}

.facts {
  display: flex;
  margin: 24px -20px 0;
  padding: 14px 20px;
  overflow-x: auto;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
  scrollbar-width: none;
}

.facts::-webkit-scrollbar {
  display: none;
}

.fact {
  display: flex;
  flex: 1 0 96px;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 0 12px;
  text-align: center;
}

.fact + .fact {
  border-left: 1px solid var(--divider);
}

.fact__label,
.fact__caption {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.fact__caption {
  text-transform: none;
  letter-spacing: 0;
}

.fact__value {
  display: flex;
  align-items: center;
  height: 28px;
  font-size: 20px;
  font-weight: 700;
}

.section {
  margin-top: 28px;
}

.section__title {
  margin-bottom: 12px;
  font-size: 21px;
  font-weight: 700;
}

.section__text {
  color: var(--text-secondary);
  font-size: 15px;
}

.gallery {
  display: flex;
  gap: 12px;
  margin: 0 -20px;
  padding: 0 20px 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 20px;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.shot {
  position: relative;
  flex: 0 0 min(82%, 420px);
  aspect-ratio: 722 / 400;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #1c7de8, #0a2a5c);
  scroll-snap-align: start;
}

.shot img {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 100%;
  height: auto;
}

.shot__caption {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 55%;
}

.shot__title {
  font-size: 22px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgb(2 4 19 / 50%);
}

.shot__text {
  color: rgb(255 255 255 / 85%);
  font-size: 13px;
  text-shadow: 0 1px 8px rgb(2 4 19 / 60%);
}

.features {
  display: grid;
  gap: 12px;
}

.feature {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
}

.feature__image {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgb(58 145 246 / 24%), transparent);
}

.feature__title {
  font-size: 16px;
  font-weight: 600;
}

.feature__text {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 14px;
}

.info {
  border-radius: var(--radius);
  background: var(--surface);
}

.info__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  font-size: 15px;
}

.info__row + .info__row {
  border-top: 1px solid var(--divider);
}

.info dt {
  color: var(--text-secondary);
}

.info dd {
  text-align: right;
}

.footer {
  margin-top: 32px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

/* Install guide */

.guide {
  width: 100%;
  max-width: 480px;
  max-height: none;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
}

.guide::backdrop {
  background: rgb(2 4 19 / 70%);
  backdrop-filter: blur(4px);
}

.guide[open] .guide__sheet {
  animation: sheet-in 0.25s ease-out;
}

.guide__sheet {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 12px 20px calc(env(safe-area-inset-bottom) + 20px);
  border-radius: 20px 20px 0 0;
  outline: none;
  background: var(--surface);
}

.guide__handle {
  align-self: center;
  width: 36px;
  height: 5px;
  border-radius: 999px;
  background: var(--surface-light);
}

.guide__header {
  display: flex;
  gap: 12px;
  align-items: center;
}

.guide__icon {
  border-radius: 12px;
}

.guide__title {
  font-size: 18px;
  font-weight: 700;
}

.guide__subtitle {
  color: var(--text-secondary);
  font-size: 14px;
}

.steps {
  display: grid;
  gap: 14px;
}

.step {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 15px;
}

.step__number {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  font-weight: 700;
  background: var(--surface-light);
}

.step__icon {
  width: 22px;
  height: 22px;
  margin: 0 2px;
  color: var(--brand);
  vertical-align: -5px;
}

@keyframes sheet-in {
  from {
    transform: translateY(100%);
  }
}

/* Installed app */

.app {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.status {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(60% 40% at 50% 45%, rgb(58 145 246 / 18%), transparent 70%), var(--bg);
}

.status__logo {
  position: relative;
  width: 96px;
  height: 96px;
}

.status__logo img {
  position: relative;
  border-radius: 22px;
  animation: logo-pulse 1.8s ease-in-out infinite;
}

.status__glow {
  position: absolute;
  inset: -12px;
  border-radius: 32px;
  background: var(--brand);
  filter: blur(28px);
  opacity: 0.45;
  animation: glow-pulse 1.8s ease-in-out infinite;
}

.status__progress {
  position: relative;
  width: 140px;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-light);
}

.status__progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 40%;
  border-radius: inherit;
  background: var(--brand);
  animation: progress 1.2s ease-in-out infinite;
}

.status__text {
  max-width: 300px;
  color: var(--text-secondary);
  font-size: 14px;
}

.status--error .status__progress {
  display: none;
}

.status--error .status__logo img {
  animation: none;
  filter: grayscale(0.6);
}

.status--error .status__glow {
  animation: none;
  opacity: 0.15;
}

@keyframes logo-pulse {
  50% {
    transform: scale(0.94);
  }
}

@keyframes glow-pulse {
  50% {
    opacity: 0.2;
    transform: scale(0.9);
  }
}

@keyframes progress {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(250%);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
