/* Betterleaf site: the landing, download and guide pages. The same warm neutrals as the rest of
   the Cranium family (the Brainpower portal and cranium-ai.com), with the product's own accent.
   Colours are tokens on :root; dark mode redefines them twice, once for the system preference and
   once for the explicit choice the theme button stores. */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface-1: #fcfcfb;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --text-muted: #898781;
  --grid: #e1e0d9;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #0f8f82;
  --accent-ink: #ffffff;
  --accent-soft: rgba(15, 143, 130, 0.12);
  --bad: #d03b3b;
  --shadow: rgba(0, 0, 0, 0.14);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface-1: #1a1a19;
    --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #898781;
    --grid: #2c2c2a; --border: rgba(255, 255, 255, 0.10);
    --accent: #6ee7d7; --accent-ink: #0d0d0d; --accent-soft: rgba(110, 231, 215, 0.16);
    --bad: #e66767; --shadow: rgba(0, 0, 0, 0.5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface-1: #1a1a19;
  --text-primary: #ffffff; --text-secondary: #c3c2b7; --text-muted: #898781;
  --grid: #2c2c2a; --border: rgba(255, 255, 255, 0.10);
  --accent: #6ee7d7; --accent-ink: #0d0d0d; --accent-soft: rgba(110, 231, 215, 0.16);
  --bad: #e66767; --shadow: rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text-primary);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
img { max-width: 100%; }
code { font-family: ui-monospace, Consolas, "Cascadia Mono", monospace; font-size: 0.9em; background: var(--grid); padding: 1px 5px; border-radius: 4px; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--text-muted); }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* header */
.site-header { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; padding: 18px 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { width: 40px; height: 40px; border-radius: 9px; display: block; }
.brand .name { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.brand .app-version { font-size: 12px; color: var(--text-muted); white-space: nowrap; align-self: flex-end; padding-bottom: 3px; }
.site-header nav { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.site-header nav a { color: var(--text-secondary); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: 14px; }
.site-header nav a:hover, .site-header nav a[aria-current="page"] { background: var(--grid); color: var(--text-primary); }
.site-header nav a.primary { background: var(--accent); color: var(--accent-ink); }
.site-header nav a.primary:hover { filter: brightness(1.08); background: var(--accent); }
#theme { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-1); color: var(--text-secondary); cursor: pointer; display: inline-grid; place-items: center; }
#theme:hover { color: var(--text-primary); background: var(--grid); }
#theme svg { width: 16px; height: 16px; }
#theme .sun { display: none; }
:root[data-theme="dark"] #theme .sun { display: block; }
:root[data-theme="dark"] #theme .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #theme .sun { display: block; }
  :root:not([data-theme="light"]) #theme .moon { display: none; }
}

/* hero */
.hero { display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; padding: 36px 0 24px; }
@media (min-width: 960px) { .hero { grid-template-columns: 5fr 7fr; gap: 40px; padding: 56px 0 36px; } }
.hero.single { grid-template-columns: 1fr; padding-bottom: 8px; }
.hero h1 { font-size: clamp(30px, 4vw, 44px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -0.01em; }
.hero .lead { font-size: 17px; line-height: 1.55; color: var(--text-secondary); margin: 0 0 22px; max-width: 560px; }
.hero.single .lead { max-width: 720px; }
.cta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cta a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 15px; border: 1px solid var(--border); color: var(--text-primary); background: var(--surface-1); }
.cta a:hover { background: var(--grid); }
.cta a.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cta a.primary:hover { filter: brightness(1.08); background: var(--accent); }
.cta a[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.cta .fine { width: 100%; color: var(--text-muted); font-size: 12.5px; margin-top: 2px; }
.cta .fine a { display: inline; padding: 0; border: 0; background: none; font-weight: 500; font-size: inherit; color: var(--text-secondary); text-decoration: underline; }

/* screenshots */
.shot { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-1); box-shadow: 0 18px 50px var(--shadow); }
.shot-wrap { overflow: hidden; border-radius: 12px; }
.shot-wrap.tall { max-height: 560px; }
.shot-wrap.tall .shot { border-radius: 12px 12px 0 0; }
.shot-wrap.narrow { max-width: 420px; display: flex; justify-content: center; }
.shot-wrap.narrow .shot { width: auto; max-width: 100%; } /* a small capture is never scaled up */

/* sections */
.section { padding: 28px 0; }
.section h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 18px; font-weight: 600; }
.feature { display: grid; grid-template-columns: 1fr; gap: 20px; align-items: center; padding: 26px 0; border-top: 1px solid var(--border); }
@media (min-width: 900px) {
  .feature { grid-template-columns: 4fr 8fr; gap: 40px; padding: 40px 0; }
  .feature.flip { grid-template-columns: 8fr 4fr; } /* the picture keeps the wide column on either side */
  .feature.flip .copy { order: 2; }
  .feature.text { grid-template-columns: 1fr; }
  .feature.text .copy { max-width: 760px; }
}
.feature h3 { font-size: 22px; margin: 0 0 10px; line-height: 1.2; }
.feature p { color: var(--text-secondary); line-height: 1.55; margin: 0 0 10px; }
.feature ul { color: var(--text-secondary); line-height: 1.55; padding-left: 18px; margin: 0; }
.feature li { margin: 4px 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px 14px; min-width: 0; }
.tile h3 { font-size: 16px; margin: 0 0 6px; }
.tile p { color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin: 0; }
.tile .n { display: inline-block; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); text-align: center; line-height: 26px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.section-more { color: var(--text-secondary); font-size: 14px; margin: 16px 0 0; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
.compare th, .compare td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.compare th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; }
.compare td.yes { color: var(--accent); font-weight: 600; }
.compare td.no { color: var(--text-muted); }
.compare tr.us td { color: var(--text-primary); font-weight: 600; }
.compare-wrap { overflow-x: auto; }

/* footer */
.site-footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 22px 0 36px; color: var(--text-muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; }
.site-footer a { color: var(--text-secondary); }
.site-footer .maker { color: var(--text-primary); font-weight: 600; }

/* download page */
.release { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 720px) { .release { grid-template-columns: 1fr 1fr; } }
.card { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.card h3 { font-size: 18px; margin: 0; }
.card .desc { color: var(--text-secondary); line-height: 1.5; flex: 1; }
.card .meta { color: var(--text-muted); font-size: 12.5px; }
.card .meta code { font-size: 11.5px; word-break: break-all; }
.card .cta { margin-top: 4px; }
.notice { border: 1px solid var(--border); background: var(--surface-1); border-radius: 10px; padding: 12px 16px; color: var(--text-secondary); font-size: 14px; line-height: 1.5; margin: 14px 0 0; }
.notice.bad { border-color: var(--bad); }
details.notes { margin: 0 0 24px; }
details.notes summary { cursor: pointer; color: var(--text-secondary); font-size: 14px; }
details.notes pre { white-space: pre-wrap; font-size: 12.5px; color: var(--text-secondary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 8px; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { position: relative; padding-left: 40px; color: var(--text-secondary); line-height: 1.5; }
.steps li::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); text-align: center; line-height: 26px; font-weight: 700; font-size: 13px; }
.steps b { color: var(--text-primary); }
.prose { max-width: 760px; color: var(--text-secondary); line-height: 1.6; }
.prose h2 { color: var(--text-primary); font-size: 20px; margin: 28px 0 8px; text-transform: none; letter-spacing: 0; }
.prose h3 { color: var(--text-primary); font-size: 16px; margin: 22px 0 6px; }
.prose p { margin: 0 0 12px; }
.prose ul, .prose ol { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin: 6px 0; }
.prose b { color: var(--text-primary); font-weight: 600; }
.prose pre { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; }
.prose pre code { background: none; padding: 0; font-size: inherit; }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 0 0 14px; }
.prose th, .prose td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { color: var(--text-muted); font-weight: 600; font-size: 12.5px; }
.table-wrap { overflow-x: auto; }

/* guide page */
.guide { display: grid; grid-template-columns: 1fr; gap: 24px 40px; align-items: start; padding: 12px 0 8px; }
@media (min-width: 960px) {
  .guide { grid-template-columns: 200px minmax(0, 1fr); }
  .guide .toc { position: sticky; top: 16px; }
}
.guide .toc h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin: 0 0 8px; font-weight: 600; }
.guide .toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
@media (min-width: 960px) { .guide .toc ol { flex-direction: column; } }
.guide .toc a { color: var(--text-secondary); text-decoration: none; font-size: 14px; line-height: 1.6; }
.guide .toc a:hover { color: var(--text-primary); text-decoration: underline; }
.guide .prose { max-width: 820px; }
.guide .prose h2 { font-size: 24px; margin: 40px 0 10px; scroll-margin-top: 16px; }
.guide .prose h2:first-child { margin-top: 0; }
.guide .prose h3 { scroll-margin-top: 16px; }
.guide .prose .steps { margin: 8px 0 14px; }
.guide figure.shot-wrap { margin: 14px 0 20px; overflow: visible; }
.guide figure.shot-wrap.tall { max-height: none; }
.guide figure.shot-wrap.tall .shot { border-radius: 12px; }
.guide figure.shot-wrap.narrow { max-width: 480px; justify-content: flex-start; }
.guide figcaption { color: var(--text-muted); font-size: 12.5px; margin-top: 8px; }

/* 404 */
.hero.plain { grid-template-columns: 1fr; padding: 48px 0 8px; }
.hero.plain h1 { font-size: clamp(30px, 4vw, 40px); }
