/* ==========================================================================
   HappyFeet — Base: reset, typography, elements, utilities
   ========================================================================== */

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

* { margin: 0; }

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

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--c-ink-700);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

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

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

a { color: var(--c-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--c-primary-strong); }

h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  color: var(--c-ink-900);
  line-height: var(--lh-tight);
  font-weight: var(--fw-semi);
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }

p { line-height: var(--lh-base); }

ul, ol { padding-left: 1.25rem; }

hr { border: none; border-top: 1px solid var(--c-line); margin: var(--sp-6) 0; }

:focus-visible {
  outline: none;
  box-shadow: var(--sh-focus);
  border-radius: var(--r-sm);
}

::selection { background: var(--c-azure-100); color: var(--c-navy-900); }

/* ---- Layout helpers ---- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-5);
}
.container-narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--sp-8); }
.section-sm { padding-block: var(--sp-7); }
.section-soft { background: var(--c-bg-soft); }
.section-sand { background: var(--c-warm-100); }

.stack > * + * { margin-top: var(--sp-4); }
.stack-lg > * + * { margin-top: var(--sp-6); }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.wrap { flex-wrap: wrap; }

/* ---- Text utilities ---- */
.text-center { text-align: center; }
.text-muted { color: var(--c-ink-500); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.lead { font-size: var(--fs-md); color: var(--c-ink-500); line-height: var(--lh-snug); }
.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semi);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--c-accent);
  margin-bottom: var(--sp-2);
}
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }

/* ---- Section heading block ---- */
.section-head { max-width: 640px; margin-bottom: var(--sp-6); }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--fs-2xl); }

/* ---- Accessibility ---- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: var(--sp-4); top: -60px;
  background: var(--c-primary); color: #fff; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-sm); z-index: var(--z-toast); transition: top var(--t-base);
}
.skip-link:focus { top: var(--sp-4); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---- Responsive grid collapse ---- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding-block: var(--sp-7); }
}
