/* ============================================================
   Agent Residency — shared design system
   Paper-and-ink. Instrument Serif (display) · Inter (body) ·
   JetBrains Mono (meta). One quiet warm accent, hairline scale.
   Used by: the specification home, brand kit, report, print
   template, and social kit. This file IS the system.
   ============================================================ */

:root {
  /* type */
  --font-display: "Instrument Serif", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* surface + ink */
  --paper: #ffffff;
  --paper-alt: #f7f7f7;
  --ink: #1b1a16;
  --ink-soft: #45413a;
  --muted: #6b665e;
  --faint: #918b80;

  /* hairlines */
  --line: #e4e4e4;
  --line-2: #c8c8c8;

  /* the one quiet accent */
  --accent: #7c6646;
  --accent-wash: #f4efe4;

  /* rhythm */
  --tracking-meta: 0.14em;
  --measure: 68ch;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.62;
  font-feature-settings: "kern", "liga", "calt";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

h1, h2, h3, h4 { font-weight: 400; margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

/* ---- primitives ------------------------------------------- */

.ar-meta {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: var(--tracking-meta);
  text-transform: uppercase;
  color: var(--accent);
}
.ar-meta--muted { color: var(--faint); }

.ar-serif { font-family: var(--font-display); font-weight: 400; }
.ar-mono  { font-family: var(--font-mono); }

.ar-rule { border: 0; border-top: 1px solid var(--line); margin: 0; }
.ar-rule--ink { border-top-color: var(--ink); }
.ar-rule--strong { border-top-color: var(--line-2); }

/* the wordmark + glyph */
.ar-glyph {
  display: inline-grid;
  place-items: center;
  width: 1em; height: 1em;
  border: 1px solid currentColor;
  position: relative;
}
.ar-glyph::before,
.ar-glyph::after {
  content: "";
  position: absolute;
  background: var(--accent);
}
.ar-glyph::before { width: 56%; height: 1px; }
.ar-glyph::after  { width: 1px; height: 56%; }

.ar-wordmark {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.005em;
  color: var(--ink);
}

/* mandate-object figure */
.ar-object {
  border: 1px solid var(--line-2);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.85;
  color: var(--ink-soft);
  overflow-x: auto;
}
.ar-object__head {
  padding: 0.7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.6875rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: flex; justify-content: space-between; gap: 1rem;
}
.ar-object__body { padding: 1rem 1.1rem 1.15rem; }
.ar-object .row { display: grid; grid-template-columns: 9.5rem 1fr; gap: 1rem; }
.ar-object .k { color: var(--faint); }
.ar-object .v { color: var(--ink); }
.ar-object .v .lim { color: var(--accent); }

/* links in reading prose */
.ar-prose a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in oklab, var(--accent) 45%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  transition: text-decoration-color 140ms ease, color 140ms ease;
}
.ar-prose a:hover { color: var(--accent); text-decoration-color: var(--accent); }

a:focus-visible, button:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}
