/* ============================================================
   AgentMesh Labs — base (reset, typography, utilities)
   spec §3.2 / §3.3
   ============================================================ */

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

* { margin: 0; }

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5625;   /* 25px */
  color: var(--text);
  background: var(--bg);
  font-weight: 450;
  font-variation-settings: "wght" 450;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s ease, color .3s ease;
}

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

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

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

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

h1, h2, h3, h4 { font-weight: 650; line-height: 1.1; letter-spacing: -0.01em; }

h1 { font-size: clamp(38px, 6vw, 64px); }
h2 { font-size: clamp(28px, 4vw, 48px); }
h3 { font-size: clamp(20px, 2.5vw, 28px); font-weight: 600; }

p { margin: 0 0 16px; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 650; }

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

small { font-size: 14px; color: var(--text-2); }

hr {
  border: 0;
  border-top: 1px solid var(--line-soft);
  margin: 32px 0;
}

/* ---------- utilities ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  max-width: var(--page-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.reading {
  max-width: var(--reading-max);
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section--alt { background: var(--bg-2); }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.lede {
  font-size: 20px;
  line-height: 1.55;
  color: var(--text-2);
  font-weight: 450;
}

.mono { font-family: var(--font-mono); font-size: 13px; }

.accent { color: var(--accent); }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.danger { color: var(--danger); }
.muted { color: var(--text-2); }

.hidden { display: none !important; }

/* scroll reveal (progressive enhancement) */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s ease, transform .6s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: none;
}

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

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

/* ---------- layout utilities (CSP-safe: no inline style attrs) ---------- */

.mt-sm { margin-top: 16px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 32px; }
.mt-xl { margin-top: 48px; }
.my-md { margin-top: 16px; margin-bottom: 16px; }
.ta-center { text-align: center; }
.flex-center { justify-content: center; }

.hidden { display: none !important; }
