/* =============================================================
   Kueup Design System v2.0 — Design Tokens
   Source of truth for colors, typography, spacing, motion.
   Apply these via CSS custom properties, never hardcode hex.
   ============================================================= */

:root {
  /* === BRAND COLORS ============================================
     Sampled directly from the chosen mockup (mockup-2 / option C).
     Brand purple = action color. Marigold = accent/warmth.
     ============================================================ */

  /* Purple ramp */
  --color-purple-50:   #F4F0FB;
  --color-purple-100:  #E6DCFA;
  --color-purple-200:  #DCD2FA;
  --color-purple-300:  #B8A3F0;
  --color-purple-400:  #8E6BE6;
  --color-purple-500:  #6B47D9;  /* secondary purple — buttons hover */
  --color-purple-600:  #3C14A0;  /* PRIMARY brand purple */
  --color-purple-700:  #2A0E80;
  --color-purple-800:  #1A0A50;  /* purple ink — for body text */
  --color-purple-900:  #0E0530;

  /* Marigold ramp (warmth accent) */
  --color-marigold-100: #FAEDCC;
  --color-marigold-200: #F5DDA0;
  --color-marigold-300: #F0B848;
  --color-marigold-400: #E6A032;  /* PRIMARY marigold */
  --color-marigold-500: #DC9628;
  --color-marigold-600: #B57718;
  --color-marigold-700: #8A560E;

  /* Neutrals — cool-leaning to harmonize with purples */
  --color-bg-page:       #F9F7FB;  /* the off-white from mockup */
  --color-bg-surface:    #FFFFFF;  /* card surfaces */
  --color-bg-subtle:     #F4F0FB;  /* lavender-tinted subtle bg */
  --color-bg-overlay:    rgba(26, 10, 80, 0.5); /* modal overlays */

  --color-text-primary:    #1A0A50;  /* purple ink, body text */
  --color-text-secondary:  #4F4565;  /* muted text, captions */
  --color-text-tertiary:   #8B829D;  /* placeholder, hints */
  --color-text-on-purple:  #FFFFFF;  /* text on brand purple bg */
  --color-text-link:       #3C14A0;  /* brand-color links */

  --color-border-subtle:   #E8E4EE;  /* card borders, dividers */
  --color-border-default:  #D6CFE0;  /* visible borders */
  --color-border-strong:   #1A0A50;  /* high-contrast borders */

  /* Semantic colors */
  --color-success:    #1A8754;
  --color-success-bg: #E0F4EA;
  --color-warning:    #B57718;
  --color-warning-bg: #FAEDCC;
  --color-danger:     #B91C2C;
  --color-danger-bg:  #FAE0E3;
  --color-info:       #2563EB;
  --color-info-bg:    #DEE9FE;

  /* === TYPOGRAPHY ============================================== */
  /* Plus Jakarta Sans matches the mockup's display style:
     geometric sans, friendly, readable. Falls back gracefully. */
  --font-display: 'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    'Plus Jakarta Sans', 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale — modular, mobile-first */
  --text-xs:    0.75rem;   /* 12px - micro labels */
  --text-sm:    0.875rem;  /* 14px - secondary text */
  --text-base:  1rem;      /* 16px - body */
  --text-lg:    1.125rem;  /* 18px */
  --text-xl:    1.25rem;   /* 20px */
  --text-2xl:   1.5rem;    /* 24px - section headings */
  --text-3xl:   1.875rem;  /* 30px - page heading mobile */
  --text-4xl:   2.25rem;   /* 36px - hero mobile */
  --text-5xl:   3rem;      /* 48px - hero tablet+ */
  --text-6xl:   3.75rem;   /* 60px - hero desktop */
  --text-7xl:   4.5rem;    /* 72px - hero XL desktop */

  --font-weight-regular:  400;
  --font-weight-medium:   500;
  --font-weight-semibold: 600;
  --font-weight-bold:     700;
  --font-weight-extrabold: 800;

  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.5;
  --leading-relaxed: 1.625;

  --tracking-tight:  -0.025em;
  --tracking-snug:   -0.015em;
  --tracking-normal: 0;
  --tracking-wide:   0.04em;
  --tracking-wider:  0.1em;

  /* === SPACING (4px base) ====================================== */
  --space-0:    0;
  --space-1:    0.25rem;   /* 4px */
  --space-2:    0.5rem;    /* 8px */
  --space-3:    0.75rem;   /* 12px */
  --space-4:    1rem;      /* 16px */
  --space-5:    1.25rem;   /* 20px */
  --space-6:    1.5rem;    /* 24px */
  --space-8:    2rem;      /* 32px */
  --space-10:   2.5rem;    /* 40px */
  --space-12:   3rem;      /* 48px */
  --space-16:   4rem;      /* 64px */
  --space-20:   5rem;      /* 80px */
  --space-24:   6rem;      /* 96px */
  --space-32:   8rem;      /* 128px */

  /* === RADII =================================================== */
  --radius-sm:   0.375rem;  /* 6px - small chips */
  --radius-md:   0.625rem;  /* 10px - inputs, small cards */
  --radius-lg:   1rem;      /* 16px - cards, banners */
  --radius-xl:   1.25rem;   /* 20px - large cards, hero */
  --radius-2xl:  1.5rem;    /* 24px - feature cards */
  --radius-3xl:  2rem;      /* 32px - phone frame, big surfaces */
  --radius-pill: 9999px;
  --radius-icon: 22%;       /* iOS/Android squircle ratio */

  /* === SHADOWS ================================================= */
  --shadow-xs:  0 1px 2px rgba(26, 10, 80, 0.05);
  --shadow-sm:  0 2px 4px rgba(26, 10, 80, 0.06), 0 1px 2px rgba(26, 10, 80, 0.04);
  --shadow-md:  0 4px 12px rgba(26, 10, 80, 0.08), 0 2px 4px rgba(26, 10, 80, 0.04);
  --shadow-lg:  0 12px 24px -8px rgba(26, 10, 80, 0.12), 0 4px 8px rgba(26, 10, 80, 0.06);
  --shadow-xl:  0 24px 48px -12px rgba(26, 10, 80, 0.18), 0 8px 16px rgba(26, 10, 80, 0.08);
  --shadow-2xl: 0 40px 64px -16px rgba(26, 10, 80, 0.24);

  /* Brand-tinted glows — for hero visuals, focused states */
  --shadow-purple-sm: 0 8px 20px -4px rgba(60, 20, 160, 0.3);
  --shadow-purple-md: 0 16px 40px -8px rgba(60, 20, 160, 0.4);
  --shadow-purple-lg: 0 32px 64px -16px rgba(60, 20, 160, 0.45);

  /* === MOTION ================================================== */
  --duration-fast:    150ms;
  --duration-normal:  250ms;
  --duration-slow:    400ms;
  --duration-slower:  600ms;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === BREAKPOINTS (for reference; CSS uses media queries) ==== */
  /* sm: 640px, md: 768px, lg: 1024px, xl: 1280px, 2xl: 1536px */

  /* === LAYOUT TOKENS =========================================== */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;

  --header-height: 64px;
  --bottom-nav-height: 64px;

  /* iOS safe areas — used in PWA standalone mode */
  --safe-top:    env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);
  --safe-left:   env(safe-area-inset-left, 0);
  --safe-right:  env(safe-area-inset-right, 0);
}

/* =============================================================
   GLOBAL RESETS & BASE STYLES
   ============================================================= */

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-primary);
  background: var(--color-bg-page);
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

/* Reduce motion if user prefers */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =============================================================
   UTILITY CLASSES (sparingly)
   ============================================================= */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

@media (min-width: 768px) {
  .container {
    padding-left: var(--space-8);
    padding-right: var(--space-8);
  }
}
