/* ============================================================
   MordanSoft — Base
   Light resets and element defaults built on the tokens.
   Plus a few brand utilities: scroll-reveal, geometric backdrop.
   ============================================================ */

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

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

body {
  margin: 0;
  background: var(--surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-text);
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  letter-spacing: var(--tracking-tighter);
  color: var(--text-primary);
  text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }

code, kbd, samp, pre {
  font-family: var(--font-mono);
  font-size: 0.92em;
}

::selection {
  background: var(--accent);
  color: var(--accent-contrast);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

hr {
  border: none;
  border-top: var(--hairline);
  margin: var(--space-8) 0;
}

/* --- Eyebrow / overline ---------------------------------- */
.ms-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-eyebrow);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--text-muted);
}

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

/* --- Entrance reveal -------------------------------------
   The base/at-rest state is fully VISIBLE. The entrance animates TRANSFORM
   only (a gentle rise) — never opacity — so even if a frame is frozen,
   throttled, captured statically, or motion is reduced, the content is
   always visible. It can never persist in a hidden frame. */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] { animation: ms-reveal 380ms var(--ease-out); }
}
@keyframes ms-reveal {
  from { transform: translateY(var(--reveal-shift)); }
  to   { transform: none; }
}

/* --- Reduced motion (global) -----------------------------
   Honour the user's preference everywhere: near-instant transitions and
   animations, no smooth scrolling. Visible end-states are unaffected. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Geometric backdrop ---------------------------------
   The brand's primary visual element: soft layered planes and
   abstract shapes suggesting depth. Apply to a positioned parent.
   Pair with .ms-geo__shape children or use as a section base. */
.ms-geo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}
.ms-geo__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
/* Soft radial wash — accent used at very low intensity for warmth */
.ms-geo__wash {
  position: absolute;
  border-radius: var(--radius-circle);
  filter: blur(48px);
  opacity: 0.55;
}

/* Hide-but-accessible */
.ms-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;
}
