/* ==========================================================================
   MUSKETEER — Base: reset, document defaults, typography
   ========================================================================== */

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

* { margin: 0; }

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

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

body {
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--step-0);
  line-height: var(--leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img { height: auto; }

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

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

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

ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }

/* --- Headings ------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: 0.01em;
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p { max-width: 68ch; }

/* --- Reusable utility primitives ----------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

.section { padding-block: var(--space-7); }
.section--tight { padding-block: var(--space-6); }

/* Small-caps brand label used for taglines / eyebrows */
.eyebrow {
  font-family: var(--font-ui);
  font-size: var(--step--1);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-deep);
}

.lede { font-size: var(--step-1); color: var(--ink-soft); }
.muted { color: var(--text-muted); }
.center { text-align: center; }

/* Accessible visually-hidden helper (kept reachable by screen readers) */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -3rem;
  z-index: var(--z-toast);
  background: var(--ink);
  color: var(--paper);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: top var(--dur) var(--ease);
}
.skip-link:focus { top: var(--space-3); }

/* Visible focus ring for keyboard users */
:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

/* Scroll reveal — elements tagged [data-reveal] fade/rise in once on screen.
   JS adds .is-in via IntersectionObserver; reduced-motion users skip the
   transition entirely (rule below + the global reduced-motion block). */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
}
