/* MotoMate download page.
 *
 * Colours are the app palette from lib/core/design/tokens.dart, transcribed
 * rather than shared: this is a static site with no Dart in it, and a build
 * step that generated CSS from tokens.dart would be more machinery than three
 * duplicated hex values deserve. If the brand teal ever moves, it moves here
 * too — the same trade-off admin_web already makes with its own copy.
 *
 * Dark is the viewer's choice, not ours: both palettes are defined and
 * prefers-color-scheme picks. A phone in Sekondi at night is the common case.
 */

:root {
  --brand: #00796B;
  --brand-text: #00695C;
  --on-brand: #ffffff;
  --accent: #B45309;
  --bg: #F6F7F9;
  --surface: #ffffff;
  --sunken: #EFF1F5;
  --border: #E2E6EC;
  --text: #1A1A2E;
  --muted: #5B6472;
  --faint: #98A2B3;
  --success: #15803D;
  --warning: #B45309;
  --danger: #B91C1C;

  --hero-from: #00695C;
  --hero-to: #064E47;
  --hero-text: #ffffff;
  --hero-muted: rgba(255, 255, 255, .78);

  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 16px;
  --maxw: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #4DB6AC;
    --brand-text: #4DB6AC;
    --on-brand: #06231F;
    --accent: #FBBF24;
    --bg: #0B0F14;
    --surface: #151B23;
    --sunken: #0F141A;
    --border: #2A323D;
    --text: #E6EAF0;
    --muted: #9AA6B5;
    --faint: #6B7787;
    --success: #4ADE80;
    --warning: #FBBF24;
    --danger: #F87171;

    --hero-from: #10302C;
    --hero-to: #0B0F14;

    /* Shadows do not read on dark — the app learned this too. Borders carry
       the edges instead, so a card is never floating with no boundary. */
    --shadow: none;
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.01em; margin: 0; }

p { margin: 0 0 1rem; }

a { color: var(--brand-text); }

.muted { color: var(--muted); }
.tiny  { font-size: .8125rem; }

/* ── Hero ──────────────────────────────────────────────────────────────── */

.hero {
  background: linear-gradient(160deg, var(--hero-from), var(--hero-to));
  color: var(--hero-text);
  padding: 0 1.25rem 4.5rem;
}

.nav {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -.01em;
}

.wordmark img { border-radius: 7px; }
.wordmark-sm { font-size: .9375rem; }

.nav-link {
  color: var(--hero-muted);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 500;
}

.nav-link:hover { color: var(--hero-text); text-decoration: underline; }

.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-top: 3rem;
}

.eyebrow {
  margin: 0 0 .75rem;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--hero-muted);
}

.hero h1 {
  font-size: clamp(2rem, 6.5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 1.1rem;
  max-width: 20ch;
}

.lede {
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  color: var(--hero-muted);
  max-width: 56ch;
  margin-bottom: 2rem;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1.25rem;
}

.hero-note {
  margin: 0;
  font-size: .875rem;
  color: var(--hero-muted);
}

/* ── Buttons ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  /* 48px tall at the default font size. A download button missed on a phone in
     one tap is a download that does not happen. */
  min-height: 48px;
  padding: .75rem 1.375rem;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--brand);
  color: var(--on-brand);
}

.hero .btn-primary {
  background: #ffffff;
  color: #00695C;
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
  background: transparent;
  border-color: var(--hero-muted);
  color: var(--hero-text);
}

.btn-ghost:hover { background: rgba(255, 255, 255, .1); }

.btn-block { width: 100%; }

/* Before the version list arrives, and if it never does. Not merely greyed:
   pointer-events off, so a tap cannot follow href="#" and look like a
   download that silently failed. */
.btn.is-waiting {
  background: var(--sunken);
  color: var(--faint);
  border-color: var(--border);
  pointer-events: none;
  font-weight: 500;
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4rem 1.25rem;
}

.section-alt {
  max-width: none;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-alt > * {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
}

.section-title {
  font-size: clamp(1.5rem, 3.6vw, 2rem);
  font-weight: 750;
  margin-bottom: .75rem;
}

.section-lede {
  color: var(--muted);
  max-width: 62ch;
  margin-bottom: 2.25rem;
}

/* ── App cards ─────────────────────────────────────────────────────────── */

.cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .cards { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.section-alt .card { background: var(--bg); }

.card-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.app-icon {
  border-radius: 18px;
  flex: 0 0 auto;
  /* The launcher icons are drawn for a rounded mask; without a border they
     bleed into a white card. */
  border: 1px solid var(--border);
}

.card h3 { font-size: 1.1875rem; font-weight: 700; }

.card-sub { margin: .2rem 0 0; color: var(--muted); font-size: .9375rem; }

.feature-list {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  gap: .5rem;
}

.feature-list li {
  position: relative;
  padding-left: 1.6rem;
  color: var(--muted);
  font-size: .9375rem;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: .35rem;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}

/* Pushes the release block to the bottom so two cards with different numbers
   of features still line their download buttons up. */
.release { margin-top: auto; }

.release-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .875rem;
}

.chip {
  display: inline-block;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand-text);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  font-size: .8125rem;
  font-weight: 650;
}

.chip-quiet {
  background: var(--sunken);
  color: var(--muted);
  border-color: var(--border);
  font-weight: 500;
}

.chip:empty { display: none; }

/* The 32-bit fallback. Deliberately quiet — almost nobody needs it, and a
   second prominent button next to the first is a choice most people cannot
   make. */
.fallback {
  margin: .625rem 0 0;
  font-size: .8125rem;
  color: var(--faint);
  text-align: center;
}

.fallback a { color: var(--muted); }

.changelog { margin-top: .875rem; font-size: .9375rem; }

.changelog summary {
  cursor: pointer;
  color: var(--brand-text);
  font-weight: 600;
}

.changelog ul {
  margin: .625rem 0 0;
  padding-left: 1.25rem;
  color: var(--muted);
  display: grid;
  gap: .3rem;
}

.error {
  margin-top: 1.5rem;
  padding: .875rem 1rem;
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 32%, transparent);
  color: var(--danger);
  font-size: .9375rem;
}

/* ── Notices (announcements, promos, flyers) ───────────────────────────── */

#notices { display: grid; }

.notice {
  padding: .875rem 1.25rem;
  background: var(--brand);
  color: var(--on-brand);
  font-size: .9375rem;
}

.notice-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
}

.notice strong { font-weight: 700; }
.notice p { margin: .15rem 0 0; opacity: .9; }
.notice a { color: inherit; font-weight: 700; }

.notice-promo   { background: var(--accent); color: #ffffff; }
.notice-warning { background: var(--danger); color: #ffffff; }

.notice-img {
  display: block;
  max-width: var(--maxw);
  margin: 0 auto;
  border-radius: var(--radius);
}

/* ── Steps ─────────────────────────────────────────────────────────────── */

.steps {
  list-style: none;
  margin: 0 0 2rem;
  padding: 0;
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 860px) {
  .steps { grid-template-columns: repeat(3, 1fr); gap: 2rem; }
}

.steps li { display: flex; gap: 1rem; }

.step-n {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: .9375rem;
}

.steps h3 { font-size: 1.0625rem; font-weight: 700; margin-bottom: .4rem; }
.steps p  { color: var(--muted); font-size: .9375rem; margin: 0; }

.callout {
  padding: 1.25rem 1.375rem;
  border-radius: var(--radius);
  background: var(--sunken);
  border: 1px solid var(--border);
  margin-bottom: 1rem;
}

.callout h3 { font-size: 1rem; font-weight: 700; margin-bottom: .4rem; }
.callout p  { margin: 0; color: var(--muted); font-size: .9375rem; }

.callout-warn {
  background: color-mix(in srgb, var(--warning) 10%, transparent);
  border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}

/* ── Riders split ──────────────────────────────────────────────────────── */

.split {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .split { grid-template-columns: 1.35fr 1fr; gap: 3rem; }
}

.split p { color: var(--muted); }
.split strong { color: var(--text); }

.checklist {
  list-style: none;
  margin: 0;
  padding: 1.375rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: .75rem;
  align-content: start;
}

.checklist li {
  position: relative;
  padding-left: 1.75rem;
  font-size: .9375rem;
  color: var(--muted);
}

.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

/* ── Footer ────────────────────────────────────────────────────────────── */

.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2.5rem 1.25rem;
}

.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: .5rem;
}

.footer p { margin: 0; font-size: .9375rem; }
