/*
 * LUNA Mast download page. Colours, corners and touch sizes follow the Ask LUNA
 * mobile DESIGN.md, so the page reads as the same family as the app it sells.
 */
:root {
  color-scheme: light dark;
  --background: #f5f5f2;
  --card: #ffffff;
  --text: #1c1c1e;
  --secondary: #62625e;
  --separator: #dadad4;
  --accent: #946800;
  --yellow: #fcb856;
  --glow: rgb(252 184 86 / 0.32);
  --shadow: 0 1px 2px rgb(28 28 30 / 0.06), 0 12px 32px rgb(28 28 30 / 0.08);
  --corner-control: 16px;
  --corner-panel: 24px;
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #101110;
    --card: #1c1d1b;
    --text: #f5f5f2;
    --secondary: #aeaea6;
    --separator: #41433b;
    --accent: #fcb856;
    --glow: rgb(252 184 86 / 0.14);
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.35);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--text);
  background:
    radial-gradient(60rem 40rem at 85% -10%, var(--glow), transparent 70%),
    radial-gradient(40rem 30rem at -10% 110%, var(--glow), transparent 70%),
    var(--background);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

h1,
h2,
p {
  margin: 0;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.masthead {
  width: 100%;
  max-width: 720px;
}

.masthead a {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
}

.logo {
  display: block;
  height: 32px;
  width: auto;
}

.card {
  width: 100%;
  max-width: 720px;
  display: grid;
  gap: 28px;
  padding: 32px 24px;
  background: var(--card);
  border-radius: var(--corner-panel);
  box-shadow: var(--shadow);
  /* Centres the card in whatever height the logo and footer leave. */
  margin-block: auto;
}

.intro {
  display: grid;
  justify-items: center;
  gap: 8px;
  text-align: center;
}

.app-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 8px;
  /* The iOS icon mask's proportion, so the icon looks as it will on a phone. */
  border-radius: 22.5%;
  box-shadow: 0 8px 24px rgb(160 100 0 / 0.25);
}

h1 {
  font-size: 2rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tagline {
  max-width: 34ch;
  color: var(--secondary);
  font-size: 1.0625rem;
}

.download {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.download h2 {
  font-size: 1.125rem;
  font-weight: 600;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.badge {
  display: block;
  border-radius: 10px;
  transition: transform 120ms ease;
}

.badge:hover {
  transform: translateY(-1px);
}

.badge:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

.badge img {
  display: block;
  height: 54px;
  width: auto;
}

/* iPadOS: platform.js sets this before the first paint and then removes them. */
html[data-target="ios"] [data-store="android"],
html[data-target="ios"] .qr {
  display: none;
}

.qr {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--separator);
  border-radius: var(--corner-panel);
}

.qr-code {
  flex: none;
  width: 136px;
  height: 136px;
  padding: 10px;
  /* White in both themes: phone cameras read dark modules on a light field. */
  background: #ffffff;
  border-radius: var(--corner-control);
}

.qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.qr-text {
  display: grid;
  gap: 4px;
}

.qr-text h2 {
  font-size: 1rem;
  font-weight: 600;
}

.qr-text p,
.fine-print {
  color: var(--secondary);
  font-size: 0.9375rem;
}

.fine-print {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--separator);
}

.footer {
  display: flex;
  gap: 16px;
  color: var(--secondary);
  font-size: 0.875rem;
}

.footer a {
  color: inherit;
}

@media (min-width: 640px) {
  .card {
    padding: 40px 48px;
  }

  h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 380px) {
  .qr {
    flex-direction: column;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .badge {
    transition: none;
  }
}
