/* Spendwise site — design tokens, reset, and shared primitives.
   Loaded by every page before site.css / legal.css. */

/* Inter is self-hosted rather than loaded from a font CDN, so visiting this site
   makes no third-party request. The file is the Latin subset of Google's variable
   build (weights 100–900 in one file), matching the font the app itself uses. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Brand — mirrors the app icon gradient (#2563EB → #004AC6). */
  --brand: #004ac6;
  --brand-bright: #2563eb;
  --brand-tint: #eef4ff;
  --brand-line: #c7d9ff;

  /* Text */
  --ink: #0b1220;
  --body: #475569;
  --muted: #64748b;

  /* Surfaces */
  --bg: #ffffff;
  --bg-soft: #f5f7fb;
  --bg-softer: #fafbfe;
  --line: #e2e8f0;
  --line-soft: #edf1f7;

  /* Status — same values the app uses for logged / overdue states. */
  --success: #15803d;
  --success-tint: #ecfdf3;
  --danger: #dc2626;
  --danger-tint: #fef2f2;

  /* Shape */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
  --wrap: 1120px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgb(11 18 32 / 6%);
  --shadow: 0 4px 16px rgb(11 18 32 / 8%);
  --shadow-lg: 0 18px 48px rgb(11 18 32 / 12%);

  --font:
    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
}

h2 {
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1rem;
}

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

a {
  color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--brand-bright);
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

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

li {
  margin-bottom: 0.4rem;
}

:focus-visible {
  outline: 3px solid var(--brand-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Keyboard users can jump the shared header on every page. */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--brand);
  color: #fff;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 0;
  color: #fff;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.7rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.12s ease,
    box-shadow 0.12s ease,
    background-color 0.12s ease;
}

.btn--primary {
  background: var(--brand);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--brand-bright);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn--ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--brand-line);
  color: var(--brand);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
