/* =========================================
   main.css — Global styles & design tokens
   ========================================= */

/* --- Design Tokens --- */
:root {
  /* Core palette (Stitch: Precision Wealth AI) */
  --color-primary: #000000;
  --color-primary-light: #333333;
  --color-primary-dark: #000000;

  --color-secondary: #4648d4;
  --color-secondary-light: #6063ee;

  --color-surface: #ffffff;
  --color-surface-low: #fafafa;
  --color-surface-container: #ededf4;
  --color-surface-container-high: #dce9ff;
  --color-surface-bg: #f9f9ff;
  --color-page-bg: #f5f5f7;

  /* Semantic text */
  --color-on-surface: #1a1b20;
  --color-on-surface-variant: #45464d;
  --color-outline: #7e7576;
  --color-outline-variant: rgba(0, 0, 0, 0.05);

  /* Legacy aliases — kept for existing pages */
  --color-accent: #4648d4;
  --color-accent-light: #6063ee;
  --color-bg: #f9f9ff;
  --color-bg-card: #ffffff;
  --color-bg-dark: #1a1b20;
  --color-text: #1a1b20;
  --color-text-muted: #45464d;
  --color-text-light: #7e7576;
  --color-text-on-dark: #f0f0f7;
  --color-border: rgba(0, 0, 0, 0.07);
  --color-border-medium: rgba(0, 0, 0, 0.10);
  --color-border-focus: #4648d4;

  /* --- Typography --- */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-signature: 'Caveat', cursive;
  --font-sans: var(--font-primary); /* backward compat */

  --font-size-xs: 0.8125rem;
  --font-size-sm: 0.9375rem;
  --font-size-base: 1rem;      /* 16px */
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;     /* 20px */
  --font-size-2xl: 1.5rem;     /* 24px */
  --font-size-3xl: 2.25rem;    /* 36px */
  --font-size-4xl: 3.5rem;     /* 56px */

  /* --- Spacing --- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-24: 6rem;

  /* Stitch spacing system */
  --section-gap: 6rem;           /* 96px */
  --section-gap-mobile: 3.5rem;  /* 56px */
  --gutter: 2rem;                /* 32px */
  --stack-sm: 0.75rem;           /* 12px */
  --stack-md: 1.5rem;            /* 24px */
  --stack-lg: 2.5rem;            /* 40px */

  /* --- Layout --- */
  --container-max: 1120px;
  --container-max-narrow: 48rem;
  --navbar-height: 3.75rem; /* 60px */

  /* --- Border Radius --- */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-card: 1.5rem;  /* 24px */
  --radius-icon: 1rem;    /* 16px */
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-premium: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 8px rgba(0, 0, 0, 0.04), 0 16px 32px -8px rgba(0, 0, 0, 0.06);
  --shadow-premium-hover: 0 2px 4px rgba(0, 0, 0, 0.05), 0 8px 16px rgba(0, 0, 0, 0.06), 0 24px 48px -8px rgba(0, 0, 0, 0.09);

  /* --- Transitions --- */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 500ms ease;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

@media (min-width: 768px) {
  html {
    font-size: 18px;
  }
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: 1.8;
  color: var(--color-on-surface);
  background-color: var(--color-page-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-light);
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.container--narrow {
  max-width: var(--container-max-narrow);
}

.section {
  padding-block: var(--section-gap-mobile);
}

@media (min-width: 768px) {
  .section {
    padding-block: var(--section-gap);
  }
}

.section--sm {
  padding-block: var(--space-8);
}

.section--alt {
  background: #eeeff4;
}

/* --- Page wrapper --- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  padding-top: var(--navbar-height);
}

/* --- Loading state --- */
.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-16);
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

/* --- Responsive breakpoints (mobile-first) ---
   sm:  640px
   md:  768px
   lg:  1024px
   xl:  1280px
*/
