/* ============================================
   Base — reset + typography + utilities
   ============================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

button {
  font-family: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  padding: 0;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol { padding: 0; margin: 0; list-style: none; }

h1, h2, h3, h4, h5, h6, p { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-h);
  color: var(--ink);
}

.h0 {
  font-family: var(--font-display);
  font-size: var(--fs-h0);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-display);
}

.h1 { font-size: var(--fs-h1); }
.h2 { font-size: var(--fs-h2); }
.h3 { font-size: var(--fs-h3); }
.h4 { font-size: var(--fs-h4); }

.eyebrow {
  font-size: var(--fs-micro);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-allcaps);
  color: var(--mers-orange);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.eyebrow::before {
  content: '';
  width: 24px;
  height: 1px;
  background: currentColor;
}

.text-muted { color: var(--ink-3); }
.text-dim { color: var(--ink-2); }

/* ----- Layout primitives ----- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.container--narrow { max-width: var(--max-w-narrow); }
.container--prose { max-width: var(--max-w-prose); }

.section {
  padding-block: var(--gutter-section);
}

.section--tight { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section--dark {
  background: var(--surface-dark);
  color: var(--mers-pearl);
}
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: white; }

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--r-md);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: transform var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-base);
  white-space: nowrap;
  line-height: 1;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--mers-orange);
  color: white;
  box-shadow: var(--shadow-pop);
}
.btn--primary:hover {
  background: var(--mers-orange-dark);
  color: white;
}

.btn--dark {
  background: var(--mers-navy);
  color: white;
}
.btn--dark:hover { background: var(--mers-navy-soft); color: white; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: white;
}

.btn--ghost-light {
  background: transparent;
  color: white;
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
}
.btn--ghost-light:hover {
  background: white;
  color: var(--mers-navy);
}

.btn--sm { padding: 0.625rem 1rem; font-size: var(--fs-body-sm); }
.btn--lg { padding: 1.125rem 2rem; font-size: var(--fs-body-lg); }
.btn--block { width: 100%; }

.btn-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.btn-icon:hover { background: var(--surface-3); color: var(--mers-orange); }

/* ----- Badges & Tags ----- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--tracking-allcaps);
  text-transform: uppercase;
}

.badge--success { background: var(--mers-success-tint); color: var(--mers-success); }
.badge--accent { background: var(--mers-orange-light); color: var(--mers-orange-dark); }
.badge--neutral { background: var(--surface-3); color: var(--ink-2); }
.badge--dark { background: var(--mers-navy); color: white; }

/* ----- Form fields ----- */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field__label {
  font-size: var(--fs-caption);
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: -0.005em;
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 0;
  border-radius: var(--r-sm);
  background: #FBFBF8;
  font-size: var(--fs-body);
  color: var(--ink);
  transition: background var(--t-fast), box-shadow var(--t-fast);
  outline: 0;
  box-shadow: inset 0 0 0 1px rgba(10, 22, 40, 0.08);
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  background: white;
  box-shadow: inset 0 0 0 1px rgba(10, 22, 40, 0.22), 0 0 0 3px rgba(255, 79, 64, 0.10);
}

.field__input::placeholder { color: var(--ink-3); }

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

.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* ----- Reveal animation (Intersection Observer hook) ----- */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Focus state — visible for keyboard nav */
:focus-visible {
  outline: 2px solid var(--mers-orange);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
