/*
 * spendxapp.com — the one stylesheet.
 *
 * Tokens come from the "Design System — spendx" sheet in
 * designs/spendx-mock.pen (mirrored in mobile/src/constants/theme.ts). Light
 * is the default; dark follows the reader's system preference. No JavaScript,
 * no cookies, nothing loaded from another origin: Inter is self-hosted as two
 * Latin subsets (regular and semibold, SIL OFL, see assets/fonts/OFL.txt).
 */

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    local('Inter'),
    url('/assets/fonts/inter-400.woff2') format('woff2');
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src:
    local('Inter SemiBold'),
    local('Inter-SemiBold'),
    url('/assets/fonts/inter-600.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  /* Each page's <meta name="theme-color"> pair restates the two
     --background values; change them together. */
  --background: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #ecedf3;
  --border: #e3e5ee;
  --text: #101219;
  --text-secondary: #666c7e;
  --text-tertiary: #9ba1b2;
  --accent: #5b3df5;
  --accent-press: #4a2fd6;
  --accent-soft: #e9e5fe;

  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --r-md: 12px;
  --r-lg: 16px;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: #0d0e13;
    --surface: #171921;
    --surface-2: #20232d;
    --border: #2b2f3b;
    --text: #f5f6fa;
    --text-secondary: #9ca2b4;
    --text-tertiary: #6c7284;
    --accent: #8570ff;
    --accent-press: #6e58f0;
    --accent-soft: #241f4d;
  }
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--background);
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-press);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --- Shell --------------------------------------------------------------- */

.site-header,
.site-footer {
  border-color: var(--border);
  border-style: solid;
  border-width: 0;
}

.site-header {
  border-bottom-width: 1px;
  background: var(--surface);
}

.site-footer {
  border-top-width: 1px;
  margin-top: auto;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.site-header .inner,
.site-footer .inner,
main {
  width: 100%;
  max-width: var(--measure);
  margin: 0 auto;
  padding-left: var(--sp-5);
  padding-right: var(--sp-5);
}

.site-header .inner {
  display: flex;
  align-items: center;
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
}

main {
  padding-top: var(--sp-7);
  padding-bottom: var(--sp-8);
}

.site-footer .inner {
  padding-top: var(--sp-6);
  padding-bottom: var(--sp-6);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  align-items: baseline;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
}

.site-footer a {
  color: var(--text-secondary);
}

.site-footer a:hover {
  color: var(--text);
}

.site-footer .copyright {
  margin-left: auto;
  color: var(--text-tertiary);
}

/* --- Type ---------------------------------------------------------------- */

h1 {
  font-size: 1.75rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin: 0 0 var(--sp-3);
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: var(--sp-7) 0 var(--sp-3);
}

p,
ul,
ol {
  margin: 0 0 var(--sp-4);
}

li {
  margin-bottom: var(--sp-2);
}

li::marker {
  color: var(--text-secondary);
}

strong {
  font-weight: 600;
}

.lede {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-6);
}

/* "Last updated" line under a policy page's h1. */
.dateline {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: var(--sp-4);
}

/* --- Blocks -------------------------------------------------------------- */

.callout {
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
  margin: 0 0 var(--sp-5);
  background: var(--accent-soft);
  border: 1px solid transparent;
}

.callout p:last-child {
  margin-bottom: 0;
}

.steps li strong {
  color: var(--text);
}

/* --- Homepage ------------------------------------------------------------ */

.hero {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.hero-logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-lg);
}

.hero .lede {
  margin-bottom: 0;
}

.download {
  text-align: center;
  border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-5);
  background: var(--accent-soft);
}

.download h2 {
  margin: 0 0 var(--sp-2);
}

.download p {
  margin: 0;
  color: var(--text-secondary);
}

@media (min-width: 640px) {
  h1 {
    font-size: 2.125rem;
  }

  main {
    padding-top: var(--sp-8);
  }
}
