/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

body {
  font-family: var(--font-main);
  line-height: 1.65;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  accent-color: var(--color-sage-700);
  caret-color: var(--color-sage-800);
}

/* Global Selection (Theme Sage Highlight) */
::selection {
  background-color: var(--color-sage-300);
  color: var(--color-sage-950);
}

input::selection,
textarea::selection,
select::selection {
  background-color: var(--color-sage-300);
  color: var(--color-sage-950);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-cream-100);
}

::-webkit-scrollbar-thumb {
  background: var(--color-sage-300);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-sage-500);
}

/* Base Elements */
img, svg, picture, video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.5rem, 5.5vw, 4.4rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(2rem, 3.8vw, 3rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  letter-spacing: -0.02em;
}

h4 {
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}

p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.7;
}

.text-lead {
  font-size: clamp(1.125rem, 1.4vw, 1.25rem);
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding-x);
  padding-right: var(--container-padding-x);
}

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

.section {
  position: relative;
  padding-top: var(--section-padding-y);
  padding-bottom: var(--section-padding-y);
  overflow: hidden;
}

.section-dark {
  background-color: var(--bg-dark);
  color: var(--text-light);
}

.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--text-light);
}

.section-dark p {
  color: var(--text-light-secondary);
}

/* Section Header Styling */
.section-header {
  margin-bottom: 60px;
}

.section-header.text-center {
  text-align: center;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--color-sage-100);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-sage-800);
  margin-bottom: 20px;
}

.badge-dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--color-sage-300);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-sage-500);
  box-shadow: 0 0 8px var(--color-sage-500);
  animation: pulse-dot 2.5s infinite ease-in-out;
}

.section-title {
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 640px;
}

.text-center .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* Ambient glow backgrounds */
.ambient-glow {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(80px);
  z-index: 0;
}

.glow-sage {
  background: radial-gradient(circle, rgba(111, 146, 118, 0.18) 0%, rgba(111, 146, 118, 0) 70%);
}

.glow-cream {
  background: radial-gradient(circle, rgba(235, 235, 224, 0.6) 0%, rgba(235, 235, 224, 0) 70%);
}

/* Keyframe Animations */
@keyframes pulse-dot {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.8);
  }
}

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

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.3;
  }
  100% {
    transform: scale(0.95);
    opacity: 0.8;
  }
}
