/* ============================================
   ITEMMAP LANDING PAGE - BASE STYLES
   Reset, typography, layout, and animations
   ============================================ */

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

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

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

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

ul, ol {
  list-style: none;
}

/* ============================================
   TYPOGRAPHY SCALE
   Using clamp() for fluid responsive sizing
   ============================================ */
.text-xs { font-size: clamp(0.7rem, 0.65rem + 0.25vw, 0.75rem); }
.text-sm { font-size: clamp(0.8rem, 0.75rem + 0.25vw, 0.875rem); }
.text-base { font-size: clamp(0.95rem, 0.9rem + 0.25vw, 1rem); }
.text-lg { font-size: clamp(1.05rem, 1rem + 0.25vw, 1.125rem); }
.text-xl { font-size: clamp(1.15rem, 1.1rem + 0.25vw, 1.25rem); }
.text-2xl { font-size: clamp(1.35rem, 1.25rem + 0.5vw, 1.5rem); }
.text-3xl { font-size: clamp(1.6rem, 1.4rem + 1vw, 1.875rem); }
.text-4xl { font-size: clamp(1.9rem, 1.6rem + 1.5vw, 2.25rem); }
.text-5xl { font-size: clamp(2.2rem, 1.8rem + 2vw, 3rem); }
.text-6xl { font-size: clamp(2.6rem, 2rem + 3vw, 3.75rem); }
.text-7xl { font-size: clamp(3rem, 2.2rem + 4vw, 4.5rem); }

/* Display Typography */
.heading-hero {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 1.8rem + 4vw, 4.5rem);
  font-weight: var(--font-weight-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.heading-section {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 1.4rem + 2vw, 3rem);
  font-weight: var(--font-weight-display);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.heading-card {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  font-weight: var(--font-weight-display);
  line-height: 1.25;
}

.body-large {
  font-size: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  line-height: 1.7;
}

.body-small {
  font-size: clamp(0.85rem, 0.8rem + 0.15vw, 0.9rem);
  color: var(--color-text-muted);
}

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

/* ============================================
   SPACING SYSTEM (8px base unit)
   ============================================ */
:root {
  --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 */
}

/* ============================================
   LAYOUT UTILITIES
   ============================================ */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: 800px;
}

.container-wide {
  max-width: 1400px;
}

/* Section spacing */
.section {
  padding: var(--space-16) 0;
}

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

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

@media (min-width: 768px) {
  .section { padding: var(--space-20) 0; }
  .section-lg { padding: var(--space-24) 0; }
  .section-xl { padding: var(--space-32) 0; }
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid utilities */
.grid { display: grid; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media (min-width: 640px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* Text alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Margin utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mt-12 { margin-top: var(--space-12); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

/* ============================================
   ANIMATIONS
   ============================================ */

/* Keyframe definitions */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Scroll-triggered animation classes */
[data-animate] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-animate].is-visible {
  opacity: 1;
  transform: translateY(0);
}

[data-animate="fade"] {
  transform: none;
}

[data-animate="slide-left"] {
  transform: translateX(-40px);
}

[data-animate="slide-right"] {
  transform: translateX(40px);
}

[data-animate="scale"] {
  transform: scale(0.9);
}

[data-animate="slide-left"].is-visible,
[data-animate="slide-right"].is-visible,
[data-animate="scale"].is-visible {
  transform: none;
}

/* Stagger children animation */
.stagger > [data-animate]:nth-child(1) { transition-delay: 0ms; }
.stagger > [data-animate]:nth-child(2) { transition-delay: 80ms; }
.stagger > [data-animate]:nth-child(3) { transition-delay: 160ms; }
.stagger > [data-animate]:nth-child(4) { transition-delay: 240ms; }
.stagger > [data-animate]:nth-child(5) { transition-delay: 320ms; }
.stagger > [data-animate]:nth-child(6) { transition-delay: 400ms; }
.stagger > [data-animate]:nth-child(7) { transition-delay: 480ms; }
.stagger > [data-animate]:nth-child(8) { transition-delay: 560ms; }

/* Hero-specific animations */
.hero-animate {
  opacity: 0;
  transform: translateY(40px);
  animation: heroReveal 0.9s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-animate-delay-1 { animation-delay: 0.1s; }
.hero-animate-delay-2 { animation-delay: 0.2s; }
.hero-animate-delay-3 { animation-delay: 0.3s; }
.hero-animate-delay-4 { animation-delay: 0.4s; }

/* Utility classes for animation */
.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* Hover transitions */
.transition-base {
  transition: all 0.2s ease;
}

.transition-smooth {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-animate] {
    opacity: 1;
    transform: none;
  }
}

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

/* 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: 0;
}

/* ============================================
   RESPONSIVE BREAKPOINTS REFERENCE
   - Mobile: < 640px
   - Tablet: 640px - 1023px
   - Desktop: 1024px+
   ============================================ */
