:root {
  --bg: #ffffff;
  --text: #091535;
  --muted: #5b6b78;
  --line: #e3e8ec;
  --card: #f4f7f5;
  --accent: #16794a;
  --lime: #77bc3f;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1420;
    --text: #e8eef2;
    --muted: #9fb3c0;
    --line: #223041;
    --card: #152131;
    --accent: #77bc3f;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
code { background: var(--card); padding: 1px 6px; border-radius: 6px; }

.top {
  position: sticky; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-weight: 700; letter-spacing: 2px; }
.brand b { color: var(--lime); }
.langs { display: flex; gap: 4px; flex-wrap: wrap; }
.langs a { padding: 4px 9px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; font-size: 13px; color: var(--text); }
.langs a:hover { border-color: var(--accent); }

main { max-width: 760px; margin: 0 auto; padding: 16px 16px 48px; }
.meta { color: var(--muted); font-size: 14px; }
section { padding-top: 24px; border-top: 1px solid var(--line); margin-top: 24px; scroll-margin-top: 70px; }
section:first-of-type { border-top: 0; margin-top: 0; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 22px 0 6px; }
ul { padding-left: 20px; }

/* Página inicial */
.hero { text-align: center; padding: 40px 16px 24px; }
.hero img { max-width: 260px; width: 70%; height: auto; }
.hero p { color: var(--muted); max-width: 560px; margin: 12px auto; }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-top: 24px; }
.card { background: var(--card); border-radius: 14px; padding: 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 24px 16px; border-top: 1px solid var(--line); }

/* O logótipo é azul-marinho: fundo branco para se ver também no tema escuro */
.brand img { background: #fff; border-radius: 8px; padding: 2px; }
.hero img { background: #fff; border-radius: 24px; padding: 16px; }

/* Galeria de ecrãs: desliza na horizontal, com encaixe */
.section-title { text-align: center; margin: 40px 0 12px; font-size: 22px; }
.gallery {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 4px 16px; -webkit-overflow-scrolling: touch;
}
.gallery figure { flex: 0 0 auto; width: 220px; margin: 0; scroll-snap-align: center; }
.gallery img {
  width: 100%; height: auto; display: block; border-radius: 18px;
  border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}
.gallery figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; line-height: 1.35; }
.gallery figcaption b { display: block; color: var(--text); font-size: 14px; }
main:has(.gallery) { max-width: 980px; }

/* Ecrãs largos: galeria em grelha (no telemóvel continua a deslizar) */
@media (min-width: 900px) {
  .gallery { flex-wrap: wrap; justify-content: center; overflow: visible; row-gap: 28px; }
}
.hero img { max-width: 180px; }

/* Botões de download (Google Play / App Store) */
.stores { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 24px; }
.stores a {
  display: inline-flex; align-items: center; gap: 10px; min-width: 170px;
  padding: 8px 18px 8px 14px; border-radius: 12px; background: #0B1E2D; color: #fff;
  border: 1px solid rgba(255, 255, 255, .18); text-decoration: none; font-weight: 600; font-size: 18px; line-height: 1.2;
}
.stores a span { display: flex; flex-direction: column; align-items: flex-start; }
.stores a .ico { width: 26px; height: 26px; flex: 0 0 auto; }
.stores a small { font-weight: 400; font-size: 11px; opacity: .8; }
.stores a:hover { background: var(--accent); }
.stores a.hidden { display: none; }
.stores a small { white-space: nowrap; }
section.download { text-align: center; margin-top: 48px; scroll-margin-top: 70px; }
.download h2 { font-size: 22px; margin: 0; }
.download p { color: var(--muted); margin: 6px 0 0; }
