:root {
  --primary: #2563eb;
  --accent: var(--primary);
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #5b6475;
  --border: #e3e8f0;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(15 23 42 / 0.06), 0 8px 24px rgb(15 23 42 / 0.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1020;
    --bg-alt: #111831;
    --surface: #151d38;
    --text: #e6e9f2;
    --muted: #9aa3b8;
    --border: #253055;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px rgb(0 0 0 / 0.3);
  }
}

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

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
code { font-size: 0.9em; padding: 0.1em 0.35em; border-radius: 6px; background: var(--bg-alt); }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 780px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.2rem; color: var(--muted); margin: 0; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Header & footer */
.site-header {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand-logo { height: 32px; width: auto; }
.site-nav { display: flex; gap: 20px; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-nav a:hover { color: var(--text); }

.site-footer { border-top: 1px solid var(--border); padding: 32px 0; font-size: 0.95rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; }

/* Buttons */
.button {
  display: inline-block; padding: 12px 22px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 600; text-decoration: none;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.button:hover { filter: brightness(1.08); transform: translateY(-1px); }

.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 20px 0; }
.center .store-buttons { justify-content: center; }
.store-button {
  display: inline-flex; flex-direction: column; justify-content: center;
  min-width: 170px; padding: 8px 20px; border-radius: 12px;
  background: #000; color: #fff; text-decoration: none; line-height: 1.2;
  border: 1px solid #333;
}
.store-button small { font-size: 0.7rem; opacity: 0.85; }
.store-button span { font-size: 1.15rem; font-weight: 600; }
.store-button:hover { background: #1a1a1a; }

/* Sections */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-title { font-size: 1.75rem; margin-bottom: 24px; }

.hero {
  padding: 96px 0 80px;
  text-align: center;
  background:
    radial-gradient(1200px 400px at 50% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent),
    var(--bg);
}
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); letter-spacing: -0.02em; }
.hero .lead { font-size: 1.35rem; margin-bottom: 16px; }
.hero-text { max-width: 640px; margin: 0 auto 28px; color: var(--muted); }

/* App icons & cards */
.app-icon { width: 72px; height: 72px; border-radius: 22%; object-fit: cover; flex-shrink: 0; box-shadow: var(--shadow); }
.app-icon-lg { width: 112px; height: 112px; }
.app-icon-fallback {
  display: grid; place-items: center; font-size: 2rem; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #000));
}

.app-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.app-card {
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: transform 0.15s ease;
}
.app-card:hover { transform: translateY(-2px); }
.app-card-main { display: flex; gap: 16px; align-items: center; padding: 22px; color: inherit; text-decoration: none; }
.app-card-main h3 { margin: 0 0 4px; font-size: 1.2rem; }
.app-card-main p { margin: 0; font-size: 0.95rem; }
.app-card-links { display: flex; border-top: 1px solid var(--border); }
.app-card-links a { flex: 1; text-align: center; padding: 12px; font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.app-card-links a + a { border-left: 1px solid var(--border); }
.app-card-links a:hover { background: var(--bg-alt); }

/* App pages */
.app-header {
  padding: 56px 0 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent),
    var(--bg);
  border-bottom: 1px solid var(--border);
}
.app-identity { display: flex; gap: 24px; align-items: center; margin-bottom: 32px; }
.app-identity h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 6px; }
.app-tabs { display: flex; gap: 4px; overflow-x: auto; }
.app-tabs a {
  padding: 12px 18px; color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap;
  border-bottom: 3px solid transparent;
}
.app-tabs a:hover { color: var(--text); }
.app-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.app-description { font-size: 1.2rem; max-width: 760px; margin-top: 0; }

.feature-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.feature-icon { font-size: 1.8rem; margin-bottom: 8px; }
.feature h3 { font-size: 1.1rem; }
.feature p { margin: 0; font-size: 0.95rem; }

.screenshots { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 12px; scroll-snap-type: x mandatory; }
.screenshots img {
  height: 520px; width: auto; max-width: none; border-radius: 28px;
  border: 1px solid var(--border); box-shadow: var(--shadow); scroll-snap-align: start;
}

.contact-card {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin-bottom: 48px;
}
.contact-card h2 { font-size: 1.4rem; }
.contact-card p { margin: 0; max-width: 460px; }

.faq { display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 4px 20px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.support-extra { margin-top: 48px; }

/* Long-form Markdown */
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.45rem; margin-top: 2em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.5em 0; font-size: 0.95rem; }
.prose th, .prose td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose blockquote { margin: 1.5em 0; padding: 4px 20px; border-left: 4px solid var(--accent); color: var(--muted); }
.prose img { border-radius: 12px; margin: 1.5em 0; }

.error-code { font-size: 5rem; font-weight: 800; margin: 0; color: var(--accent); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .section { padding: 48px 0; }
  .hero { padding: 64px 0 56px; }
  .app-identity { flex-direction: column; align-items: flex-start; gap: 16px; }
  .app-icon-lg { width: 88px; height: 88px; }
  .screenshots img { height: 420px; }
  .site-nav { gap: 14px; }
}
