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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#main-content {
  flex: 1;
  padding-bottom: calc(var(--tab-bar-height) + var(--space-md));
}

#main-content.main-content--no-tabbar {
  padding-bottom: 0;
}

#main-content.main-content--fullbleed {
  height: 100dvh;
  min-height: 100dvh;
  padding-bottom: 0;
  overflow: hidden;
}

/* ========== TYPOGRAPHY ========== */
h1, h2, h3, h4, h5 {
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(36px, 6vw, 56px); line-height: 1.1; }
h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; }
h3 { font-size: clamp(20px, 3vw, 26px); line-height: 1.3; }
h4 { font-size: 18px; line-height: 1.4; font-weight: 700; }
h5 { font-size: 15px; line-height: 1.4; font-weight: 700; }

p { font-size: 16px; line-height: 1.65; color: var(--color-text-secondary); }
.small { font-size: 14px; }
.caption { font-size: 12px; line-height: 1.4; }

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }

/* ========== SECTION HEADERS ========== */
.section__overline {
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-primary);
  margin-bottom: var(--space-sm);
}

.section__title {
  text-align: center;
  margin-bottom: var(--space-md);
}

.section__title--left { text-align: left; }

.section__subtitle {
  text-align: center;
  max-width: 520px;
  margin: 0 auto var(--space-xl);
  font-size: 17px;
  color: var(--color-text-secondary);
}

.section__subtitle--left {
  text-align: left;
  margin-left: 0;
}

/* ========== CONTAINER ========== */
.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Landing container */
.landing .container {
  max-width: var(--max-landing-width);
}

/* ========== LINKS ========== */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

/* ========== FORM ELEMENTS ========== */
input, textarea, select {
  font-family: var(--font-body);
  font-size: 15px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  background: var(--color-surface);
  color: var(--color-text);
  width: 100%;
  transition: all 0.2s var(--ease-out);
  -webkit-appearance: none;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(91,168,108,0.12);
}

input::placeholder { color: var(--color-text-tertiary); }
input:disabled, button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ========== ANIMATIONS ========== */

/* Fade in up */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Fade in scale */
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* Slide up */
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Float / gentle hover */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Pulse glow */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91,168,108,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(91,168,108,0); }
}

/* Shape drift */
@keyframes shapeDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(15px, -10px) rotate(5deg); }
  50% { transform: translate(-5px, 15px) rotate(-3deg); }
  75% { transform: translate(10px, 5px) rotate(2deg); }
}

/* Counter tick */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Gradient shift */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Pin bounce */
@keyframes pinBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.05); }
}

/* Radar pulse */
@keyframes radarPulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Card shimmer on hover */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  animation: fadeIn 0.5s var(--ease-out) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }

/* Fade in class */
.fade-in {
  animation: fadeIn 0.4s var(--ease-out);
}

/* Page transitions */
.page-enter {
  animation: fadeIn 0.35s var(--ease-out);
}

/* ========== SCROLL REVEAL ========== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========== UTILITY ========== */
.hidden { display: none !important; }
.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;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid rgba(61, 107, 71, 0.55);
  outline-offset: 3px;
}

:where(button, input, select, textarea):disabled {
  cursor: not-allowed;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 480px) {
  .container { padding: 0 var(--space-sm); }
}

@media (min-width: 768px) {
  h1 { font-size: 56px; }
  h2 { font-size: 40px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
