
/* Reset and Base Typography */
:root {
  --font-sans: 'Inter', sans-serif;
  --font-heading: 'Montserrat', sans-serif;
  
  /* Fluid Typography Scales - Based on 320px to 1920px range */
  --text-xs: clamp(0.7rem, 0.65rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.8rem, 0.75rem + 0.25vw, 1rem);
  --text-base: clamp(0.875rem, 0.8rem + 0.375vw, 1.125rem);
  --text-lg: clamp(1rem, 0.9rem + 0.5vw, 1.375rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.75rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 1vw, 2.25rem);
  --text-3xl: clamp(1.875rem, 1.6rem + 1.375vw, 3.5rem);
  --text-4xl: clamp(2.25rem, 1.8rem + 2.25vw, 5rem);
  --text-5xl: clamp(3rem, 2.5rem + 3vw, 6.5rem);
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: #1a1a1a;
  background-color: #ffffff;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.04em; /* Tight tracking for "Polis" aesthetic */
  color: #0b3c5d;
  line-height: 1.1;
  text-wrap: balance; /* Prevent single words on new lines */
}

/* Responsive Images & Media */
img, video, iframe, canvas, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Touch Targets for Mobile */
button, a, input, select, textarea {
  min-height: 44px;
  min-width: 44px;
}

/* Fluid Spacing Utilities */
:root {
  --space-xs: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
  --space-sm: clamp(0.75rem, 0.6rem + 0.75vw, 1.125rem);
  --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2.25rem);
  --space-xl: clamp(2rem, 1.6rem + 2vw, 3rem);
  --space-2xl: clamp(3rem, 2.4rem + 3vw, 4.5rem);
  --space-3xl: clamp(4rem, 3.2rem + 4vw, 6rem);
}

/* Ensure containers don't stretch too wide on ultra-wide screens */
.container-fluid {
  width: 100%;
  max-width: 1920px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

/* Custom Scrollbar for better UX on desktop */
@media (min-width: 1024px) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  ::-webkit-scrollbar-track {
    background: #f1f1f1;
  }
  ::-webkit-scrollbar-thumb {
    background: #0b3c5d;
    border-radius: 4px;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: #328cc1;
  }
}


p, span, li, a, button {
  font-family: var(--font-sans);
}

/* General interactive elements */
.card-interactive {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@media (hover: hover) and (pointer: fine) {
  .card-interactive:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -10px rgba(0, 0, 0, 0.15);
  }
}

/* Subtle background pattern */
.bg-pattern-subtle {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d1d5db' fill-opacity='0.1'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Hide scrollbar utility */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
.hide-scrollbar {
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Hero Logo White Filter - Forces dark logos to white for dark backgrounds */
.hero-logo-white {
  filter: brightness(0) invert(1);
}

/* Hero Logo Pulse Animation */
@keyframes pulse-logo {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}
.animate-pulse-logo {
  animation: pulse-logo 4s ease-in-out infinite;
}

/* Scroll-triggered Animations: Slide Up and Fade In */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

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

/* Modal Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.animate-fadeIn { animation: fadeIn 0.4s ease-out forwards; }

@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }
.animate-fadeOut { animation: fadeOut 0.3s ease-in forwards; }

@keyframes scaleUp { 
  from { transform: scale(0.95); opacity: 0; } 
  to { transform: scale(1); opacity: 1; } 
}
.animate-scaleUp { animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes scaleDown { 
  from { transform: scale(1); opacity: 1; } 
  to { transform: scale(0.95); opacity: 0; } 
}
.animate-scaleDown { animation: scaleDown 0.2s ease-in forwards; }

/* Shake animation for errors */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.animate-shake { animation: shake 0.3s ease-in-out; }

/* Specific Section Title & Subtitle Animations */
.animate-on-scroll h2,
.animate-on-scroll .section-title-subtitle {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll .section-title-subtitle {
  transition-delay: 0.15s;
}

.is-visible h2,
.is-visible .section-title-subtitle {
  opacity: 1;
  transform: translateY(0);
}

/* Section Title Bar Animation */
.section-title-bar {
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: 0.3s;
  width: 0; /* Initially */
}
.is-visible .section-title-bar {
  width: 3rem; /* Reduced to match Milken's minimal aesthetic */
}

/* Staggered animation for list items and section title parts */
.animate-stagger.is-visible > * {
    opacity: 0;
    transform: translateY(15px);
    animation: stagger-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stagger-up {
  to { opacity: 1; transform: translateY(0); }
}

.animate-stagger.is-visible > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger.is-visible > *:nth-child(2) { animation-delay: 0.15s; }
.animate-stagger.is-visible > *:nth-child(3) { animation-delay: 0.25s; }
.animate-stagger.is-visible > *:nth-child(4) { animation-delay: 0.35s; }
.animate-stagger.is-visible > *:nth-child(5) { animation-delay: 0.45s; }
.animate-stagger.is-visible > *:nth-child(6) { animation-delay: 0.55s; }
