/* ==========================================================================
   Base · reset, typography, layout primitives, buttons, utilities
   ========================================================================== */

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

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

body {
  margin: 0;
  padding-bottom: calc(64px + env(safe-area-inset-bottom)); /* room for the mobile tab bar */
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.015em;
  font-variation-settings: "SOFT" 50, "opsz" 144;
}
em { font-style: italic; }
h1 em, h2 em, h3 em { color: var(--clay); font-variation-settings: "SOFT" 100, "WONK" 1; }

::selection { background: var(--ochre-300); color: var(--ebony); }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }

[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;
}

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--sand { background: var(--sand); }

.section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 24px;
  margin-bottom: clamp(32px, 4vw, 56px); flex-wrap: wrap;
}
.section-head__title { font-size: var(--fs-3xl); max-width: 16ch; }
.section-head__text { max-width: 42ch; color: var(--muted); }
.section-head--center { flex-direction: column; align-items: center; text-align: center; }
.section-head--center .section-head__title { max-width: 20ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--clay);
  margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 22px; height: 8px; flex: none;
  background: var(--pattern-kente) left center / auto 8px repeat-x;
  border-radius: 2px;
}

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--ebony); --btn-fg: var(--ivory);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 28px;
  border-radius: 999px; border: 1.5px solid var(--btn-bg);
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: var(--fs-sm); font-weight: 700; letter-spacing: 0.04em;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur) var(--ease), background .25s, color .25s, border-color .25s, box-shadow .25s;
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.btn:active { transform: scale(.97); }
@media (hover: hover) {
  .btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
  .btn:hover svg { transform: translateX(3px); }
}
.btn--primary { --btn-bg: var(--clay); }
.btn--primary:hover { --btn-bg: var(--clay-700); }
.btn--ghost { background: transparent; color: var(--ebony); border-color: currentColor; }
.btn--ghost:hover { background: var(--ebony); color: var(--ivory); border-color: var(--ebony); }
.btn--light { --btn-bg: var(--ivory); --btn-fg: var(--ebony); }
.btn--outline-light { background: transparent; color: var(--ivory); border-color: rgba(251,247,240,.5); }
.btn--outline-light:hover { background: var(--ivory); color: var(--ebony); }
.btn--block { width: 100%; }
.btn--sm { min-height: 40px; padding: 0 18px; font-size: var(--fs-xs); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: var(--fs-sm); letter-spacing: 0.04em;
  border-bottom: 1.5px solid currentColor; padding-bottom: 4px;
}
.link-arrow svg { width: 16px; height: 16px; transition: transform .3s var(--ease); }
.link-arrow:hover svg { transform: translateX(4px); }

/* ---------- Pattern utilities ---------- */
.kente-band {
  height: 12px;
  background: var(--pattern-kente) left center / auto 12px repeat-x;
}
.pattern-mudcloth { position: relative; isolation: isolate; }
.pattern-mudcloth::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--pattern-mudcloth) center / 120px repeat;
  opacity: 0.09;
  pointer-events: none;
}

/* ---------- Form controls ---------- */
.field { display: grid; gap: 6px; }
.field label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.input, .select {
  width: 100%; min-height: 50px; padding: 0 16px;
  font-size: 16px; /* 16px stops iOS zooming into inputs */
  background: var(--white); border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, box-shadow .2s;
}
.input:focus, .select:focus { outline: none; border-color: var(--clay); box-shadow: 0 0 0 4px rgba(180,83,42,.12); }
.select { appearance: none; padding-right: 40px;
  background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%232A201B' stroke-width='1.6'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E") right 16px center no-repeat;
}

@media (min-width: 900px) {
  body { padding-bottom: 0; }
}

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js [data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js [data-reveal].is-visible { opacity: 1; transform: none; }
.js [data-reveal-delay="1"] { transition-delay: .1s; }
.js [data-reveal-delay="2"] { transition-delay: .2s; }
.js [data-reveal-delay="3"] { transition-delay: .3s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; }
}
