/* Become Better website. One small stylesheet, no outside fonts or files.
   Normal pages follow the visitor's light or dark setting. With ?app=1 the app's web view adds
   the in-app class on <html> (inline script in each page): dark BB style, no header, footer or
   big title (legal-screens.md). */

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #0b0f19;
  --body: #0b0f19;
  --muted: #4b5565;
  --link: #1e6bff;
  --brand: #1e6bff;
  --rule: #e3e6ee;
  --h2: 1.375rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f19;
    --text: #f8fafc;
    --body: #f8fafc;
    --muted: #9aa3b2;
    --link: #4d8bff;
    --rule: #23283a;
  }
}

/* In the app: BB's dark style whatever the phone's setting. Body text and lists are secondary. */
html.in-app {
  color-scheme: dark;
  --bg: #0b0f19;
  --text: #f8fafc;
  --body: #9aa3b2;
  --muted: #9aa3b2;
  --link: #4d8bff;
  --rule: #23283a;
  --h2: 1.125rem;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.wrap {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-header {
  padding: 1.25rem 0 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  display: block;
  width: 2.25rem;
  height: 2.25rem;
}

main.wrap {
  padding-top: 1.5rem;
  padding-bottom: 2rem;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--text);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

h2 {
  margin-top: 2rem;
  font-size: var(--h2);
  font-weight: 600;
  line-height: 1.35;
}

h3 {
  margin-top: 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

p,
ul,
ol {
  margin: 0.625rem 0 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

li {
  margin-top: 0.375rem;
}

strong {
  color: var(--text);
  font-weight: 600;
}

.updated {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

.placeholder {
  padding: 0.125rem 0.375rem;
  border-radius: 0.375rem;
  background: rgb(234 179 8 / 0.18);
  color: var(--text);
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 2rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.site-footer p {
  margin: 0.25rem 0 0;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-top: 0.25rem;
}

/* Home and the small pages */
main.hero {
  padding-top: 3rem;
  padding-bottom: 1rem;
}

.hero .brand {
  gap: 0.875rem;
  font-size: 1.75rem;
}

.hero .brand img {
  width: 3.5rem;
  height: 3.5rem;
}

.lead {
  margin-top: 1.5rem;
  color: var(--text);
  font-size: 1.25rem;
  line-height: 1.4;
}

.note {
  margin-top: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* In the app the page is only the text under the app's own title bar. */
html.in-app .site-header,
html.in-app .site-footer,
html.in-app .page-title {
  display: none;
}

html.in-app main.wrap {
  padding-top: 1.25rem;
}

html.in-app .updated {
  margin-top: 0;
}
