/* ============================================================================
   MONARCA — BASE
   Reset, document defaults, typography primitives and shared helpers.
   Loaded after tokens.css.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;            /* safety net against sub-pixel horizontal overflow */
}

body {
  min-height: 100vh;
  background-color: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-b2-size);
  line-height: var(--text-b2-lh);
  letter-spacing: var(--text-b2-tr);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

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

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

a { color: inherit; text-decoration: none; }

ul[class],
ol[class] { list-style: none; padding-inline-start: 0; }

h1, h2, h3, h4, h5, h6 { font-weight: 400; }

:target { scroll-margin-top: var(--space-10); }

/* --- Typography primitives --------------------------------------------------
   Element defaults; sections compose on top of these.                        */
.u-serif { font-family: var(--font-serif); }
.u-sans  { font-family: var(--font-sans); }
.u-accent-warm { color: var(--color-accent-warm); }

h1, .u-h1 {
  font-family: var(--font-serif);
  font-size: var(--text-h1-size);
  line-height: var(--text-h1-lh);
  letter-spacing: var(--text-h1-tr);
}

h2, .u-h2 {
  font-family: var(--font-serif);
  font-size: var(--text-h2-size);
  line-height: var(--text-h2-lh);
  letter-spacing: var(--text-h2-tr);
}

h3, .u-h3 {
  font-family: var(--font-serif);
  font-size: var(--text-h3-size);
  line-height: var(--text-h3-lh);
  letter-spacing: var(--text-h3-tr);
}

/* Eyebrow / kicker — the Figma "tag" text style ------------------------------ */
.eyebrow {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: var(--text-eyebrow-size);
  line-height: var(--text-eyebrow-lh);
  letter-spacing: var(--text-eyebrow-tr);
  text-transform: uppercase;
}

/* --- Layout helper -------------------------------------------------------- */
.container {
  width: 100%;
  max-width: calc(var(--container-max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* --- Accessibility helpers --------------------------------------------------*/
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 999;
  padding: var(--space-3) var(--space-5);
  background: var(--color-surface-inverse);
  color: var(--color-on-accent);
  font: 500 var(--text-b4-size) / 1 var(--font-sans);
  letter-spacing: var(--text-eyebrow-tr);
  text-transform: uppercase;
  transform: translateY(-150%);
  transition: transform var(--transition-fast);
}
.skip-link:focus { transform: translateY(0); }

:focus-visible {
  outline: 2px solid var(--color-focus-ring);
  outline-offset: 3px;
}

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