/* AppHub "default" theme. Mobile-first, no build step, no inline <style> (strict CSP).
   The app's brand colours arrive as --brand-l / --brand-d on <html style="...">. */

:root {
  --brand-l: #3378fa;
  --brand-d: #7ea8ff;
  --accent: var(--brand-l);
  --on-accent: #ffffff;
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --card: #ffffff;
  --text: #11172b;
  --muted: #5b6478;
  --border: #e3e6ee;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px rgba(16, 24, 40, .06);
  --radius: 16px;
  --max: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: var(--brand-d);
    --on-accent: #0b1020;
    --bg: #0b1020;
    --bg-soft: #10162b;
    --card: #131a30;
    --text: #eef1fa;
    --muted: #98a2bd;
    --border: #232c48;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --accent: var(--brand-d);
  --on-accent: #0b1020;
  --bg: #0b1020;
  --bg-soft: #10162b;
  --card: #131a30;
  --text: #eef1fa;
  --muted: #98a2bd;
  --border: #232c48;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 7vw, 3.75rem); font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); font-weight: 750; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.center { text-align: center; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--on-accent); padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* Header ---------------------------------------------------------------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(12px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }
.nav { display: none; align-items: center; gap: 22px; }
.nav a { color: var(--muted); font-weight: 550; font-size: .95rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); text-decoration: none; }
.head-actions { display: flex; align-items: center; gap: 10px; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--border); color: var(--text); }
.menu summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: 48px; min-width: 220px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; display: grid; }
.menu-panel a { padding: 10px 12px; border-radius: 8px; color: var(--text); font-weight: 550; }
.menu-panel a:hover { background: var(--bg-soft); text-decoration: none; }
.theme-toggle { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.theme-toggle:hover { background: var(--bg-soft); }
@media (min-width: 860px) { .nav { display: flex; } .menu { display: none; } }

/* Buttons ---------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-weight: 700; font-size: 1rem; border: 1px solid transparent; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; }
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-sm { padding: 8px 14px; font-size: .9rem; border-radius: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.center .btn-row { justify-content: center; }

/* Sections ---------------------------------------------------------------- */
section { padding: 64px 0; }
.band { background: var(--bg-soft); border-block: 1px solid var(--border); }
.eyebrow { display: inline-block; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.section-head { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.hero { padding: 72px 0 56px; text-align: center; }
.hero .lead { max-width: 720px; margin: 0 auto 28px; font-size: 1.15rem; color: var(--muted); }
.hero h1 .accent { color: var(--accent); }
.hero .badge { margin-top: 22px; color: var(--muted); font-size: .9rem; font-weight: 550; }
.hero .note { margin-top: 6px; color: var(--muted); font-size: .85rem; }
.hero-logo { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 22px; display: block; box-shadow: var(--shadow); }

.grid { display: grid; gap: 16px; }
.grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card p { color: var(--muted); margin: 0; }
.icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); margin-bottom: 14px; }
.icon svg { width: 22px; height: 22px; }

.steps { counter-reset: step; display: grid; gap: 16px; }
@media (min-width: 860px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { position: relative; padding-top: 56px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; top: 20px; left: 24px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--on-accent); font-weight: 800; display: grid; place-items: center; font-size: .9rem; }

/* Comparison ---------------------------------------------------------------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); -webkit-overflow-scrolling: touch; }
table.compare { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .95rem; }
.compare th, .compare td { padding: 12px 14px; text-align: center; border-bottom: 1px solid var(--border); }
.compare th:first-child, .compare td:first-child { text-align: left; position: sticky; left: 0; background: var(--card); }
.compare thead th { font-weight: 700; background: var(--bg-soft); }
.compare th.me, .compare td.me { background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
.compare tr:last-child td { border-bottom: 0; }
.yes { color: var(--accent); display: inline-flex; }
.no { color: var(--muted); opacity: .6; }
.compare .val { font-size: .88rem; color: var(--muted); }

/* Pricing ---------------------------------------------------------------- */
.plan { display: flex; flex-direction: column; gap: 14px; }
.plan.highlight { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.plan .price { font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.plan .period { color: var(--muted); font-size: .9rem; }
.plan ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; flex: 1; }
.plan li { display: flex; gap: 10px; color: var(--muted); }
.plan li svg { flex: none; margin-top: 3px; color: var(--accent); }
.footnote { margin-top: 18px; color: var(--muted); font-size: .85rem; text-align: center; }

/* FAQ ---------------------------------------------------------------- */
.faq { display: grid; gap: 10px; max-width: 820px; margin: 0 auto; }
.faq details { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 0 20px; }
.faq summary { cursor: pointer; font-weight: 650; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 800; font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { color: var(--muted); padding-bottom: 16px; margin: 0; }

/* Download / changelog / legal ---------------------------------------------------------------- */
.cta-band { text-align: center; }
.reqs { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; color: var(--muted); font-size: .92rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; word-break: break-all; }
.release { border-left: 3px solid var(--border); padding: 4px 0 4px 20px; margin-bottom: 32px; }
.release h2 { font-size: 1.4rem; margin-bottom: .2em; }
.release .meta { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.4rem; margin-top: 1.8em; }
.prose h3 { margin-top: 1.4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .35em; }
.prose a { text-decoration: underline; }
.prose code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); }

/* Footer ---------------------------------------------------------------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 40px 0; color: var(--muted); font-size: .92rem; }
.site-footer .cols { display: grid; gap: 28px; }
@media (min-width: 760px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.disclaimer { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); font-size: .82rem; line-height: 1.65; }
.footer-bottom { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 16px; font-size: .82rem; }
.footer-bottom p { margin: 0; }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (min-width: 640px) { .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; } }

.works-with { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; list-style: none; margin: 0; padding: 0; }
.works-with li { padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); font-weight: 600; font-size: .95rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
