/* VitaCore Premium Design System */
/* Fluid Typography + Generous Whitespace + Micro-interactions */

/* ============================================
   FLUID TYPOGRAPHY SYSTEM
   ============================================ */
:root {
  /* Fluid Type Scale - grows smoothly with viewport */
  --text-xs: clamp(0.65rem, 0.8vw, 0.75rem);
  --text-sm: clamp(0.8rem, 0.9vw, 0.875rem);
  --text-base: clamp(1rem, 1.1vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.3vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.6vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 2vw, 2rem);
  --text-3xl: clamp(1.875rem, 2.8vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 3.5vw, 3.5rem);
  --text-hero: clamp(2.5rem, 6vw, 5rem);
  
  /* Premium Color Palette */
  --color-bg: #ffffff;
  --color-bg-secondary: #fafafa;
  --color-bg-tertiary: #f5f5f5;
  --color-text-primary: #0a0a0a;
  --color-text-secondary: #525252;
  --color-text-tertiary: #737373;
  --color-accent: #00b894;
  --color-accent-hover: #00a383;
  --color-accent-light: rgba(0, 184, 148, 0.08);
  --color-accent-alt: #0099cc;
  --color-border: #e8e8e8;
  --color-border-light: #f0f0f0;
  
  /* Generous Spacing - Luxury breathing room */
  --space-xs: clamp(0.5rem, 1vw, 0.75rem);
  --space-sm: clamp(0.75rem, 1.5vw, 1rem);
  --space-md: clamp(1rem, 2vw, 1.5rem);
  --space-lg: clamp(1.5rem, 3vw, 2.5rem);
  --space-xl: clamp(2rem, 4vw, 4rem);
  --space-2xl: clamp(3rem, 6vw, 6rem);
  --space-3xl: clamp(4rem, 8vw, 10rem);
  --space-section: clamp(5rem, 12vh, 10rem);
  
  /* Layout */
  --container-max: 80rem;
  --container-padding: clamp(1.5rem, 6vw, 5rem);
  
  /* Premium Border Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-2xl: 2rem;
  --radius-full: 9999px;
  
  /* Premium Shadows - Soft, diffused */
  --shadow-sm: 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
  --shadow-accent: 0 8px 30px rgba(0, 184, 148, 0.2);
  
  /* Animation Timing - Physics-based */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-in-out-cubic: cubic-bezier(0.65, 0, 0.35, 1);
  --duration-fast: 200ms;
  --duration-normal: 350ms;
  --duration-slow: 500ms;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text-primary);
  background-color: var(--color-bg);
  letter-spacing: -0.01em;
}

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

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out-quart);
}

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

/* ============================================
   TYPOGRAPHY - Premium Hierarchy
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

h1 {
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

h2 {
  font-size: var(--text-4xl);
  font-weight: 600;
}

h3 {
  font-size: var(--text-3xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-2xl);
  font-weight: 600;
}

h5 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h6 {
  font-size: var(--text-lg);
  font-weight: 600;
}

/* Premium paragraph styling */
p {
  color: var(--color-text-secondary);
  line-height: 1.75;
  font-weight: 400;
}

/* Elegant label style */
.label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
}

/* ============================================
   MICRO-INTERACTIONS
   ============================================ */

/* Smooth button hover with physics */
.btn-premium {
  position: relative;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              box-shadow var(--duration-fast) var(--ease-out-quart);
}

.btn-premium:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-accent);
}

.btn-premium:active {
  transform: translateY(0);
}

/* Link underline animation */
.link-animated {
  position: relative;
}

.link-animated::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width var(--duration-normal) var(--ease-out-expo);
}

.link-animated:hover::after {
  width: 100%;
}

/* Card hover lift */
.card-lift {
  transition: transform var(--duration-normal) var(--ease-out-expo),
              box-shadow var(--duration-normal) var(--ease-out-quart);
}

.card-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* Fade in animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeInUp var(--duration-slow) var(--ease-out-expo) forwards;
}

/* Stagger children animation */
.stagger-children > * {
  opacity: 0;
  animation: fadeInUp var(--duration-slow) var(--ease-out-expo) forwards;
}

.stagger-children > *:nth-child(1) { animation-delay: 0ms; }
.stagger-children > *:nth-child(2) { animation-delay: 100ms; }
.stagger-children > *:nth-child(3) { animation-delay: 200ms; }
.stagger-children > *:nth-child(4) { animation-delay: 300ms; }
.stagger-children > *:nth-child(5) { animation-delay: 400ms; }
.stagger-children > *:nth-child(6) { animation-delay: 500ms; }

/* ============================================
   BENTO BOX GRID
   ============================================ */
.bento-grid {
  display: grid;
  gap: var(--space-lg);
}

.bento-grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.bento-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.bento-item-large {
  grid-column: span 2;
  grid-row: span 2;
}

.bento-item-wide {
  grid-column: span 2;
}

@media (max-width: 1024px) {
  .bento-grid-3,
  .bento-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bento-item-large,
  .bento-item-wide {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .bento-grid-3,
  .bento-grid-4 {
    grid-template-columns: 1fr;
  }
  
  .bento-item-large,
  .bento-item-wide {
    grid-column: span 1;
    grid-row: span 1;
  }
}

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

.section-premium {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

.section-title-premium {
  font-size: var(--text-4xl);
  font-weight: 600;
  text-align: center;
  margin-bottom: var(--space-md);
  letter-spacing: -0.03em;
}

.section-subtitle-premium {
  font-size: var(--text-lg);
  color: var(--color-text-secondary);
  text-align: center;
  max-width: 50ch;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
}

/* Asymmetric spacing for visual interest */
.asymmetric-top {
  padding-top: calc(var(--space-section) * 1.2);
  padding-bottom: var(--space-section);
}

.asymmetric-bottom {
  padding-top: var(--space-section);
  padding-bottom: calc(var(--space-section) * 1.2);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.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;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@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;
  }
}
