/* ==========================================================================
   BASE — Reset, Custom Properties, Typography
   ========================================================================== */

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

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

body {
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

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

input, button, textarea, select {
  font: inherit;
}

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

ul, ol {
  list-style: none;
}

/* --- Design Tokens --- */
:root {
  /* Color Palette — Dark Charcoal + Warm Accent */
  --color-bg:              #FAFAFA;
  --color-bg-alt:          #F3F4F6;
  --color-bg-card:         #FFFFFF;
  --color-bg-dark:         #0B0F19;
  --color-bg-dark-alt:     #111827;

  --color-text:            #1F2937;
  --color-text-secondary:  #6B7280;
  --color-text-muted:      #9CA3AF;
  --color-text-inverse:    #F9FAFB;
  --color-heading:         #1e3a8a;

  --color-primary:         #2563EB;
  --color-primary-hover:   #1D4ED8;
  --color-primary-light:   #DBEAFE;

  --color-accent:          #F59E0B;
  --color-accent-hover:    #D97706;
  --color-accent-light:    #FEF3C7;

  --color-success:         #10B981;
  --color-success-light:   #D1FAE5;
  --color-danger:          #EF4444;
  --color-danger-light:    #FEE2E2;

  --color-border:          #E5E7EB;
  --color-border-light:    #F3F4F6;

  /* Amazon Orange */
  --color-amazon:          #FF9900;
  --color-amazon-hover:    #E88B00;
  --color-amazon-dark:     #131921;

  /* Typography */
  --font-heading:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:             'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:             'JetBrains Mono', 'Fira Code', monospace;

  --text-xs:               0.75rem;
  --text-sm:               0.875rem;
  --text-base:             1rem;
  --text-lg:               1.125rem;
  --text-xl:               1.25rem;
  --text-2xl:              1.5rem;
  --text-3xl:              1.875rem;
  --text-4xl:              2.25rem;
  --text-5xl:              3rem;

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

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

  /* Layout */
  --container-sm:          640px;
  --container-md:          768px;
  --container-lg:          1024px;
  --container-xl:          1200px;
  --container-2xl:         1400px;

  /* Border Radius */
  --radius-sm:             0.375rem;
  --radius-md:             0.5rem;
  --radius-lg:             0.75rem;
  --radius-xl:             1rem;
  --radius-full:           9999px;

  /* Shadows */
  --shadow-sm:             0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:             0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg:             0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl:             0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);

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

  /* Z-index scale */
  --z-dropdown:            100;
  --z-sticky:              200;
  --z-overlay:             300;
  --z-modal:               400;
  --z-toast:               500;
}

/* --- Typography Base --- */
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: var(--weight-bold);
  line-height: 1.2;
  color: var(--color-heading);
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl);  }
h5 { font-size: var(--text-lg);  }
h6 { font-size: var(--text-base); font-weight: var(--weight-semibold); }

p {
  margin-bottom: var(--space-4);
  line-height: 1.75;
  color: var(--color-text-secondary);
}

strong {
  font-weight: var(--weight-semibold);
  color: var(--color-text);
}

/* --- Links --- */
.content-area a:not(.btn):not(.cta-button) {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 2px;
  transition: text-decoration-color var(--transition-fast);
}

.content-area a:not(.btn):not(.cta-button):hover {
  text-decoration-color: var(--color-primary);
}

/* --- Selection --- */
::selection {
  background-color: var(--color-primary-light);
  color: var(--color-primary);
}

/* --- Focus styles --- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

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

.container--wide {
  max-width: var(--container-2xl);
}

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

/* --- Utility: Content flow spacing --- */
.flow > * + * {
  margin-top: var(--space-4);
}

.flow--lg > * + * {
  margin-top: var(--space-8);
}
