/* Base Typography & Elements */

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: var(--leading-relaxed);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h1 {
  font-size: var(--text-6xl);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: var(--text-4xl);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h3 {
  font-size: var(--text-3xl);
  letter-spacing: -0.01em;
}

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

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

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

/* Paragraphs */
p {
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-relaxed);
  color: var(--color-text-muted);
}

/* Reading-optimized paragraphs */
.prose p {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  max-width: 65ch;
}

/* Links */
a {
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

/* Text emphasis */
strong, b {
  font-weight: var(--weight-bold);
}

small {
  font-size: var(--text-xs);
}

/* Uppercase text treatment */
.text-uppercase,
.section-label,
.form__label,
.card__label,
.badge {
  letter-spacing: var(--tracking-wider);
}

/* Selection highlight */
::selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}

/* Focus visible — accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-padding-top: calc(var(--header-height) + 2rem);
}

/* Page load animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes kenBurns {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.08);
  }
}

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

/* Animate-on-scroll utility */
.animate-in {
  animation: fadeInUp 0.7s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

/* Responsive typography */
@media (max-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
    letter-spacing: -0.02em;
  }

  h2 {
    font-size: var(--text-3xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: var(--text-4xl);
  }

  h2 {
    font-size: var(--text-2xl);
  }

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

/* Reduced motion — accessibility */
@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;
  }
}
