:root {
  color-scheme: dark;
  --color-text: #fff;
  --color-button-start: #ff5e62;
  --color-button-end: #ff9966;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #303b50;
}

body {
  margin: 0;
  color: var(--color-text);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .35)),
    url("./assets/mountains.jpg") center / cover no-repeat;
}

.page {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-rows: 1fr auto;
  position: relative;
  padding: 64px 24px 22px;
}

.welcome {
  width: 100%;
  max-width: 1100px;
  margin: auto;
  text-align: center;
  padding: 0 0 8px;
}

.greeting {
  margin: 0 0 20px;
  font-size: 18px;
  line-height: 1.5;
  opacity: .85;
}

h1 {
  margin: 0 0 36px;
  font-size: 60px;
  font-weight: 600;
  line-height: 1.4;
  text-shadow: 0 4px 24px rgba(0, 0, 0, .4);
}

.quote {
  margin: 0 0 56px;
  font-size: 20px;
  line-height: 2;
  opacity: .92;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .4);
}

.quote > span {
  display: block;
  text-wrap: balance;
}

.download-area {
  position: relative;
}

.download-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 16px 48px;
  max-width: 100%;
  color: var(--color-text);
  background: linear-gradient(135deg, var(--color-button-start), var(--color-button-end));
  border-radius: 999px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(255, 94, 98, .4), 0 0 0 8px rgba(255, 255, 255, .12);
  transition: transform .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.download-btn img {
  display: block;
  flex-shrink: 0;
}

.download-btn:active {
  transform: scale(.98);
}

a:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 7px;
}

.fallback {
  margin: 22px 0 0;
  font-size: 14px;
  line-height: 1.7;
  text-shadow: 0 2px 8px #000;
}

.fallback a {
  color: #ffd591;
  margin-inline: 4px;
  text-underline-offset: 3px;
}

footer {
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  opacity: .75;
  padding-top: 40px;
}

footer span {
  white-space: nowrap;
}

.toast {
  position: fixed;
  top: max(24px, env(safe-area-inset-top));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  background: rgba(0, 0, 0, .75);
  opacity: 0;
  transform: translate(-50%, -12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (hover: hover) {
  .download-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 40px rgba(255, 94, 98, .55), 0 0 0 8px rgba(255, 255, 255, .2);
  }
}

@media (min-width: 1600px) {
  .page {
    padding-top: 80px;
    padding-bottom: 26px;
  }

  .greeting {
    font-size: 23px;
    margin-bottom: 24px;
  }

  h1 {
    font-size: 74px;
    margin-bottom: 44px;
  }

  .quote {
    font-size: 25px;
    margin-bottom: 70px;
  }

  .download-btn {
    min-height: 80px;
    padding: 20px 60px;
    gap: 18px;
    font-size: 25px;
  }

  .download-btn img {
    width: 28px;
    height: 28px;
  }

  footer {
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .page {
    padding: max(44px, env(safe-area-inset-top)) 24px max(20px, env(safe-area-inset-bottom));
  }

  .welcome {
    padding-bottom: 24px;
  }

  .greeting {
    font-size: 15px;
    margin-bottom: 20px;
  }

  h1 {
    font-size: 36px;
    line-height: 1.45;
    margin-bottom: 28px;
  }

  .title-ending {
    display: block;
  }

  .quote {
    max-width: 440px;
    margin: 0 auto 40px;
    font-size: 16px;
    line-height: 1.9;
  }

  .quote > span + span {
    margin-top: 6px;
  }

  .download-btn {
    min-height: 60px;
    padding: 16px 30px;
    font-size: 18px;
    gap: 12px;
    width: 300px;
  }

  footer {
    font-size: 12px;
    padding-top: 40px;
  }
}

@media (max-width: 359px) {
  .page {
    padding-inline: 18px;
  }

  h1 {
    font-size: 32px;
  }

  .download-btn {
    padding-inline: 22px;
    font-size: 17px;
  }
}

@media (max-height: 600px) and (min-width: 768px) {
  .page {
    padding-top: 32px;
  }

  h1 {
    font-size: 40px;
    margin-bottom: 20px;
  }

  .quote {
    font-size: 17px;
    line-height: 1.8;
    margin-bottom: 30px;
  }
}

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