/* ============================================================
   morgunov.tech design system — v1 — base.css
   Reset, body defaults, base typography, and accessibility primitives
   (sr-only, skip-link). Depends on tokens.css for colour/type variables.
   Reusable across all morgunov.tech services.
   ============================================================ */

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

button, input, select, textarea {
  font-family: inherit;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--v4-bg);
  color: var(--v4-fg);
  /* 0.2s matches .v4-root and the paper surfaces — the theme switch reads
     as one synchronous fade instead of staggered layers. */
  transition: background 0.2s ease, color 0.2s ease;
}

/* Suppress transitions until first paint — the theme attribute is applied
   before stylesheets arrive, and async-loaded CSS would otherwise animate
   every themed surface from its unstyled state on each load. Covers
   descendants too, not just body. */
body.no-transition,
body.no-transition * {
  transition: none !important;
}

body.v4-page {
  font-family: var(--v4-sans);
  font-size: 14px;
  line-height: 1.55;
  letter-spacing: -0.005em;
}

[data-theme="high-contrast"] body.v4-page {
  font-size: 16px;
}

/* IBM Plex is shipped in 400/500/600 only: keep emphasis on a real face
   instead of a browser-synthesized 700. */
.v4-page strong,
.v4-page b {
  font-weight: 600;
}

.v4-page .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;
}

.v4-page .skip-link {
  position: fixed;
  top: -10rem;
  left: 16px;
  background: var(--v4-orange);
  color: var(--v4-on-accent);
  padding: 6px 12px;
  z-index: 100;
  text-decoration: none;
  font-size: 13px;
  transition: top 0.2s;
}

.v4-page .skip-link:focus {
  top: 8px;
}
