/* Neutral site styles. App pages override only --accent, --on-accent and --tint from app.json "theme". */
:root {
  --bg: #fafaf8;
  --text: #1c1c1a;
  --muted: #6e6e68;
  --line: #e6e5e1;
  --accent: #1c1c1a;
  --on-accent: #fafaf8;
  --tint: #efeeea;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'PingFang TC', 'Noto Sans TC', sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131312;
    --text: #ecebe7;
    --muted: #9a9993;
    --line: #2a2a27;
    --accent: #ecebe7;
    --on-accent: #131312;
    --tint: #22221f;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding: 0 20px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.wrap { max-width: 640px; margin: 0 auto; padding-block: 28px 56px; }

/* Bilingual text: English first, Traditional Chinese underneath, a little quieter. */
.bi > [lang] { display: block; }
.bi > [lang="zh-Hant"] { color: var(--muted); font-size: 0.92em; }
h1.bi > [lang="zh-Hant"],
h2.bi > [lang="zh-Hant"] { font-size: 0.6em; font-weight: 500; margin-top: 4px; letter-spacing: 0; }

/* Inline variant for short labels: "Download · 下載" */
.inline.bi > [lang] { display: inline; color: inherit; font-size: inherit; }
.inline.bi > [lang="zh-Hant"]::before { content: ' · '; }

.site-header,
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.site-header a,
.site-footer a { text-decoration: none; }
.site-header a:hover,
.site-footer a:hover { color: var(--text); }
.site-footer { margin-top: 72px; padding-top: 20px; border-top: 1px solid var(--line); }

main { margin-top: 64px; }

h1 { font-size: clamp(30px, 6vw, 40px); line-height: 1.15; letter-spacing: -0.02em; margin: 0; font-weight: 650; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 8px; font-weight: 600; }

.app-icon { display: block; width: 64px; height: 64px; margin-bottom: 20px; }
.lede { margin: 12px 0 0; font-size: 17px; }

.btn {
  display: inline-block;
  margin-top: 24px;
  background: var(--accent);
  color: var(--on-accent);
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.btn:hover { opacity: 0.88; }
.btn small { display: block; font-weight: 400; font-size: 12px; opacity: 0.75; }

.platforms { list-style: none; padding: 0; margin: 16px 0 0; font-size: 14px; }
.platforms li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.platforms li + li { margin-top: 2px; }
.platforms .mark { width: 1em; text-align: center; }
.platforms .no { color: var(--muted); }
.platforms .note { font-size: 12px; }

.hero-art {
  margin: 48px 0 0;
  background: var(--tint);
  border-radius: 20px;
  padding: clamp(16px, 4vw, 32px);
}
.hero-art img { display: block; width: 100%; height: auto; }

/* App screenshots: a grid on wider screens (--cols set per app), a sideways-scrolling strip on phones.
   The shots carry their own transparent window shadow, so no background box. */
.screens {
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), 1fr);
  gap: 8px;
}
.screens figure { margin: 0; }
.screens img { display: block; width: 100%; height: auto; }
@media (max-width: 560px) {
  .screens {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -20px;
    padding-inline: 20px;
    scroll-padding-inline: 20px;
    scrollbar-width: none;
  }
  .screens::-webkit-scrollbar { display: none; }
  .screens figure { flex: 0 0 82%; scroll-snap-align: start; }
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px 32px;
  padding: 0;
  margin: 56px 0 0;
  list-style: none;
}
.features strong { display: block; font-size: 15px; margin-bottom: 4px; }
.features .bi:not(strong) { font-size: 14px; color: var(--muted); }

.section { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.section > p { margin: 0 0 16px; color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin-top: 16px; }
.fine .bi { display: block; }

.downloads { display: flex; flex-wrap: wrap; gap: 12px; }
.downloads .btn { margin-top: 8px; }
.notice {
  margin: 24px 0 0;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--tint);
  font-size: 15px;
}
.notice code { font: inherit; font-weight: 600; word-break: break-all; }

/* MailerLite embedded form, restyled to match the site (shared by every app's form).
   MailerLite injects its own CSS with an id selector + !important, so these rules need
   "html body #signup-form" to outrank it. Colors come from the app's theme tokens. */
html body #signup-form .ml-form-embedContainer,
html body #signup-form .ml-form-embedContainer * { font-family: inherit !important; }
html body #signup-form .ml-form-embedContainer .ml-form-align-center { text-align: left !important; }
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper {
  background: transparent !important;
  max-width: 100% !important;
  width: 100% !important;
  border-radius: 0 !important;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody,
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody { padding: 0 !important; }
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-block-form {
  display: flex !important;
  flex-wrap: wrap;
  gap: 8px;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-formContent {
  flex: 1 1 220px;
  margin: 0 !important;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow { margin: 0 !important; }
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input {
  background: var(--bg) !important;
  color: var(--text) !important;
  border: 1px solid var(--line) !important;
  border-radius: 999px !important;
  padding: 11px 18px !important;
  font-family: inherit !important;
  font-size: 15px !important;
  line-height: 20px !important;
  height: auto !important;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input:focus {
  outline: 2px solid var(--accent) !important;
  outline-offset: 1px;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow input::placeholder { color: var(--muted) !important; }
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-fieldRow.ml-error input,
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-field-group.ml-error input { border-color: #d14343 !important; }
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit {
  flex: 0 0 auto;
  float: none !important;
  width: auto !important;
  margin: 0 !important;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button {
  background: var(--accent) !important;
  color: var(--on-accent) !important;
  border-radius: 999px !important;
  padding: 11px 22px !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  line-height: 20px !important;
  width: auto !important;
  height: auto !important;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button:hover {
  background: var(--accent) !important;
  opacity: 0.88;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent h4 {
  color: var(--text) !important;
  font-size: 20px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  margin: 0 0 8px !important;
}
html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-successBody .ml-form-successContent p {
  color: var(--muted) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  font-family: inherit !important;
  margin: 0 !important;
}
@media (max-width: 420px) {
  html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit,
  html body #signup-form .ml-form-embedContainer .ml-form-embedWrapper .ml-form-embedBody .ml-form-embedSubmit button { width: 100% !important; }
}

.app-list { list-style: none; padding: 0; margin: 32px 0 0; border-top: 1px solid var(--line); }
.app-list li { border-bottom: 1px solid var(--line); }
.app-list a { display: flex; align-items: center; gap: 16px; padding: 18px 0; text-decoration: none; }
.app-list a:hover strong { text-decoration: underline; text-underline-offset: 3px; }
.app-list img { width: 48px; height: 48px; flex-shrink: 0; }
.app-list strong { display: block; }
.app-list .bi { font-size: 14px; color: var(--muted); }
.app-list .arrow { margin-left: auto; color: var(--muted); }

.intro { color: var(--muted); margin: 12px 0 0; }

.prose h2 { font-size: 17px; margin-top: 36px; }
.prose p, .prose li { color: var(--muted); }
.prose .bi > [lang="en"] { color: var(--text); }
.prose li + li { margin-top: 8px; }
