/* ============================================================
   Cashual Design System — CSS Custom Properties & Reset
   Palette: Charcoal Black, Royal Blue, Tangerine Orange
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Space+Grotesk:wght@500;600;700&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* --- Colors: Core Palette --- */
  --color-charcoal-black: #111318;
  --color-surface-charcoal: #1B1E26;
  --color-surface-charcoal-hover: #222631;
  --color-royal-blue: #3156C8;
  --color-royal-blue-hover: #2645A8;
  --color-highlight-blue: #6D8EF0;
  --color-tangerine-orange: #F28C28;
  --color-tangerine-orange-subtle: rgba(242, 140, 40, 0.12);
  --color-soft-white: #F4F5F7;
  --color-muted-grey: #A1A1AA;
  --color-border-grey: #303541;

  /* --- Colors: Semantic Aliases --- */
  --color-bg-primary: var(--color-charcoal-black);
  --color-bg-surface: var(--color-surface-charcoal);
  --color-bg-surface-hover: var(--color-surface-charcoal-hover);
  --color-text-primary: var(--color-soft-white);
  --color-text-secondary: var(--color-muted-grey);
  --color-accent-primary: var(--color-royal-blue);
  --color-accent-highlight: var(--color-highlight-blue);
  --color-accent-warm: var(--color-tangerine-orange);
  --color-border-default: var(--color-border-grey);
  --color-border-focus: var(--color-royal-blue);
  --color-success: var(--color-highlight-blue);
  --color-error: #EF4444;

  /* --- Colors: Light surface (Trust bar & Light cards) --- */
  --color-bg-light: #F4F5F7;
  --color-text-on-light: #111318;
  --color-text-muted-on-light: #52525B;
  --color-border-on-light: #E4E4E7;

  /* --- Gradients --- */
  --gradient-hero: linear-gradient(180deg, #111318 0%, #151821 50%, #111318 100%);
  --gradient-royal: linear-gradient(135deg, #3156C8 0%, #486FE0 100%);
  --gradient-royal-glow: radial-gradient(ellipse at 50% 0%, rgba(49, 86, 200, 0.14) 0%, transparent 70%);
  --gradient-card-dark: linear-gradient(180deg, #1B1E26 0%, #15171E 100%);
  --gradient-cta-banner: linear-gradient(135deg, #161A24 0%, #1E2333 50%, #161A24 100%);
  --gradient-text-accent: linear-gradient(135deg, #6D8EF0 0%, #3156C8 100%);

  /* --- Typography --- */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;

  --text-hero: 3.5rem;
  --text-h1: 2.75rem;
  --text-h2: 2.25rem;
  --text-h3: 1.5rem;
  --text-h4: 1.125rem;
  --text-body-lg: 1.125rem;
  --text-body: 1rem;
  --text-body-sm: 0.875rem;
  --text-caption: 0.75rem;
  --text-button: 1rem;
  --text-nav: 0.9375rem;

  /* --- Spacing (4px base scale) --- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;

  /* --- Layout --- */
  --width-max: 1200px;
  --width-narrow: 640px;
  --container-padding: 24px;

  /* --- Border Radii --- */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-full: 9999px;

  /* --- Shadows (Restrained & Sophisticated) --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-royal-glow: 0 4px 20px rgba(49, 86, 200, 0.3);
  --shadow-royal-subtle: 0 0 10px rgba(49, 86, 200, 0.2);
  --shadow-inset: inset 0 1px 2px rgba(0, 0, 0, 0.3);

  /* --- Animation --- */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --duration-entrance: 600ms;
  --ease-default: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  /* --- Icons --- */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-xl: 32px;
  --icon-2xl: 48px;
}

/* --- Mobile type overrides --- */
@media (max-width: 768px) {
  :root {
    --text-hero: 2.25rem;
    --text-h1: 2rem;
    --text-h2: 1.75rem;
    --text-h3: 1.25rem;
    --container-padding: 16px;
  }
}

/* ============================================================
   2. CSS RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  outline: none;
}

button {
  cursor: pointer;
}

ul,
ol {
  list-style: none;
}

/* --- Skip Link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-royal-blue);
  color: var(--color-soft-white);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-md);
  font-weight: 600;
  z-index: 10000;
  transition: top var(--duration-fast) var(--ease-default);
}

.skip-link:focus {
  top: var(--space-4);
}

/* ============================================================
   3. TYPOGRAPHY UTILITIES
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.15;
  color: var(--color-text-primary);
}

.text-hero {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.1;
}

.text-h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  line-height: 1.15;
}

.text-h2 {
  font-size: var(--text-h2);
  font-weight: 700;
  line-height: 1.2;
}

.text-h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  line-height: 1.3;
}

.text-h4 {
  font-size: var(--text-h4);
  font-weight: 600;
  line-height: 1.4;
}

.text-body-lg {
  font-size: var(--text-body-lg);
  line-height: 1.6;
}

.text-body-sm {
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.text-caption {
  font-size: var(--text-caption);
  font-weight: 500;
  line-height: 1.4;
}

/* Brand Text Highlights */
.text-royal {
  color: var(--color-royal-blue);
}

.text-highlight {
  color: var(--color-highlight-blue);
}

.text-orange {
  color: var(--color-tangerine-orange);
}

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

/* ============================================================
   4. LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--width-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

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

.section {
  padding: var(--space-20) 0;
}

.section--lg {
  padding: var(--space-24) 0;
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-12) 0;
  }
  .section--lg {
    padding: var(--space-16) 0;
  }
}

/* --- Flex Utilities --- */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.text-center {
  text-align: center;
}

/* ============================================================
   5. SCROLL ANIMATION BASE
   ============================================================ */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--duration-entrance) var(--ease-default),
              transform var(--duration-entrance) var(--ease-default);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-1 { transition-delay: 0ms; }
.stagger-2 { transition-delay: 100ms; }
.stagger-3 { transition-delay: 200ms; }
.stagger-4 { transition-delay: 300ms; }

@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    transform: none;
    transition: opacity var(--duration-slow) var(--ease-default);
  }
  
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
