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

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  /* Colors */
  --color-primary-blue: #0052CC;
  --color-accent-yellow: #FFD700;
  --color-black: #1A1A1A;
  --color-light-gray: #F5F5F5;
  --color-dark-gray: #2A2A2A;
  --color-success: #10B981;
  --color-error: #EF4444;
  --color-warning: #F59E0B;
  --color-info: #3B82F6;

  /* Typography */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* Spacing (8px base grid) */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);

  /* Transitions */
  --transition-fast: 200ms;
  --transition-normal: 300ms;
  --transition-slow: 500ms;
  --easing-ease-out: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --easing-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
}

body {
  overflow-x: hidden;
}

/* Accessibility: Respect prefers-reduced-motion */
@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;
  }
}

/* Typography Scale */
h1 {
  font-family: var(--font-display);
  font-size: 60px;
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 600;
  line-height: 1.3;
}

h3 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 600;
  line-height: 1.4;
}

h4 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.4;
}

p {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.6;
}

.text-caption {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.text-mono {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
}

/* Focus States (WCAG 2.1 AA - 3px blue outline) */
:focus-visible {
  outline: 3px solid var(--color-primary-blue);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid var(--color-primary-blue);
  outline-offset: 2px;
}

/* Link Styles */
a {
  color: var(--color-primary-blue);
  text-decoration: none;
  transition: color var(--transition-normal) var(--easing-ease-out);
}

a:hover {
  color: #003d99;
}

/* Button Reset */
button {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
}

/* Input Reset */
input,
textarea,
select {
  font: inherit;
  color: var(--color-black);
}

/* Animations */

/* 1. Hero Text Reveal - 600ms ease-out, stagger 100ms between lines */
@keyframes heroTextReveal {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. Product Card Lift - 300ms hover, translateY(-8px), shadow increase */
@keyframes cardLift {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-8px);
  }
}

/* 3. Pulsing Arrow - 1200ms infinite, opacity/translateY pulse */
@keyframes pulsingArrow {
  0%,
  100% {
    opacity: 1;
    transform: translateY(0);
  }
  50% {
    opacity: 0.6;
    transform: translateY(8px);
  }
}

/* 4. Filter Chip Selection - 200ms ease-out */
@keyframes chipSelection {
  from {
    transform: scale(0.95);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* 5. Product Image Hover - 400ms scale(1.05) */
@keyframes imageZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* 6. Form Input Focus - 200ms shadow expansion */
@keyframes inputFocus {
  from {
    box-shadow: 0 0 0 0 rgba(0, 82, 204, 0);
  }
  to {
    box-shadow: 0 0 0 3px rgba(0, 82, 204, 0.2);
  }
}

/* 7. Modal Open - 300ms (opacity 0→1, scale 0.95→1) */
@keyframes modalOpen {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 8. Toast Entrance - 300ms translateY(20px)→0 */
@keyframes toastEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 9. Step Progress - 800ms with 100ms stagger per step */
@keyframes stepProgress {
  from {
    width: 0;
    opacity: 0;
  }
  to {
    width: 100%;
    opacity: 1;
  }
}

/* 10. 3D Loader Rotation - 20s infinite linear */
@keyframes loaderRotate {
  from {
    transform: rotateZ(0deg) rotateX(0deg);
  }
  to {
    transform: rotateZ(360deg) rotateX(360deg);
  }
}

/* 11. Quote Success - 800ms machinery drives away + confetti */
@keyframes machineryDriveAway {
  from {
    opacity: 1;
    transform: translateX(0) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(100vw) translateY(-50px);
  }
}

/* 12. Skeleton Shimmer - 2s infinite linear */
@keyframes skeletonShimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1 {
    font-size: 42px;
  }

  h2 {
    font-size: 32px;
  }

  h3 {
    font-size: 24px;
  }

  h4 {
    font-size: 18px;
  }

  p {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 32px;
  }

  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 18px;
  }

  p {
    font-size: 13px;
  }
}
